[tor-commits] [stegotorus/master] Fix hang on shutdown.
zwol at torproject.org
zwol at torproject.org
Fri Jul 20 23:17:08 UTC 2012
commit 1109030065086668970d05ce15b5d78d4ebb52bb
Author: Zack Weinberg <zackw at cmu.edu>
Date: Sun Jul 8 17:39:20 2012 +0200
Fix hang on shutdown.
If all connections and circuits were already closed when conn_start_shutdown
was called, close_cleanup_cb would never be called in the proper state to
terminate the event loop. Activate the cleanup event explicitly from
conn_start_shutdown to prevent this.
---
src/connections.cc | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/src/connections.cc b/src/connections.cc
index 8f8a8c6..91d9c7d 100644
--- a/src/connections.cc
+++ b/src/connections.cc
@@ -148,6 +148,11 @@ conn_start_shutdown(int barbaric)
(*i)->close();
}
}
+
+ /* Make sure close_cleanup_cb is called at least once after this
+ point; if there were no connections to tear down it might not
+ otherwise happen. */
+ event_active(cgs->close_cleanup, 0, 0);
}
size_t
More information about the tor-commits
mailing list