aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-09-16 04:43:21 +0000
committerNick Mathewson <nickm@torproject.org>2005-09-16 04:43:21 +0000
commit1a786a297f539404c21dac3ddaa9598b9ff3661c (patch)
treeb122bce360158a229d3f5e1cd6059f30705ebb7c
parent9c2ca40df3b84c66a55d273ddea4cbc765476da6 (diff)
downloadtor-1a786a297f539404c21dac3ddaa9598b9ff3661c.tar
tor-1a786a297f539404c21dac3ddaa9598b9ff3661c.tar.gz
Fix the confusing bug where we were downloading only the first n/2-1 of the servers we actually wanted.
svn:r5078
-rw-r--r--src/or/routerlist.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 9c744ff79..6deab45cc 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -2401,7 +2401,6 @@ router_list_downloadable(void)
ri->nickname);
base16_encode(d, HEX_DIGEST_LEN+1, ri->identity_digest, DIGEST_LEN);
smartlist_add(superseded, d);
- break;
}
strmap_remove(most_recent, fp);
});
@@ -2418,6 +2417,9 @@ router_list_downloadable(void)
strmap_free(most_recent, NULL);
+ /* Send the keys in sorted order. */
+ smartlist_sort_strings(superseded);
+
return superseded;
}
@@ -2445,7 +2447,7 @@ update_router_descriptor_downloads(time_t now)
smartlist_t *downloadable = router_list_downloadable();
if (smartlist_len(downloadable)) {
char *dl = smartlist_join_strings(downloadable,"+",0,NULL);
- size_t r_len = smartlist_len(downloadable)*(DIGEST_LEN+1)+16;
+ size_t r_len = smartlist_len(downloadable)*(HEX_DIGEST_LEN+1)+16;
/* Damn, that's an ugly way to do this. XXXX011 NM */
resource = tor_malloc(r_len);
tor_snprintf(resource, r_len, "fp/%s.z", dl);