From: Bob Halley Date: Wed, 19 Aug 2020 15:24:11 +0000 (-0700) Subject: fix timeout computation in async send_tcp() X-Git-Tag: v2.1.0rc1~66 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9326311ba4e69984c6acc7f7376c16637ec98ca;p=thirdparty%2Fdnspython.git fix timeout computation in async send_tcp() --- diff --git a/dns/asyncquery.py b/dns/asyncquery.py index b7926480..8a10daeb 100644 --- a/dns/asyncquery.py +++ b/dns/asyncquery.py @@ -294,7 +294,7 @@ async def send_tcp(sock, what, expiration=None): # onto the net tcpmsg = struct.pack("!H", l) + what sent_time = time.time() - await sock.sendall(tcpmsg, expiration) + await sock.sendall(tcpmsg, _timeout(expiration, sent_time)) return (len(tcpmsg), sent_time)