mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +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:
|
try:
|
||||||
partial = self._socket.recv(bytes_left)
|
partial = self._socket.recv(bytes_left)
|
||||||
if len(partial) == 0:
|
if len(partial) == 0:
|
||||||
|
self.connected = False
|
||||||
raise ConnectionResetError(
|
raise ConnectionResetError(
|
||||||
'The server has closed the connection (recv() returned 0 bytes).')
|
'The server has closed the connection.')
|
||||||
|
|
||||||
buffer.write(partial)
|
buffer.write(partial)
|
||||||
bytes_left -= len(partial)
|
bytes_left -= len(partial)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user