]> 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:35:29 +0000 (13:35 -0700)
commit0c183f10c78941a4e72046d4dcb2ecf20083b398
tree1b7f6085f1e3e2b29d4d7f9a7c731d26b1d0b556
parent349545a05151acd389e06f28975b4f3e4f426977
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.
dns/_asyncio_backend.py
dns/_trio_backend.py
dns/asyncquery.py
dns/resolver.py