diff options
author | Donncha O'Cearbhaill <donncha@donncha.is> | 2015-07-21 17:03:23 +0200 |
---|---|---|
committer | Donncha O'Cearbhaill <donncha@donncha.is> | 2015-08-25 17:30:02 +0200 |
commit | af3be650e3f8417da985efc4d26c676201c7e38b (patch) | |
tree | 4194ceee8f23ee23032075fb1da53ce3ec5f5195 /src/or | |
parent | 1a75e6da007ddd3207726dc2b1293e22453c81af (diff) | |
download | tor-af3be650e3f8417da985efc4d26c676201c7e38b.tar.gz tor-af3be650e3f8417da985efc4d26c676201c7e38b.zip |
Add a HS_DESC CREATED control event
The HS_DESC CREATED event should be emmited when a new service descriptor
is generated for a local rendevous service. This event is documented
in the control spec.
This commit resolves ticket #16291.
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/control.c | 21 | ||||
-rw-r--r-- | src/or/control.h | 2 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/or/control.c b/src/or/control.c index d237f8feb1..fb74d7d6f3 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -6233,6 +6233,27 @@ get_desc_id_from_query(const rend_data_t *rend_data, const char *hsdir_fp) return desc_id; } +/** send HS_DESC CREATED event when a local service generates a descriptor. + * + * <b>service_id</b> is the descriptor onion address. + * <b>desc_id_base32</b> is the descriptor ID. + */ +void +control_event_hs_descriptor_created(const char *service_id, + const char *desc_id_base32) +{ + if (!service_id || !desc_id_base32) { + log_warn(LD_BUG, "Called with service_digest==%p, " + "desc_id_base32==%p", service_id, desc_id_base32); + return; + } + + send_control_event(EVENT_HS_DESC, + "650 HS_DESC CREATED %s UNKNOWN UNKNOWN %s\r\n", + service_id, + desc_id_base32); +} + /** send HS_DESC upload event. * * <b>service_id</b> is the descriptor onion address. diff --git a/src/or/control.h b/src/or/control.h index fdf7903cb8..26f7f50b88 100644 --- a/src/or/control.h +++ b/src/or/control.h @@ -117,6 +117,8 @@ MOCK_DECL(const char *, node_describe_longname_by_id,(const char *id_digest)); void control_event_hs_descriptor_requested(const rend_data_t *rend_query, const char *desc_id_base32, const char *hs_dir); +void control_event_hs_descriptor_created(const char *service_id, + const char *desc_id_base32); void control_event_hs_descriptor_upload(const char *service_id, const char *desc_id_base32, const char *hs_dir); |