diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-08-10 09:02:26 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-08-10 09:02:26 +0000 |
commit | 7ddd9e8cd9472af6c4fa84173fb3e0c5d1b00335 (patch) | |
tree | 3fa22d97d784b03ee0bfc9713b9a949b05a11034 /src/or | |
parent | 3da737ac98f6e793ed94da019e14129e873ee3f0 (diff) | |
download | tor-7ddd9e8cd9472af6c4fa84173fb3e0c5d1b00335.tar.gz tor-7ddd9e8cd9472af6c4fa84173fb3e0c5d1b00335.zip |
r7304@Kushana: nickm | 2006-08-10 01:58:05 -0700
Fix verbose compilation errors; make sure transparent proxy fails when no method is configured.
svn:r7012
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/config.c | 2 | ||||
-rw-r--r-- | src/or/connection_edge.c | 12 | ||||
-rw-r--r-- | src/or/dns.c | 6 |
3 files changed, 13 insertions, 7 deletions
diff --git a/src/or/config.c b/src/or/config.c index 16efa9bd23..7f4525879c 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -2072,6 +2072,7 @@ options_validate(or_options_t *old_options, or_options_t *options, for (i = 0; i < 2; ++i) { int is_socks = i==0; config_line_t *line, *opt, *old; + const char *tp = is_socks ? "SOCKS proxy" : "transparent proxy"; if (is_socks) { opt = options->SocksListenAddress; old = old_options->SocksListenAddress; @@ -2079,7 +2080,6 @@ options_validate(or_options_t *old_options, or_options_t *options, opt = options->TransListenAddress; old = old_options->TransListenAddress; } - const char *tp = is_socks ? "SOCKS proxy" : "transparent proxy"; for (line = opt; line; line = line->next) { char *address = NULL; diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 840aee2a47..6e971328af 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1290,9 +1290,9 @@ connection_ap_get_original_destination(edge_connection_t *conn, tor_inet_ntoa(&orig_dst.sin_addr, tmpbuf, sizeof(tmpbuf)); strlcpy(req->address, tmpbuf, sizeof(req->address)); req->port = ntohs(orig_dst.sin_port); -#endif -#ifdef TRANS_PF + return 0; +#elif defined(TRANS_PF) struct sockaddr_in proxy_addr; socklen_t proxy_addr_len = sizeof(proxy_addr); char tmpbuf[INET_NTOA_BUF_LEN]; @@ -1327,9 +1327,15 @@ connection_ap_get_original_destination(edge_connection_t *conn, tor_inet_ntoa(&pnl.rdaddr.v4, tmpbuf, sizeof(tmpbuf)); strlcpy(req->address, tmpbuf, sizeof(req->address)); req->port = ntohs(pnl.rdport); -#endif return 0; +#else + (void)conn; + (void)req; + log_warn(LD_BUG, "Called connection_ap_get_original_destination, but no " + "transparent proxy method was configured."); + return -1; +#endif } /** connection_edge_process_inbuf() found a conn in state diff --git a/src/or/dns.c b/src/or/dns.c index dc54626b8b..4377d0a24b 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -95,7 +95,7 @@ typedef struct cached_resolve_t { pending_connection_t *pending_connections; } cached_resolve_t; -static void purge_expired_resolves(uint32_t now); +static void purge_expired_resolves(time_t now); static void dns_found_answer(const char *address, uint32_t addr, char outcome, uint32_t ttl); static void send_resolved_cell(edge_connection_t *conn, uint8_t answer_type); @@ -253,7 +253,7 @@ dns_free_all(void) /** Remove every cached_resolve whose <b>expire</b> time is before <b>now</b> * from the cache. */ static void -purge_expired_resolves(uint32_t now) +purge_expired_resolves(time_t now) { cached_resolve_t *resolve, *removed; pending_connection_t *pend; @@ -386,7 +386,7 @@ dns_resolve(edge_connection_t *exitconn) pending_connection_t *pending_connection; struct in_addr in; circuit_t *circ; - uint32_t now = time(NULL); + time_t now = time(NULL); assert_connection_ok(TO_CONN(exitconn), 0); tor_assert(exitconn->_base.s == -1); |