aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2013-09-01 16:51:27 -0400
committerRoger Dingledine <arma@torproject.org>2013-09-04 23:21:45 -0400
commit9d2030e5801acd955ab81d1329360b45af09d253 (patch)
tree59b765ce2841bbbccd6a2c6596c846fd069f4e50 /src
parentbb32bfa2f240d3f417e11b08d98069e0a4a8307e (diff)
downloadtor-9d2030e5801acd955ab81d1329360b45af09d253.tar
tor-9d2030e5801acd955ab81d1329360b45af09d253.tar.gz
add info-level logs to help track onion queue sizes
Diffstat (limited to 'src')
-rw-r--r--src/or/onion.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index a102f131a..c5f156699 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -135,6 +135,11 @@ onion_pending_add(or_circuit_t *circ, create_cell_t *onionskin)
}
++ol_entries[onionskin->handshake_type];
+ log_info(LD_OR, "New create (%s). Queues now ntor=%d and tap=%d.",
+ onionskin->handshake_type == ONION_HANDSHAKE_TYPE_NTOR ? "ntor" : "tap",
+ ol_entries[ONION_HANDSHAKE_TYPE_NTOR],
+ ol_entries[ONION_HANDSHAKE_TYPE_TAP]);
+
circ->onionqueue_entry = tmp;
TOR_TAILQ_INSERT_TAIL(&ol_list[onionskin->handshake_type], tmp, next);
@@ -176,8 +181,13 @@ onion_next_task(create_cell_t **onionskin_out)
* more manageable. That's probably not good long-term. -RD */
circ = head->circ;
if (head->onionskin &&
- head->onionskin->handshake_type <= MAX_ONION_HANDSHAKE_TYPE)
- --ol_entries[head->onionskin->handshake_type];
+ head->handshake_type <= MAX_ONION_HANDSHAKE_TYPE)
+ --ol_entries[head->handshake_type];
+ log_info(LD_OR, "Processing create (%s). Queues now ntor=%d and tap=%d.",
+ head->handshake_type == ONION_HANDSHAKE_TYPE_NTOR ? "ntor" : "tap",
+ ol_entries[ONION_HANDSHAKE_TYPE_NTOR],
+ ol_entries[ONION_HANDSHAKE_TYPE_TAP]);
+
*onionskin_out = head->onionskin;
head->onionskin = NULL; /* prevent free. */
circ->onionqueue_entry = NULL;