aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-02-24 22:11:12 +0000
committerNick Mathewson <nickm@torproject.org>2008-02-24 22:11:12 +0000
commitee8dce3084261447420f0bb7abeb6807583325ee (patch)
treecd748ccd045e59271de63bb30193c2a052f7971a /src/or/control.c
parentb8f1092077159d71734404522add4488a882eac4 (diff)
downloadtor-ee8dce3084261447420f0bb7abeb6807583325ee.tar
tor-ee8dce3084261447420f0bb7abeb6807583325ee.tar.gz
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.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 5b0d7c2ca..fb4af9112 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)