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

[or-cvs] We weren"t cannibilizing circuits correctly for



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

Modified Files:
	circuituse.c rendservice.c 
Log Message:
We weren't cannibilizing circuits correctly for
CIRCUIT_PURPOSE_C_ESTABLISH_REND and CIRCUIT_PURPOSE_S_ESTABLISH_INTRO
so we were being forced to build those from scratch.
This should save us a bit of time. Also fixes bug 173.


Index: circuituse.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/circuituse.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- circuituse.c	14 Jul 2005 08:43:19 -0000	1.77
+++ circuituse.c	12 Aug 2005 01:26:21 -0000	1.78
@@ -751,13 +751,8 @@
       circ->timestamp_created = time(NULL);
       switch (purpose) {
         case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
-          /* it's ready right now */
-          /* XXX should we call control_event_circuit_status() here? */
-          rend_client_rendcirc_has_opened(circ);
-          break;
         case CIRCUIT_PURPOSE_S_ESTABLISH_INTRO:
           /* it's ready right now */
-          rend_service_intro_has_opened(circ);
           break;
         case CIRCUIT_PURPOSE_C_INTRODUCING:
         case CIRCUIT_PURPOSE_S_CONNECT_REND:
@@ -942,6 +937,9 @@
       if (circ) {
         /* write the service_id into circ */
         strlcpy(circ->rend_query, conn->rend_query, sizeof(circ->rend_query));
+        if (circ->purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND &&
+            circ->state == CIRCUIT_STATE_OPEN)
+          rend_client_rendcirc_has_opened(circ);
       }
     }
   }

Index: rendservice.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/rendservice.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- rendservice.c	6 Aug 2005 21:35:04 -0000	1.131
+++ rendservice.c	12 Aug 2005 01:26:21 -0000	1.132
@@ -655,6 +655,8 @@
           sizeof(launched->rend_query));
   memcpy(launched->rend_pk_digest, service->pk_digest, DIGEST_LEN);
 
+  if (launched->state == CIRCUIT_STATE_OPEN)
+    rend_service_intro_has_opened(launched);
   return 0;
 }