aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-11-11 15:59:24 +0000
committerNick Mathewson <nickm@torproject.org>2008-11-11 15:59:24 +0000
commite08cbe2029e366bfbd7cf9a3bf9d0ec0088ab1cf (patch)
treede0dd2de33ec1602e08837ae0a58534f6e540e3d /src
parenta95e0e73559349fbbcd97c183ffd481616cbfd5e (diff)
downloadtor-e08cbe2029e366bfbd7cf9a3bf9d0ec0088ab1cf.tar.gz
tor-e08cbe2029e366bfbd7cf9a3bf9d0ec0088ab1cf.zip
Add PURPOSE= field to getinfo circuit-status. With luck, controllers are ignoring extra fields (like they are supposed to) and this will not break any controllers.
svn:r17245
Diffstat (limited to 'src')
-rw-r--r--src/or/control.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 31468831a0..6ec244612a 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1631,6 +1631,7 @@ getinfo_helper_events(control_connection_t *control_conn,
char *s, *path;
size_t slen;
const char *state;
+ const char *purpose;
if (! CIRCUIT_IS_ORIGIN(circ) || circ->marked_for_close)
continue;
if (control_conn->use_long_names)
@@ -1644,11 +1645,12 @@ getinfo_helper_events(control_connection_t *control_conn,
else
state = "LAUNCHED";
- slen = strlen(path)+strlen(state)+20;
+ purpose = circuit_purpose_to_controller_string(circ->purpose);
+ slen = strlen(path)+strlen(state)+strlen(purpose)+30;
s = tor_malloc(slen+1);
- tor_snprintf(s, slen, "%lu %s%s%s",
+ tor_snprintf(s, slen, "%lu %s%s%s PURPOSE=%s",
(unsigned long)TO_ORIGIN_CIRCUIT(circ)->global_identifier,
- state, *path ? " " : "", path);
+ state, *path ? " " : "", path, purpose);
smartlist_add(status, s);
tor_free(path);
}