]> granicus.if.org Git - libevent/commitdiff
Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL
authorNick Mathewson <nickm@torproject.org>
Fri, 19 Nov 2010 16:33:48 +0000 (11:33 -0500)
committerNick Mathewson <nickm@torproject.org>
Fri, 19 Nov 2010 17:08:34 +0000 (12:08 -0500)
evdns.c

diff --git a/evdns.c b/evdns.c
index 25857a380a34d10ffd94815e022e71f60909fc34..e13dbbf53ad1a679ad4110e3d2fc15c5073d2fda 100644 (file)
--- a/evdns.c
+++ b/evdns.c
@@ -4248,6 +4248,11 @@ evdns_getaddrinfo_gotresolve(int result, char type, int count,
                free_getaddrinfo_request(data);
                return;
        } else if (data->user_canceled) {
+               if (other_req->r) {
+                       /* The other request is still working; let it
+                        * hit the callback and report the failure. */
+                       return;
+               }
                data->user_cb(EVUTIL_EAI_CANCEL, NULL, data->user_data);
                free_getaddrinfo_request(data);
                return;