summaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-08-10 09:02:26 +0000
committerNick Mathewson <nickm@torproject.org>2006-08-10 09:02:26 +0000
commit7ddd9e8cd9472af6c4fa84173fb3e0c5d1b00335 (patch)
tree3fa22d97d784b03ee0bfc9713b9a949b05a11034 /src/or/connection_edge.c
parent3da737ac98f6e793ed94da019e14129e873ee3f0 (diff)
downloadtor-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/connection_edge.c')
-rw-r--r--src/or/connection_edge.c12
1 files changed, 9 insertions, 3 deletions
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