aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-03-13 15:47:59 -0400
committerRoger Dingledine <arma@torproject.org>2011-03-13 15:47:59 -0400
commit1a9d19e9728c21ffa37f2b751df8e8e97c1835d3 (patch)
tree654b11c2b1f97870642e81c71789687b2b0549e9 /src
parent151ab614421eed48ba2f39518695b8ee08206904 (diff)
downloadtor-1a9d19e9728c21ffa37f2b751df8e8e97c1835d3.tar
tor-1a9d19e9728c21ffa37f2b751df8e8e97c1835d3.tar.gz
we're not reachable if we don't have a routerinfo yet
Diffstat (limited to 'src')
-rw-r--r--src/or/router.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 75f592d9e..ba7be3d7d 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -793,19 +793,14 @@ consider_testing_reachability(int test_or, int test_dir)
void
router_orport_found_reachable(void)
{
- if (!can_reach_or_port) {
- routerinfo_t *me = router_get_my_routerinfo();
+ routerinfo_t *me = router_get_my_routerinfo();
+ if (!can_reach_or_port && me) {
log_notice(LD_OR,"Self-testing indicates your ORPort is reachable from "
"the outside. Excellent.%s",
get_options()->_PublishServerDescriptor != NO_AUTHORITY ?
" Publishing server descriptor." : "");
can_reach_or_port = 1;
mark_my_descriptor_dirty();
- 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);
@@ -816,18 +811,13 @@ router_orport_found_reachable(void)
void
router_dirport_found_reachable(void)
{
- if (!can_reach_dir_port) {
- routerinfo_t *me = router_get_my_routerinfo();
+ routerinfo_t *me = router_get_my_routerinfo();
+ if (!can_reach_dir_port && me) {
log_notice(LD_DIRSERV,"Self-testing indicates your DirPort is reachable "
"from the outside. Excellent.");
can_reach_dir_port = 1;
- if (!me || decide_to_advertise_dirport(get_options(), me->dir_port))
+ if (decide_to_advertise_dirport(get_options(), me->dir_port))
mark_my_descriptor_dirty();
- 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);