aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-03-03 06:26:34 +0000
committerRoger Dingledine <arma@torproject.org>2004-03-03 06:26:34 +0000
commit3c71d09402ed58fab896f27ab7b668b547e8ab5e (patch)
tree9f65ab3a6aaaad5f6d2c9d0c2056e17ce34ce27a /src/or/connection.c
parentf4e4dac80163625d0d1713ee8ff6c2d9f0c3d394 (diff)
downloadtor-3c71d09402ed58fab896f27ab7b668b547e8ab5e.tar
tor-3c71d09402ed58fab896f27ab7b668b547e8ab5e.tar.gz
use conn->hold_open_until_flushed for streams
and also note/fix a variety of other stream-based bugs svn:r1210
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c11
1 files changed, 8 insertions, 3 deletions
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. */