diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-01-04 13:50:24 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-01-04 13:50:24 -0500 |
commit | 65420e4cb5edcd02b6f44462dcc5c3a7fa8bb2e9 (patch) | |
tree | 86e7a09ba27884359051963eb4097cc3a353413a /src/or/rendclient.c | |
parent | 47b7a279298c81137430527ed0a72c6a6d3fcd61 (diff) | |
parent | 0bd53b8d87a5fd4691530b8cb54181037062b949 (diff) | |
download | tor-65420e4cb5edcd02b6f44462dcc5c3a7fa8bb2e9.tar.gz tor-65420e4cb5edcd02b6f44462dcc5c3a7fa8bb2e9.zip |
Merge remote-tracking branch 'rransom-tor/bug1297b-v2'
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r-- | src/or/rendclient.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c index 8aae8c5cb5..17c92ab6ae 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -275,6 +275,12 @@ rend_client_send_introduction(origin_circuit_t *introcirc, payload_len = DIGEST_LEN + r; tor_assert(payload_len <= RELAY_PAYLOAD_SIZE); /* we overran something */ + /* Copy the rendezvous cookie from rendcirc to introcirc, so that + * when introcirc gets an ack, we can change the state of the right + * rendezvous circuit. */ + memcpy(rendcirc->rend_data->rend_cookie, introcirc->rend_data->rend_cookie, + REND_COOKIE_LEN); + log_info(LD_REND, "Sending an INTRODUCE1 cell"); if (relay_send_command_from_edge(0, TO_CIRCUIT(introcirc), RELAY_COMMAND_INTRODUCE1, @@ -344,8 +350,7 @@ rend_client_introduction_acked(origin_circuit_t *circ, * and tell it. */ log_info(LD_REND,"Received ack. Telling rend circ..."); - rendcirc = circuit_get_by_rend_query_and_purpose( - circ->rend_data->onion_address, CIRCUIT_PURPOSE_C_REND_READY); + rendcirc = circuit_get_ready_rend_circ_by_rend_data(circ->rend_data); if (rendcirc) { /* remember the ack */ #ifndef NON_ANONYMOUS_MODE_ENABLED tor_assert(!(rendcirc->build_state->onehop_tunnel)); @@ -890,6 +895,11 @@ rend_client_receive_rendezvous(origin_circuit_t *circ, const uint8_t *request, hop->package_window = circuit_initial_package_window(); hop->deliver_window = CIRCWINDOW_START; + /* Now that this circuit has finished connecting to its destination, + * make sure circuit_get_open_circ_or_launch is willing to return it + * so we can actually use it. */ + circ->hs_circ_has_timed_out = 0; + onion_append_to_cpath(&circ->cpath, hop); circ->build_state->pending_final_cpath = NULL; /* prevent double-free */ |