diff options
author | David Goulet <dgoulet@torproject.org> | 2021-01-21 14:58:31 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-01-21 14:58:31 -0500 |
commit | c54f4b81da5635b282fc45c6301c490663113434 (patch) | |
tree | b166f137cc85ca852ac406edddc745c7000895e9 /src/feature/dircache/dircache.c | |
parent | 08c0ef61d8aa9490f78c3a77c1fbb86de09b1872 (diff) | |
parent | 633b68bfe2cfaab41dc473923acc794e789a4c16 (diff) | |
download | tor-c54f4b81da5635b282fc45c6301c490663113434.tar.gz tor-c54f4b81da5635b282fc45c6301c490663113434.zip |
Merge branch 'tor-gitlab/mr/270' into maint-0.4.5
Diffstat (limited to 'src/feature/dircache/dircache.c')
-rw-r--r-- | src/feature/dircache/dircache.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/feature/dircache/dircache.c b/src/feature/dircache/dircache.c index 207ea6698b..00bb0abf23 100644 --- a/src/feature/dircache/dircache.c +++ b/src/feature/dircache/dircache.c @@ -1675,6 +1675,15 @@ directory_handle_command_post,(dir_connection_t *conn, const char *headers, const char *msg = "[None]"; uint8_t purpose = authdir_mode_bridge(options) ? ROUTER_PURPOSE_BRIDGE : ROUTER_PURPOSE_GENERAL; + + { + char *genreason = http_get_header(headers, "X-Desc-Gen-Reason: "); + log_info(LD_DIRSERV, + "New descriptor post, because: %s", + genreason ? genreason : "not specified"); + tor_free(genreason); + } + was_router_added_t r = dirserv_add_multiple_descriptors(body, body_len, purpose, conn->base_.address, &msg); tor_assert(msg); @@ -1699,7 +1708,8 @@ directory_handle_command_post,(dir_connection_t *conn, const char *headers, !strcmp(url,"/tor/post/vote")) { /* v3 networkstatus vote */ const char *msg = "OK"; int status; - if (dirvote_add_vote(body, approx_time(), &msg, &status)) { + if (dirvote_add_vote(body, approx_time(), TO_CONN(conn)->address, + &msg, &status)) { write_short_http_response(conn, status, "Vote stored"); } else { tor_assert(msg); |