Avoid spurious "Invalid Preserves tag 0" message when server quits before sending anything

This commit is contained in:
Tony Garnock-Jones 2023-10-19 12:40:38 +02:00
parent 2bf2e29dc2
commit 60e6c6badf
1 changed files with 4 additions and 1 deletions

View File

@ -58,7 +58,10 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut buf = [0; 131072];
let turn_size = {
stream.read(&mut buf)?;
let n = stream.read(&mut buf)?;
if n == 0 {
return Ok(());
}
let mut src = BytesBinarySource::new(&buf);
src.packed_iovalues().demand_next(false)?;
src.index