summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-04-13 03:19:58 +0000
committerNick Mathewson <nickm@torproject.org>2004-04-13 03:19:58 +0000
commitc9b5ca39dea5d4b83c9aa0828963754ab9d107d6 (patch)
tree6c0f9b66fc53178fe4e89ad3786efa9679cde834
parenta4d25bdbd99bbfb1933e6ed5f6f01baa3ac0eee0 (diff)
downloadtor-c9b5ca39dea5d4b83c9aa0828963754ab9d107d6.tar.gz
tor-c9b5ca39dea5d4b83c9aa0828963754ab9d107d6.zip
Handle the rendezvous-circ elements of retrying introductions.
svn:r1604
-rw-r--r--src/or/rendclient.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 2fd0567b97..0f2dfa15c9 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -8,11 +8,16 @@
void
rend_client_introcirc_is_open(circuit_t *circ)
{
+ circuit_t *rendcirc = NULL;
assert(circ->purpose == CIRCUIT_PURPOSE_C_INTRODUCING);
assert(CIRCUIT_IS_ORIGIN(circ) && circ->cpath);
log_fn(LOG_INFO,"introcirc is open");
connection_ap_attach_pending();
+ while ((rendcirc = circuit_get_next_by_pk_and_purpose(
+ rendcirc, circ->rend_pk_digest, CIRCUIT_PURPOSE_C_REND_READY))) {
+ rend_client_send_introduction(circ, rendcirc);
+ }
}
/* send the establish-rendezvous cell. if it fails, mark
@@ -69,15 +74,18 @@ rend_client_send_introduction(circuit_t *introcirc, circuit_t *rendcirc) {
}
/* Initialize the pending_final_cpath and start the DH handshake. */
- cpath = rendcirc->build_state->pending_final_cpath =
- tor_malloc_zero(sizeof(crypt_path_t));
- if (!(cpath->handshake_state = crypto_dh_new())) {
- log_fn(LOG_WARN, "Couldn't allocate DH");
- goto err;
- }
- if (crypto_dh_generate_public(cpath->handshake_state)<0) {
- log_fn(LOG_WARN, "Couldn't generate g^x");
- goto err;
+ cpath = rendcirc->build_state->pending_final_cpath;
+ if (!cpath) {
+ cpath = rendcirc->build_state->pending_final_cpath =
+ tor_malloc_zero(sizeof(crypt_path_t));
+ if (!(cpath->handshake_state = crypto_dh_new())) {
+ log_fn(LOG_WARN, "Couldn't allocate DH");
+ goto err;
+ }
+ if (crypto_dh_generate_public(cpath->handshake_state)<0) {
+ log_fn(LOG_WARN, "Couldn't generate g^x");
+ goto err;
+ }
}
/* write the remaining items into tmp */