Loading src/or/control.c +0 −2 Original line number Diff line number Diff line Loading @@ -896,8 +896,6 @@ handle_control_setevents(control_connection_t *conn, uint32_t len, event_code = EVENT_GUARD; } else if (!strcasecmp(ev, "STREAM_BW")) event_code = EVENT_STREAM_BANDWIDTH_USED; else if (!strcasecmp(ev, "RESOLVED")) event_code = EVENT_RESOLVED; else { connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n", ev); Loading src/or/dnsserv.c +11 −33 Original line number Diff line number Diff line Loading @@ -221,50 +221,28 @@ dnsserv_resolved(edge_connection_t *conn, * or more of the questions in the request); then, call * evdns_server_request_respond. */ if (answer_type == RESOLVED_TYPE_IPV6) { if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) handle_control_resolve_response(req->questions[0]->name, "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 && conn->socks_request->command == SOCKS_COMMAND_RESOLVE) { if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) handle_control_resolve_response(req->questions[0]->name, tor_dup_addr(ntohl(get_uint32(answer)))); else evdns_server_request_add_a_reply(req, conn->socks_request->address, 1, (char*)answer, ttl); } else if (answer_type == RESOLVED_TYPE_HOSTNAME && conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) { if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) handle_control_resolve_response(req->questions[0]->name, answer); else { char *ans = tor_strndup(answer, answer_len); evdns_server_request_add_ptr_reply(req, NULL, conn->socks_request->address, (char*)answer, ttl); tor_free(ans); } } else if (answer_type == RESOLVED_TYPE_ERROR) { if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) handle_control_resolve_response(req->questions[0]->name, "Unknown Host"); else err = DNS_ERR_NOTEXIST; } else { /* answer_type == RESOLVED_TYPE_ERROR_TRANSIENT */ if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) 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); conn->dns_server_request = NULL; } Loading Loading
src/or/control.c +0 −2 Original line number Diff line number Diff line Loading @@ -896,8 +896,6 @@ handle_control_setevents(control_connection_t *conn, uint32_t len, event_code = EVENT_GUARD; } else if (!strcasecmp(ev, "STREAM_BW")) event_code = EVENT_STREAM_BANDWIDTH_USED; else if (!strcasecmp(ev, "RESOLVED")) event_code = EVENT_RESOLVED; else { connection_printf_to_buf(conn, "552 Unrecognized event \"%s\"\r\n", ev); Loading
src/or/dnsserv.c +11 −33 Original line number Diff line number Diff line Loading @@ -221,50 +221,28 @@ dnsserv_resolved(edge_connection_t *conn, * or more of the questions in the request); then, call * evdns_server_request_respond. */ if (answer_type == RESOLVED_TYPE_IPV6) { if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) handle_control_resolve_response(req->questions[0]->name, "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 && conn->socks_request->command == SOCKS_COMMAND_RESOLVE) { if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) handle_control_resolve_response(req->questions[0]->name, tor_dup_addr(ntohl(get_uint32(answer)))); else evdns_server_request_add_a_reply(req, conn->socks_request->address, 1, (char*)answer, ttl); } else if (answer_type == RESOLVED_TYPE_HOSTNAME && conn->socks_request->command == SOCKS_COMMAND_RESOLVE_PTR) { if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) handle_control_resolve_response(req->questions[0]->name, answer); else { char *ans = tor_strndup(answer, answer_len); evdns_server_request_add_ptr_reply(req, NULL, conn->socks_request->address, (char*)answer, ttl); tor_free(ans); } } else if (answer_type == RESOLVED_TYPE_ERROR) { if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) handle_control_resolve_response(req->questions[0]->name, "Unknown Host"); else err = DNS_ERR_NOTEXIST; } else { /* answer_type == RESOLVED_TYPE_ERROR_TRANSIENT */ if (SOCKS_COMMAND_IS_RESOLVE_CONTROL(conn->socks_request->command)) 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); conn->dns_server_request = NULL; } Loading