Skip to content
Snippets Groups Projects
Commit 4190f602 authored by David Goulet's avatar David Goulet :panda_face:
Browse files

circuit: Log n_circ_id and global identifier of HS circuits


So we can track them more easily in the logs and match any open/close/free
with those identifiers.

Part of #23645

Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
parent 767b1815
No related branches found
No related tags found
No related merge requests found
...@@ -2695,9 +2695,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn) ...@@ -2695,9 +2695,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
tor_assert(rendcirc); tor_assert(rendcirc);
/* one is already established, attach */ /* one is already established, attach */
log_info(LD_REND, log_info(LD_REND,
"rend joined circ %u already here. attaching. " "rend joined circ %u (id: %" PRIu32 ") already here. "
"(stream %d sec old)", "Attaching. (stream %d sec old)",
(unsigned)rendcirc->base_.n_circ_id, conn_age); (unsigned) TO_CIRCUIT(rendcirc)->n_circ_id,
rendcirc->global_identifier, conn_age);
/* Mark rendezvous circuits as 'newly dirty' every time you use /* Mark rendezvous circuits as 'newly dirty' every time you use
* them, since the process of rebuilding a rendezvous circ is so * them, since the process of rebuilding a rendezvous circ is so
* expensive. There is a tradeoff between linkability and * expensive. There is a tradeoff between linkability and
...@@ -2730,9 +2731,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn) ...@@ -2730,9 +2731,10 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (rendcirc && (rendcirc->base_.purpose == if (rendcirc && (rendcirc->base_.purpose ==
CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED)) { CIRCUIT_PURPOSE_C_REND_READY_INTRO_ACKED)) {
log_info(LD_REND, log_info(LD_REND,
"pending-join circ %u already here, with intro ack. " "pending-join circ %u (id: %" PRIu32 ") already here, with "
"Stalling. (stream %d sec old)", "intro ack. Stalling. (stream %d sec old)",
(unsigned)rendcirc->base_.n_circ_id, conn_age); (unsigned) TO_CIRCUIT(rendcirc)->n_circ_id,
rendcirc->global_identifier, conn_age);
return 0; return 0;
} }
...@@ -2744,10 +2746,13 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn) ...@@ -2744,10 +2746,13 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (retval > 0) { if (retval > 0) {
/* one has already sent the intro. keep waiting. */ /* one has already sent the intro. keep waiting. */
tor_assert(introcirc); tor_assert(introcirc);
log_info(LD_REND, "Intro circ %u present and awaiting ack (rend %u). " log_info(LD_REND, "Intro circ %u (id: %" PRIu32 ") present and "
"Stalling. (stream %d sec old)", "awaiting ACK. Rend circuit %u (id: %" PRIu32 "). "
(unsigned)introcirc->base_.n_circ_id, "Stalling. (stream %d sec old)",
rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0, (unsigned) TO_CIRCUIT(introcirc)->n_circ_id,
introcirc->global_identifier,
rendcirc ? (unsigned) TO_CIRCUIT(rendcirc)->n_circ_id : 0,
rendcirc ? rendcirc->global_identifier : 0,
conn_age); conn_age);
return 0; return 0;
} }
...@@ -2757,19 +2762,24 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn) ...@@ -2757,19 +2762,24 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
if (rendcirc && introcirc && if (rendcirc && introcirc &&
rendcirc->base_.purpose == CIRCUIT_PURPOSE_C_REND_READY) { rendcirc->base_.purpose == CIRCUIT_PURPOSE_C_REND_READY) {
log_info(LD_REND, log_info(LD_REND,
"ready rend circ %u already here (no intro-ack yet on " "ready rend circ %u (id: %" PRIu32 ") already here. No"
"intro %u). (stream %d sec old)", "intro-ack yet on intro %u (id: %" PRIu32 "). "
(unsigned)rendcirc->base_.n_circ_id, "(stream %d sec old)",
(unsigned)introcirc->base_.n_circ_id, conn_age); (unsigned) TO_CIRCUIT(rendcirc)->n_circ_id,
rendcirc->global_identifier,
(unsigned) TO_CIRCUIT(introcirc)->n_circ_id,
introcirc->global_identifier, conn_age);
tor_assert(introcirc->base_.purpose == CIRCUIT_PURPOSE_C_INTRODUCING); tor_assert(introcirc->base_.purpose == CIRCUIT_PURPOSE_C_INTRODUCING);
if (introcirc->base_.state == CIRCUIT_STATE_OPEN) { if (introcirc->base_.state == CIRCUIT_STATE_OPEN) {
int ret; int ret;
log_info(LD_REND,"found open intro circ %u (rend %u); sending " log_info(LD_REND, "Found open intro circ %u (id: %" PRIu32 "). "
"introduction. (stream %d sec old)", "Rend circuit %u (id: %" PRIu32 "); Sending "
(unsigned)introcirc->base_.n_circ_id, "introduction. (stream %d sec old)",
(unsigned)rendcirc->base_.n_circ_id, (unsigned) TO_CIRCUIT(introcirc)->n_circ_id,
conn_age); introcirc->global_identifier,
(unsigned) TO_CIRCUIT(rendcirc)->n_circ_id,
rendcirc->global_identifier, conn_age);
ret = hs_client_send_introduce1(introcirc, rendcirc); ret = hs_client_send_introduce1(introcirc, rendcirc);
switch (ret) { switch (ret) {
case 0: /* success */ case 0: /* success */
...@@ -2793,10 +2803,13 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn) ...@@ -2793,10 +2803,13 @@ connection_ap_handshake_attach_circuit(entry_connection_t *conn)
} }
} }
log_info(LD_REND, "Intro (%u) and rend (%u) circs are not both ready. " log_info(LD_REND, "Intro %u (id: %" PRIu32 ") and rend circuit %u "
"Stalling conn. (%d sec old)", "(id: %" PRIu32 ") circuits are not both ready. "
introcirc ? (unsigned)introcirc->base_.n_circ_id : 0, "Stalling conn. (%d sec old)",
rendcirc ? (unsigned)rendcirc->base_.n_circ_id : 0, conn_age); introcirc ? (unsigned) TO_CIRCUIT(introcirc)->n_circ_id : 0,
introcirc ? introcirc->global_identifier : 0,
rendcirc ? (unsigned) TO_CIRCUIT(rendcirc)->n_circ_id : 0,
rendcirc ? rendcirc->global_identifier : 0, conn_age);
return 0; return 0;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment