Skip to content

Commit ee119e2

Browse files
authored
dupclicate socket (#282)
* dupclicate socket * cleanup
1 parent 3c23879 commit ee119e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

aiomysql/connection.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,8 @@ def _request_authentication(self):
685685
if raw_sock is None:
686686
raise RuntimeError("Transport does not expose socket instance")
687687

688+
raw_sock = raw_sock.dup()
689+
self._writer.transport.close()
688690
# MySQL expects TLS negotiation to happen in the middle of a
689691
# TCP connection not at start. Passing in a socket to
690692
# open_connection will cause it to negotiate TLS on an existing

0 commit comments

Comments
 (0)