diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 8bc4e234e3..5d42548bd8 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -669,7 +669,7 @@ addressmap_rewrite(char *address, size_t maxlen) return (rewrites > 0); /* done, no rewrite needed */ cp = tor_strdup(escaped_safe_str(ent->new_address)); - log_notice(LD_APP, "Addressmap: rewriting %s to %s", + log_info(LD_APP, "Addressmap: rewriting %s to %s", escaped_safe_str(address), cp); tor_free(cp); strlcpy(address, ent->new_address, maxlen); @@ -1945,12 +1945,6 @@ 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); - conn->socks_request->has_finished = 1; /* DOCDOC */ - return; - } - if (ttl >= 0) { if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4) { uint32_t a = ntohl(get_uint32(answer)); @@ -1966,6 +1960,12 @@ connection_ap_handshake_socks_resolved(edge_connection_t *conn, } } + if (conn->dns_server_request) { + dnsserv_resolved(conn, answer_type, answer_len, answer, ttl); + conn->socks_request->has_finished = 1; /* DOCDOC */ + return; + } + if (conn->socks_request->socks_version == 4) { buf[0] = 0x00; /* version */ if (answer_type == RESOLVED_TYPE_IPV4 && answer_len == 4) { diff --git a/src/or/dnsserv.c b/src/or/dnsserv.c index 489dda73e8..89077342c5 100644 --- a/src/or/dnsserv.c +++ b/src/or/dnsserv.c @@ -90,10 +90,10 @@ evdns_server_callback(struct evdns_server_request *req, void *_data) return; } - /* XXXX020 Handle .onion and .exit. */ /* XXXX020 Send a stream event to the controller. */ conn = TO_EDGE_CONN(connection_new(CONN_TYPE_AP)); + conn->_base.state = AP_CONN_STATE_RESOLVE_WAIT; if (q->type == EVDNS_TYPE_A) conn->socks_request->command = SOCKS_COMMAND_RESOLVE; else @@ -104,8 +104,6 @@ evdns_server_callback(struct evdns_server_request *req, void *_data) conn->dns_server_request = req; - /* XXXX need to set state ?? */ - log_info(LD_APP, "Passing request for %s to rewrite_and_attach.", q->name); connection_ap_handshake_rewrite_and_attach(conn, NULL, NULL); /* Now the connection is marked if it was bad. */