commit 8f1ddf0cd2b10f75d895c8d55bae6c2cbd60c050 Author: Roger Dingledine arma@torproject.org Date: Wed May 10 20:03:07 2017 -0400
Remove unused "ROUTER_ADDED_NOTIFY_GENERATOR" internal value
We already have a way to return a 400 response code along with a personalized message response for the uploader.
Resolves ticket 22213. --- changes/cleanup22213 | 4 ++++ src/or/directory.c | 9 +-------- src/or/or.h | 2 -- src/or/routerlist.h | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/changes/cleanup22213 b/changes/cleanup22213 new file mode 100644 index 0000000..d100aee --- /dev/null +++ b/changes/cleanup22213 @@ -0,0 +1,4 @@ + o Code simplification and refactoring: + - Remove unused "ROUTER_ADDED_NOTIFY_GENERATOR" internal value. + Resolves ticket 22213. + diff --git a/src/or/directory.c b/src/or/directory.c index c1db40e..da92e0f 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -4467,14 +4467,7 @@ directory_handle_command_post,(dir_connection_t *conn, const char *headers, conn->base_.address, &msg); tor_assert(msg);
- if (r == ROUTER_ADDED_NOTIFY_GENERATOR) { - /* Accepted with a message. */ - log_info(LD_DIRSERV, - "Problematic router descriptor or extra-info from %s " - "("%s").", - conn->base_.address, msg); - write_http_status_line(conn, 400, msg); - } else if (r == ROUTER_ADDED_SUCCESSFULLY) { + if (r == ROUTER_ADDED_SUCCESSFULLY) { write_http_status_line(conn, 200, msg); } else if (WRA_WAS_OUTDATED(r)) { write_http_response_header_impl(conn, -1, NULL, NULL, diff --git a/src/or/or.h b/src/or/or.h index 9027f31..297ec47 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -5331,8 +5331,6 @@ typedef enum { typedef enum was_router_added_t { /* Router was added successfully. */ ROUTER_ADDED_SUCCESSFULLY = 1, - /* Router descriptor was added with warnings to submitter. */ - ROUTER_ADDED_NOTIFY_GENERATOR = 0, /* Extrainfo document was rejected because no corresponding router * descriptor was found OR router descriptor was rejected because * it was incompatible with its extrainfo document. */ diff --git a/src/or/routerlist.h b/src/or/routerlist.h index 25b2f64..e0ed4e6 100644 --- a/src/or/routerlist.h +++ b/src/or/routerlist.h @@ -124,7 +124,7 @@ static int WRA_NEVER_DOWNLOADABLE(was_router_added_t s); */ static inline int WRA_WAS_ADDED(was_router_added_t s) { - return s == ROUTER_ADDED_SUCCESSFULLY || s == ROUTER_ADDED_NOTIFY_GENERATOR; + return s == ROUTER_ADDED_SUCCESSFULLY; } /** Return true iff the outcome code in <b>s</b> indicates that the descriptor * was not added because it was either:
tor-commits@lists.torproject.org