[or-cvs] The crowning bugfix.

Roger Dingledine arma at seul.org
Sun Nov 21 11:30:35 UTC 2004


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

Modified Files:
	connection_edge.c 
Log Message:
The crowning bugfix.

The problem was that with high load, circuit package window was
reaching 0. Whenever we got a circuit-level sendme, we were
reading a lot on each socket, but only writing out a bit. So we
would eventually reach eof. This would be noticed and acted on
even when there are still bytes sitting in the inbuf.


Index: connection_edge.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.236
retrieving revision 1.237
diff -u -d -r1.236 -r1.237
--- connection_edge.c	21 Nov 2004 10:14:57 -0000	1.236
+++ connection_edge.c	21 Nov 2004 11:30:33 -0000	1.237
@@ -34,7 +34,10 @@
   }
   return 0;
 #else
-  /* eof reached, kill it. */
+  if(buf_datalen(conn->inbuf)) {
+    /* it still has stuff to process. don't let it die yet. */
+    return 0;
+  }
   log_fn(LOG_INFO,"conn (fd %d) reached eof (stream size %d). Closing.", conn->s, (int)conn->stream_size);
   connection_edge_end(conn, END_STREAM_REASON_DONE, conn->cpath_layer);
   if(!conn->marked_for_close) {



More information about the tor-commits mailing list