mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 15:10:48 +01:00
Consistently use braced blocks in hibernate_go_dormant()
This commit is contained in:
parent
e57604183c
commit
e9f57e193d
1 changed files with 7 additions and 4 deletions
|
@ -907,21 +907,24 @@ hibernate_go_dormant(time_t now)
|
||||||
while ((conn = connection_get_by_type(CONN_TYPE_OR)) ||
|
while ((conn = connection_get_by_type(CONN_TYPE_OR)) ||
|
||||||
(conn = connection_get_by_type(CONN_TYPE_AP)) ||
|
(conn = connection_get_by_type(CONN_TYPE_AP)) ||
|
||||||
(conn = connection_get_by_type(CONN_TYPE_EXIT))) {
|
(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);
|
connection_edge_end(TO_EDGE_CONN(conn), END_STREAM_REASON_HIBERNATING);
|
||||||
|
}
|
||||||
log_info(LD_NET,"Closing conn type %d", conn->type);
|
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),
|
connection_mark_unattached_ap(TO_ENTRY_CONN(conn),
|
||||||
END_STREAM_REASON_HIBERNATING);
|
END_STREAM_REASON_HIBERNATING);
|
||||||
else if (conn->type == CONN_TYPE_OR) {
|
} else if (conn->type == CONN_TYPE_OR) {
|
||||||
if (TO_OR_CONN(conn)->chan) {
|
if (TO_OR_CONN(conn)->chan) {
|
||||||
connection_or_close_normally(TO_OR_CONN(conn), 0);
|
connection_or_close_normally(TO_OR_CONN(conn), 0);
|
||||||
} else {
|
} else {
|
||||||
connection_mark_for_close(conn);
|
connection_mark_for_close(conn);
|
||||||
}
|
}
|
||||||
} else
|
} else {
|
||||||
connection_mark_for_close(conn);
|
connection_mark_for_close(conn);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (now < interval_wakeup_time)
|
if (now < interval_wakeup_time)
|
||||||
hibernate_end_time = interval_wakeup_time;
|
hibernate_end_time = interval_wakeup_time;
|
||||||
|
|
Loading…
Add table
Reference in a new issue