summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authors0rlxmh0 <s6yg1ez3@mail2tor.com>2016-05-02 14:01:36 -0400
committerNick Mathewson <nickm@torproject.org>2016-05-02 14:01:36 -0400
commit054d9398531b148d8b41c382da36c83c0381e09e (patch)
tree08bfb19e89e7a4bd0196d51374419e75e33039b1 /src/or/control.c
parentde08f2d96bd1815a8da5c359a4f52310dc1905d7 (diff)
downloadtor-054d9398531b148d8b41c382da36c83c0381e09e.tar.gz
tor-054d9398531b148d8b41c382da36c83c0381e09e.zip
(cherry-picked by nickm, with changes file from isis.)
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 655b4dd335..e06d7d28a2 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();