From: Nick Mathewson Date: Wed, 30 May 2012 20:38:20 +0000 (-0400) Subject: Merge remote-tracking branch 'public/bug5954' X-Git-Tag: tor-0.2.3.16-alpha~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37f42c2f5898dedfb043a760b30081a0c39f1cd1;p=thirdparty%2Ftor.git Merge remote-tracking branch 'public/bug5954' --- 37f42c2f5898dedfb043a760b30081a0c39f1cd1 diff --cc src/or/control.c index ec018ffc23,57dd0f1fde..1bba2e18de --- a/src/or/control.c +++ b/src/or/control.c @@@ -27,9 -26,9 +27,10 @@@ #include "hibernate.h" #include "main.h" #include "networkstatus.h" +#include "nodelist.h" #include "policies.h" #include "reasons.h" + #include "rephist.h" #include "router.h" #include "routerlist.h" #include "routerparse.h" @@@ -1397,17 -1409,15 +1398,20 @@@ getinfo_helper_misc(control_connection_ *answer = options_dump(get_options(), 1); } else if (!strcmp(question, "info/names")) { *answer = list_getinfo_options(); + } else if (!strcmp(question, "dormant")) { + int dormant = rep_hist_circbuilding_dormant(time(NULL)); + *answer = tor_strdup(dormant ? "1" : "0"); } else if (!strcmp(question, "events/names")) { - *answer = tor_strdup("CIRC STREAM ORCONN BW DEBUG INFO NOTICE WARN ERR " - "NEWDESC ADDRMAP AUTHDIR_NEWDESCS DESCCHANGED " - "NS STATUS_GENERAL STATUS_CLIENT STATUS_SERVER " - "GUARD STREAM_BW CLIENTS_SEEN NEWCONSENSUS " - "BUILDTIMEOUT_SET"); + int i; + smartlist_t *event_names = smartlist_new(); + + for (i = 0; control_event_table[i].event_name != NULL; ++i) { + smartlist_add(event_names, (char *)control_event_table[i].event_name); + } + + *answer = smartlist_join_strings(event_names, " ", 0, NULL); + + smartlist_free(event_names); } else if (!strcmp(question, "features/names")) { *answer = tor_strdup("VERBOSE_NAMES EXTENDED_EVENTS"); } else if (!strcmp(question, "address")) {