Expand description
The rules an endpoint enforces that its own decoder cannot see, named once across the drafts that state them.
§Why these do not live in the codec
A decoder refuses a frame it cannot read. Every rule here is stated about a frame that reads perfectly well — an Object whose properties are legal bytes on a status that forbids properties, a GOAWAY that is a valid GOAWAY and is the second one, a Request ID that is a valid varint and belongs to the other endpoint’s half of the number space. Being an endpoint rather than an observer is what turns each of them into an error, so each is raised on a receive path and never in the decoder.
That placement is deliberate and it has a cost: a caller that reads
crate::dispatch::ErrorCause::Codec to find out which rule a peer broke
sees none of them, because the codec never raised anything.
AboveCodecRule is the other half of that answer.
§Two groups, one enum
What one frame says about itself. Three rules, across six drafts, each
comparing two fields of a single message: properties against a status, a
payload against a status, a stream’s first message type against the set of
types that may open one. They reach here through
Connection::draft_specific_cause, which every draft implements over its own
ConnectionError.
The drafts renamed two of the three and widened one, and none of the three changes altered what is required:
- Properties on a non-Normal status. Drafts 15 and 16 call the block extension headers and drafts 17 through 20 call it properties. Same sentence, same consequence, one rule.
- A bidirectional stream’s opening message. Draft-16 permits exactly two openers and names SUBSCRIBE_NAMESPACE as the second; drafts 17 through 20 permit any message that begins a request stream. The legal set grew, the requirement did not.
- A payload on a status that permits none. Drafts 17 through 20 only,
and the one of the three the drafts state without a close — see
AboveCodecRule::PayloadOnStatusDatagram.
What a message says about the session it arrived in. The rest, across
all the drafts, each comparing a message against state this endpoint
has been keeping: a Request ID against the sequence the peer’s own ids
follow, a GOAWAY against whether one has already arrived, a Track Alias
against the track it already names, an Object’s Location against the one the
track ended at. They reach here through EndpointError::fault, which every
draft implements over its own EndpointError.
No frame carries the fact that decides any of them, so no decoder built for any draft could refuse one — the same reason the first group is here, one layer further out.
§Which draft states which is not asked here
It is answered per draft, beside the variant whose doc comment quotes that
draft’s own sentence — the same division of labour
Connection::codec_session_error_code already has for the decoder’s errors.
A rule named here on ten drafts and not on the other four is not a claim
that the other four permit it; it is a claim that this build enforces it
where the text says to.
§And a second enum, for the rules the decoder did refuse
CodecRule is at the foot of this file and is the other half of the same
job. Everything above is a rule no decoder could have caught; everything
there is one a decoder caught and nothing carried the draft’s own sentence
for. The two are kept apart because they are two kinds of evidence — see
that enum’s own doc — and they share this file for one reason:
scripts/check-drafts.py rule 8 reads RuleCitation rows out of this
path, so a citation written anywhere else is a citation nothing checks.
Structs§
- Rule
Citation - One draft’s own words for one rule: the sentence, the section it sits in, and what that draft calls the code it answers the rule with.
Enums§
- Above
Codec Rule - A rule a peer broke that no decoder could have caught.
- Codec
Rule - A rule a peer broke that the negotiated draft’s decoder did refuse, named once across the drafts that state it.
- Draft
Specific Cause - What one of a draft’s own
ConnectionErrorvariants is — the ones outside the ten every draft shares. - Endpoint
Fault - Whose doing one of a draft’s
EndpointErrorvariants is.
Constants§
- ALIAS_
07 🔒 - ALIAS_
10 🔒 - ALIAS_
12 🔒 - ALIAS_
14 🔒 - ALIAS_
15 🔒 - ALIAS_
17 🔒 - ALIAS_
18 🔒 - BIDI_
OPENER_ 🔒16 - BIDI_
OPENER_ 🔒17 - CEILING_
07 🔒 - CEILING_
08 🔒 - CEILING_
10 🔒 - CEILING_
11 🔒 - CEILING_
12 🔒 - CEILING_
13 🔒 - CEILING_
14 🔒 - CEILING_
16 🔒 - END_
GROUP_ 🔒WRAP_ 18 - END_
GROUP_ 🔒WRAP_ 20 - END_
OF_ 🔒TRACK_ 08 - END_
OF_ 🔒TRACK_ 11 - END_
OF_ 🔒TRACK_ OBJECT_ ID - EXTENSIONS_
ON_ 🔒NONEXISTENT_ 11 - EXTENSIONS_
ON_ 🔒NONEXISTENT_ 14 - EXTENSION_
HEADERS_ 🔒ON_ STATUS - FETCH_
TYPE_ 🔒14 - FETCH_
TYPE_ 🔒15 - FILTER_
PARAMETER_ 🔒15 - FILTER_
TYPE_ 🔒14 - FILTER_
TYPE_ 🔒15 - FIRST_
RESPONSE 🔒 - GOAWAY_
AT_ 🔒SERVER_ 07 - GOAWAY_
URI_ 🔒CLOSE - GOAWAY_
URI_ 🔒MAX_ 11 - GOAWAY_
URI_ 🔒MAX_ 14 - GOAWAY_
URI_ 🔒MAX_ 17 - GOAWAY_
URI_ 🔒TERMINATE - GOAWAY_
URI_ 🔒TERMINATE_ 14 - INVALID_
DATAGRAM_ 🔒TYPE_ 16 - INVALID_
DATAGRAM_ 🔒TYPE_ 20 - INVALID_
STREAM_ 🔒TYPE_ 16 - INVALID_
STREAM_ 🔒TYPE_ 20 - KVP_
FORMATTING_ 🔒11 - KVP_
FORMATTING_ 🔒14 - KVP_
FORMATTING_ 🔒16 - KVP_
VALUE_ 🔒MAX_ 11 - KVP_
VALUE_ 🔒MAX_ 16 - MAX_
ID_ 🔒07 - MAX_
ID_ 🔒11 - MAX_
ID_ 🔒14 - MAX_
ID_ 🔒16 - MIXED_
PREFERENCE_ 🔒07 - MIXED_
PREFERENCE_ 🔒11 - OBJECT_
ID_ 🔒WRAP - PARAMETER_
LENGTH 🔒 - PARAMETER_
SCOPE 🔒 - PROPERTIES_
ON_ 🔒STATUS - REASON_
PHRASE_ 🔒MAX_ 11 - REASON_
PHRASE_ 🔒MAX_ 14 - REASON_
PHRASE_ 🔒MAX_ 15 - REDIRECT_
TRACK_ 🔒NAME - REDIRECT_
URI_ 🔒AT_ SERVER - REPEATED_
GOAWAY_ 🔒07 - REPEATED_
GOAWAY_ 🔒08 - REPEATED_
GOAWAY_ 🔒10 - REPEATED_
GOAWAY_ 🔒14 - REPEATED_
GOAWAY_ 🔒16 - REPEATED_
GOAWAY_ 🔒17 - REPEATED_
GOAWAY_ 🔒18 - REPEATED_
GOAWAY_ 🔒21 - REQUEST_
ID_ 🔒11 - REQUEST_
ID_ 🔒14 - REQUEST_
ID_ 🔒15 - REQUEST_
ID_ 🔒17 - REQUIRED_
REQUEST_ 🔒ID_ DELTA - STATE_
NOTIFY 🔒 - SUBSCRIBE_
AFTER_ 🔒CANCEL - SUBSCRIBE_
ID_ 🔒UNIQUE - TOO_
MANY_ 🔒UPDATES - TRACK_
NAME_ 🔒MAX_ 11 - TRACK_
NAME_ 🔒MAX_ 14 - TRACK_
NAME_ 🔒MAX_ 15 - TRACK_
NAME_ 🔒MAX_ 16 - TRACK_
PROPERTIES 🔒 - UNKNOWN_
PARAMETER_ 🔒16 - UNKNOWN_
PARAMETER_ 🔒17 - UPDATE_
WRONG_ 🔒12 - UPDATE_
WRONG_ 🔒14 - UPDATE_
WRONG_ 🔒15 - UPDATE_
WRONG_ 🔒16 - UPDATE_
WRONG_ 🔒19