summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-03-14 17:22:38 -0400
committerNick Mathewson <nickm@torproject.org>2011-03-14 17:22:38 -0400
commitebf6786ab3597ec96ef2c026d7dc32c26fbc84e4 (patch)
tree4575b3c24b16a928a31700a14db66be6fae0b588 /src/or/router.c
parent50c9d310290886d84c8d2d604279d674042d11c4 (diff)
parentb97d9abd0940037b249a1ee56724dbfed904263b (diff)
downloadtor-ebf6786ab3597ec96ef2c026d7dc32c26fbc84e4.tar.gz
tor-ebf6786ab3597ec96ef2c026d7dc32c26fbc84e4.zip
Merge remote branch 'origin/maint-0.2.2'
Fixed conflict: router_get_my_routerinfo now returns const Conflicts: src/or/router.c
Diffstat (limited to 'src/or/router.c')
-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 3f1a0a0e02..eb4d6b5d40 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -886,19 +886,14 @@ consider_testing_reachability(int test_or, int test_dir)
void
router_orport_found_reachable(void)
{
- if (!can_reach_or_port) {
- const routerinfo_t *me = router_get_my_routerinfo();
+ const 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);
@@ -909,18 +904,13 @@ router_orport_found_reachable(void)
void
router_dirport_found_reachable(void)
{
- if (!can_reach_dir_port) {
- const routerinfo_t *me = router_get_my_routerinfo();
+ const 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);