[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[or-cvs] fixed rare race condition



Update of /home/or/cvsroot/src/or
In directory moria.seul.org:/home/arma/work/onion/cvs/src/or

Modified Files:
	connection_exit.c 
Log Message:
fixed rare race condition


Index: connection_exit.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_exit.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- connection_exit.c	2 Oct 2002 22:54:20 -0000	1.14
+++ connection_exit.c	24 Nov 2002 08:33:15 -0000	1.15
@@ -76,7 +76,10 @@
 
   circ = circuit_get_by_conn(conn);
 
-  assert(circ && circ->p_conn && circ->n_conn == conn); /* is this true? i guess i'll see if it breaks. */
+  if(!circ) {
+    log(LOG_DEBUG,"connection_exit_send_connected(): client-side sent destroy just as we completed server connection. Closing.");
+    return -1;
+  }
 
   return connection_send_connected(circ->p_aci, circ->p_conn);
 }