From 9d1ad9d1100b636ef777ac6a52b0066673f0f8a0 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 15 Oct 2014 23:32:33 +0200 Subject: [PATCH] Respond correctly to non-blocking events --- src/stub.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/stub.c b/src/stub.c index fed751e0..d27a8855 100644 --- a/src/stub.c +++ b/src/stub.c @@ -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 */