Fix verbose compilation errors; make sure transparent proxy fails when no method is configured.
svn:r7012
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;
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;
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];
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
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);
/** 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;
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);