summaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
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 /src/or/networkstatus.c
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
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r--src/or/networkstatus.c11
1 files changed, 6 insertions, 5 deletions
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