[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] don"t process marked-for-close conns further.



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

Modified Files:
	connection.c 
Log Message:
don't process marked-for-close conns further.
(fix assert trigger -- if we're lucky.)


Index: connection.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -d -r1.296 -r1.297
--- connection.c	22 Nov 2004 22:50:17 -0000	1.296
+++ connection.c	24 Nov 2004 06:41:58 -0000	1.297
@@ -850,14 +850,19 @@
     if (connection_process_inbuf(conn, 0) < 0) {
       return -1;
     }
-    if (connection_is_reading(conn) && !conn->inbuf_reached_eof)
+    if (!conn->marked_for_close &&
+        connection_is_reading(conn) &&
+        !conn->inbuf_reached_eof)
       goto loop_again; /* try reading again, in case more is here now */
   }
   /* one last try, packaging partial cells and all. */
-  if (connection_process_inbuf(conn, 1) < 0) {
+  if (!conn->marked_for_close &&
+      connection_process_inbuf(conn, 1) < 0) {
     return -1;
   }
-  if (conn->inbuf_reached_eof && connection_reached_eof(conn) < 0) {
+  if (!conn->marked_for_close &&
+      conn->inbuf_reached_eof &&
+      connection_reached_eof(conn) < 0) {
     return -1;
   }
   return 0;