aboutsummaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-01-02 04:43:44 +0000
committerNick Mathewson <nickm@torproject.org>2008-01-02 04:43:44 +0000
commit11fff225fa4a644a40e3adfe2fea7b92b8184dbc (patch)
treeffdba9ef6dcb3d1e6ed17205cf448c70fed82e1d /src/or/relay.c
parent99be6dae1e0c50a6ab42a45e206141d5da0241fd (diff)
downloadtor-11fff225fa4a644a40e3adfe2fea7b92b8184dbc.tar.gz
tor-11fff225fa4a644a40e3adfe2fea7b92b8184dbc.zip
r15779@tombo: nickm | 2008-01-01 23:43:24 -0500
Use reference-counting to avoid allocating a zillion little addr_policy_t objects. (This is an old patch that had been sitting on my hard drive for a while.) svn:r13017
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 650a3d567a..d5e81c1b72 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -764,9 +764,7 @@ connection_edge_process_end_not_open(
"Exitrouter '%s' seems to be more restrictive than its exit "
"policy. Not using this router as exit for now.",
exitrouter->nickname);
- addr_policy_free(exitrouter->exit_policy);
- exitrouter->exit_policy =
- router_parse_addr_policy_from_string("reject *:*", -1);
+ policies_set_router_exitpolicy_to_reject_all(exitrouter);
}
/* rewrite it to an IP if we learned one. */
if (addressmap_rewrite(conn->socks_request->address,
@@ -819,9 +817,7 @@ connection_edge_process_end_not_open(
case END_STREAM_REASON_HIBERNATING:
case END_STREAM_REASON_RESOURCELIMIT:
if (exitrouter) {
- addr_policy_free(exitrouter->exit_policy);
- exitrouter->exit_policy =
- router_parse_addr_policy_from_string("reject *:*", -1);
+ policies_set_router_exitpolicy_to_reject_all(exitrouter);
}
if (conn->_base.chosen_exit_optional) {
/* stop wanting a specific exit */