diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-01-24 00:31:16 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-01-24 00:31:16 +0000 |
commit | 9f42c9d65001bb5c08ee79f8e39c144fb82c1e72 (patch) | |
tree | eec030d1fda331dc00b43b5b691b131eb3bd2edc /src/or/routerlist.c | |
parent | f1864dfff351773b7268e095a41e4b8c2c919b8a (diff) | |
download | tor-9f42c9d65001bb5c08ee79f8e39c144fb82c1e72.tar.gz tor-9f42c9d65001bb5c08ee79f8e39c144fb82c1e72.zip |
Make dirservers generate a separate "guard" flag to mean, "would make a good entry guard". Make clients parse it and vote on it.
svn:r5856
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r-- | src/or/routerlist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 6a4bc5cbb5..72ba8f4d70 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2941,7 +2941,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; + int n_v2_dir=0, n_fast=0, n_stable=0, n_exit=0, n_guard=0; int n_desc_digests=0, highest_count=0; const char *the_name = NULL; local_routerstatus_t *rs_out, *rs_old; @@ -3020,6 +3020,8 @@ routerstatus_list_update_from_networkstatus(time_t now) ++n_exit; if (rs->is_fast) ++n_fast; + if (rs->is_possible_guard) + ++n_guard; if (rs->is_stable) ++n_stable; if (rs->is_v2_dir) @@ -3069,6 +3071,7 @@ routerstatus_list_update_from_networkstatus(time_t now) rs_out->status.is_running = n_running > n_recent/2; rs_out->status.is_exit = n_exit > n_statuses/2; rs_out->status.is_fast = n_fast > n_statuses/2; + rs_out->status.is_fast = 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; } |