summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2009-08-31 16:14:41 -0400
committerRoger Dingledine <arma@torproject.org>2009-08-31 16:14:41 -0400
commit4c297f74f79e0e3d357d20bfc584eccc758d1fd8 (patch)
tree0327e49bcede6702ca16e1700cb30cb5f4eb3f56 /src/or/router.c
parent64f393d56f8ff58223db56f3b8e64f0074877616 (diff)
downloadtor-4c297f74f79e0e3d357d20bfc584eccc758d1fd8.tar.gz
tor-4c297f74f79e0e3d357d20bfc584eccc758d1fd8.zip
Only send reachability status events on overall success/failure
We were telling the controller about CHECKING_REACHABILITY and REACHABILITY_FAILED status events whenever we launch a testing circuit or notice that one has failed. Instead, only tell the controller when we want to inform the user of overall success or overall failure. Bugfix on 0.1.2.6-alpha. Fixes bug 1075. Reported by SwissTorExit.
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/or/router.c b/src/or/router.c
index f0a1e40743..fcfbe79112 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -770,9 +770,6 @@ consider_testing_reachability(int test_or, int test_dir)
me->address, me->or_port);
circuit_launch_by_router(CIRCUIT_PURPOSE_TESTING, me,
CIRCLAUNCH_NEED_CAPACITY|CIRCLAUNCH_IS_INTERNAL);
- control_event_server_status(LOG_NOTICE,
- "CHECKING_REACHABILITY ORADDRESS=%s:%d",
- me->address, me->or_port);
}
tor_addr_from_ipv4h(&addr, me->addr);
@@ -788,10 +785,6 @@ consider_testing_reachability(int test_or, int test_dir)
DIR_PURPOSE_FETCH_SERVERDESC,
ROUTER_PURPOSE_GENERAL,
1, "authority.z", NULL, 0, 0);
-
- control_event_server_status(LOG_NOTICE,
- "CHECKING_REACHABILITY DIRADDRESS=%s:%d",
- me->address, me->dir_port);
}
}
@@ -807,8 +800,11 @@ router_orport_found_reachable(void)
" Publishing server descriptor." : "");
can_reach_or_port = 1;
mark_my_descriptor_dirty();
- if (!me)
+ if (!me) { /* should never happen */
+ log_warn(LD_BUG, "ORPort found reachable, but I have no routerinfo "
+ "yet. Failing to inform controller of success.");
return;
+ }
control_event_server_status(LOG_NOTICE,
"REACHABILITY_SUCCEEDED ORADDRESS=%s:%d",
me->address, me->or_port);
@@ -826,8 +822,11 @@ router_dirport_found_reachable(void)
can_reach_dir_port = 1;
if (!me || decide_to_advertise_dirport(get_options(), me->dir_port))
mark_my_descriptor_dirty();
- if (!me)
+ if (!me) { /* should never happen */
+ log_warn(LD_BUG, "DirPort found reachable, but I have no routerinfo "
+ "yet. Failing to inform controller of success.");
return;
+ }
control_event_server_status(LOG_NOTICE,
"REACHABILITY_SUCCEEDED DIRADDRESS=%s:%d",
me->address, me->dir_port);