]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Fix unintended "wait forever" behavior with zero timeouts [#976].
authorBob Halley <halley@dnspython.org>
Sat, 5 Aug 2023 20:35:29 +0000 (13:35 -0700)
committerBob Halley <halley@dnspython.org>
Sat, 5 Aug 2023 20:39:40 +0000 (13:39 -0700)
commit52c2dc1bc360d604081e0b981d69dc6c553a7b0a
tree724bf1b968957d71fa0076e30c1f14233944cfa5
parent1d9651c2d5bc565846a12bdbd2a9ccb7ecf46a15
Fix unintended "wait forever" behavior with zero timeouts [#976].

In a few places we did "if timeout:" or "if expiration:" when we
really meant "if timeout is not None:".  This meant that in the zero
timeout case we fell into the "wait forever" path instead of
immediately timing out.  In the case of UDP queries, we'd be waiting
on recvfrom() and if a packet was lost, then the code would never wake
up.

(cherry picked from commit 0c183f10c78941a4e72046d4dcb2ecf20083b398)
dns/_asyncio_backend.py
dns/_trio_backend.py
dns/asyncquery.py
dns/resolver.py