Skip to main content

pipe_data_passthrough

Function pipe_data_passthrough 

Source
async fn pipe_data_passthrough(
    recv: PeekedRecv,
    send: SendStream,
    side: ProxySide,
    key: StreamKey,
    requests: Receiver<StreamCommand>,
    ctx: &ForwardCtx,
) -> Result<(), ProxyError>
Expand description

Forward a unidirectional data stream without interpreting it.

A stack buffer, a write and one boxed stop-watcher per stream — no parser and still no per-object work. This is the path every session takes when nothing is observing and no hook declared object or stream interest.

The watcher is the single heap allocation this function makes, and it is made lazily on the first select! iteration (see StopWatcher), once per forwarded stream. Counters has no allocation field, so interest_none.rs’s whole-struct Counters::default() comparison cannot see this cost — this sentence is the only gate it has, which is why it is stated rather than quietly dropped.