mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
Fix error when reset
If `Mplex` is cleanup first, `MplexStream.reset` possibly fails because `Mplex.streams` is set to `None` in `cleanup`.
This commit is contained in:
@ -204,7 +204,11 @@ class MplexStream(IMuxedStream):
|
|||||||
self.event_remote_closed.set()
|
self.event_remote_closed.set()
|
||||||
|
|
||||||
async with self.mplex_conn.streams_lock:
|
async with self.mplex_conn.streams_lock:
|
||||||
del self.mplex_conn.streams[self.stream_id]
|
if (
|
||||||
|
self.mplex_conn.streams is not None
|
||||||
|
and self.stream_id in self.mplex_conn.streams
|
||||||
|
):
|
||||||
|
del self.mplex_conn.streams[self.stream_id]
|
||||||
|
|
||||||
# TODO deadline not in use
|
# TODO deadline not in use
|
||||||
def set_deadline(self, ttl: int) -> bool:
|
def set_deadline(self, ttl: int) -> bool:
|
||||||
|
|||||||
Reference in New Issue
Block a user