From a131783c8bf9bb8bd99404003ae314ffc7f842f1 Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Sun, 11 Dec 2005 11:56:17 +0000 Subject: when removing dead helpers, only write or_state to disk once at the end, not for every helper you remove. svn:r5568 --- src/or/circuitbuild.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/or/circuitbuild.c') diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index dc5a02d1a..a4b410633 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -1746,6 +1746,7 @@ remove_dead_helpers(void) char tbuf[ISO_TIME_LEN+1]; time_t now = time(NULL); int i; + int changed = 0; for (i = 0; i < smartlist_len(helper_nodes); ) { helper_node_t *helper = smartlist_get(helper_nodes, i); @@ -1767,10 +1768,11 @@ remove_dead_helpers(void) helper->nickname, dbuf, why, tbuf); tor_free(helper); smartlist_del(helper_nodes, i); - helper_nodes_changed(); } else ++i; } + if (changed) + helper_nodes_changed(); } /** A new directory or router-status has arrived; update the down/listed status @@ -1860,11 +1862,11 @@ helper_node_set_status(const char *digest, int succeeded) if (!memcmp(helper->identity, digest, DIGEST_LEN)) { if (succeeded) { if (helper->down_since) { - /*XXXX shouldn't warn. NM */ - warn(LD_CIRC, - "Connection to formerly down helper node '%s' succeeded. " - "%d/%d helpers usable.", helper->nickname, - num_live_helpers(), smartlist_len(helper_nodes)); + /*XXXX shouldn't be so loud. NM */ + notice(LD_CIRC, + "Connection to formerly down helper node '%s' succeeded. " + "%d/%d helpers usable.", helper->nickname, + num_live_helpers(), smartlist_len(helper_nodes)); helper_nodes_changed(); } helper->down_since = 0; -- cgit v1.2.3