summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-03-06 06:05:00 +0000
committerRoger Dingledine <arma@torproject.org>2004-03-06 06:05:00 +0000
commit10cee8b7f7de5656b7e2d4dea7ee797bcf966f3d (patch)
tree9a45aae193d7d09ab16a8e74e541ab75579bd277
parent516ef41ac1fd26f338cf1d36ec9d2bf0beedaa5c (diff)
downloadtor-10cee8b7f7de5656b7e2d4dea7ee797bcf966f3d.tar.gz
tor-10cee8b7f7de5656b7e2d4dea7ee797bcf966f3d.zip
fix a rare race condition: when we send a cell and then
mark an OR connection expired, we might close it before finishing a flush if the other side isn't reading. svn:r1240
-rw-r--r--src/or/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 0a74d44747..10dc270352 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -304,10 +304,9 @@ static void run_connection_housekeeping(int i, time_t now) {
/* we're an onion proxy, with no circuits; or our handshake has expired. kill it. */
log_fn(LOG_INFO,"Expiring connection to %d (%s:%d).",
i,conn->address, conn->port);
- connection_mark_for_close(conn,0); /* Suppress end ??? */
-/* XXX there's no concept of 'suppressing end' here, because it's an OR
- * connection, and there's no such thing as an end cell for an OR
- * connection. -RD */
+ /* flush anything waiting, e.g. a destroy for a just-expired circ */
+ conn->hold_open_until_flushed = 1;
+ connection_mark_for_close(conn,0);
} else {
/* either a full router, or we've got a circuit. send a padding cell. */
log_fn(LOG_DEBUG,"Sending keepalive to (%s:%d)",