aboutsummaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-01-05 20:52:14 +0000
committerNick Mathewson <nickm@torproject.org>2009-01-05 20:52:14 +0000
commitf772fc0c36578e61e01f8d54c95415554d5ef892 (patch)
tree6e49e10e1ec83e3e9b2e860839857706bfd2a51c /src/or/relay.c
parente3388230c4c02c3fd83e38a87785ae815851578c (diff)
downloadtor-f772fc0c36578e61e01f8d54c95415554d5ef892.tar.gz
tor-f772fc0c36578e61e01f8d54c95415554d5ef892.zip
apply a variant of rovv's bug 872 patch, and document that we want a better solution for 0.2.2.x.
svn:r17924
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index bc1b2a50ed..0c607f04f7 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -659,7 +659,9 @@ connection_ap_process_end_not_open(
int control_reason = reason | END_STREAM_REASON_FLAG_REMOTE;
(void) layer_hint; /* unused */
- if (rh->length > 0 && edge_reason_is_retriable(reason)) {
+ if (rh->length > 0 && edge_reason_is_retriable(reason) &&
+ !connection_edge_is_rendezvous_stream(conn) /* avoid retry if rend */
+ ) {
log_info(LD_APP,"Address '%s' refused due to '%s'. Considering retrying.",
safe_str(conn->socks_request->address),
stream_end_reason_to_string(reason));
@@ -681,10 +683,15 @@ connection_ap_process_end_not_open(
else
ttl = -1;
- if (!(get_options()->ClientDNSRejectInternalAddresses &&
- is_internal_IP(addr, 0)))
- client_dns_set_addressmap(conn->socks_request->address, addr,
- conn->chosen_exit_name, ttl);
+ if (get_options()->ClientDNSRejectInternalAddresses &&
+ is_internal_IP(addr, 0)) {
+ log_info(LD_APP,"Address '%s' resolved to internal. Closing,",
+ safe_str(conn->socks_request->address));
+ connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
+ return 0;
+ }
+ client_dns_set_addressmap(conn->socks_request->address, addr,
+ conn->chosen_exit_name, ttl);
}
/* check if he *ought* to have allowed it */
if (exitrouter &&