diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-24 16:51:46 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-24 16:53:35 -0400 |
commit | 408ed52e3d5b9ec973f12ed21d2a77abc4f15d8f (patch) | |
tree | c6359fa828911540ea6ba8b6ade1ad0988ed8411 /src/or/control.c | |
parent | f9cd870f50d770f629e370583b0e9df2f8844436 (diff) | |
download | tor-408ed52e3d5b9ec973f12ed21d2a77abc4f15d8f.tar.gz tor-408ed52e3d5b9ec973f12ed21d2a77abc4f15d8f.zip |
Remove the AUTHDIR_NEWDESCS feature: nobody is using it any more
If somebody asks for it, log a warning.
Closes ticket 22377.
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 47 |
1 files changed, 4 insertions, 43 deletions
diff --git a/src/or/control.c b/src/or/control.c index bc173a6e1c..c9551829f7 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1154,7 +1154,6 @@ static const struct control_event_t control_event_table[] = { { EVENT_ERR_MSG, "ERR" }, { EVENT_NEW_DESC, "NEWDESC" }, { EVENT_ADDRMAP, "ADDRMAP" }, - { EVENT_AUTHDIR_NEWDESCS, "AUTHDIR_NEWDESCS" }, { EVENT_DESCCHANGED, "DESCCHANGED" }, { EVENT_NS, "NS" }, { EVENT_STATUS_GENERAL, "STATUS_GENERAL" }, @@ -1194,7 +1193,10 @@ handle_control_setevents(control_connection_t *conn, uint32_t len, SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); SMARTLIST_FOREACH_BEGIN(events, const char *, ev) { - if (!strcasecmp(ev, "EXTENDED")) { + if (!strcasecmp(ev, "EXTENDED") || + !strcasecmp(ev, "AUTHDIR_NEWDESCS")) { + log_warn(LD_CONTROL, "The \"%s\" SETEVENTS argument is no longer " + "supported.", ev); continue; } else { int i; @@ -6053,47 +6055,6 @@ control_event_address_mapped(const char *from, const char *to, time_t expires, return 0; } -/** The authoritative dirserver has received a new descriptor that - * has passed basic syntax checks and is properly self-signed. - * - * Notify any interested party of the new descriptor and what has - * been done with it, and also optionally give an explanation/reason. */ -int -control_event_or_authdir_new_descriptor(const char *action, - const char *desc, size_t desclen, - const char *msg) -{ - char firstline[1024]; - char *buf; - size_t totallen; - char *esc = NULL; - size_t esclen; - - if (!EVENT_IS_INTERESTING(EVENT_AUTHDIR_NEWDESCS)) - return 0; - - tor_snprintf(firstline, sizeof(firstline), - "650+AUTHDIR_NEWDESC=\r\n%s\r\n%s\r\n", - action, - msg ? msg : ""); - - /* Escape the server descriptor properly */ - esclen = write_escaped_data(desc, desclen, &esc); - - totallen = strlen(firstline) + esclen + 1; - buf = tor_malloc(totallen); - strlcpy(buf, firstline, totallen); - strlcpy(buf+strlen(firstline), esc, totallen); - send_control_event_string(EVENT_AUTHDIR_NEWDESCS, - buf); - send_control_event_string(EVENT_AUTHDIR_NEWDESCS, - "650 OK\r\n"); - tor_free(esc); - tor_free(buf); - - return 0; -} - /** Cached liveness for network liveness events and GETINFO */ |