aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2014-04-15 20:19:39 -0700
committerAndrea Shepard <andrea@torproject.org>2014-04-15 20:19:39 -0700
commita5544e589d1724fc2765b277da736bbb2a9a8299 (patch)
treee3b236e917b1a2cf456bcfcdf9db05bc7c8a9203 /src
parent125c8e54680c936b9e532597372c62ac47af4fa9 (diff)
downloadtor-a5544e589d1724fc2765b277da736bbb2a9a8299.tar
tor-a5544e589d1724fc2765b277da736bbb2a9a8299.tar.gz
Close orconns correctly through channels when setting DisableNetwork to 1
Diffstat (limited to 'src')
-rw-r--r--src/or/connection.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 1be4c45dd..0c61b0d61 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2359,6 +2359,20 @@ connection_mark_all_noncontrol_connections(void)
connection_mark_unattached_ap(TO_ENTRY_CONN(conn),
END_STREAM_REASON_HIBERNATING);
break;
+ case CONN_TYPE_OR:
+ {
+ or_connection_t *orconn = TO_OR_CONN(conn);
+ if (orconn->chan) {
+ connection_or_close_normally(orconn, 0);
+ } else {
+ /*
+ * There should have been one, but mark for close and hope
+ * for the best..
+ */
+ connection_mark_for_close(conn);
+ }
+ }
+ break;
default:
connection_mark_for_close(conn);
break;