From 0b4b51314f5cb0242e7a8fd3b87bc800cd04eacc Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 18 Jul 2010 17:05:58 +0200 Subject: Make the controller act more usefully when GETINFO fails Right now it says "552 internal error" because there's no way for getinfo_helper_*() countries to specify an error message. This patch changes the getinfo_helper_*() interface, and makes most of the getinfo helpers give useful error messages in response to failures. This should prevent recurrences of bug 1699, where a missing GeoIPFile line in the torrc made GETINFO ip-to-county/* fail in a "not obvious how to fix" way. --- src/or/config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/or/config.c') diff --git a/src/or/config.c b/src/or/config.c index 7dee8ffab..70a3ee621 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -5060,9 +5060,11 @@ remove_file_if_very_old(const char *fname, time_t now) * types. */ int getinfo_helper_config(control_connection_t *conn, - const char *question, char **answer) + const char *question, char **answer, + const char **errmsg) { (void) conn; + (void) errmsg; if (!strcmp(question, "config/names")) { smartlist_t *sl = smartlist_create(); int i; -- cgit v1.2.3