|
@@ -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)
|