mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +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()
|
||||
|
||||
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
|
||||
def set_deadline(self, ttl: int) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user