Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix packet buffer panic caused by large payload (#332)
When packet buffer's payload buffer does not have enough contiguous window left, the ring buffer roll over uses an incorrect size causing the ring buffer pointer not resetting to the head. When the payload enqueued is larger than 1/2 of the payload ring buffer, this bug will cause the slice returned by `PacketBuffer::enqueue` to not match the requested size, and trigger `debug_assert` in debug profile or size mismatch panic in `copy_from_slice` when compiled in release profile.
- Loading branch information