mirror of https://github.com/getdnsapi/getdns.git
Respond correctly to non-blocking events
This commit is contained in:
parent
124de13caa
commit
9d1ad9d110
|
@ -288,6 +288,9 @@ stub_resolve_read_cb(void *userarg)
|
|||
dns_req->loop->vmt->clear(dns_req->loop, &netreq->event);
|
||||
|
||||
read = recvfrom(netreq->udp_fd, pkt, pkt_len, 0, NULL, NULL);
|
||||
if (read == -1 && (errno = EAGAIN || errno == EWOULDBLOCK))
|
||||
return;
|
||||
|
||||
if (read < GLDNS_HEADER_SIZE)
|
||||
return; /* Not DNS */
|
||||
|
||||
|
|
Loading…
Reference in New Issue