Problem
http1::Decoder gives no predicate for "am I currently inside a response/request body." The only way to ask is eof(), which answers by returning an error or not — i.e. the only way to find out is to tell the decoder the connection closed and see what it says.
Why it matters
Perry's P11 lane (perry-http-client, the perry CLI's blocking HTTP/1 client) needs this on every connection: when a read() returns zero, the caller has to decide whether that's a legal end of body (Connection: close, body ends at EOF) or a truncated response cut off mid-message. Today the only mechanism is calling eof() and inspecting whether it errors, so the decision and the query are fused into one call — there is no way to check first and choose different handling (retry, hard-fail, log a specific diagnosis) before committing to the EOF path.
What would fix it
A Decoder::wants_step()-style predicate (the same shape turnloop#50 proposes for the zero-consume Event::End case), or an explicit Decoder::in_body() / Decoder::is_mid_message() query that answers from current state without needing to feed EOF first.
Problem
http1::Decodergives no predicate for "am I currently inside a response/request body." The only way to ask iseof(), which answers by returning an error or not — i.e. the only way to find out is to tell the decoder the connection closed and see what it says.Why it matters
Perry's P11 lane (
perry-http-client, theperryCLI's blocking HTTP/1 client) needs this on every connection: when aread()returns zero, the caller has to decide whether that's a legal end of body (Connection: close, body ends at EOF) or a truncated response cut off mid-message. Today the only mechanism is callingeof()and inspecting whether it errors, so the decision and the query are fused into one call — there is no way to check first and choose different handling (retry, hard-fail, log a specific diagnosis) before committing to the EOF path.What would fix it
A
Decoder::wants_step()-style predicate (the same shape turnloop#50 proposes for the zero-consumeEvent::Endcase), or an explicitDecoder::in_body()/Decoder::is_mid_message()query that answers from current state without needing to feed EOF first.