diff options
author | Roger Dingledine <arma@torproject.org> | 2002-09-21 22:41:48 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2002-09-21 22:41:48 +0000 |
commit | 8d1aa27c462848b5111b874a51469761ca659f0d (patch) | |
tree | c860b6063aaff3b6f3a42dc1a2ec11975e6aace0 /src/or/circuit.c | |
parent | 8019f2250c2f5383732cf16dd1b918abd7380d98 (diff) | |
download | tor-8d1aa27c462848b5111b874a51469761ca659f0d.tar tor-8d1aa27c462848b5111b874a51469761ca659f0d.tar.gz |
kill -USR1 the or and it will dump conn/circuit stats to stdout
svn:r106
Diffstat (limited to 'src/or/circuit.c')
-rw-r--r-- | src/or/circuit.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c index 1da22e960..ceb841eb8 100644 --- a/src/or/circuit.c +++ b/src/or/circuit.c @@ -8,6 +8,12 @@ static circuit_t *global_circuitlist=NULL; +char *circuit_state_to_string[] = { + "receiving the onion", /* 0 */ + "connecting to firsthop", /* 1 */ + "open" /* 2 */ +}; + /********* END VARIABLES ************/ void circuit_add(circuit_t *circ) { @@ -399,3 +405,18 @@ void circuit_about_to_close_connection(connection_t *conn) { } } +void circuit_dump_by_conn(connection_t *conn) { + circuit_t *circ; + + for(circ=global_circuitlist;circ;circ = circ->next) { + if(circ->p_conn == conn) { + printf("Conn %d has App-ward circuit: aci %d (other side %d), state %d (%s)\n", + conn->poll_index, circ->p_aci, circ->n_aci, circ->state, circuit_state_to_string[circ->state]); + } + if(circ->n_conn == conn) { + printf("Conn %d has Exit-ward circuit: aci %d (other side %d), state %d (%s)\n", + conn->poll_index, circ->n_aci, circ->p_aci, circ->state, circuit_state_to_string[circ->state]); + } + } +} + |