diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | doc/TODO | 6 | ||||
-rw-r--r-- | src/or/control.c | 14 | ||||
-rw-r--r-- | src/or/or.h | 1 | ||||
-rw-r--r-- | src/or/router.c | 1 |
5 files changed, 21 insertions, 3 deletions
@@ -40,6 +40,8 @@ Changes in version 0.1.2.2-alpha - 2006-??-?? any router can call itself Unnamed; directory servers will never allocate Unnamed to any particular router; clients won't believe that any router is the canonical Unnamed. + - New controller event to alert the controller when our server descriptor + has changed. o Security Fixes, minor: - If a client asked for a server by name, and we didn't have a @@ -85,8 +85,8 @@ N - Simplify authority operation registered and can't be looked up by nickname.] d - Tolerate clock skew on bridge relays. d - A way to examine and twiddle router flags from controller. - - A way to export server descriptors to controllers -N - Event / getinfo for "when did routerdesc last change". + o A way to export server descriptors to controllers + o Event for "when did routerdesc last change". d - a way to pick entries based wholly on extend_info equivalent; a way to export extend_info equivalent. R - option to dl directory info via tor @@ -410,6 +410,8 @@ Future version: - Specify; implement. - let each hidden service (or other thing) specify its own OutboundBindAddress? + - Stop using tor_socketpair to make connection bridges: do an + implementation that uses buffers only. Blue-sky: - Patch privoxy and socks protocol to pass strings to the browser. 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. */ diff --git a/src/or/or.h b/src/or/or.h index fbb9bcb98e..e6ea1b1047 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2063,6 +2063,7 @@ int control_event_address_mapped(const char *from, const char *to, int control_event_or_authdir_new_descriptor(const char *action, const char *descriptor, const char *msg); +int control_event_my_descriptor_changed(void); int init_cookie_authentication(int enabled); int decode_hashed_password(char *buf, const char *hashed); diff --git a/src/or/router.c b/src/or/router.c index 4ead508fd6..d2d707e943 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -903,6 +903,7 @@ router_rebuild_descriptor(int force) desc_clean_since = time(NULL); desc_needs_upload = 1; + control_event_my_descriptor_changed(); return 0; } |