Merge branch 'ibb-fix-races' into 'master'
fix: specific cases in xep-0047 with network race conditions See merge request poezio/slixmpp!179
This commit is contained in:
commit
1e7d7bf8cb
1 changed files with 7 additions and 0 deletions
|
@ -99,6 +99,13 @@ class IBBytestream(object):
|
|||
:returns: All bytes accumulated in the stream.
|
||||
"""
|
||||
result = b''
|
||||
while not self.recv_queue.empty():
|
||||
result += self.recv_queue.get_nowait()
|
||||
if max_data and len(result) > max_data:
|
||||
return result
|
||||
if self.stream_in_closed:
|
||||
return result
|
||||
|
||||
end_future = asyncio.Future()
|
||||
|
||||
def on_close(stream):
|
||||
|
|
Loading…
Reference in a new issue