]> git.ipfire.org Git - thirdparty/knot-resolver.git/commit
selection: cap the timeout value when probing a random server
authorŠtěpán Balážik <stepan.balazik@nic.cz>
Wed, 17 Mar 2021 14:53:33 +0000 (15:53 +0100)
committerTomas Krizek <tomas.krizek@nic.cz>
Fri, 19 Mar 2021 12:25:10 +0000 (13:25 +0100)
commit7bd70e162d44cae62a8b1ac2b09e5b5790ceab8e
tree3c0d0a124aa2946757eb13ab58d08c9c4356e6ab
parentd10fdaa6d89d9887c378cc19f4cd5da15c07d613
selection: cap the timeout value when probing a random server

This patch caps the timeout set on UDP queries to servers chosen in the
EXPLORE phase of the selection algorithm to two times the timeout that
would be set if we were EXPLOITing.

This measns that we no longer spend an unreasonable amount of time
probing servers that are probably dead anyway while ensuring that we do
probe them from time to time to check if they didn't come to life.

If the timeout value is capped and the server fails to respond, we don't
punish the server for it i.e. we don't cache the timeout.
lib/selection.c
lib/selection.h