diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-24 22:11:12 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-24 22:11:12 +0000 |
commit | ee8dce3084261447420f0bb7abeb6807583325ee (patch) | |
tree | cd748ccd045e59271de63bb30193c2a052f7971a /src/or/control.c | |
parent | b8f1092077159d71734404522add4488a882eac4 (diff) | |
download | tor-ee8dce3084261447420f0bb7abeb6807583325ee.tar.gz tor-ee8dce3084261447420f0bb7abeb6807583325ee.zip |
r14421@tombo: nickm | 2008-02-24 17:05:18 -0500
Patch from mwenge: always willingly serve our own extrainfo from the controlport
svn:r13699
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c index 5b0d7c2ca2..fb4af9112b 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1523,8 +1523,17 @@ getinfo_helper_dir(control_connection_t *control_conn, if (strlen(question) == HEX_DIGEST_LEN) { char d[DIGEST_LEN]; signed_descriptor_t *sd = NULL; - if (base16_decode(d, sizeof(d), question, strlen(question))==0) - sd = extrainfo_get_by_descriptor_digest(d); + if (base16_decode(d, sizeof(d), question, strlen(question))==0) { + /* XXXX this test should move into extrainfo_get_by_descriptor_digest, + * but I don't want to risk affecting other parts of the code, + * especially since the rules for using our own extrainfo (including + * when it might be freed) are different from those for using one + * we have downloaded. */ + if (router_extrainfo_digest_is_me(d)) + sd = &(router_get_my_extrainfo()->cache_info); + else + sd = extrainfo_get_by_descriptor_digest(d); + } if (sd) { const char *body = signed_descriptor_get_body(sd); if (body) |