]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
minor race condition
authorRoger Dingledine <arma@torproject.org>
Mon, 9 Sep 2002 04:06:59 +0000 (04:06 +0000)
committerRoger Dingledine <arma@torproject.org>
Mon, 9 Sep 2002 04:06:59 +0000 (04:06 +0000)
(it seemed to work anyway, but...)

svn:r100

src/or/connection.c
src/or/connection_ap.c

index 243fd60a58691ded39ba537583b9de59595fb3da..8b86d253b3192d594a91558d8e0ea56cb8fba98c 100644 (file)
@@ -635,8 +635,9 @@ int connection_consider_sending_sendme(connection_t *conn) {
 
   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 9d96ae85b335bb70274207059d8e5c066fbe4d39..3080fe8226152d7cda22f6051aaedf0e445a4b15 100644 (file)
@@ -365,8 +365,7 @@ int connection_ap_finished_flushing(connection_t *conn) {
     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;