mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 09:26:37 +03:00
Fix ConnectionResetError not flagging the socket as disconnected
This commit is contained in:
parent
b0173c3ec2
commit
0cfbf63eaf
|
@ -96,8 +96,9 @@ class TcpClient:
|
|||
try:
|
||||
partial = self._socket.recv(bytes_left)
|
||||
if len(partial) == 0:
|
||||
self.connected = False
|
||||
raise ConnectionResetError(
|
||||
'The server has closed the connection (recv() returned 0 bytes).')
|
||||
'The server has closed the connection.')
|
||||
|
||||
buffer.write(partial)
|
||||
bytes_left -= len(partial)
|
||||
|
|
Loading…
Reference in New Issue
Block a user