From cebf16eaf01d9dea65b0252f36e33514bdd6f84e Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Mon, 5 Apr 2004 15:24:03 +0000 Subject: [PATCH] if a rend stream has already been attached to a rend circ, then don't attach it again (and again, and again, and...) svn:r1477 --- src/or/connection_edge.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 0c293b2653..8c33b6cef5 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -818,7 +818,7 @@ void link_apconn_to_circ(connection_t *apconn, circuit_t *circ) { /* Try to find a safe live circuit for CONN_TYPE_AP connection conn. If * we don't find one: if conn cannot be handled by any known nodes, * warn and return -1 (conn needs to die); - * else launch new circuit and return 0. + * else launch new circuit (if necessary) and return 0. * Otherwise, associate conn with a safe live circuit, do the * right next step, and return 1. */ @@ -854,7 +854,13 @@ int connection_ap_handshake_attach_circuit(connection_t *conn) { } else { /* we're a rendezvous conn */ circuit_t *rendcirc=NULL, *introcirc=NULL; - /* first, find a rendezvous circuit for us */ + /* before anything else, see if we've already been attached + * to a rendezvous circuit */ + if(conn->cpath_layer) { + return 1; + } + + /* else, start by finding a rendezvous circuit for us */ retval = circuit_get_open_circ_or_launch(conn, CIRCUIT_PURPOSE_C_REND_JOINED, &rendcirc); if(retval < 0) return -1; /* failed */