r13676@catbus: nickm | 2007-07-10 13:41:24 -0400

Man. I thought I removed that code.


svn:r10785
This commit is contained in:
Nick Mathewson 2007-07-10 17:41:26 +00:00
parent 4325fc5e83
commit d6ba1c3d96
2 changed files with 11 additions and 35 deletions

View File

@ -896,8 +896,6 @@ handle_control_setevents(control_connection_t *conn, uint32_t len,
event_code = EVENT_GUARD; event_code = EVENT_GUARD;
} else if (!strcasecmp(ev, "STREAM_BW")) } else if (!strcasecmp(ev, "STREAM_BW"))
event_code = EVENT_STREAM_BANDWIDTH_USED; event_code = EVENT_STREAM_BANDWIDTH_USED;
else if (!strcasecmp(ev, "RESOLVED"))
event_code = EVENT_RESOLVED;
else { else {
connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n", connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n",
ev); ev);

View File

@ -221,49 +221,27 @@ dnsserv_resolved(edge_connection_t *conn,
* or more of the questions in the request); then, call * or more of the questions in the request); then, call
* evdns_server_request_respond. */ * evdns_server_request_respond. */
if (answer_type == RESOLVED_TYPE_IPV6) { if (answer_type == RESOLVED_TYPE_IPV6) {
if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) log_info(LD_APP, "Got an IPv6 answer; that's not implemented.");
handle_control_resolve_response(req->questions[0]->name, err = DNS_ERR_NOTIMPL;
"IPv6 not implemented");
else {
log_info(LD_APP, "Got an IPv6 answer; that's not implemented.");
err = DNS_ERR_NOTIMPL;
}
} else if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4 && } else if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4 &&
conn->socks_request->command == SOCKS_COMMAND_RESOLVE) { conn->socks_request->command == SOCKS_COMMAND_RESOLVE) {
if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) evdns_server_request_add_a_reply(req,
handle_control_resolve_response(req->questions[0]->name, conn->socks_request->address,
tor_dup_addr(ntohl(get_uint32(answer)))); 1, (char*)answer, ttl);
else
evdns_server_request_add_a_reply(req,
conn->socks_request->address,
1, (char*)answer, ttl);
} else if (answer_type == RESOLVED_TYPE_HOSTNAME && } else if (answer_type == RESOLVED_TYPE_HOSTNAME &&
conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) { conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) {
if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) char *ans = tor_strndup(answer, answer_len);
handle_control_resolve_response(req->questions[0]->name, answer); evdns_server_request_add_ptr_reply(req, NULL,
else {
char *ans = tor_strndup(answer, answer_len);
evdns_server_request_add_ptr_reply(req, NULL,
conn->socks_request->address, conn->socks_request->address,
(char*)answer, ttl); (char*)answer, ttl);
tor_free(ans); tor_free(ans);
}
} else if (answer_type == RESOLVED_TYPE_ERROR) { } else if (answer_type == RESOLVED_TYPE_ERROR) {
if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) err = DNS_ERR_NOTEXIST;
handle_control_resolve_response(req->questions[0]->name, "Unknown Host");
else
err = DNS_ERR_NOTEXIST;
} else { /* answer_type == RESOLVED_TYPE_ERROR_TRANSIENT */ } else { /* answer_type == RESOLVED_TYPE_ERROR_TRANSIENT */
if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) err = DNS_ERR_SERVERFAILED;
handle_control_resolve_response(req->questions[0]->name,
"Temporary Error");
else
err = DNS_ERR_SERVERFAILED;
} }
if (!SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) evdns_server_request_respond(req, err);
evdns_server_request_respond(req, err);
conn->dns_server_request = NULL; conn->dns_server_request = NULL;
} }