commit 37f42c2f5898dedfb043a760b30081a0c39f1cd1 Merge: 711e4b4 2418bc9 Author: Nick Mathewson nickm@torproject.org Date: Wed May 30 16:38:20 2012 -0400
Merge remote-tracking branch 'public/bug5954'
changes/bug5954 | 5 +++++ src/or/control.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletions(-)
diff --cc src/or/control.c index ec018ff,57dd0f1..1bba2e1 --- 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")) {