aboutsummaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-06-23 14:59:06 -0700
committerRobert Ransom <rransom.8774@gmail.com>2011-11-24 06:32:54 -0800
commitc818f1f25d0ee55b9597f0ca064a3436897f733a (patch)
treec5e96c5badbb2308c6f95dd7493f5df6d172fe7c /src/or/control.c
parentb7c765b1b196433f38b94353edbc1655f5da1017 (diff)
downloadtor-c818f1f25d0ee55b9597f0ca064a3436897f733a.tar.gz
tor-c818f1f25d0ee55b9597f0ca064a3436897f733a.zip
Use the new circ-description function for GETINFO circuit-status
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 3dda9979fb..620b2f5656 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1849,30 +1849,29 @@ getinfo_helper_events(control_connection_t *control_conn,
circuit_t *circ;
smartlist_t *status = smartlist_create();
for (circ = _circuit_get_global_list(); circ; circ = circ->next) {
- char *s, *path;
+ char *s, *circdesc;
size_t slen;
const char *state;
- const char *purpose;
if (! CIRCUIT_IS_ORIGIN(circ) || circ->marked_for_close)
continue;
- path = circuit_list_path_for_controller(TO_ORIGIN_CIRCUIT(circ));
-
if (circ->state == CIRCUIT_STATE_OPEN)
state = "BUILT";
- else if (strlen(path))
+ else if (TO_ORIGIN_CIRCUIT(circ)->cpath)
state = "EXTENDED";
else
state = "LAUNCHED";
- purpose = circuit_purpose_to_controller_string(circ->purpose);
- slen = strlen(path)+strlen(state)+strlen(purpose)+30;
+ circdesc = circuit_describe_status_for_controller(
+ TO_ORIGIN_CIRCUIT(circ));
+
+ slen = strlen(circdesc)+strlen(state)+30;
s = tor_malloc(slen+1);
- tor_snprintf(s, slen, "%lu %s%s%s PURPOSE=%s",
+ tor_snprintf(s, slen, "%lu %s%s%s",
(unsigned long)TO_ORIGIN_CIRCUIT(circ)->global_identifier,
- state, *path ? " " : "", path, purpose);
+ state, *circdesc ? " " : "", circdesc);
smartlist_add(status, s);
- tor_free(path);
+ tor_free(circdesc);
}
*answer = smartlist_join_strings(status, "\r\n", 0, NULL);
SMARTLIST_FOREACH(status, char *, cp, tor_free(cp));