mirror of https://github.com/getdnsapi/getdns.git
Implement round robin for UDP. Not sure this is the best option though. Noticed it results in more timeouts if one resolver isn't responding because it is retried more frequently. Willem - please review.
This commit is contained in:
parent
1d4e3dd790
commit
dd76132a92
|
@ -1370,7 +1370,13 @@ stub_udp_read_cb(void *userarg)
|
|||
return;
|
||||
}
|
||||
netreq->response_len = read;
|
||||
if (!dnsreq->context->round_robin_upstreams)
|
||||
dnsreq->upstreams->current_udp = 0;
|
||||
else {
|
||||
dnsreq->upstreams->current_udp+=GETDNS_UPSTREAM_TRANSPORTS;
|
||||
if (dnsreq->upstreams->current_udp >= dnsreq->upstreams->count)
|
||||
dnsreq->upstreams->current_udp = 0;
|
||||
}
|
||||
netreq->debug_end_time = _getdns_get_time_as_uintt64();
|
||||
netreq->state = NET_REQ_FINISHED;
|
||||
upstream->udp_responses++;
|
||||
|
|
Loading…
Reference in New Issue