[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] if a rend stream has already been attached to a rend circ,



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	connection_edge.c 
Log Message:
if a rend stream has already been attached to a rend circ,
then don't attach it again (and again, and again, and...)


Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_edge.c,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- connection_edge.c	5 Apr 2004 07:41:30 -0000	1.137
+++ connection_edge.c	5 Apr 2004 15:24:03 -0000	1.138
@@ -818,7 +818,7 @@
 /* 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 @@
   } 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 */