diff options
author | Mike Perry <mikeperry-git@fscked.org> | 2009-07-31 06:33:53 +0200 |
---|---|---|
committer | Mike Perry <mikeperry-git@fscked.org> | 2009-08-06 11:48:03 -0700 |
commit | 6fbdf635fa300fb4d9be32cd397dea3bb8cfa4fa (patch) | |
tree | 2d1842cac2d7fabe6c0da3226ca2bb40db3f08cd /src/or/networkstatus.c | |
parent | 9da7b22355b71ed7becad99d5773909e25b400a6 (diff) | |
download | tor-6fbdf635fa300fb4d9be32cd397dea3bb8cfa4fa.tar tor-6fbdf635fa300fb4d9be32cd397dea3bb8cfa4fa.tar.gz |
Implement measured bw parsing + unit tests.
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 97353c01d..b02299960 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -780,8 +780,8 @@ networkstatus_v2_list_clean(time_t now) /** Helper for bsearching a list of routerstatus_t pointers: compare a * digest in the key to the identity digest of a routerstatus_t. */ -static int -_compare_digest_to_routerstatus_entry(const void *_key, const void **_member) +int +compare_digest_to_routerstatus_entry(const void *_key, const void **_member) { const char *key = _key; const routerstatus_t *rs = *_member; @@ -794,7 +794,7 @@ routerstatus_t * networkstatus_v2_find_entry(networkstatus_v2_t *ns, const char *digest) { return smartlist_bsearch(ns->entries, digest, - _compare_digest_to_routerstatus_entry); + compare_digest_to_routerstatus_entry); } /** Return the entry in <b>ns</b> for the identity digest <b>digest</b>, or @@ -803,7 +803,7 @@ routerstatus_t * networkstatus_vote_find_entry(networkstatus_t *ns, const char *digest) { return smartlist_bsearch(ns->routerstatus_list, digest, - _compare_digest_to_routerstatus_entry); + compare_digest_to_routerstatus_entry); } /*XXXX make this static once functions are moved into this file. */ @@ -815,7 +815,7 @@ networkstatus_vote_find_entry_idx(networkstatus_t *ns, const char *digest, int *found_out) { return smartlist_bsearch_idx(ns->routerstatus_list, digest, - _compare_digest_to_routerstatus_entry, + compare_digest_to_routerstatus_entry, found_out); } @@ -868,7 +868,7 @@ router_get_consensus_status_by_id(const char *digest) if (!current_consensus) return NULL; return smartlist_bsearch(current_consensus->routerstatus_list, digest, - _compare_digest_to_routerstatus_entry); + compare_digest_to_routerstatus_entry); } /** Given a nickname (possibly verbose, possibly a hexadecimal digest), return @@ -1827,7 +1827,7 @@ char * networkstatus_getinfo_helper_single(routerstatus_t *rs) { char buf[RS_ENTRY_LEN+1]; - routerstatus_format_entry(buf, sizeof(buf), rs, NULL, 0, 1); + routerstatus_format_entry(buf, sizeof(buf), rs, NULL, NS_CONTROL_PORT); return tor_strdup(buf); } |