aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-03-08 16:10:40 -0500
committerNick Mathewson <nickm@torproject.org>2011-03-08 16:10:40 -0500
commitf9bb3ced51422bc8f6c3702a169a799614bbce02 (patch)
tree6a6d23808b219366bfe433aa4d00bbb114e69ac0 /src/or/dirserv.c
parentd5907e7d9d79297cc7359aeae810972a1b834e23 (diff)
parent0d78a16c3642f7538266e007da79c39860aac332 (diff)
downloadtor-f9bb3ced51422bc8f6c3702a169a799614bbce02.tar.gz
tor-f9bb3ced51422bc8f6c3702a169a799614bbce02.zip
Merge remote branch 'origin/maint-0.2.2'
Resolved trivial one-line conflicts. Conflicts: src/or/dirserv.c src/or/rephist.c
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index bf61059d2a..4f06de1e90 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -3143,20 +3143,27 @@ dirserv_orconn_tls_done(const char *address,
tor_assert(address);
tor_assert(digest_rcvd);
- SMARTLIST_FOREACH(rl->routers, routerinfo_t *, ri, {
+ /* XXX023 Doing a loop like this is stupid. We should just look up the
+ * router by digest_rcvd, and see if address, orport, and as_advertised
+ * match up. -NM */
+ SMARTLIST_FOREACH_BEGIN(rl->routers, routerinfo_t *, ri) {
if (!strcasecmp(address, ri->address) && or_port == ri->or_port &&
as_advertised &&
!memcmp(ri->cache_info.identity_digest, digest_rcvd, DIGEST_LEN)) {
/* correct digest. mark this router reachable! */
if (!bridge_auth || ri->purpose == ROUTER_PURPOSE_BRIDGE) {
- log_info(LD_DIRSERV, "Found router %s to be reachable. Yay.",
- ri->nickname);
- rep_hist_note_router_reachable(digest_rcvd, now);
+ tor_addr_t addr, *addrp=NULL;
+ log_info(LD_DIRSERV, "Found router %s to be reachable at %s:%d. Yay.",
+ ri->nickname, address, ri->or_port );
+ if (tor_addr_from_str(&addr, ri->address) != -1)
+ addrp = &addr;
+ else
+ log_warn(LD_BUG, "Couldn't parse IP address \"%s\"", ri->address);
+ rep_hist_note_router_reachable(digest_rcvd, addrp, or_port, now);
ri->last_reachable = now;
}
}
- });
-
+ } SMARTLIST_FOREACH_END(ri);
/* FFFF Maybe we should reinstate the code that dumps routers with the same
* addr/port but with nonmatching keys, but instead of dumping, we should
* skip testing. */