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/hibernate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/or/hibernate.c') diff --git a/src/or/hibernate.c b/src/or/hibernate.c index 3c52a31729..6b512eacf2 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -863,9 +863,11 @@ consider_hibernation(time_t now) * NULL. */ int getinfo_helper_accounting(control_connection_t *conn, - const char *question, char **answer) + const char *question, char **answer, + const char **errmsg) { (void) conn; + (void) errmsg; if (!strcmp(question, "accounting/enabled")) { *answer = tor_strdup(accounting_is_enabled(get_options()) ? "1" : "0"); } else if (!strcmp(question, "accounting/hibernating")) { -- cgit v1.2.3-54-g00ecf