summaryrefslogtreecommitdiff
path: root/src/or/main.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-12-22 02:55:26 +0000
committerRoger Dingledine <arma@torproject.org>2004-12-22 02:55:26 +0000
commit036384fd8eaf83354ed59abec1c9816abd82528c (patch)
treeaa997829d326c94018b17f1b375925a5a3b11641 /src/or/main.c
parentc79c4200f43680da35849c03fe7fd7705a400d01 (diff)
downloadtor-036384fd8eaf83354ed59abec1c9816abd82528c.tar.gz
tor-036384fd8eaf83354ed59abec1c9816abd82528c.zip
respond to an 009 XXX
svn:r3201
Diffstat (limited to 'src/or/main.c')
-rw-r--r--src/or/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index e9b77a6ab2..1c2779066f 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -252,6 +252,17 @@ static void conn_read(int i) {
/* 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))