diff --git a/draft-ietf-quic-http.md b/draft-ietf-quic-http.md index 46ddd10215..5d92afc256 100644 --- a/draft-ietf-quic-http.md +++ b/draft-ietf-quic-http.md @@ -337,7 +337,7 @@ If the stream header indicates a stream type which is not supported by the recipient, the remainder of the stream cannot be consumed as the semantics are unknown. Recipients of unknown stream types MAY trigger a QUIC STOP_SENDING frame with an error code of HTTP_UNKNOWN_STREAM_TYPE, but MUST NOT consider such -streams to be an error of any kind. +streams to be a connection error of any kind. Implementations MAY send stream types before knowing whether the peer supports them. However, stream types which could modify the state or semantics of @@ -377,7 +377,7 @@ remaining data on this stream consists of HTTP/3 frames, as defined in described in {{server-push}}. Only servers can push; if a server receives a client-initiated push stream, this -MUST be treated as a stream error of type HTTP_WRONG_STREAM_DIRECTION. +MUST be treated as a connection error of type HTTP_WRONG_STREAM_DIRECTION. ~~~~~~~~~~ drawing 0 1 2 3 @@ -518,7 +518,7 @@ frame of the stream, creating a dependency on an existing element. In order to ensure that prioritization is processed in a consistent order, any subsequent PRIORITY frames for that request MUST be sent on the control stream. A PRIORITY frame received after other frames on a request stream MUST be treated -as a stream error of type HTTP_UNEXPECTED_FRAME. +as a connection error of type HTTP_UNEXPECTED_FRAME. If, by the time a new request stream is opened, its priority information has already been received via the control stream, the PRIORITY frame @@ -592,23 +592,28 @@ of the associated Element ID fields. Note that unlike in {{!RFC7540}}, the root of the tree cannot be referenced using a Stream ID of 0, as in QUIC stream 0 carries a valid HTTP request. The -root of the tree cannot be reprioritized. A PRIORITY frame sent on a request -stream with the Prioritized Element Type set to any value other than `11` or -which expresses a dependency on a request with a greater Stream ID than the -current stream MUST be treated as a stream error of type HTTP_MALFORMED_FRAME. -Likewise, a PRIORITY frame sent on a control stream with the Prioritized Element -Type set to `11` MUST be treated as a connection error of type -HTTP_MALFORMED_FRAME. A PRIORITY frame with Empty bits not set to zero MAY be -treated as a connection error of type HTTP_MALFORMED_FRAME. - -When a PRIORITY frame claims to reference a request, the associated ID MUST -identify a client-initiated bidirectional stream. A server MUST treat receipt -of a PRIORITY frame identifying a stream of any other type as a connection error -of type HTTP_MALFORMED_FRAME. +root of the tree cannot be reprioritized. + +The PRIORITY frame can express relationships which might not be permitted based +on the stream on which it is sent or its position in the stream. These +situations MUST be treated as a connection error of type HTTP_MALFORMED_FRAME. +The following situations are examples of invalid PRIORITY frames: + +- A PRIORITY frame sent on a request stream with the Prioritized Element Type + set to any value other than `11` +- A PRIORITY frame sent on a request stream which expresses a dependency on a + request with a greater Stream ID than the current stream +- A PRIORITY frame sent on a control stream with the Prioritized Element Type + set to `11` +- A PRIORITY frame which claims to reference a request, but the associated ID + does not identify a client-initiated bidirectional stream + +A PRIORITY frame with Empty bits not set to zero MAY be treated as a connection +error of type HTTP_MALFORMED_FRAME. A PRIORITY frame that references a non-existent Push ID, a Placeholder ID greater than the server's limit, or a Stream ID the client is not yet permitted -to open MUST be treated as an HTTP_LIMIT_EXCEEDED error. +to open MUST be treated as a connection error of type HTTP_LIMIT_EXCEEDED. A PRIORITY frame received on any stream other than a request or control stream MUST be treated as a connection error of type HTTP_WRONG_STREAM. @@ -637,7 +642,7 @@ stream. A QUIC RESET_STREAM frame SHOULD be used instead to abort transmission of the server push response. A CANCEL_PUSH frame is sent on the control stream. Receiving a CANCEL_PUSH -frame on a stream other than the control stream MUST be treated as a stream +frame on a stream other than the control stream MUST be treated as a connection error of type HTTP_WRONG_STREAM. ~~~~~~~~~~ drawing diff --git a/draft-ietf-quic-qpack.md b/draft-ietf-quic-qpack.md index 7707175979..d91d884873 100644 --- a/draft-ietf-quic-qpack.md +++ b/draft-ietf-quic-qpack.md @@ -268,10 +268,10 @@ entries. For a header block with no references to the dynamic table, the Required Insert Count is zero. If the decoder encounters a header block with a Required Insert Count value -larger than defined above, it MAY treat this as a stream error of type +larger than defined above, it MAY treat this as a connection error of type HTTP_QPACK_DECOMPRESSION_FAILED. If the decoder encounters a header block with a Required Insert Count value smaller than defined above, it MUST treat this as -a stream error of type HTTP_QPACK_DECOMPRESSION_FAILED as prescribed in +a connection error of type HTTP_QPACK_DECOMPRESSION_FAILED as prescribed in {{invalid-references}}. When the Required Insert Count is zero, the frame contains no references to the @@ -290,7 +290,7 @@ the number of streams which could become blocked to the value of SETTINGS_QPACK_BLOCKED_STREAMS at all times. Note that the decoder might not actually become blocked on every stream which risks becoming blocked. If the decoder encounters more blocked streams than it promised to support, it MUST -treat this as a stream error of type HTTP_QPACK_DECOMPRESSION_FAILED. +treat this as a connection error of type HTTP_QPACK_DECOMPRESSION_FAILED. An encoder can decide whether to risk having a stream become blocked. If permitted by the value of SETTINGS_QPACK_BLOCKED_STREAMS, compression efficiency @@ -378,7 +378,7 @@ Note the QPACK static table is indexed from 0, whereas the HPACK static table is indexed from 1. When the decoder encounters an invalid static table index in a header block -instruction it MUST treat this as a stream error of type +instruction it MUST treat this as a connection error of type `HTTP_QPACK_DECOMPRESSION_FAILED`. If this index is received on the encoder stream, this MUST be treated as a connection error of type `HTTP_QPACK_ENCODER_STREAM_ERROR`. @@ -557,7 +557,7 @@ d = count of entries dropped If the decoder encounters a reference in a header block instruction to a dynamic table entry which has already been evicted or which has an absolute index greater than or equal to the declared Required Insert Count (see -{{header-prefix}}), it MUST treat this as a stream error of type +{{header-prefix}}), it MUST treat this as a connection error of type `HTTP_QPACK_DECOMPRESSION_FAILED`. If the decoder encounters a reference in an encoder instruction to a dynamic @@ -895,7 +895,7 @@ This encoding limits the length of the prefix on long-lived connections. The decoder can reconstruct the Required Insert Count using an algorithm such as the following. If the decoder encounters a value of EncodedInsertCount that could not have been produced by a conformant encoder, it MUST treat this as a -stream error of type `HTTP_QPACK_DECOMPRESSION_FAILED`. +connection error of type `HTTP_QPACK_DECOMPRESSION_FAILED`. TotalNumberOfInserts is the total number of inserts into the decoder's dynamic table. @@ -1116,7 +1116,7 @@ QPACK defines two settings which are included in the HTTP/3 SETTINGS frame. # Error Handling {#error-handling} The following error codes are defined for HTTP/3 to indicate failures of -QPACK which prevent the stream or connection from continuing: +QPACK which prevent the connection from continuing: HTTP_QPACK_DECOMPRESSION_FAILED (0x200): : The decoder failed to interpret a header block instruction and is not @@ -1130,10 +1130,6 @@ HTTP_QPACK_DECODER_STREAM_ERROR (0x202): : The encoder failed to interpret a decoder instruction received on the decoder stream. -Upon encountering an error, an implementation MAY elect to treat it as a -connection error even if this document prescribes that it MUST be treated as a -stream error. - # Security Considerations