summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2011-02-26 09:42:44 +0100
committerSebastian Hahn <sebastian@torproject.org>2011-02-26 09:42:44 +0100
commit5a4f7fa1e48923730376c0a42121e4c3022eef3b (patch)
treeacdacbb63d60cbc109326d7577b7584dba9c7ce4
parent9b64227ffd38e9406c5c88ace137a0eae010771d (diff)
downloadtor-5a4f7fa1e48923730376c0a42121e4c3022eef3b.tar.gz
tor-5a4f7fa1e48923730376c0a42121e4c3022eef3b.zip
clarify an assert
also log about running changes, even on a bridge authority.
-rw-r--r--src/or/rephist.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 7c570e26a6..207eb88935 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -307,6 +307,7 @@ rep_hist_note_router_reachable(const char *id, const tor_addr_t *at_addr,
int addr_changed, port_changed;
tor_assert(hist);
+ tor_assert((!at_addr && !at_port) || (at_addr && at_port));
addr_changed = at_addr &&
tor_addr_compare(at_addr, &hist->last_reached_addr, CMP_EXACT) != 0;
@@ -335,7 +336,6 @@ rep_hist_note_router_reachable(const char *id, const tor_addr_t *at_addr,
* downtime. */
int penalty = get_options()->TestingTorNetwork ? 240 : 3600;
networkstatus_t *ns;
- tor_assert(at_addr);
if ((ns = networkstatus_get_latest_consensus())) {
int fresh_interval = (int)(ns->fresh_until - ns->valid_after);
@@ -346,11 +346,10 @@ rep_hist_note_router_reachable(const char *id, const tor_addr_t *at_addr,
penalty = (int)(fresh_interval + live_interval) / 2;
}
format_local_iso_time(tbuf, hist->start_of_run);
- if (!authdir_mode_bridge(get_options()))
- log_info(LD_HIST,"Router %s still seems Running, but its address appears "
- "to have changed since the last time it was reachable. I'm "
- "going to treat it as having been down for %d seconds",
- hex_str(id, DIGEST_LEN), penalty);
+ log_info(LD_HIST,"Router %s still seems Running, but its address appears "
+ "to have changed since the last time it was reachable. I'm "
+ "going to treat it as having been down for %d seconds",
+ hex_str(id, DIGEST_LEN), penalty);
rep_hist_note_router_unreachable(id, when-penalty);
rep_hist_note_router_reachable(id, NULL, 0, when);
} else {