expression
HTTP/2: distinguish requests after GOAWAY
A server GOAWAY boundary identifies client streams above its last-stream ID as not processed by that server. Earlier streams may have been processed; the application must not assume they failed. The labels are evidence for retry decisions, not permission to replay arbitrary requests. Expected stdout (not executed): 1: may have been processed 3: may have been processed 5: not processed by peer Common mistake: Blindly retrying every in-flight write on connection shutdown.
Formal Syntax & Structure
rust syntaxrust
stream_id > last_stream_idWorking Example
Example Snippetrust
fn main() { let last_stream_id = 3; for id in [1, 3, 5] { let state = if id > last_stream_id { "not processed by peer" } else { "may have been processed" }; println!("{id}: {state}"); }}