Skip to main content

check_extensions_against_status

Function check_extensions_against_status 

Source
fn check_extensions_against_status(
    status: Option<u64>,
    extension_headers_len: u64,
) -> Result<(), CodecError>
Expand description

Hold an object to the rule binding extension headers to Object Status.

Draft-14 Section 10.2.1.2: “Any Object may have extension headers except those with Object Status ‘Object Does Not Exist’. If an endpoint receives a non-existent Object containing extension headers it MUST close the session with a PROTOCOL_VIOLATION.”

The rule names one status and no others, so extensions beside End of Group or End of Track stay legal and are left alone here. The reasoning behind the exception is that an object nobody has cannot carry metadata about itself: a relay that forwards the extensions of a non-existent object is inventing provenance for something that was never published.

All three carriers reach this, in both directions — subgroup streams, fetch streams and status datagrams each pair a status with an extension block.

Reported under CodecError::ExtensionsOnNonExistentObject, which is this rule and nothing else. It was CodecError::InvalidField until now, shared with a dozen unrelated malformations the draft does not answer with a close, which left a caller unable to act on the sentence above.