[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] evdns_cancel_request may not fully cancel



Hello,

I've run into an issue in my codebase where it appears evdns is callingÂ
a callback on a request that I've canceled.

This is an issue for me, because once I call evdns_cancel_request, I'veÂ
also freed my own context associated with the request (i.e. theÂ
void* passed back by libevent to the callback).

If the result was always DNS_ERR_CANCEL on a cancelled request,Â
this wouldn't be a problem, because I could abort. It seems that in someÂ
cases the result could be DNS_ERR_NONE if the callback wasÂ
already pending


I believe this code may be to blame?

void
evdns_cancel_request(struct evdns_base *base, struct evdns_request *handle)
    ...

EVDNS_LOCK(base);
if (handle->pending_cb) {
EVDNS_UNLOCK(base);
return;
}
 Â
    ...
}

Is this expected?

Thanks!
Erik