mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 01:16:35 +03:00
Wait on step_done only for reads
Otherwise it gets into an infinite loop.
This commit is contained in:
parent
f15af530fa
commit
91e997ed15
|
@ -246,8 +246,7 @@ class Sender:
|
||||||
self._reading = True
|
self._reading = True
|
||||||
await self._do_read()
|
await self._do_read()
|
||||||
self._reading = False
|
self._reading = False
|
||||||
|
else:
|
||||||
if not self._step_done.is_set():
|
|
||||||
await self._step_done.wait()
|
await self._step_done.wait()
|
||||||
|
|
||||||
def pop_updates(self) -> list[Updates]:
|
def pop_updates(self) -> list[Updates]:
|
||||||
|
@ -271,12 +270,6 @@ class Sender:
|
||||||
self._step_done.set()
|
self._step_done.set()
|
||||||
|
|
||||||
async def _do_write(self) -> None:
|
async def _do_write(self) -> None:
|
||||||
self._step_done.clear()
|
|
||||||
await self._try_fill_write()
|
|
||||||
self._try_timeout_ping()
|
|
||||||
self._step_done.set()
|
|
||||||
|
|
||||||
async def _try_fill_write(self) -> None:
|
|
||||||
if not self._requests:
|
if not self._requests:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user