summaryrefslogtreecommitdiff
path: root/src/or/routerlist.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-05-13 00:53:13 +0000
committerRoger Dingledine <arma@torproject.org>2007-05-13 00:53:13 +0000
commitdc76c31c79ac0323e641b48dab08d8ae4df5abb0 (patch)
tree2b26c6b8d26180f2c344f72ea20bfad831a56765 /src/or/routerlist.c
parentf597b73dc0667910c60341780be1c811dc9380b1 (diff)
downloadtor-dc76c31c79ac0323e641b48dab08d8ae4df5abb0.tar.gz
tor-dc76c31c79ac0323e641b48dab08d8ae4df5abb0.zip
backport r10157
svn:r10178
Diffstat (limited to 'src/or/routerlist.c')
-rw-r--r--src/or/routerlist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index ab47705cfc..8abd03e5b8 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2909,14 +2909,14 @@ update_networkstatus_client_downloads(time_t now)
/* If no networkstatus was found, choose a dirserver at random as "most
* recent". */
if (most_recent_idx<0)
- most_recent_idx = crypto_rand_int(n_dirservers);
+ most_recent_idx = crypto_rand_int(smartlist_len(trusted_dir_servers));
if (fetch_latest) {
int i;
int n_failed = 0;
for (i = most_recent_idx + 1; 1; ++i) {
trusted_dir_server_t *ds;
- if (i >= n_dirservers)
+ if (i >= smartlist_len(trusted_dir_servers))
i = 0;
ds = smartlist_get(trusted_dir_servers, i);
if (! ds->is_v2_authority)