summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-10-11 22:06:01 +0000
committerNick Mathewson <nickm@torproject.org>2006-10-11 22:06:01 +0000
commiteca28f24f51a3b7e59a22002d8119db8a98c781a (patch)
treeb35c2427cc76b50c021863d94f7d481cb9d4d0db /src/or/routerlist.c
parent7f3fc70945e8f3286c9701c168fa364003949b3e (diff)
downloadtor-eca28f24f51a3b7e59a22002d8119db8a98c781a.tar.gz
tor-eca28f24f51a3b7e59a22002d8119db8a98c781a.zip
r9004@totoro: nickm | 2006-10-11 18:05:24 -0400
Add client support for a 'BadExit' flag, so authorities can say "Server X is a poor choise for your nytimes.com connections, as it seems to direct them to HoorayForMao.com or (more likely) WouldYouLikeToBuyTheseFineEncyclopedias.com" svn:r8690
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index f8a22a1926..226b6d52f7 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -3294,7 +3294,7 @@ routerstatus_list_update_from_networkstatus(time_t now)
*/
while (1) {
int n_running=0, n_named=0, n_valid=0, n_listing=0;
- int n_v2_dir=0, n_fast=0, n_stable=0, n_exit=0, n_guard=0;
+ int n_v2_dir=0, n_fast=0, n_stable=0, n_exit=0, n_guard=0, n_bad_exit=0;
int n_desc_digests=0, highest_count=0;
const char *the_name = NULL;
local_routerstatus_t *rs_out, *rs_old;
@@ -3380,6 +3380,8 @@ routerstatus_list_update_from_networkstatus(time_t now)
++n_stable;
if (rs->is_v2_dir)
++n_v2_dir;
+ if (rs->is_bad_exit)
+ ++n_bad_exit;
}
/* Go over the descriptor digests and figure out which descriptor we
* want. */
@@ -3428,6 +3430,7 @@ routerstatus_list_update_from_networkstatus(time_t now)
rs_out->status.is_possible_guard = n_guard > n_statuses/2;
rs_out->status.is_stable = n_stable > n_statuses/2;
rs_out->status.is_v2_dir = n_v2_dir > n_statuses/2;
+ rs_out->status.is_bad_exit = n_bad_exit > n_statuses/2;
}
SMARTLIST_FOREACH(routerstatus_list, local_routerstatus_t *, rs,
local_routerstatus_free(rs));
@@ -3482,6 +3485,7 @@ routers_update_status_from_networkstatus(smartlist_t *routers,
router->is_stable = rs->status.is_stable;
router->is_possible_guard = rs->status.is_possible_guard;
router->is_exit = rs->status.is_exit;
+ router->is_bad_exit = rs->status.is_bad_exit;
}
if (router->is_running && ds) {
ds->n_networkstatus_failures = 0;