commit 054d9398531b148d8b41c382da36c83c0381e09e Author: s0rlxmh0 s6yg1ez3@mail2tor.com Date: Mon May 2 14:01:36 2016 -0400
(cherry-picked by nickm, with changes file from isis.) --- changes/bug18920 | 5 +++++ src/or/control.c | 5 +++++ 2 files changed, 10 insertions(+)
diff --git a/changes/bug18920 b/changes/bug18920 new file mode 100644 index 0000000..1babfd6 --- /dev/null +++ b/changes/bug18920 @@ -0,0 +1,5 @@ + o Minor bugfixes (controller, microdescriptors): + - Make GETINFO dir/status-vote/current/consensus conform to the control + specification by returning "551 Could not open cached consensus..." + when not caching consensuses. + Fixes bug 18920; bugfix on 0.2.2.6-alpha. diff --git a/src/or/control.c b/src/or/control.c index 655b4dd..e06d7d2 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -2011,6 +2011,11 @@ getinfo_helper_dir(control_connection_t *control_conn, char *filename = get_datadir_fname("cached-consensus"); *answer = read_file_to_str(filename, RFTS_IGNORE_MISSING, NULL); tor_free(filename); + if (!*answer) { /* generate an error */ + *errmsg = "Could not open cached consensus. " + "Make sure FetchUselessDescriptors is set to 1."; + return -1; + } } } else if (!strcmp(question, "network-status")) { /* v1 */ routerlist_t *routerlist = router_get_routerlist();
tor-commits@lists.torproject.org