Skip to content

Commit

Permalink
Merge pull request #90 from pufit/dev
Browse files Browse the repository at this point in the history
Fix a `bytearray index out of range` error while reading a string.
  • Loading branch information
long2ice authored Mar 15, 2024
2 parents 229a3fb + c49ffce commit 4a7a06e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions asynch/proto/streams/buffered.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ def _read_one(self):
return packet

async def read_varint(self):
if self.position == self.current_buffer_size:
self._reset_buffer()
await self._read_into_buffer()
packets = bytearray()
while True:
if self.position == self.current_buffer_size:
self._reset_buffer()
await self._read_into_buffer()
packet = self._read_one()
packets.append(packet)
if packet < 0x80:
Expand Down

0 comments on commit 4a7a06e

Please sign in to comment.