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

[or-cvs] minor race condition



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

Modified Files:
	connection.c connection_ap.c 
Log Message:
minor race condition

(it seemed to work anyway, but...)


Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- connection.c	4 Sep 2002 06:29:27 -0000	1.19
+++ connection.c	9 Sep 2002 04:06:58 -0000	1.20
@@ -635,8 +635,9 @@
 
   circ = circuit_get_by_conn(conn);
   if(!circ) {
-    log(LOG_DEBUG,"connection_consider_sending_sendme(): Bug: no circuit associated with conn. Closing.");
-    return -1;
+    /* this can legitimately happen if the destroy has already arrived and torn down the circuit */
+    log(LOG_DEBUG,"connection_consider_sending_sendme(): No circuit associated with conn. Skipping.");
+    return 0;
   }
   sendme.command = CELL_SENDME;
   sendme.length = RECEIVE_WINDOW_INCREMENT;

Index: connection_ap.c
===================================================================
RCS file: /home/or/cvsroot/src/or/connection_ap.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- connection_ap.c	24 Aug 2002 07:55:49 -0000	1.9
+++ connection_ap.c	9 Sep 2002 04:06:59 -0000	1.10
@@ -365,8 +365,7 @@
     case AP_CONN_STATE_OPEN:
       /* FIXME down the road, we'll clear out circuits that are pending to close */
       connection_stop_writing(conn);
-      connection_consider_sending_sendme(conn);
-      return 0;
+      return connection_consider_sending_sendme(conn);
     default:
       log(LOG_DEBUG,"Bug: connection_ap_finished_flushing() called in unexpected state.");
       return 0;