From: Wouter Wijngaards Date: Tue, 16 Sep 2014 13:08:27 +0000 (+0000) Subject: - Fix tcp timer waiting list removal code. X-Git-Tag: release-1.5.0rc1~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a7193a016054d32f7950fd01bc24be291efc4b2;p=thirdparty%2Funbound.git - Fix tcp timer waiting list removal code. git-svn-id: file:///svn/unbound/trunk@3222 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 4b3fbf08a..3166146aa 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,3 +1,6 @@ +16 September 2014: Wouter + - Fix tcp timer waiting list removal code. + 15 September 2014: Wouter - Fix unit test for CDS typecode. diff --git a/services/outside_network.c b/services/outside_network.c index 33ae79fb8..986c53dd8 100644 --- a/services/outside_network.c +++ b/services/outside_network.c @@ -81,6 +81,10 @@ static void serviced_tcp_initiate(struct serviced_query* sq, sldns_buffer* buff) static int randomize_and_send_udp(struct pending* pend, sldns_buffer* packet, int timeout); +/** remove waiting tcp from the outnet waiting list */ +static void waiting_list_remove(struct outside_network* outnet, + struct waiting_tcp* w); + int pending_cmp(const void* key1, const void* key2) { @@ -1100,17 +1104,7 @@ outnet_tcptimer(void* arg) void* cb_arg; if(w->pkt) { /* it is on the waiting list */ - struct waiting_tcp* p=outnet->tcp_wait_first, *prev=NULL; - while(p) { - if(p == w) { - if(prev) prev->next_waiting = w->next_waiting; - else outnet->tcp_wait_first=w->next_waiting; - outnet->tcp_wait_last = prev; - break; - } - prev = p; - p=p->next_waiting; - } + waiting_list_remove(outnet, w); } else { /* it was in use */ struct pending_tcp* pend=(struct pending_tcp*)w->next_waiting;