summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-04-22 17:21:12 +0000
committerNick Mathewson <nickm@torproject.org>2008-04-22 17:21:12 +0000
commit21592ad429c1921e4033697aaf6ddb5ababe7bce (patch)
tree4699924e2dc4c7c4bb28f691100e3951142d6415 /src/or
parente623d9baff1c2dd45cf7b8768b58088ef4e56b3a (diff)
downloadtor-21592ad429c1921e4033697aaf6ddb5ababe7bce.tar.gz
tor-21592ad429c1921e4033697aaf6ddb5ababe7bce.zip
r15278@tombo: nickm | 2008-04-22 13:17:37 -0400
Apply patch from mwenge to fix bug 646: makes stream events for dns requests get generated more consistently. svn:r14413
Diffstat (limited to 'src/or')
-rw-r--r--src/or/connection_edge.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index ed725dd117..e059850df1 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -1348,13 +1348,15 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
&map_expires)) {
char *result = tor_strdup(socks->address);
/* remember _what_ is supposed to have been resolved. */
- strlcpy(socks->address, orig_address, sizeof(socks->address));
+ tor_snprintf(socks->address, sizeof(socks->address), "REVERSE[%s]",
+ orig_address);
connection_ap_handshake_socks_resolved(conn, RESOLVED_TYPE_HOSTNAME,
strlen(result), result, -1,
map_expires);
connection_mark_unattached_ap(conn,
- END_STREAM_REASON_DONE |
- END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED);
+ END_STREAM_REASON_DONE |
+ END_STREAM_REASON_FLAG_ALREADY_SOCKS_REPLIED |
+ END_STREAM_REASON_FLAG_ALREADY_SENT_CLOSED);
return 0;
}
if (options->ClientDNSRejectInternalAddresses) {
@@ -2084,9 +2086,11 @@ connection_ap_handshake_send_resolve(edge_connection_t *ap_conn)
string_addr, payload_len) < 0)
return -1; /* circuit is closed, don't continue */
+ ap_conn->_base.address = tor_strdup("(Tor_internal)");
ap_conn->_base.state = AP_CONN_STATE_RESOLVE_WAIT;
log_info(LD_APP,"Address sent for resolve, ap socket %d, n_circ_id %d",
ap_conn->_base.s, 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;
}