diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-03-18 15:13:59 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-03-18 15:13:59 -0400 |
commit | 3f837d4826cce0e7917e79d73b81aefc3fefc6bd (patch) | |
tree | 180f45b7c1825911a9ee085221874653aa44eeb2 /src/or/connection_edge.c | |
parent | 7e9b6a19d4cdc605039f4e0107cbd5f4781fe150 (diff) | |
download | tor-3f837d4826cce0e7917e79d73b81aefc3fefc6bd.tar.gz tor-3f837d4826cce0e7917e79d73b81aefc3fefc6bd.zip |
Make stream events for RESOLVE lookups more consistent
Fixes 8203; patch by Desoxy
Diffstat (limited to 'src/or/connection_edge.c')
-rw-r--r-- | src/or/connection_edge.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c index 84d556513c..0660b1fafd 100644 --- a/src/or/connection_edge.c +++ b/src/or/connection_edge.c @@ -1945,13 +1945,14 @@ connection_ap_handshake_send_resolve(entry_connection_t *ap_conn) string_addr, payload_len) < 0) return -1; /* circuit is closed, don't continue */ - tor_free(base_conn->address); /* Maybe already set by dnsserv. */ - base_conn->address = tor_strdup("(Tor_internal)"); + if (!base_conn->address) { + /* This might be unnecessary. XXXX */ + base_conn->address = tor_dup_addr(&base_conn->addr); + } base_conn->state = AP_CONN_STATE_RESOLVE_WAIT; log_info(LD_APP,"Address sent for resolve, ap socket "TOR_SOCKET_T_FORMAT ", n_circ_id %u", base_conn->s, (unsigned)circ->base_.n_circ_id); - control_event_stream_status(ap_conn, STREAM_EVENT_NEW, 0); control_event_stream_status(ap_conn, STREAM_EVENT_SENT_RESOLVE, 0); return 0; } @@ -2201,9 +2202,11 @@ connection_ap_handshake_socks_reply(entry_connection_t *conn, char *reply, tor_assert(conn->socks_request); /* make sure it's an AP stream */ - control_event_stream_status(conn, - status==SOCKS5_SUCCEEDED ? STREAM_EVENT_SUCCEEDED : STREAM_EVENT_FAILED, - endreason); + if (!SOCKS_COMMAND_IS_RESOLVE(conn->socks_request->command)) { + control_event_stream_status(conn, status==SOCKS5_SUCCEEDED ? + STREAM_EVENT_SUCCEEDED : STREAM_EVENT_FAILED, + endreason); + } /* Flag this stream's circuit as having completed a stream successfully * (for path bias) */ |