diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-10-31 11:59:18 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-10-31 11:59:18 -0400 |
commit | c9ad172dd4081fbb3cd5e2995a79d3e449b7e474 (patch) | |
tree | ac259bcac9ff0c58a81f80539a5558a464f68003 /src/or/hibernate.c | |
parent | cf98ca715c0899b5d0f9617cd4a7eb2e3a128fb9 (diff) | |
parent | e9f57e193d75f5c61b05dafb1c1585e5b1762866 (diff) | |
download | tor-c9ad172dd4081fbb3cd5e2995a79d3e449b7e474.tar.gz tor-c9ad172dd4081fbb3cd5e2995a79d3e449b7e474.zip |
Merge branch 'bug23571_033_squashed'
Diffstat (limited to 'src/or/hibernate.c')
-rw-r--r-- | src/or/hibernate.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/or/hibernate.c b/src/or/hibernate.c index 8f665a15a4..4dc35f68d0 100644 --- a/src/or/hibernate.c +++ b/src/or/hibernate.c @@ -34,6 +34,7 @@ hibernating, phase 2: #include "config.h" #include "connection.h" #include "connection_edge.h" +#include "connection_or.h" #include "control.h" #include "hibernate.h" #include "main.h" @@ -906,20 +907,23 @@ hibernate_go_dormant(time_t now) while ((conn = connection_get_by_type(CONN_TYPE_OR)) || (conn = connection_get_by_type(CONN_TYPE_AP)) || (conn = connection_get_by_type(CONN_TYPE_EXIT))) { - if (CONN_IS_EDGE(conn)) + if (CONN_IS_EDGE(conn)) { connection_edge_end(TO_EDGE_CONN(conn), END_STREAM_REASON_HIBERNATING); + } log_info(LD_NET,"Closing conn type %d", conn->type); - if (conn->type == CONN_TYPE_AP) /* send socks failure if needed */ + if (conn->type == CONN_TYPE_AP) { + /* send socks failure if needed */ connection_mark_unattached_ap(TO_ENTRY_CONN(conn), END_STREAM_REASON_HIBERNATING); - else if (conn->type == CONN_TYPE_OR) { + } else if (conn->type == CONN_TYPE_OR) { if (TO_OR_CONN(conn)->chan) { - channel_mark_for_close(TLS_CHAN_TO_BASE(TO_OR_CONN(conn)->chan)); + connection_or_close_normally(TO_OR_CONN(conn), 0); } else { connection_mark_for_close(conn); } - } else + } else { connection_mark_for_close(conn); + } } if (now < interval_wakeup_time) |