From c147f4a3c3f243051bc5b4381984a8a2b91042e9 Mon Sep 17 00:00:00 2001 From: "v.chesnokov" Date: Sat, 11 Apr 2020 23:33:33 +0300 Subject: [PATCH] Fixed a problem with proxy connection: [Errno 115] Operation now in progress --- telethon/network/connection/connection.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/telethon/network/connection/connection.py b/telethon/network/connection/connection.py index d7190c73..d6b9ea16 100644 --- a/telethon/network/connection/connection.py +++ b/telethon/network/connection/connection.py @@ -65,7 +65,7 @@ class Connection(abc.ABC): else: s.set_proxy(*self._proxy) - s.setblocking(False) + s.settimeout(timeout) await asyncio.wait_for( self._loop.sock_connect(s, address), timeout=timeout, @@ -78,14 +78,14 @@ class Connection(abc.ABC): 'without the SSL module being available' ) - s.settimeout(timeout) s = ssl_mod.wrap_socket( s, do_handshake_on_connect=True, ssl_version=ssl_mod.PROTOCOL_SSLv23, ciphers='ADH-AES256-SHA' ) - s.setblocking(False) + + s.setblocking(False) self._reader, self._writer = \ await asyncio.open_connection(sock=s, loop=self._loop)