Skip to main content

propagate_reset

Function propagate_reset 

Source
async fn propagate_reset(
    err: &ProxyError,
    send: &mut SendStream,
    st: &mut StreamState<'_>,
    side: ProxySide,
    ctx: &ForwardCtx,
    report: &Reporter<'_>,
)
Expand description

Mirror a source-side read failure onto the destination stream.

If the source peer sent RESET_STREAM, the destination stream must be reset with the same application code. Letting the SendStream drop instead sends a FIN — quinn’s SendStream::drop calls finish() — so the far end would see an abandoned, truncated stream as one that ended cleanly, and the peer’s code would never arrive.

Every other read failure now resets the destination too, with a synthesized code from synthesized_reset_code, reported as ActionApplied { effect: StreamReset { code, code_defined } }. Before this the destination was dropped, and quinn’s finish()-on-drop made a truncated group look complete to the peer.

Except on a control stream. Synthesizing a reset there is a session-level protocol violation on every draft, so the destination still ends with a FIN and the truncation is reported as Impairment { ControlStreamTruncated } instead. ProxySide does not carry the control/data distinction, so StreamState does.

Anything the hook deferred is drained ignoring release times before the reset, which is what keeps “data, then reset” true.