[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] Fix the confusing bug where we were downloading only the fi...
Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv20028/src/or
Modified Files:
routerlist.c
Log Message:
Fix the confusing bug where we were downloading only the first n/2-1 of the servers we actually wanted.
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.296
retrieving revision 1.297
diff -u -d -r1.296 -r1.297
--- routerlist.c 15 Sep 2005 21:11:48 -0000 1.296
+++ routerlist.c 16 Sep 2005 04:43:21 -0000 1.297
@@ -2401,7 +2401,6 @@
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 @@
strmap_free(most_recent, NULL);
+ /* Send the keys in sorted order. */
+ smartlist_sort_strings(superseded);
+
return superseded;
}
@@ -2445,7 +2447,7 @@
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);