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:
Sara Dickinson 2017-03-17 17:16:14 +00:00
parent 1d4e3dd790
commit dd76132a92
1 changed files with 7 additions and 1 deletions

View File

@ -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++;