Fix timeout issue with async stub TCP pipelining

This commit is contained in:
Willem Toorop 2014-10-19 08:08:45 +02:00
parent fc6e583b4b
commit fa02e3ae70
1 changed files with 14 additions and 7 deletions

View File

@ -333,13 +333,20 @@ stub_cleanup(getdns_network_req *netreq)
} }
static void static void
upstream_cleanup(getdns_upstream *upstream) upstream_erred(getdns_upstream *upstream)
{ {
while (upstream->write_queue) getdns_network_req *netreq;
stub_cleanup(upstream->write_queue);
while (upstream->netreq_by_query_id.count) while ((netreq = upstream->write_queue)) {
stub_cleanup((getdns_network_req *) stub_cleanup(netreq);
getdns_rbtree_first(&upstream->netreq_by_query_id)); priv_getdns_check_dns_req_complete(netreq->owner);
}
while (upstream->netreq_by_query_id.count) {
netreq = (getdns_network_req *)
getdns_rbtree_first(&upstream->netreq_by_query_id);
stub_cleanup(netreq);
priv_getdns_check_dns_req_complete(netreq->owner);
}
close(upstream->fd); close(upstream->fd);
upstream->fd = -1; upstream->fd = -1;
} }
@ -607,7 +614,7 @@ upstream_read_cb(void *userarg)
return; return;
case STUB_TCP_ERROR: case STUB_TCP_ERROR:
upstream_cleanup(upstream); upstream_erred(upstream);
return; return;
default: default: