diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-06-29 10:16:15 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-06-29 10:16:15 -0400 |
commit | bb5968cae19d46eb4d45123146efacf0477a9d2c (patch) | |
tree | 852acbc0b1499514982c9421661a64e6261447ba /src/or/control.c | |
parent | 0f3084c4f2b6018d4f8b5f6d6868c7c3801eb45d (diff) | |
parent | 5dcc6bef1ec69248ff82d111ff64d61ee71f1f11 (diff) | |
download | tor-bb5968cae19d46eb4d45123146efacf0477a9d2c.tar.gz tor-bb5968cae19d46eb4d45123146efacf0477a9d2c.zip |
Merge branch 'ticket22684'
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/control.c b/src/or/control.c index 232f7b9c2c..a953da9db0 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1919,6 +1919,9 @@ getinfo_helper_dir(control_connection_t *control_conn, "instead of desc/name/*."; return 0; } + } else if (!strcmp(question, "desc/download-enabled")) { + int r = we_fetch_router_descriptors(get_options()); + tor_asprintf(answer, "%d", !!r); } else if (!strcmp(question, "desc/all-recent")) { routerlist_t *routerlist = router_get_routerlist(); smartlist_t *sl = smartlist_new(); @@ -2004,6 +2007,9 @@ getinfo_helper_dir(control_connection_t *control_conn, if (md && md->body) { *answer = tor_strndup(md->body, md->bodylen); } + } else if (!strcmp(question, "md/download-enabled")) { + int r = we_fetch_microdescriptors(get_options()); + tor_asprintf(answer, "%d", !!r); } else if (!strcmpstart(question, "desc-annotations/id/")) { const routerinfo_t *ri = NULL; const node_t *node = @@ -3026,9 +3032,13 @@ static const getinfo_item_t getinfo_items[] = { PREFIX("desc/name/", dir, "Router descriptors by nickname."), ITEM("desc/all-recent", dir, "All non-expired, non-superseded router descriptors."), + ITEM("desc/download-enabled", dir, + "Do we try to download router descriptors?"), ITEM("desc/all-recent-extrainfo-hack", dir, NULL), /* Hack. */ PREFIX("md/id/", dir, "Microdescriptors by ID"), PREFIX("md/name/", dir, "Microdescriptors by name"), + ITEM("md/download-enabled", dir, + "Do we try to download microdescriptors?"), PREFIX("extra-info/digest/", dir, "Extra-info documents by digest."), PREFIX("hs/client/desc/id", dir, "Hidden Service descriptor in client's cache by onion."), |