aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2008-04-24 15:39:10 +0000
committerPeter Palfrader <peter@palfrader.org>2008-04-24 15:39:10 +0000
commiteaad3ab395c8da0cc5c8cbe3e51109f181891216 (patch)
treeda45f1dc4af71b266543ee919b2e9e9e82504a15
parent901ee58c5348924d7eb06abd090f80441d5e262d (diff)
downloadtor-eaad3ab395c8da0cc5c8cbe3e51109f181891216.tar
tor-eaad3ab395c8da0cc5c8cbe3e51109f181891216.tar.gz
Spec compliance: sort id fingerprints in consensus get requests
svn:r14450
-rw-r--r--src/or/directory.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 135ba54da..fd2e215df 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -773,6 +773,17 @@ connection_dir_is_encrypted(dir_connection_t *conn)
return TO_CONN(conn)->linked;
}
+/** Helper for sorting
+ *
+ * sort strings alphabetically
+ */
+static int
+_compare_strs(const void **a, const void **b)
+{
+ const char *s1 = *a, *s2 = *b;
+ return strcmp(s1, s2);
+}
+
/** Return the URL we should use for a consensus download.
*
* This url depends on whether or not the server we go to
@@ -801,6 +812,7 @@ directory_get_consensus_url(int supports_conditional_consensus)
ds->digest, CONDITIONAL_CONSENSUS_FPR_LEN);
smartlist_add(authority_digets, hex);
});
+ smartlist_sort(authority_digets, _compare_strs);
authority_id_list = smartlist_join_strings(authority_digets,
"+", 0, NULL);