summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-12-11 11:56:17 +0000
committerRoger Dingledine <arma@torproject.org>2005-12-11 11:56:17 +0000
commita131783c8bf9bb8bd99404003ae314ffc7f842f1 (patch)
tree436aa36b5b53b9aa927bdfda4b4cdf7d1b993510
parent598116944026e5237b12a15697a3caf4aa47b515 (diff)
downloadtor-a131783c8bf9bb8bd99404003ae314ffc7f842f1.tar.gz
tor-a131783c8bf9bb8bd99404003ae314ffc7f842f1.zip
when removing dead helpers, only write or_state to disk once at the
end, not for every helper you remove. svn:r5568
-rw-r--r--src/or/circuitbuild.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index dc5a02d1ad..a4b410633a 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;