Skip to main content

forward_inject_to_peer

Function forward_inject_to_peer 

Source
pub(super) async fn forward_inject_to_peer(
    state: &AppState,
    req: &InjectionRequest,
    forwarded_req: &InjectionRequest,
    peer: ForwardPeer<'_>,
) -> ForwardOutcome
Expand description

POSTs forwarded_req to a peer srv and echoes it to the sender if it lands: the one implementation every forwarding tier shares. As three copies, a tier that forgot the echo or passed delivery_tier wrong failed silently and differently from its siblings (docs/reports/REPORT_NETWORK_ARCHITECTURE_DRYNESS_AND_ROBUST_LAN_2026_09_06.md §4).

Delivered means success: true in the body, in every tier. The LAN tier used to accept a body that omitted success, which echoed a delivery confirmation for a message that may never have arrived. A real peer always sends it (InjectionResponse::success has no skip_serializing_if).