[tor-commits] [tor/master] Avoid redundant calls to connection_mark_for_close() on listeners when setting DisableNetwork to 1

nickm at torproject.org nickm at torproject.org
Thu Apr 17 03:15:50 UTC 2014


commit f36e93206a20b37321b372802032d3dec481856d
Author: Andrea Shepard <andrea at torproject.org>
Date:   Tue Apr 15 20:35:31 2014 -0700

    Avoid redundant calls to connection_mark_for_close() on listeners when setting DisableNetwork to 1
---
 src/or/config.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/or/config.c b/src/or/config.c
index ca99d01..3089c6f 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1178,10 +1178,13 @@ options_act_reversible(const or_options_t *old_options, char **msg)
 
   SMARTLIST_FOREACH(replaced_listeners, connection_t *, conn,
   {
+    int marked = conn->marked_for_close;
     log_notice(LD_NET, "Closing old %s on %s:%d",
                conn_type_to_string(conn->type), conn->address, conn->port);
     connection_close_immediate(conn);
-    connection_mark_for_close(conn);
+    if (!marked) {
+      connection_mark_for_close(conn);
+    }
   });
   goto done;
 





More information about the tor-commits mailing list