summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-11-11 17:37:59 +0000
committerRoger Dingledine <arma@torproject.org>2007-11-11 17:37:59 +0000
commit7870964e0cd919acabc08c915682d1033c2bf862 (patch)
tree8bc2df657b3fcb33dfb28b701b2c41503bde9a85
parent49e9c6d96b30a7604c2def15aff5d46a57350e5d (diff)
downloadtor-7870964e0cd919acabc08c915682d1033c2bf862.tar.gz
tor-7870964e0cd919acabc08c915682d1033c2bf862.zip
Don't reevaluate all the information from our consensus document
just because we've downloaded a v2 networkstatus that we intend to cache. Fixes bug 545. svn:r12479
-rw-r--r--ChangeLog13
-rw-r--r--src/or/directory.c6
-rw-r--r--src/or/networkstatus.c11
-rw-r--r--src/or/or.h2
-rw-r--r--src/or/routerlist.c4
5 files changed, 22 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index ff28837acf..8206bfced5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,15 +10,20 @@ Changes in version 0.2.0.11-alpha - 2007-11-??
- Fix a memory leak on exit relays; we were leaking a cached_resolve_t
on every successful resolve. Reported by Mike Perry.
- o Minor features:
- - Allow people to say PreferTunnelledDirConns rather than
- PreferTunneledDirConns, for those alternate-spellers out there.
-
o Packaging fixes on 0.2.0.10-alpha:
- We were including instructions about what to do with the
src/config/fallback-consensus file, but we weren't actually
including it in the tarball. Disable all of that for now.
+ o Minor features:
+ - Allow people to say PreferTunnelledDirConns rather than
+ PreferTunneledDirConns, for those alternate-spellers out there.
+
+ o Minor bugfixes:
+ - Don't reevaluate all the information from our consensus document
+ just because we've downloaded a v2 networkstatus that we intend
+ to cache. Fixes bug 545.
+
Changes in version 0.2.0.10-alpha - 2007-11-10
o New directory authorities:
diff --git a/src/or/directory.c b/src/or/directory.c
index 8e6d3c9eec..34162ce6bc 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -1448,7 +1448,8 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
} else
break;
}
- routers_update_all_from_networkstatus(now); /*launches router downloads*/
+ /* launches router downloads as needed */
+ routers_update_all_from_networkstatus(now, 2);
directory_info_has_arrived(now, 0);
if (which) {
if (smartlist_len(which)) {
@@ -1482,7 +1483,8 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
networkstatus_consensus_download_failed(0);
return -1;
}
- routers_update_all_from_networkstatus(now); /*launches router downloads*/
+ /* launches router downloads as needed */
+ routers_update_all_from_networkstatus(now, 3);
directory_info_has_arrived(now, 0);
log_info(LD_DIR, "Successfully loaded consensus.");
}
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 2dea5d4a38..150a5d1b81 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -148,7 +148,7 @@ router_reload_v2_networkstatus(void)
SMARTLIST_FOREACH(entries, char *, fn, tor_free(fn));
smartlist_free(entries);
networkstatus_v2_list_clean(time(NULL));
- routers_update_all_from_networkstatus(time(NULL));
+ routers_update_all_from_networkstatus(time(NULL), 2);
return 0;
}
@@ -202,7 +202,7 @@ router_reload_consensus_networkstatus(void)
}
}
- routers_update_all_from_networkstatus(time(NULL));
+ routers_update_all_from_networkstatus(time(NULL), 3);
return 0;
}
@@ -1398,10 +1398,11 @@ networkstatus_note_certs_arrived(void)
/** If the network-status list has changed since the last time we called this
* function, update the status of every routerinfo from the network-status
- * list.
+ * list. If <b>dir_version</b> is 2, it's a v2 networkstatus that changed.
+ * If <b>dir_version</b> is 3, it's a v3 consensus that changed.
*/
void
-routers_update_all_from_networkstatus(time_t now)
+routers_update_all_from_networkstatus(time_t now, int dir_version)
{
routerinfo_t *me;
routerlist_t *rl = router_get_routerlist();
@@ -1410,7 +1411,7 @@ routers_update_all_from_networkstatus(time_t now)
if (networkstatus_v2_list_has_changed)
download_status_map_update_from_v2_networkstatus();
- if (!consensus)
+ if (!consensus || dir_version < 3) /* nothing more we should do */
return;
/* More routers may be up or down now: we need to recalc whether there's
diff --git a/src/or/or.h b/src/or/or.h
index 0bded333a5..2e852eefb9 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3268,7 +3268,7 @@ networkstatus_vote_t *networkstatus_get_reasonably_live_consensus(time_t now);
int networkstatus_set_current_consensus(const char *consensus, int from_cache,
int was_waiting_for_certs);
void networkstatus_note_certs_arrived(void);
-void routers_update_all_from_networkstatus(time_t now);
+void routers_update_all_from_networkstatus(time_t now, dir_version);
void routerstatus_list_update_from_consensus_networkstatus(time_t now);
void routers_update_status_from_consensus_networkstatus(smartlist_t *routers,
int reset_failures);
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 2b3fe3fdea..ad50c2ebda 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3986,10 +3986,10 @@ update_router_have_minimum_dir_info(void)
if (!consensus) {
if (!networkstatus_get_latest_consensus())
- strlcpy(dir_info_status, "We have no network-status document.",
+ strlcpy(dir_info_status, "We have no network-status consensus.",
sizeof(dir_info_status));
else
- strlcpy(dir_info_status, "We have no recent network-status document.",
+ strlcpy(dir_info_status, "We have no recent network-status consensus.",
sizeof(dir_info_status));
res = 0;
goto done;