diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-10-11 11:21:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-10-11 11:30:12 -0400 |
commit | 00b2b69add373f168e8729e99f349ec5a3753db3 (patch) | |
tree | 1752d1b14be442831174faadcbfce9afd83181bb /src/or/circuituse.c | |
parent | 69921837a743d551576b3b157657623a0bb96308 (diff) | |
download | tor-00b2b69add373f168e8729e99f349ec5a3753db3.tar.gz tor-00b2b69add373f168e8729e99f349ec5a3753db3.zip |
Fix names of functions that convert strings to addrs
Now let's have "lookup" indicate that there can be a hostname
resolution, and "parse" indicate that there wasn't. Previously, we
had one "lookup" function that did resolution; four "parse" functions,
half of which did resolution; and a "from_str()" function that didn't
do resolution. That's confusing and error-prone!
The code changes in this commit are exactly the result of this perl
script, run under "perl -p -i.bak" :
s/tor_addr_port_parse/tor_addr_port_lookup/g;
s/parse_addr_port(?=[^_])/addr_port_lookup/g;
s/tor_addr_from_str/tor_addr_parse/g;
This patch leaves aton and pton alone: their naming convention and
behavior is is determined by the sockets API.
More renaming may be needed.
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r-- | src/or/circuituse.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c index 9b9621890f..23efe05348 100644 --- a/src/or/circuituse.c +++ b/src/or/circuituse.c @@ -117,7 +117,7 @@ circuit_is_acceptable(const origin_circuit_t *origin_circ, if (tor_digest_is_zero(digest)) { /* we don't know the digest; have to compare addr:port */ tor_addr_t addr; - int r = tor_addr_from_str(&addr, conn->socks_request->address); + int r = tor_addr_parse(&addr, conn->socks_request->address); if (r < 0 || !tor_addr_eq(&build_state->chosen_exit->addr, &addr) || build_state->chosen_exit->port != conn->socks_request->port) @@ -1454,7 +1454,7 @@ circuit_get_open_circ_or_launch(entry_connection_t *conn, log_info(LD_DIR, "Broken exit digest on tunnel conn. Closing."); return -1; } - if (tor_addr_from_str(&addr, conn->socks_request->address) < 0) { + if (tor_addr_parse(&addr, conn->socks_request->address) < 0) { log_info(LD_DIR, "Broken address %s on tunnel conn. Closing.", escaped_safe_str_client(conn->socks_request->address)); return -1; |