aboutsummaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-01-12 14:00:56 -0500
committerNick Mathewson <nickm@torproject.org>2011-01-12 14:00:56 -0500
commit468da1c28a9c85fbb45f91a651884d81e630027d (patch)
tree892477d523abf11aea454fd6077141a347e0426c /src/or/dns.c
parenta84c6e86fe3e739a21094cf1e02dd5d7d54056e4 (diff)
parent43e12a79885871cdf18bfe6cc835b2414d21e29d (diff)
downloadtor-468da1c28a9c85fbb45f91a651884d81e630027d.tar.gz
tor-468da1c28a9c85fbb45f91a651884d81e630027d.zip
Merge remote branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index 9138dedf03..a3ddc7a48b 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -54,12 +54,19 @@ struct evdns_request;
evdns_config_windows_nameservers()
#define evdns_base_set_option_(base, opt, val) \
evdns_set_option((opt),(val),DNS_OPTIONS_ALL)
+/* Note: our internal eventdns.c, plus Libevent 1.4, used a 1 return to
+ * signify failure to launch a resolve. Libevent 2.0 uses a -1 return to
+ * signify a failure on a resolve, though if we're on Libevent 2.0, we should
+ * have event2/dns.h and never hit these macros. Regardless, 0 is success. */
#define evdns_base_resolve_ipv4(base, addr, options, cb, ptr) \
- ((evdns_resolve_ipv4(addr, options, cb, ptr)<0) ? NULL : ((void*)1))
-#define evdns_base_resolve_reverse(base, addr, options, cb, ptr) \
- ((evdns_resolve_reverse(addr, options, cb, ptr)<0) ? NULL : ((void*)1))
-#define evdns_base_resolve_reverse_ipv6(base, addr, options, cb, ptr) \
- ((evdns_resolve_reverse_ipv6(addr, options, cb, ptr)<0) ? NULL : ((void*)1))
+ ((evdns_resolve_ipv4((addr), (options), (cb), (ptr))!=0) \
+ ? NULL : ((void*)1))
+#define evdns_base_resolve_reverse(base, addr, options, cb, ptr) \
+ ((evdns_resolve_reverse((addr), (options), (cb), (ptr))!=0) \
+ ? NULL : ((void*)1))
+#define evdns_base_resolve_reverse_ipv6(base, addr, options, cb, ptr) \
+ ((evdns_resolve_reverse_ipv6((addr), (options), (cb), (ptr))!=0) \
+ ? NULL : ((void*)1))
#elif defined(LIBEVENT_VERSION_NUMBER) && LIBEVENT_VERSION_NUMBER < 0x02000303
#define evdns_base_set_option_(base, opt, val) \