mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
When retransmitting a timed-out DNS request, pick a fresh nameserver.
Otherwise, requests initially sent to a failing nameserver would stay there indefinitely, even if other nameservers would work. Fix for sourceforge bug 3518439
This commit is contained in:
parent
d873d6787c
commit
3d9e52ac56
4
evdns.c
4
evdns.c
@ -2161,9 +2161,13 @@ evdns_request_timeout_callback(evutil_socket_t fd, short events, void *arg) {
|
||||
request_finished(req, &REQ_HEAD(req->base, req->trans_id), 1);
|
||||
} else {
|
||||
/* retransmit it */
|
||||
struct nameserver *new_ns;
|
||||
log(EVDNS_LOG_DEBUG, "Retransmitting request %p; tx_count==%d",
|
||||
arg, req->tx_count);
|
||||
(void) evtimer_del(&req->timeout_event);
|
||||
new_ns = nameserver_pick(base);
|
||||
if (new_ns)
|
||||
req->ns = new_ns;
|
||||
evdns_request_transmit(req);
|
||||
}
|
||||
EVDNS_UNLOCK(base);
|
||||
|
Loading…
x
Reference in New Issue
Block a user