Codebase list python-msgpack / f38c1a3
Fix Unpacker.feed() drops unused data in buffer. (#289) Fixes #287 INADA Naoki authored 6 years ago GitHub committed 6 years ago
1 changed file(s) with 7 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
288288 view = _get_data_from_buffer(next_bytes)
289289 if (len(self._buffer) - self._buff_i + len(view) > self._max_buffer_size):
290290 raise BufferFull
291 del self._buffer[:self._buff_i]
292 self._buff_i = 0
291
292 # Strip buffer before checkpoint before reading file.
293 if self._buf_checkpoint > 0:
294 del self._buffer[:self._buf_checkpoint]
295 self._buff_i -= self._buf_checkpoint
296 self._buf_checkpoint = 0
297
293298 self._buffer += view
294299
295300 def _consume(self):