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:
parent
b51c2939a8
commit
4a689c7d57
|
@ -204,6 +204,10 @@ 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:
|
||||||
|
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]
|
del self.mplex_conn.streams[self.stream_id]
|
||||||
|
|
||||||
# TODO deadline not in use
|
# TODO deadline not in use
|
||||||
|
|
Loading…
Reference in New Issue
Block a user