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
This commit is contained in:
Nick Mathewson 2008-04-22 17:21:12 +00:00
parent e623d9baff
commit 21592ad429
2 changed files with 11 additions and 3 deletions

View File

@ -31,6 +31,10 @@ Changes in version 0.2.1.1-alpha - 2008-??-??
untrusted sources. Fixes bug 663.
- Non-exit relays no longer allow DNS requests. Fixes bug 619.
Patch from Lodger.
- Make controller stream events for DNS requests more consistent,
by adding "new stream" events for DNS requests, and removing
spurious "stream closed" events" for cached reverse resolves.
Patch from mwenge. Fixes bug 646.
o Minor features:
- Allow separate log levels to be configured for different logging

View File

@ -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;
}