aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2007-07-06 21:21:09 +0000
committerPeter Palfrader <peter@palfrader.org>2007-07-06 21:21:09 +0000
commitdb3a4bf8976da8f4048d213a0cfe9e269c65a0e5 (patch)
treeb952e64ca7a7e5507de13d7b9c10cf77a8f29641 /src/or
parent39b1a11f8d0a1a9eae0b17730eceae1c2a0fe4c8 (diff)
downloadtor-db3a4bf8976da8f4048d213a0cfe9e269c65a0e5.tar
tor-db3a4bf8976da8f4048d213a0cfe9e269c65a0e5.tar.gz
Call router_have_minimum_dir_info() at the beginning of router_add_to_routerlist() since it has side effects
svn:r10754
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerlist.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index f30367032..c021d208a 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2359,6 +2359,8 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
int authdir = authdir_mode(get_options());
int authdir_believes_valid = 0;
routerinfo_t *old_router;
+ /* This has side effects, so do it before we start the real work */
+ int have_dir_info = router_have_minimum_dir_info();
routerlist_check_bug_417();
tor_assert(msg);
@@ -2454,7 +2456,7 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
old_router->num_unreachable_notifications;
}
if (authdir && !from_cache && !from_fetch &&
- router_have_minimum_dir_info() &&
+ have_dir_info &&
dirserv_thinks_router_is_blatantly_unreachable(router, time(NULL))) {
if (router->num_unreachable_notifications >= 3) {
unreachable = 1;