aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2009-04-11 12:06:27 +0000
committerRoger Dingledine <arma@torproject.org>2009-04-11 12:06:27 +0000
commit235a1196b34a5680529299c4b5fa4e8583998a6f (patch)
tree63a6485733e6e6b6d499832c18f7768931efefd9
parent48118b228e5c3d361a5cfdfa614b1a923da0a854 (diff)
downloadtor-235a1196b34a5680529299c4b5fa4e8583998a6f.tar.gz
tor-235a1196b34a5680529299c4b5fa4e8583998a6f.zip
only log that at loglevel notice if there's a problem with the
version. otherwise there's no reason to tell the user we're doing behind-the-scenes cleaning. svn:r19288
-rw-r--r--src/or/circuitbuild.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 64196b07a9..3ed291a3ff 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2142,27 +2142,33 @@ remove_obsolete_entry_guards(void)
const char *ver = entry->chosen_by_version;
const char *msg = NULL;
tor_version_t v;
+ int version_is_bad = 0, date_is_bad = 0;
if (!ver) {
msg = "does not say what version of Tor it was selected by";
+ version_is_bad = 1;
} else if (tor_version_parse(ver, &v)) {
msg = "does not seem to be from any recognized version of Tor";
+ version_is_bad = 1;
} else if ((tor_version_as_new_as(ver, "0.1.0.10-alpha") &&
!tor_version_as_new_as(ver, "0.1.2.16-dev")) ||
(tor_version_as_new_as(ver, "0.2.0.0-alpha") &&
!tor_version_as_new_as(ver, "0.2.0.6-alpha"))) {
msg = "was selected without regard for guard bandwidth";
+ version_is_bad = 1;
} else if (entry->chosen_on_date + 3600*24*35 < this_month) {
/* It's been more than a month, and probably more like two since
* chosen_on_date is clipped to the beginning of its month. */
msg = "was selected several months ago";
+ date_is_bad = 1;
}
- if (msg) { /* we need to drop it */
+ if (version_is_bad || date_is_bad) { /* we need to drop it */
char dbuf[HEX_DIGEST_LEN+1];
+ tor_assert(msg);
base16_encode(dbuf, sizeof(dbuf), entry->identity, DIGEST_LEN);
- log_notice(LD_CIRC, "Entry guard '%s' (%s) %s. (Version=%s.) "
- "Replacing it.",
- entry->nickname, dbuf, msg, ver?escaped(ver):"none");
+ log_fn(version_is_bad ? LOG_NOTICE : LOG_INFO, LD_CIRC,
+ "Entry guard '%s' (%s) %s. (Version=%s.) Replacing it.",
+ entry->nickname, dbuf, msg, ver?escaped(ver):"none");
control_event_guard(entry->nickname, entry->identity, "DROPPED");
entry_guard_free(entry);
smartlist_del_keeporder(entry_guards, i--);