diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-06-24 16:43:08 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-09-07 15:03:28 -0400 |
commit | 3e3480d70406d9deab79c478868ba5acb44255e7 (patch) | |
tree | 238b3378c9ac881372d2833ece1e61e49cc8853c /src/or/directory.c | |
parent | ed463404e94d294ac474e6dd6921fdda54415daf (diff) | |
download | tor-3e3480d70406d9deab79c478868ba5acb44255e7.tar.gz tor-3e3480d70406d9deab79c478868ba5acb44255e7.zip |
Report reason for generating descriptor in an HTTP header
Suggested by arma; based on 3327.
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 6055ae38dd..f56a63c08c 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1228,12 +1228,18 @@ directory_send_command(dir_connection_t *conn, httpcommand = "GET"; tor_asprintf(&url, "/tor/micro/%s", resource); break; - case DIR_PURPOSE_UPLOAD_DIR: + case DIR_PURPOSE_UPLOAD_DIR: { + const char *why = router_get_descriptor_gen_reason(); tor_assert(!resource); tor_assert(payload); httpcommand = "POST"; url = tor_strdup("/tor/"); + if (why) { + tor_asprintf(&header, "X-Desc-Gen-Reason: %s\r\n", why); + smartlist_add(headers, header); + } break; + } case DIR_PURPOSE_UPLOAD_VOTE: tor_assert(!resource); tor_assert(payload); |