From 3c71d09402ed58fab896f27ab7b668b547e8ab5e Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Wed, 3 Mar 2004 06:26:34 +0000 Subject: use conn->hold_open_until_flushed for streams and also note/fix a variety of other stream-based bugs svn:r1210 --- src/or/connection.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/or/connection.c') diff --git a/src/or/connection.c b/src/or/connection.c index 30741ebea..58e82616a 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -223,9 +223,11 @@ void connection_expire_held_open(void) /* If we've been holding the connection open, but we haven't written * for 15 seconds... */ - if (conn->marked_for_close && conn->hold_open_until_flushed && - now - conn->timestamp_lastwritten >= 15) { - conn->hold_open_until_flushed = 0; + if (conn->hold_open_until_flushed) { + assert(conn->marked_for_close); + if (now - conn->timestamp_lastwritten >= 15) { + conn->hold_open_until_flushed = 0; + } } } } @@ -848,6 +850,9 @@ void assert_connection_ok(connection_t *conn, time_t now) assert(connection_is_writing(conn) || conn->wants_to_write); } + if(conn->hold_open_until_flushed) + assert(conn->marked_for_close); + /* XXX check: wants_to_read, wants_to_write, s, poll_index, * marked_for_close. */ -- cgit v1.2.3