]> git.ipfire.org Git - thirdparty/bind9.git/commit
fix handling of TCP timeouts
authorEvan Hunt <each@isc.org>
Tue, 16 May 2023 22:35:00 +0000 (15:35 -0700)
committerEvan Hunt <each@isc.org>
Fri, 26 May 2023 07:41:01 +0000 (00:41 -0700)
commit0e800467ee0eb0b8b92531968ec4e7be55222490
treed13bca758dd87b3b80f1c57a900fa3bf3bdf6418
parent2f75605698b94a643df6c7891dc334cc3538c7ee
fix handling of TCP timeouts

when a TCP dispatch times out, we call tcp_recv() with a result
value of ISC_R_TIMEDOUT; this cancels the oldest dispatch
entry in the dispatch's active queue, plus any additional entries
that have waited longer than their configured timeouts. if, at
that point, there were more dispatch entries still on the active
queue, it resumes reading, but until now it failed to restart
the timer.

this has been corrected: we now calculate a new timeout
based on the oldest dispatch entry still remaining.  this
requires us to initialize the start time of each dispatch entry
when it's first added to the queue.

in order to ensure that the handling of timed-out requests is
consistent, we now calculate the runtime of each dispatch
entry based on the same value for 'now'.

incidentally also fixed a compile error that turned up when
DNS_DISPATCH_TRACE was turned on.
lib/dns/dispatch.c