]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist: Properly handle buffering in the "max read IOs" test 15462/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 24 Apr 2025 11:45:14 +0000 (13:45 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Thu, 24 Apr 2025 12:16:47 +0000 (14:16 +0200)
commit92f2cb5dcb867186fab7a7a816d5f5eb384a1c9a
treecc9c1b375115f39a3c5d156b50334472d9538a3f
parent5f92d0c32db7f47664eb4f983641f3e0c8334453
dnsdist: Properly handle buffering in the "max read IOs" test

It is completely possible that the entire query will be sent before
the dnsdist process notices that the number of IOs is larger than the
limit, closes the connection, and the test process is notified of the
socket being closed (for example because of buffering).
So we need to detect that the connection is closed during our attempt
to read the response, rather than while we are sending the query.
This commit does that, and also introduces a slight delay after sending
each byte of the query, increasing the likelihood of the dnsdist process
actually reading the query bytes one by one.
regression-tests.dnsdist/test_TCPLimits.py