[or-cvs] Fix a double-mark-for-close bug, where we were finding a conn

Roger Dingledine arma at seul.org
Sat Jan 1 07:54:03 UTC 2005


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

Modified Files:
	relay.c 
Log Message:
Fix a double-mark-for-close bug, where we were finding a conn
for a cell even if that conn is already marked for close.

Don't back-port to 0.0.9.x, since this fix could have weird implications.


Index: relay.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/relay.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- relay.c	13 Dec 2004 02:23:22 -0000	1.32
+++ relay.c	1 Jan 2005 07:54:01 -0000	1.33
@@ -349,7 +349,7 @@
    */
 
   for (tmpconn = circ->n_streams; tmpconn; tmpconn=tmpconn->next_stream) {
-    if (rh.stream_id == tmpconn->stream_id) {
+    if (rh.stream_id == tmpconn->stream_id && !tmpconn->marked_for_close) {
       log_fn(LOG_DEBUG,"found conn for stream %d.", rh.stream_id);
       if (cell_direction == CELL_DIRECTION_OUT ||
           connection_edge_is_rendezvous_stream(tmpconn))
@@ -357,13 +357,13 @@
     }
   }
   for (tmpconn = circ->p_streams; tmpconn; tmpconn=tmpconn->next_stream) {
-    if (rh.stream_id == tmpconn->stream_id) {
+    if (rh.stream_id == tmpconn->stream_id && !tmpconn->marked_for_close) {
       log_fn(LOG_DEBUG,"found conn for stream %d.", rh.stream_id);
       return tmpconn;
     }
   }
   for (tmpconn = circ->resolving_streams; tmpconn; tmpconn=tmpconn->next_stream) {
-    if (rh.stream_id == tmpconn->stream_id) {
+    if (rh.stream_id == tmpconn->stream_id && !tmpconn->marked_for_close) {
       log_fn(LOG_DEBUG,"found conn for stream %d.", rh.stream_id);
       return tmpconn;
     }



More information about the tor-commits mailing list