Skip to main content

validate_ranges

Function validate_ranges 

Source
pub fn validate_ranges(ranges: &[ByteRange]) -> Result<(), &'static str>
Expand description

Check a range list: 1 to MAX_RANGES_PER_MESSAGE ranges, none empty, none whose end overflows a u64, sorted by offset and not overlapping (adjacent is fine). A message that fails is answered INVALID_REQUEST (or dropped, when it came from the server).