Merge branch 'bugfix/388-endless-fallback-loop' into release/1.4.1

This commit is contained in:
Willem Toorop 2018-03-05 11:52:36 +01:00
commit fd5e0cdc02
3 changed files with 7 additions and 0 deletions

View File

@ -134,6 +134,7 @@ netreq_reset(getdns_network_req *net_req)
uint8_t *buf;
/* variables that need to be reset on reinit
*/
net_req->first_upstream = NULL;
net_req->unbound_id = -1;
_getdns_netreq_change_state(net_req, NET_REQ_NOT_SENT);
if (net_req->query_id_registered) {

View File

@ -2296,8 +2296,13 @@ upstream_find_for_netreq(getdns_network_req *netreq)
return STUB_TRY_AGAIN_LATER;
return -1;
}
if (upstream == netreq->first_upstream)
continue;
netreq->transport_current = i;
netreq->upstream = upstream;
if (!netreq->first_upstream)
netreq->first_upstream = upstream;
netreq->keepalive_sent = 0;
DEBUG_STUB("%s %-35s: MSG: %p found upstream %p with transport %d, fd: %d\n", STUB_DEBUG_SCHEDULE, __FUNC__, (void*)netreq, (void *)upstream, (int)netreq->transports[i], fd);

View File

@ -221,6 +221,7 @@ typedef struct getdns_network_req
getdns_redirects_t follow_redirects;
/* For stub resolving */
struct getdns_upstream *first_upstream;
struct getdns_upstream *upstream;
int fd;
getdns_transport_list_t transports[GETDNS_TRANSPORTS_MAX];