From 50157aa070bde7e312675fe209af548ca266cd1b Mon Sep 17 00:00:00 2001 From: Alex Haynes Date: Wed, 28 Nov 2018 21:19:54 -0500 Subject: [PATCH] updated logic to avoid conflicts in next stream id selection --- stream_muxer/mplex/mplex.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stream_muxer/mplex/mplex.py b/stream_muxer/mplex/mplex.py index 21ec0d6b..a65ecb22 100644 --- a/stream_muxer/mplex/mplex.py +++ b/stream_muxer/mplex/mplex.py @@ -23,7 +23,7 @@ class Mplex(IMuxedConn): self.buffers = {} self.stream_queue = asyncio.Queue() - self._next_id = 0 + self._next_id = 0 if self.initiator else 1 self.data_buffer = bytearray() # The initiator need not read upon construction time. @@ -37,7 +37,7 @@ class Mplex(IMuxedConn): :return: next available stream id for the connection """ next_id = self._next_id - self._next_id += 1 + self._next_id += 2 return next_id def close(self):