aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-04-05 15:24:03 +0000
committerRoger Dingledine <arma@torproject.org>2004-04-05 15:24:03 +0000
commitcebf16eaf01d9dea65b0252f36e33514bdd6f84e (patch)
tree0f813c37253fd4af751f349bc0ff42874eb1bd40 /src/or/connection_edge.c
parent8a209bc4d3abdab79dd35b360448547e15059a56 (diff)
downloadtor-cebf16eaf01d9dea65b0252f36e33514bdd6f84e.tar.gz
tor-cebf16eaf01d9dea65b0252f36e33514bdd6f84e.zip
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
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c10
1 files 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 */