circular::Buffer is possible to become position() == 0 and available_data() == 0 right after a consume call.
/// advances the position tracker
///
/// if the position gets past the buffer's half,
/// this will call `shift()` to move the remaining data
/// to the beginning of the buffer
pub fn consume(&mut self, count: usize) -> usize {
This is causing an early EOF in the following demo, when the buffer is precisely consumed to zero.
https://github.com/rusticata/pcap-parser/blob/a13bd1db2cf076969c2abb36c0d01a2b510c794a/src/capture_pcap.rs#L140-L145
circular::Buffer
is possible to becomeposition() == 0
andavailable_data() == 0
right after aconsume
call.This is causing an early EOF in the following demo, when the buffer is precisely consumed to zero.
a workaround for me would be