]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'public/bug5954'
authorNick Mathewson <nickm@torproject.org>
Wed, 30 May 2012 20:38:20 +0000 (16:38 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 30 May 2012 20:38:20 +0000 (16:38 -0400)
1  2 
src/or/control.c

index ec018ffc23e627a2b0ff91a73aabaf309bd6e1ab,57dd0f1fde77c3637e0ce74e7cc4f19724e4d746..1bba2e18dec70ab3dfcb406b18dee1e36bcb4322
  #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")) {