apply patch from lodger to simplify code a bit

svn:r14474
This commit is contained in:
Roger Dingledine 2008-04-25 18:42:42 +00:00
parent 4fa1c69c44
commit 5ad9dc2244

View File

@ -549,11 +549,12 @@ dns_resolve(edge_connection_t *exitconn)
or_circuit_t *oncirc = TO_OR_CIRCUIT(exitconn->on_circuit); or_circuit_t *oncirc = TO_OR_CIRCUIT(exitconn->on_circuit);
int is_resolve, r; int is_resolve, r;
char *hostname = NULL; char *hostname = NULL;
routerinfo_t *me = router_get_my_routerinfo(); routerinfo_t *me;
is_resolve = exitconn->_base.purpose == EXIT_PURPOSE_RESOLVE; is_resolve = exitconn->_base.purpose == EXIT_PURPOSE_RESOLVE;
if (is_resolve && me && if (is_resolve &&
policy_is_reject_star(me->exit_policy)) /* non-exit */ (!(me = router_get_my_routerinfo()) ||
policy_is_reject_star(me->exit_policy))) /* non-exit */
r = -1; r = -1;
else else
r = dns_resolve_impl(exitconn, is_resolve, oncirc, &hostname); r = dns_resolve_impl(exitconn, is_resolve, oncirc, &hostname);