diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-09-29 18:13:25 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-09-29 18:13:25 +0000 |
commit | 0335bd51d384ed6d075413580eefa1248c730d0f (patch) | |
tree | 37a366440ac49d95456b4d8cc914c6ea35497fa9 /src/or/control.c | |
parent | 17b878ee347559ffe8d961b62652c7b71a6b312f (diff) | |
download | tor-0335bd51d384ed6d075413580eefa1248c730d0f.tar.gz tor-0335bd51d384ed6d075413580eefa1248c730d0f.zip |
r9005@Kushana: nickm | 2006-09-29 10:37:55 -0400
Implement DESCCHANGED event to tell controller when our router descriptor changes.
svn:r8533
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c index 16cc715b92..47fc9ea381 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -77,7 +77,8 @@ const char control_c_id[] = #define LAST_V0_EVENT 0x000B #define EVENT_ADDRMAP 0x000C #define EVENT_AUTHDIR_NEWDESCS 0x000D -#define _EVENT_MAX 0x000D +#define EVENT_DESCCHANGED 0x000E +#define _EVENT_MAX 0x000E /** Array mapping from message type codes to human-readable message * type names. Used for compatibility with version 0 of the control @@ -952,6 +953,8 @@ handle_control_setevents(control_connection_t *conn, uint32_t len, event_code = EVENT_ADDRMAP; else if (!strcasecmp(ev, "AUTHDIR_NEWDESCS")) event_code = EVENT_AUTHDIR_NEWDESCS; + else if (!strcasecmp(ev, "DESCCHANGED")) + event_code = EVENT_DESCCHANGED; else { connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n", ev); @@ -2982,6 +2985,15 @@ control_event_or_authdir_new_descriptor(const char *action, return 0; } +/** Our own router descriptor has changed; tell any controllers that care. + */ +int +control_event_my_descriptor_changed(void) +{ + send_control1_event(EVENT_DESCCHANGED, "650 DESCCHANGED\r\n"); + return 0; +} + /** Choose a random authentication cookie and write it to disk. * Anybody who can read the cookie from disk will be considered * authorized to use the control connection. */ |