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

[or-cvs] bugfix: sometimes we closed a circ while cpuworker was cran...



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

Modified Files:
	circuit.c onion.c 
Log Message:
bugfix: sometimes we closed a circ while cpuworker was cranking,
        and it didn't notice


Index: circuit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuit.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -d -r1.106 -r1.107
--- circuit.c	18 Nov 2003 09:53:02 -0000	1.106
+++ circuit.c	18 Nov 2003 21:12:17 -0000	1.107
@@ -552,6 +552,10 @@
 
   assert(circ);
   circuit_remove(circ);
+  if(circ->state == CIRCUIT_STATE_ONIONSKIN_PENDING) {
+    onion_pending_remove(circ);
+  }
+
   if(circ->n_conn)
     connection_send_destroy(circ->n_circ_id, circ->n_conn);
   for(conn=circ->n_streams; conn; conn=conn->next_stream) {
@@ -706,7 +710,6 @@
   }
 
   if(circuit_establish_circuit() < 0) {
-    failures++;
     return 0;
   }
 
@@ -746,7 +749,7 @@
     circ->n_port = firsthop->or_port;
     if(options.OnionRouter) { /* we would be connected if he were up. but he's not. */
       log_fn(LOG_INFO,"Route's firsthop isn't connected.");
-      circuit_close(circ); 
+      circuit_close(circ);
       return -1;
     }
 

Index: onion.c
===================================================================
RCS file: /home/or/cvsroot/src/or/onion.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- onion.c	18 Nov 2003 09:53:02 -0000	1.91
+++ onion.c	18 Nov 2003 21:12:17 -0000	1.92
@@ -69,11 +69,14 @@
     return NULL; /* no onions pending, we're done */
 
   assert(ol_list->circ);
+  assert(ol_list->circ->p_conn); /* make sure it's still valid */
+#if 0
   if(!ol_list->circ->p_conn) {
     log_fn(LOG_INFO,"ol_list->circ->p_conn null, must have died?");
     onion_pending_remove(ol_list->circ);
     return onion_next_task(); /* recurse: how about the next one? */
   }
+#endif
 
   assert(ol_length > 0);
   circ = ol_list->circ;