summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@persephoneslair.org>2012-09-08 18:58:03 -0700
committerAndrea Shepard <andrea@torproject.org>2012-10-08 03:06:09 -0700
commit07f9e8fc7d5de57b878118a5179c26eee8466a39 (patch)
tree4e5bcd8fe9d6c254aa3e2c126c54d3a7f9a2c975 /src
parentf06880c855a6ac4dd824bed7efcd0bd0436bda32 (diff)
downloadtor-07f9e8fc7d5de57b878118a5179c26eee8466a39.tar.gz
tor-07f9e8fc7d5de57b878118a5179c26eee8466a39.zip
Call channel_run_cleanup() in main.c, and include a comment explaining how closing or_connections related to channels
Diffstat (limited to 'src')
-rw-r--r--src/or/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/or/main.c b/src/or/main.c
index f53bcf3574..491c48ea7c 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -400,6 +400,18 @@ connection_unlink(connection_t *conn)
if (conn->type == CONN_TYPE_OR) {
if (!tor_digest_is_zero(TO_OR_CONN(conn)->identity_digest))
connection_or_remove_from_identity_map(TO_OR_CONN(conn));
+ /* connection_unlink() can only get called if the connection
+ * was already on the closeable list, and it got there by
+ * connection_mark_for_close(), which was called from
+ * connection_or_close_normally() or
+ * connection_or_close_for_error(), so the channel should
+ * already be in CHANNEL_STATE_CLOSING, and then the
+ * connection_about_to_close_connection() goes to
+ * connection_or_about_to_close(), which calls channel_closed()
+ * to notify the channel_t layer, and closed the channel, so
+ * nothing more to do here to deal with the channel associated
+ * with an orconn.
+ */
}
connection_free(conn);
}
@@ -1525,6 +1537,9 @@ run_scheduled_events(time_t now)
* flush it. */
or_state_save(now);
+ /** 8c. Do channel cleanup just like for connections */
+ channel_run_cleanup();
+
/** 9. and if we're a server, check whether our DNS is telling stories to
* us. */
if (!net_is_disabled() &&