diff options
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r-- | src/or/rendmid.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c index 81a2f16ec..475358189 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -31,8 +31,9 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request, int reason = END_CIRC_REASON_INTERNAL; log_info(LD_REND, - "Received an ESTABLISH_INTRO request on circuit %u", - (unsigned) circ->p_circ_id); + "Received an ESTABLISH_INTRO request on circuit (p_circ_id %u n_circ_id %u)", + (unsigned) circ->p_circ_id, + (unsigned) circ->base_.n_circ_id); if (circ->base_.purpose != CIRCUIT_PURPOSE_OR || circ->base_.n_chan) { log_fn(LOG_PROTOCOL_WARN, LD_PROTOCOL, @@ -181,6 +182,12 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request, "found %i possible introduction circuits for service %s", smartlist_len(intro_circuits), safe_str(serviceid)); + SMARTLIST_FOREACH_BEGIN(intro_circuits, or_circuit_t *, circuit) + { + log_info(LD_REND, "circuit id %u", (unsigned) circuit->p_circ_id); + } + SMARTLIST_FOREACH_END(circuit); + if (smartlist_len(intro_circuits) == 0) { log_info(LD_REND, "No intro circ found for INTRODUCE1 cell (%s) from circuit %u; " @@ -234,22 +241,28 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request, safe_str(serviceid), (unsigned)circ->p_circ_id, (unsigned)intro_circ->p_circ_id); + log_info(LD_REND, "Sending relay cell"); /* Great. Now we just relay the cell down the circuit. */ if (relay_send_command_from_edge(0, TO_CIRCUIT(intro_circ), RELAY_COMMAND_INTRODUCE2, (char*)request, request_len, NULL)) { log_warn(LD_GENERAL, "Unable to send INTRODUCE2 cell to Tor client."); + log_info(LD_REND, + "Unable to send INTRODUCE2 cell to Tor client."); goto err; } + log_info(LD_REND, "Sending ack cell"); /* And sent an ack down Alice's circuit. Empty body means succeeded. */ if (relay_send_command_from_edge(0,TO_CIRCUIT(circ), RELAY_COMMAND_INTRODUCE_ACK, NULL,0,NULL)) { log_warn(LD_GENERAL, "Unable to send INTRODUCE_ACK cell to Tor client."); + log_info(LD_REND, "Unable to send INTRODUCE_ACK cell to Tor client, calling circuit_mark_for_close"); circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL); return -1; } + log_info(LD_REND, "Completed sending introduction request"); return 0; err: @@ -259,6 +272,7 @@ rend_mid_introduce(or_circuit_t *circ, const uint8_t *request, RELAY_COMMAND_INTRODUCE_ACK, nak_body, 1, NULL)) { log_warn(LD_GENERAL, "Unable to send NAK to Tor client."); + log_info(LD_REND, "Unable to send NAK to Tor client, calling circuit_mark_for_close"); /* Is this right? */ circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_INTERNAL); } |