From: Nick Mathewson Date: Fri, 19 Nov 2010 16:33:48 +0000 (-0500) Subject: Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL X-Git-Tag: release-2.0.9-rc~28^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=abf01ed13af22637ceeb4c5732c2347fd25a8c03;p=libevent Avoid double-invocation of user callback with EVUTIL_EAI_CANCEL --- diff --git a/evdns.c b/evdns.c index 25857a38..e13dbbf5 100644 --- 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;