aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2008-04-25 18:42:42 +0000
committerRoger Dingledine <arma@torproject.org>2008-04-25 18:42:42 +0000
commit5ad9dc2244d8d3c600f0776fe8cc99c701d5ae7f (patch)
tree12aa2fea3f88d7637c9c68f70c76b690893f397e /src/or
parent4fa1c69c4446aa3f9c0bc86046cd5b9d449da21b (diff)
downloadtor-5ad9dc2244d8d3c600f0776fe8cc99c701d5ae7f.tar.gz
tor-5ad9dc2244d8d3c600f0776fe8cc99c701d5ae7f.zip
apply patch from lodger to simplify code a bit
svn:r14474
Diffstat (limited to 'src/or')
-rw-r--r--src/or/dns.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index 041ae74bc0..5af868b27b 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -549,11 +549,12 @@ dns_resolve(edge_connection_t *exitconn)
or_circuit_t *oncirc = TO_OR_CIRCUIT(exitconn->on_circuit);
int is_resolve, r;
char *hostname = NULL;
- routerinfo_t *me = router_get_my_routerinfo();
+ routerinfo_t *me;
is_resolve = exitconn->_base.purpose == EXIT_PURPOSE_RESOLVE;
- if (is_resolve && me &&
- policy_is_reject_star(me->exit_policy)) /* non-exit */
+ if (is_resolve &&
+ (!(me = router_get_my_routerinfo()) ||
+ policy_is_reject_star(me->exit_policy))) /* non-exit */
r = -1;
else
r = dns_resolve_impl(exitconn, is_resolve, oncirc, &hostname);