summaryrefslogtreecommitdiff
path: root/src/or/dnsserv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/or/dnsserv.c')
-rw-r--r--src/or/dnsserv.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c
index ad4f4122bc..f2c473dfc5 100644
--- a/src/or/dnsserv.c
+++ b/src/or/dnsserv.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2010, The Tor Project, Inc. */
+/* Copyright (c) 2007-2011, The Tor Project, Inc. */
/* See LICENSE for licensing information */
/**
@@ -19,7 +19,7 @@
#ifdef HAVE_EVENT2_DNS_H
#include <event2/dns.h>
#include <event2/dns_compat.h>
-/* XXXX022 this implies we want an improved evdns */
+/* XXXX023 this implies we want an improved evdns */
#include <event2/dns_struct.h>
#else
#include "eventdns.h"
@@ -95,8 +95,8 @@ evdns_server_callback(struct evdns_server_request *req, void *_data)
}
if (!q) {
log_info(LD_APP, "None of the questions we got were ones we're willing "
- "to support. Sending NODATA.");
- evdns_server_request_respond(req, DNS_ERR_NONE);
+ "to support. Sending NOTIMPL.");
+ evdns_server_request_respond(req, DNS_ERR_NOTIMPL);
return;
}
if (q->type != EVDNS_TYPE_A) {
@@ -280,13 +280,14 @@ dnsserv_resolved(edge_connection_t *conn,
conn->socks_request->command == SOCKS_COMMAND_RESOLVE) {
evdns_server_request_add_a_reply(req,
name,
- 1, (char*)answer, ttl);
+ 1, answer, ttl);
} else if (answer_type == RESOLVED_TYPE_HOSTNAME &&
+ answer_len < 256 &&
conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) {
char *ans = tor_strndup(answer, answer_len);
evdns_server_request_add_ptr_reply(req, NULL,
name,
- (char*)answer, ttl);
+ ans, ttl);
tor_free(ans);
} else if (answer_type == RESOLVED_TYPE_ERROR) {
err = DNS_ERR_NOTEXIST;
@@ -305,7 +306,7 @@ void
dnsserv_configure_listener(connection_t *conn)
{
tor_assert(conn);
- tor_assert(conn->s >= 0);
+ tor_assert(SOCKET_OK(conn->s));
tor_assert(conn->type == CONN_TYPE_AP_DNS_LISTENER);
conn->dns_server_port =