aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-05-30 16:38:20 -0400
committerNick Mathewson <nickm@torproject.org>2012-05-30 16:38:20 -0400
commit37f42c2f5898dedfb043a760b30081a0c39f1cd1 (patch)
tree2d7b7eeb2bcc2cbd8ed07f9e811fde3f4c52bbf4 /src/or/control.c
parent711e4b423714de93abff03c4cf740f19f4d4c630 (diff)
parent2418bc95946bd568e960f6ed42b0cd4dce3b835b (diff)
downloadtor-37f42c2f5898dedfb043a760b30081a0c39f1cd1.tar
tor-37f42c2f5898dedfb043a760b30081a0c39f1cd1.tar.gz
Merge remote-tracking branch 'public/bug5954'
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/control.c b/src/or/control.c
index ec018ffc2..1bba2e18d 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -30,6 +30,7 @@
#include "nodelist.h"
#include "policies.h"
#include "reasons.h"
+#include "rephist.h"
#include "router.h"
#include "routerlist.h"
#include "routerparse.h"
@@ -1397,6 +1398,9 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
*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")) {
int i;
smartlist_t *event_names = smartlist_new();
@@ -2138,12 +2142,13 @@ static const getinfo_item_t getinfo_items[] = {
"Brief summary of router status by nickname (v2 directory format)."),
PREFIX("ns/purpose/", networkstatus,
"Brief summary of router status by purpose (v2 directory format)."),
-
ITEM("network-status", dir,
"Brief summary of router status (v1 directory format)"),
ITEM("circuit-status", events, "List of current circuits originating here."),
ITEM("stream-status", events,"List of current streams."),
ITEM("orconn-status", events, "A list of current OR connections."),
+ ITEM("dormant", misc,
+ "Is Tor dormant (not building circuits because it's idle)?"),
PREFIX("address-mappings/", events, NULL),
DOC("address-mappings/all", "Current address mappings."),
DOC("address-mappings/cache", "Current cached DNS replies."),