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

[or-cvs] respond to an 009 XXX



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 main.c 
Log Message:
respond to an 009 XXX


Index: connection.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.310
retrieving revision 1.311
diff -u -d -r1.310 -r1.311
--- connection.c	13 Dec 2004 00:44:38 -0000	1.310
+++ connection.c	22 Dec 2004 02:55:26 -0000	1.311
@@ -942,7 +942,7 @@
     result = read_to_buf(conn->s, at_most, conn->inbuf,
                          &conn->inbuf_reached_eof);
 
-//  log(LOG_DEBUG,"connection_read_to_buf(): read_to_buf returned %d.",read_result);
+//  log_fn(LOG_DEBUG,"read_to_buf returned %d.",read_result);
 
     if (result < 0)
       return -1;

Index: main.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.407
retrieving revision 1.408
diff -u -d -r1.407 -r1.408
--- main.c	16 Dec 2004 05:23:48 -0000	1.407
+++ main.c	22 Dec 2004 02:55:26 -0000	1.408
@@ -252,6 +252,17 @@
     /* XXX Post 0.0.9, we should rewrite this whole if statement;
      * something sane may result.  Nick suspects that the || below
      * should be a &&.
+     *
+     * No, it should remain a ||. Here's why: when we reach the end
+     * of a read bucket, we stop reading on a conn. We don't want to
+     * read any more bytes on it, until we're allowed to resume reading.
+     * So if !connection_is_reading, then return right then. Also, if
+     * poll() said nothing (true because the if above), and there's
+     * nothing pending, then also return because nothing to do.
+     *
+     * If poll *does* have something to say, even though
+     * !connection_is_reading, then we want to handle it in connection.c
+     * to make it stop reading for next time, else we loop.
      */
     if (!connection_is_reading(conn) ||
         !connection_has_pending_tls_data(conn))