diff options
author | Andrea Shepard <andrea@torproject.org> | 2016-06-30 14:13:42 +0000 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2016-08-20 01:43:50 +0000 |
commit | e9464737af4b31e0aba29eb5581a5faf80647800 (patch) | |
tree | 30d738e7fce9108534d7dda2822f5e4e77191d8c /src/or/connection.c | |
parent | c76d45bdecb0ac5f11b578919e491957bee41d8f (diff) | |
download | tor-e9464737af4b31e0aba29eb5581a5faf80647800.tar.gz tor-e9464737af4b31e0aba29eb5581a5faf80647800.zip |
Implement kill_conn_list_for_oos()
Diffstat (limited to 'src/or/connection.c')
-rw-r--r-- | src/or/connection.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c index fce63adcbe..e164fae15c 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -4519,9 +4519,20 @@ pick_oos_victims(int n) static void kill_conn_list_for_oos(smartlist_t *conns) { - (void)conns; + if (!conns) return; - /* TODO */ + SMARTLIST_FOREACH_BEGIN(conns, connection_t *, c) { + /* Make sure the channel layer gets told about orconns */ + if (c->type == CONN_TYPE_OR) { + connection_or_close_for_error(TO_OR_CONN(c), 1); + } else { + connection_mark_and_flush(c); + } + } SMARTLIST_FOREACH_END(c); + + log_notice(LD_NET, + "OOS handler marked and flushed %d connections", + smartlist_len(conns)); } /** Out-of-Sockets handler; n_socks is the current number of open |