]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Close QUIC sync and trio sockets when done.
authorBob Halley <halley@dnspython.org>
Thu, 7 Mar 2024 13:15:34 +0000 (05:15 -0800)
committerBob Halley <halley@dnspython.org>
Thu, 7 Mar 2024 13:16:05 +0000 (05:16 -0800)
(cherry picked from commit 11b09df714b9d159a47cc9fe9e3934ac32646f9a)

dns/quic/_sync.py
dns/quic/_trio.py

index 120cb5f329c779a6556143339e536d1443bf3ddf..9cc4c3227a8ea82c3dff7f8967fec610350137f1 100644 (file)
@@ -140,6 +140,7 @@ class SyncQuicConnection(BaseQuicConnection):
         finally:
             with self._lock:
                 self._done = True
+            self._socket.close()
             # Ensure anyone waiting for this gets woken up.
             self._handshake_complete.set()
 
index 35e36b982f71df873fd5ac70edd46179a8091ab4..675ec16624ecd2f9bd13b29cffd1b913676701ff 100644 (file)
@@ -115,6 +115,7 @@ class TrioQuicConnection(AsyncQuicConnection):
                     await self._socket.send(datagram)
         finally:
             self._done = True
+            self._socket.close()
             self._handshake_complete.set()
 
     async def _handle_events(self):