aboutsummaryrefslogtreecommitdiff
path: root/src/common/container.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2013-05-16 12:08:48 +0200
committerKarsten Loesing <karsten.loesing@gmx.net>2013-05-16 12:08:48 +0200
commit1293835440dd4debf6fbfc66e755d9b9384aa362 (patch)
tree11891e6aaee7dafd69fb0077c33b148a8df73f04 /src/common/container.c
parent95c34399cfb66a46371562f1532e8aa396243876 (diff)
downloadtor-1293835440dd4debf6fbfc66e755d9b9384aa362.tar
tor-1293835440dd4debf6fbfc66e755d9b9384aa362.tar.gz
Lower dir fetch retry schedules in testing networks.
Also lower maximum interval without directory requests, and raise maximum download tries. Implements #6752.
Diffstat (limited to 'src/common/container.c')
-rw-r--r--src/common/container.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/common/container.c b/src/common/container.c
index eec497a3e..03c65b7c1 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -243,6 +243,25 @@ smartlist_strings_eq(const smartlist_t *sl1, const smartlist_t *sl2)
return 1;
}
+/** Return true iff the two lists contain the same ints in the same order,
+ * or if they are both NULL. */
+int
+smartlist_ints_eq(const smartlist_t *sl1, const smartlist_t *sl2)
+{
+ if (sl1 == NULL)
+ return sl2 == NULL;
+ if (sl2 == NULL)
+ return 0;
+ if (smartlist_len(sl1) != smartlist_len(sl2))
+ return 0;
+ SMARTLIST_FOREACH(sl1, int *, cp1, {
+ int *cp2 = smartlist_get(sl2, cp1_sl_idx);
+ if (*cp1 != *cp2)
+ return 0;
+ });
+ return 1;
+}
+
/** Return true iff <b>sl</b> has some element E such that
* tor_memeq(E,<b>element</b>,DIGEST_LEN)
*/