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,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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user