summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorrl1987 <rl1987@sdf.lonestar.org>2018-04-26 11:18:13 +0200
committerNick Mathewson <nickm@torproject.org>2018-09-12 09:05:39 -0400
commit9f7ed1d04e7afd261898236a70f3cd02697c4a01 (patch)
tree39b2f83ffc13e7ff5d525e348d51688e961029c2 /src/core
parentf04e0bd5d630a2ef3b618f3fe6f05d46358dfb65 (diff)
downloadtor-9f7ed1d04e7afd261898236a70f3cd02697c4a01.tar.gz
tor-9f7ed1d04e7afd261898236a70f3cd02697c4a01.zip
Always close old listeners in retry_all_listeners
Diffstat (limited to 'src/core')
-rw-r--r--src/core/mainloop/connection.c13
-rw-r--r--src/core/mainloop/connection.h3
-rw-r--r--src/core/mainloop/main.c2
3 files changed, 5 insertions, 13 deletions
diff --git a/src/core/mainloop/connection.c b/src/core/mainloop/connection.c
index 9725c3030a..1cc83016fd 100644
--- a/src/core/mainloop/connection.c
+++ b/src/core/mainloop/connection.c
@@ -2802,15 +2802,13 @@ retry_listener_ports(smartlist_t *old_conns,
* listeners who are not already open, and only close listeners we no longer
* want.
*
- * Add all old conns that should be closed to <b>replaced_conns</b>.
* Add all new connections to <b>new_conns</b>.
*
* If <b>close_all_noncontrol</b> is true, then we only open control
* listeners, and we close all other listeners.
*/
int
-retry_all_listeners(smartlist_t *replaced_conns,
- smartlist_t *new_conns, int close_all_noncontrol)
+retry_all_listeners(smartlist_t *new_conns, int close_all_noncontrol)
{
smartlist_t *listeners = smartlist_new();
smartlist_t *replacements = smartlist_new();
@@ -2849,7 +2847,6 @@ retry_all_listeners(smartlist_t *replaced_conns,
if (skip)
continue;
- // XXX: replaced_conns
connection_close_immediate(r->old_conn);
connection_mark_for_close(r->old_conn);
@@ -2872,12 +2869,8 @@ retry_all_listeners(smartlist_t *replaced_conns,
SMARTLIST_FOREACH_BEGIN(listeners, connection_t *, conn) {
log_notice(LD_NET, "Closing no-longer-configured %s on %s:%d",
conn_type_to_string(conn->type), conn->address, conn->port);
- if (replaced_conns) {
- smartlist_add(replaced_conns, conn);
- } else {
- connection_close_immediate(conn);
- connection_mark_for_close(conn);
- }
+ connection_close_immediate(conn);
+ connection_mark_for_close(conn);
} SMARTLIST_FOREACH_END(conn);
smartlist_free(listeners);
diff --git a/src/core/mainloop/connection.h b/src/core/mainloop/connection.h
index 3419ee65e8..2552808fd8 100644
--- a/src/core/mainloop/connection.h
+++ b/src/core/mainloop/connection.h
@@ -178,8 +178,7 @@ void log_failed_proxy_connection(connection_t *conn);
int get_proxy_addrport(tor_addr_t *addr, uint16_t *port, int *proxy_type,
const connection_t *conn);
-int retry_all_listeners(smartlist_t *replaced_conns,
- smartlist_t *new_conns,
+int retry_all_listeners(smartlist_t *new_conns,
int close_all_noncontrol);
void connection_mark_all_noncontrol_listeners(void);
diff --git a/src/core/mainloop/main.c b/src/core/mainloop/main.c
index c648d236bb..a50c852ecd 100644
--- a/src/core/mainloop/main.c
+++ b/src/core/mainloop/main.c
@@ -2338,7 +2338,7 @@ retry_listeners_callback(time_t now, const or_options_t *options)
(void)now;
(void)options;
if (!net_is_disabled()) {
- retry_all_listeners(NULL, NULL, 0);
+ retry_all_listeners(NULL, 0);
return 60;
}
return PERIODIC_EVENT_NO_UPDATE;