aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_edge.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-24 20:31:30 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-24 20:31:30 +0000
commit703bf1962068a2beb8754f9bb772efd7eb3c100d (patch)
tree4fa9db1792fad7b4bcc36f2ff466f9033549eaca /src/or/connection_edge.c
parent17830bc03ba26dc90258f436fbd9786cf769027c (diff)
downloadtor-703bf1962068a2beb8754f9bb772efd7eb3c100d.tar.gz
tor-703bf1962068a2beb8754f9bb772efd7eb3c100d.zip
r12942@catbus: nickm | 2007-05-24 16:31:22 -0400
Well, that was easier than I thought it would be. Tor is now a DNS proxy as well as a socks proxy. Probably some bugs remain, but since it A) has managed to resolve one address for me successfully, and B) will not affect anybody who leaves DNSPort unset, it feel like a good time to commit. svn:r10317
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r--src/or/connection_edge.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index a910013d25..e2b4f1b021 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -30,7 +30,6 @@ static smartlist_t *redirect_exit_list = NULL;
static int connection_ap_handshake_process_socks(edge_connection_t *conn);
static int connection_ap_process_natd(edge_connection_t *conn);
static int connection_exit_connect_dir(edge_connection_t *exitconn);
-static int hostname_is_noconnect_address(const char *address);
/** An AP stream has failed/finished. If it hasn't already sent back
* a socks reply, send one now (based on endreason). Also set
@@ -1920,6 +1919,11 @@ connection_ap_handshake_socks_resolved(edge_connection_t *conn,
char buf[384];
size_t replylen;
+ if (conn->dns_server_request) {
+ dnsserv_resolved(conn, answer_type, answer_len, answer, ttl);
+ return;
+ }
+
if (ttl >= 0) {
if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4) {
uint32_t a = ntohl(get_uint32(answer));
@@ -2551,7 +2555,7 @@ failed:
/** Check if the address is of the form "y.noconnect"
*/
-static int
+int
hostname_is_noconnect_address(const char *address)
{
return ! strcasecmpend(address, ".noconnect");