Skip to main content

check_ranges

Function check_ranges 

Source
fn check_ranges(message: &ControlMessage) -> Result<(), CodecError>
Expand description

Refuse a FETCH whose range ends before it starts.

Section 9.16.3: “Fetch specifies an inclusive range of Objects starting at Start Location and ending at End Location. End Location MUST specify the same or a larger Location than Start Location for Standalone and Absolute Joining Fetches.” A Joining Fetch names no explicit range - it is computed from the subscription it joins - so only a standalone range is checked here.

SUBSCRIBE is not checked here. Its filter moved into the parameters on this draft, and this codec carries a parameter value as the bytes it arrived as, so the start and end are not fields this function can see.

Applied on both sides. A range that ends before it starts selects nothing, and the peer’s only recourse is an error response or a session close, so writing one is not a way to ask for anything.