diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-02-13 01:27:55 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-02-13 01:27:55 +0000 |
commit | 3c691b9da696f78049845b7b14e084c902df9ad6 (patch) | |
tree | 561ca0c5262b5bc6677ad73210c6d054fee39cf5 /src/common/container.c | |
parent | dc4c1f1b21370b3c4ab0bd4d59131284ab2c3839 (diff) | |
download | tor-3c691b9da696f78049845b7b14e084c902df9ad6.tar.gz tor-3c691b9da696f78049845b7b14e084c902df9ad6.zip |
r11785@catbus: nickm | 2007-02-12 20:27:48 -0500
Node-picking fixes: Never warn when a down node is listed in a config option (bug 348); always warn when a node in a config option is unnamed. Also, when entrynodes is configured, then build the guard list as: (parts of EntryNodes that were guards before), (the rest of EntryNodes), (the rest of the old guards). This last point ensures that EntryNode users will get the EntryNodes they want with the minimum change to their guard list.
svn:r9574
Diffstat (limited to 'src/common/container.c')
-rw-r--r-- | src/common/container.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/container.c b/src/common/container.c index f5461ef4c8..5f829c29ec 100644 --- a/src/common/container.c +++ b/src/common/container.c @@ -221,6 +221,20 @@ smartlist_string_num_isin(const smartlist_t *sl, int num) return smartlist_string_isin(sl, buf); } +/** Return true iff <b>sl</b> has some element E such that + * !memcmp(E,<b>element</b>,DIGEST_LEN) + */ +int +smartlist_digest_isin(const smartlist_t *sl, const char *element) +{ + int i; + if (!sl) return 0; + for (i=0; i < sl->num_used; i++) + if (memcmp((const char*)sl->list[i],element,DIGEST_LEN)==0) + return 1; + return 0; +} + /** Return true iff some element E of sl2 has smartlist_isin(sl1,E). */ int |