aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-10-24 03:34:03 +0000
committerRoger Dingledine <arma@torproject.org>2007-10-24 03:34:03 +0000
commit7a35dad00722413c5816f9b5557c61319f5984d3 (patch)
treec8c064d53c9e71ffe0722694e0ea7e4f2a68f4b0 /src
parentfd911646628cd4a30614c1a44ed51d3e50c8664d (diff)
downloadtor-7a35dad00722413c5816f9b5557c61319f5984d3.tar
tor-7a35dad00722413c5816f9b5557c61319f5984d3.tar.gz
Authorities no longer send back "400 you're unreachable please fix
it" errors to Tor servers that aren't online all the time. We're supposed to tolerate these servers now. svn:r12136
Diffstat (limited to 'src')
-rw-r--r--src/or/dirserv.c17
-rw-r--r--src/or/or.h5
-rw-r--r--src/or/routerlist.c31
3 files changed, 3 insertions, 50 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index cf941f6c2..e9d552e8a 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -883,22 +883,6 @@ dirserv_set_router_is_running(routerinfo_t *router, time_t now)
router->is_running = answer;
}
-/** Return 1 if we're confident that there's a problem with
- * <b>router</b>'s reachability and its operator should be notified.
- */
-int
-dirserv_thinks_router_is_blatantly_unreachable(routerinfo_t *router,
- time_t now)
-{
- if (router->is_hibernating)
- return 0;
- if (now >= router->last_reachable + 5*REACHABLE_TIMEOUT &&
- router->testing_since &&
- now >= router->testing_since + 5*REACHABLE_TIMEOUT)
- return 1;
- return 0;
-}
-
/** Based on the routerinfo_ts in <b>routers</b>, allocate the
* contents of a v1-style router-status line, and store it in
* *<b>router_status_out</b>. Return 0 on success, -1 on failure.
@@ -2452,7 +2436,6 @@ dirserv_orconn_tls_done(const char *address,
ri->nickname);
rep_hist_note_router_reachable(digest_rcvd, now);
ri->last_reachable = now;
- ri->num_unreachable_notifications = 0;
}
});
/* FFFF Maybe we should reinstate the code that dumps routers with the same
diff --git a/src/or/or.h b/src/or/or.h
index 5ce203976..4e636af73 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -1181,9 +1181,6 @@ typedef struct {
time_t last_reachable;
/** When did we start testing reachability for this OR? */
time_t testing_since;
- /** How many times has a descriptor been posted and we believed
- * this router to be unreachable? We only actually warn on the third. */
- int num_unreachable_notifications;
/** What position is this descriptor within routerlist->routers? -1 for
* none. */
@@ -2853,8 +2850,6 @@ int dirserv_add_descriptor(routerinfo_t *ri, const char **msg);
int getinfo_helper_dirserv_unregistered(control_connection_t *conn,
const char *question, char **answer);
void dirserv_free_descriptors(void);
-int dirserv_thinks_router_is_blatantly_unreachable(routerinfo_t *router,
- time_t now);
int list_server_status(smartlist_t *routers, char **router_status_out,
int for_controller);
int dirserv_dump_directory_to_string(char **dir_out,
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 95e63df3a..c25a25adb 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2536,11 +2536,6 @@ 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;
- /* router_have_minimum_dir_info() has side effects, so do it before we
- * start the real work */
- int authdir_may_warn_about_unreachable_server =
- authdir && !from_cache && !from_fetch &&
- router_have_minimum_dir_info();
networkstatus_vote_t *consensus = networkstatus_get_latest_consensus();
const smartlist_t *networkstatus_v2_list = networkstatus_get_v2_list();
int in_consensus = 0;
@@ -2648,33 +2643,14 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
return -1;
} else {
/* Same key, new. */
- int unreachable = 0;
log_debug(LD_DIR, "Replacing entry for router '%s/%s' [%s]",
router->nickname, old_router->nickname,
hex_str(id_digest,DIGEST_LEN));
if (router->addr == old_router->addr &&
router->or_port == old_router->or_port) {
- /* these carry over when the address and orport are unchanged.*/
+ /* these carry over when the address and orport are unchanged. */
router->last_reachable = old_router->last_reachable;
router->testing_since = old_router->testing_since;
- router->num_unreachable_notifications =
- old_router->num_unreachable_notifications;
- }
- if (authdir_may_warn_about_unreachable_server &&
- dirserv_thinks_router_is_blatantly_unreachable(router, time(NULL))) {
- if (router->num_unreachable_notifications >= 3) {
- unreachable = 1;
- log_notice(LD_DIR, "Notifying server '%s' that it's unreachable. "
- "(ContactInfo '%s', platform '%s').",
- router->nickname,
- router->contact_info ? router->contact_info : "",
- router->platform ? router->platform : "");
- } else {
- log_info(LD_DIR,"'%s' may be unreachable -- the %d previous "
- "descriptors were thought to be unreachable.",
- router->nickname, router->num_unreachable_notifications);
- router->num_unreachable_notifications++;
- }
}
routerlist_replace(routerlist, old_router, router);
if (!from_cache) {
@@ -2682,11 +2658,10 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
&routerlist->desc_store);
}
directory_set_dirty();
- *msg = unreachable ? "Dirserver believes your ORPort is unreachable" :
- authdir_believes_valid ? "Valid server updated" :
+ *msg = authdir_believes_valid ? "Valid server updated" :
("Invalid server updated. (This dirserver is marking your "
"server as unapproved.)");
- return unreachable ? 1 : 0;
+ return 0;
}
}