summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-04-11 12:50:50 -0400
committerNick Mathewson <nickm@torproject.org>2013-01-16 16:57:11 -0500
commit49e619c1cf7ed62334263a89eb031899bc2e7178 (patch)
treeb16cd982baa62c80db14d3671c7c1a355794239a /src/or
parente4821fa14de6d76219d4e5c1a320ba263bd5e46d (diff)
downloadtor-49e619c1cf7ed62334263a89eb031899bc2e7178.tar.gz
tor-49e619c1cf7ed62334263a89eb031899bc2e7178.zip
Rename *_isin to *_contains
This is an automatically generated commit, from the following perl script, run with the options "-w -i -p". s/smartlist_string_num_isin/smartlist_contains_int_as_string/g; s/smartlist_string_isin((?:_case)?)/smartlist_contains_string$1/g; s/smartlist_digest_isin/smartlist_contains_digest/g; s/smartlist_isin/smartlist_contains/g; s/digestset_isin/digestset_contains/g;
Diffstat (limited to 'src/or')
-rw-r--r--src/or/circuitbuild.c2
-rw-r--r--src/or/circuitlist.c4
-rw-r--r--src/or/circuituse.c4
-rw-r--r--src/or/connection_edge.c4
-rw-r--r--src/or/dirvote.c2
-rw-r--r--src/or/dns.c8
-rw-r--r--src/or/entrynodes.c4
-rw-r--r--src/or/main.c10
-rw-r--r--src/or/networkstatus.c2
-rw-r--r--src/or/policies.c2
-rw-r--r--src/or/rendservice.c8
-rw-r--r--src/or/router.c4
-rw-r--r--src/or/routerlist.c10
-rw-r--r--src/or/transports.c4
14 files changed, 34 insertions, 34 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index fffdde9093..b986243867 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -2301,7 +2301,7 @@ circuit_all_predicted_ports_handled(time_t now, int *need_uptime,
enough = (smartlist_len(sl) == 0);
for (i = 0; i < smartlist_len(sl); ++i) {
port = smartlist_get(sl, i);
- if (smartlist_string_num_isin(LongLivedServices, *port))
+ if (smartlist_contains_int_as_string(LongLivedServices, *port))
*need_uptime = 1;
tor_free(port);
}
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 81f6831cef..b8f71bd342 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1611,10 +1611,10 @@ assert_circuit_ok(const circuit_t *c)
}
if (c->state == CIRCUIT_STATE_CHAN_WAIT && !c->marked_for_close) {
tor_assert(circuits_pending_chans &&
- smartlist_isin(circuits_pending_chans, c));
+ smartlist_contains(circuits_pending_chans, c));
} else {
tor_assert(!circuits_pending_chans ||
- !smartlist_isin(circuits_pending_chans, c));
+ !smartlist_contains(circuits_pending_chans, c));
}
if (origin_circ && origin_circ->cpath) {
assert_cpath_ok(origin_circ->cpath);
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index b94b602169..bd28a1b2c5 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -804,7 +804,7 @@ circuit_stream_is_being_handled(entry_connection_t *conn,
const node_t *exitnode;
int num=0;
time_t now = time(NULL);
- int need_uptime = smartlist_string_num_isin(get_options()->LongLivedPorts,
+ int need_uptime = smartlist_contains_int_as_string(get_options()->LongLivedPorts,
conn ? conn->socks_request->port : port);
for (circ=global_circuitlist;circ;circ = circ->next) {
@@ -1621,7 +1621,7 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn,
want_onehop = conn->want_onehop;
need_uptime = !conn->want_onehop && !conn->use_begindir &&
- smartlist_string_num_isin(options->LongLivedPorts,
+ smartlist_contains_int_as_string(options->LongLivedPorts,
conn->socks_request->port);
if (desired_circuit_purpose != CIRCUIT_PURPOSE_C_GENERAL)
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index 0964c423d4..acab81565d 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -829,9 +829,9 @@ static int
consider_plaintext_ports(entry_connection_t *conn, uint16_t port)
{
const or_options_t *options = get_options();
- int reject = smartlist_string_num_isin(options->RejectPlaintextPorts, port);
+ int reject = smartlist_contains_int_as_string(options->RejectPlaintextPorts, port);
- if (smartlist_string_num_isin(options->WarnPlaintextPorts, port)) {
+ if (smartlist_contains_int_as_string(options->WarnPlaintextPorts, port)) {
log_warn(LD_APP, "Application request to port %d: this port is "
"commonly used for unencrypted protocols. Please make sure "
"you don't send anything you would mind the rest of the "
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index dcc2420797..0731426d97 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -3110,7 +3110,7 @@ dirvote_compute_consensuses(void)
}
tor_assert(pending_vote_list);
SMARTLIST_FOREACH(pending_vote_list, pending_vote_t *, v, {
- if (smartlist_string_isin(v->vote->known_flags, "Running"))
+ if (smartlist_contains_string(v->vote->known_flags, "Running"))
n_vote_running++;
});
if (!n_vote_running) {
diff --git a/src/or/dns.c b/src/or/dns.c
index 556dd1e282..80e7d8b023 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -1218,7 +1218,7 @@ is_test_address(const char *address)
{
const or_options_t *options = get_options();
return options->ServerDNSTestAddresses &&
- smartlist_string_isin_case(options->ServerDNSTestAddresses, address);
+ smartlist_contains_string_case(options->ServerDNSTestAddresses, address);
}
/** Called on the OR side when the eventdns library tells us the outcome of a
@@ -1843,7 +1843,7 @@ wildcard_increment_answer(const char *id)
if (*ip > 5 && n_wildcard_requests > 10) {
if (!dns_wildcard_list) dns_wildcard_list = smartlist_new();
- if (!smartlist_string_isin(dns_wildcard_list, id)) {
+ if (!smartlist_contains_string(dns_wildcard_list, id)) {
log(dns_wildcard_notice_given ? LOG_INFO : LOG_NOTICE, LD_EXIT,
"Your DNS provider has given \"%s\" as an answer for %d different "
"invalid addresses. Apparently they are hijacking DNS failures. "
@@ -1866,7 +1866,7 @@ add_wildcarded_test_address(const char *address)
if (!dns_wildcarded_test_address_list)
dns_wildcarded_test_address_list = smartlist_new();
- if (smartlist_string_isin_case(dns_wildcarded_test_address_list, address))
+ if (smartlist_contains_string_case(dns_wildcarded_test_address_list, address))
return;
n_test_addrs = get_options()->ServerDNSTestAddresses ?
@@ -2104,7 +2104,7 @@ dns_reset_correctness_checks(void)
static int
answer_is_wildcarded(const char *ip)
{
- return dns_wildcard_list && smartlist_string_isin(dns_wildcard_list, ip);
+ return dns_wildcard_list && smartlist_contains_string(dns_wildcard_list, ip);
}
/** Exit with an assertion if <b>resolve</b> is corrupt. */
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index 035f3ca8cd..3e58371643 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -762,7 +762,7 @@ entry_guards_set_from_config(const or_options_t *options)
smartlist_add(entry_fps, (void*)node->identity));
SMARTLIST_FOREACH(entry_guards, entry_guard_t *, e, {
- if (smartlist_digest_isin(entry_fps, e->identity))
+ if (smartlist_contains_digest(entry_fps, e->identity))
smartlist_add(old_entry_guards_on_list, e);
else
smartlist_add(old_entry_guards_not_on_list, e);
@@ -901,7 +901,7 @@ choose_random_entry_impl(cpath_build_state_t *state, int for_directory,
}
if (node == chosen_exit)
continue; /* don't pick the same node for entry and exit */
- if (consider_exit_family && smartlist_isin(exit_family, node))
+ if (consider_exit_family && smartlist_contains(exit_family, node))
continue; /* avoid relays that are family members of our exit */
#if 0 /* since EntryNodes is always strict now, this clause is moot */
if (options->EntryNodes &&
diff --git a/src/or/main.c b/src/or/main.c
index 10ee0d7eef..1dd207a753 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -422,7 +422,7 @@ connection_unlink(connection_t *conn)
void
add_connection_to_closeable_list(connection_t *conn)
{
- tor_assert(!smartlist_isin(closeable_connection_lst, conn));
+ tor_assert(!smartlist_contains(closeable_connection_lst, conn));
tor_assert(conn->marked_for_close);
assert_connection_ok(conn, time(NULL));
smartlist_add(closeable_connection_lst, conn);
@@ -432,14 +432,14 @@ add_connection_to_closeable_list(connection_t *conn)
int
connection_is_on_closeable_list(connection_t *conn)
{
- return smartlist_isin(closeable_connection_lst, conn);
+ return smartlist_contains(closeable_connection_lst, conn);
}
/** Return true iff conn is in the current poll array. */
int
connection_in_array(connection_t *conn)
{
- return smartlist_isin(connection_array, conn);
+ return smartlist_contains(connection_array, conn);
}
/** Set <b>*array</b> to an array of all connections, and <b>*n</b>
@@ -666,7 +666,7 @@ connection_start_reading_from_linked_conn(connection_t *conn)
tor_event_base_loopexit(tor_libevent_get_base(), &tv);
}
} else {
- tor_assert(smartlist_isin(active_linked_connection_lst, conn));
+ tor_assert(smartlist_contains(active_linked_connection_lst, conn));
}
}
@@ -686,7 +686,7 @@ connection_stop_reading_from_linked_conn(connection_t *conn)
* so let's leave it alone for now. */
smartlist_remove(active_linked_connection_lst, conn);
} else {
- tor_assert(!smartlist_isin(active_linked_connection_lst, conn));
+ tor_assert(!smartlist_contains(active_linked_connection_lst, conn));
}
}
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 22b5b8b933..79dd706c47 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -774,7 +774,7 @@ router_set_networkstatus_v2(const char *s, time_t arrived_at,
}
if (requested_fingerprints) {
- if (smartlist_string_isin(requested_fingerprints, fp)) {
+ if (smartlist_contains_string(requested_fingerprints, fp)) {
smartlist_string_remove(requested_fingerprints, fp);
} else {
if (source != NS_FROM_DIR_ALL) {
diff --git a/src/or/policies.c b/src/or/policies.c
index d8200ae755..f9a03aef2c 100644
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@ -374,7 +374,7 @@ addr_is_in_cc_list(uint32_t addr, const smartlist_t *cc_list)
tor_addr_from_ipv4h(&tar, addr);
country = geoip_get_country_by_addr(&tar);
name = geoip_get_country_name(country);
- return smartlist_string_isin_case(cc_list, name);
+ return smartlist_contains_string_case(cc_list, name);
}
/** Return 1 if <b>addr</b>:<b>port</b> is permitted to publish to our
diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 6da9ba4698..7d4f6fa5d4 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -931,7 +931,7 @@ rend_service_requires_uptime(rend_service_t *service)
for (i=0; i < smartlist_len(service->ports); ++i) {
p = smartlist_get(service->ports, i);
- if (smartlist_string_num_isin(get_options()->LongLivedPorts,
+ if (smartlist_contains_int_as_string(get_options()->LongLivedPorts,
p->virtual_port))
return 1;
}
@@ -2774,7 +2774,7 @@ directory_post_to_hs_dir(rend_service_descriptor_t *renddesc,
char *hs_dir_ip;
const node_t *node;
hs_dir = smartlist_get(responsible_dirs, j);
- if (smartlist_digest_isin(renddesc->successful_uploads,
+ if (smartlist_contains_digest(renddesc->successful_uploads,
hs_dir->identity_digest))
/* Don't upload descriptor if we succeeded in doing so last time. */
continue;
@@ -2809,7 +2809,7 @@ directory_post_to_hs_dir(rend_service_descriptor_t *renddesc,
hs_dir->or_port);
tor_free(hs_dir_ip);
/* Remember successful upload to this router for next time. */
- if (!smartlist_digest_isin(successful_uploads, hs_dir->identity_digest))
+ if (!smartlist_contains_digest(successful_uploads, hs_dir->identity_digest))
smartlist_add(successful_uploads, hs_dir->identity_digest);
}
smartlist_clear(responsible_dirs);
@@ -2827,7 +2827,7 @@ directory_post_to_hs_dir(rend_service_descriptor_t *renddesc,
if (!renddesc->successful_uploads)
renddesc->successful_uploads = smartlist_new();
SMARTLIST_FOREACH(successful_uploads, const char *, c, {
- if (!smartlist_digest_isin(renddesc->successful_uploads, c)) {
+ if (!smartlist_contains_digest(renddesc->successful_uploads, c)) {
char *hsdir_id = tor_memdup(c, DIGEST_LEN);
smartlist_add(renddesc->successful_uploads, hsdir_id);
}
diff --git a/src/or/router.c b/src/or/router.c
index 1057973dbb..c584d6277f 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -1858,7 +1858,7 @@ router_rebuild_descriptor(int force)
member = node_get_by_nickname(name, 1);
if (!member) {
int is_legal = is_legal_nickname_or_hexdigest(name);
- if (!smartlist_string_isin(warned_nonexistent_family, name) &&
+ if (!smartlist_contains_string(warned_nonexistent_family, name) &&
!is_legal_hexdigest(name)) {
if (is_legal)
log_warn(LD_CONFIG,
@@ -1884,7 +1884,7 @@ router_rebuild_descriptor(int force)
base16_encode(fp+1,HEX_DIGEST_LEN+1,
member->identity, DIGEST_LEN);
smartlist_add(ri->declared_family, fp);
- if (smartlist_string_isin(warned_nonexistent_family, name))
+ if (smartlist_contains_string(warned_nonexistent_family, name))
smartlist_string_remove(warned_nonexistent_family, name);
}
skip:
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 6d509f3d32..b294bfa080 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -541,7 +541,7 @@ authority_certs_fetch_missing(networkstatus_t *status, time_t now)
int found = 0;
if (!(ds->type & V3_DIRINFO))
continue;
- if (smartlist_digest_isin(missing_digests, ds->v3_identity_digest))
+ if (smartlist_contains_digest(missing_digests, ds->v3_identity_digest))
continue;
cl = get_cert_list(ds->v3_identity_digest);
SMARTLIST_FOREACH(cl->certs, authority_cert_t *, cert, {
@@ -3327,7 +3327,7 @@ routerlist_remove_old_cached_routers_with_id(time_t now,
signed_descriptor_t *r_next;
lifespans[i-lo].idx = i;
if (r->last_listed_as_valid_until >= now ||
- (retain && digestset_isin(retain, r->signed_descriptor_digest))) {
+ (retain && digestset_contains(retain, r->signed_descriptor_digest))) {
must_keep[i-lo] = 1;
}
if (i < hi) {
@@ -3461,7 +3461,7 @@ routerlist_remove_old_routers(void)
router = smartlist_get(routerlist->routers, i);
if (router->cache_info.published_on <= cutoff &&
router->cache_info.last_listed_as_valid_until < now &&
- !digestset_isin(retain,
+ !digestset_contains(retain,
router->cache_info.signed_descriptor_digest)) {
/* Too old: remove it. (If we're a cache, just move it into
* old_routers.) */
@@ -3482,7 +3482,7 @@ routerlist_remove_old_routers(void)
sd = smartlist_get(routerlist->old_routers, i);
if (sd->published_on <= cutoff &&
sd->last_listed_as_valid_until < now &&
- !digestset_isin(retain, sd->signed_descriptor_digest)) {
+ !digestset_contains(retain, sd->signed_descriptor_digest)) {
/* Too old. Remove it. */
routerlist_remove_old(routerlist, sd, i--);
}
@@ -3661,7 +3661,7 @@ router_load_routers_from_string(const char *s, const char *eos,
ri->cache_info.signed_descriptor_digest :
ri->cache_info.identity_digest,
DIGEST_LEN);
- if (smartlist_string_isin(requested_fingerprints, fp)) {
+ if (smartlist_contains_string(requested_fingerprints, fp)) {
smartlist_string_remove(requested_fingerprints, fp);
} else {
char *requested =
diff --git a/src/or/transports.c b/src/or/transports.c
index 7903fb7231..647b293168 100644
--- a/src/or/transports.c
+++ b/src/or/transports.c
@@ -428,7 +428,7 @@ static void
add_transport_to_proxy(const char *transport, managed_proxy_t *mp)
{
tor_assert(mp->transports_to_launch);
- if (!smartlist_string_isin(mp->transports_to_launch, transport))
+ if (!smartlist_contains_string(mp->transports_to_launch, transport))
smartlist_add(mp->transports_to_launch, tor_strdup(transport));
}
@@ -453,7 +453,7 @@ proxy_needs_restart(const managed_proxy_t *mp)
goto needs_restart;
SMARTLIST_FOREACH_BEGIN(mp->transports, const transport_t *, t) {
- if (!smartlist_string_isin(mp->transports_to_launch, t->name))
+ if (!smartlist_contains_string(mp->transports_to_launch, t->name))
goto needs_restart;
} SMARTLIST_FOREACH_END(t);