Skip to content

Commit

Permalink
Make error codes smaller (#851)
Browse files Browse the repository at this point in the history
* Make error codes smaller

* Correct diagram and hyphens
  • Loading branch information
martinthomson authored and janaiyengar committed Oct 12, 2017
1 parent 7af651d commit 0bf810a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 19 deletions.
4 changes: 2 additions & 2 deletions draft-ietf-quic-http.md
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ The entries in the following table are registered by this document.
## Error Codes {#iana-error-codes}

This document establishes a registry for HTTP/QUIC error codes. The
"HTTP/QUIC Error Code" registry manages a 32-bit space. The "HTTP/QUIC
"HTTP/QUIC Error Code" registry manages a 16-bit space. The "HTTP/QUIC
Error Code" registry operates under the "Expert Review" policy
{{?RFC5226}}.

Expand All @@ -1292,7 +1292,7 @@ Name:
: A name for the error code. Specifying an error code name is optional.

Code:
: The 32-bit error code value.
: The 16-bit error code value.

Description:
: A brief description of the error code semantics, longer if no detailed
Expand Down
35 changes: 18 additions & 17 deletions draft-ietf-quic-transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -1688,7 +1688,7 @@ The RST_STREAM frame is as follows:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application Protocol Error Code (32) |
| Application Error Code (16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
+ Final Offset (64) +
Expand All @@ -1704,7 +1704,7 @@ Stream ID:

Application Protocol Error Code:

: A 32-bit application protocol error code (see {{app-error-codes}}) which
: A 16-bit application protocol error code (see {{app-error-codes}}) which
indicates why the stream is being closed.

Final Offset:
Expand All @@ -1728,17 +1728,17 @@ The CONNECTION_CLOSE frame is as follows:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Error Code (32) |
| Error Code (16) | Reason Phrase Length (16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Reason Phrase Length (16) | [Reason Phrase (*)] ...
| Reason Phrase (*) ...
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~

The fields of a CONNECTION_CLOSE frame are as follows:

Error Code:

: A 32-bit error code which indicates the reason for closing this connection.
: A 16-bit error code which indicates the reason for closing this connection.
CONNECTION_CLOSE uses codes from the space defined in {{error-codes}}
(APPLICATION_CLOSE uses codes from the application protocol error code space,
see {{app-error-codes}}).
Expand Down Expand Up @@ -2010,8 +2010,8 @@ The STOP_SENDING frame is as follows:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Stream ID (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application Error Code (32) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Application Error Code (16) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
~~~

The fields are:
Expand All @@ -2022,7 +2022,7 @@ Stream ID:

Application Error Code:

: A 32-bit, application-specified reason the sender is ignoring the stream (see
: A 16-bit, application-specified reason the sender is ignoring the stream (see
{{app-error-codes}}).


Expand Down Expand Up @@ -3033,7 +3033,7 @@ consistent state between endpoints.
## Transport Error Codes {#error-codes}
Transport error codes are 32 bits long.
QUIC error codes are 16-bit unsigned integers.
This section lists the defined QUIC transport error codes that may be used in a
CONNECTION_CLOSE frame. These errors apply to the entire connection.
Expand Down Expand Up @@ -3107,10 +3107,11 @@ See {{iana-error-codes}} for details of registering new error codes.
## Application Protocol Error Codes {#app-error-codes}
Application protocol error codes are 32-bits long, but the management of
application error codes are left to application protocols. Application protocol
error codes are used for the RST_STREAM ({{frame-rst-stream}}) and
APPLICATION_CLOSE ({{frame-application-close}}) frames.
Application protocol error codes are 16-bit unsigned integers, but the
management of application error codes are left to application protocols.
Application protocol error codes are used for the RST_STREAM
({{frame-rst-stream}}) and APPLICATION_CLOSE ({{frame-application-close}})
frames.
There is no restriction on the use of the 16-bit error code space for
application protocols. However, QUIC reserves the error code with a value of 0
Expand Down Expand Up @@ -3255,7 +3256,7 @@ The initial contents of this registry are shown in {{iana-tp-table}}.
IANA \[SHALL add/has added] a registry for "QUIC Transport Error Codes" under a
"QUIC Protocol" heading.
The "QUIC Transport Error Codes" registry governs a 32-bit space. This space is
The "QUIC Transport Error Codes" registry governs a 16-bit space. This space is
split into two spaces that are governed by different policies. Values with the
first byte in the range 0x00 to 0xfe (in hexadecimal) are assigned via the
Specification Required policy {{!RFC5226}}. Values with the first byte 0xff are
Expand All @@ -3265,8 +3266,8 @@ Registrations MUST include the following fields:
Value:
: The numeric value of the assignment (registrations will be between 0x00000000
and 0xfeffffff).
: The numeric value of the assignment (registrations will be between 0x0000 and
0xfeff).
Code:
Expand All @@ -3283,7 +3284,7 @@ Specification:
The initial contents of this registry are shown in {{iana-error-table}}. Note
that FRAME_ERROR takes the range from 0x100 to 0x1FF and private use occupies
the range from 0XFE000000 to 0XFFFFFFFF.
the range from 0xFE00 to 0xFFFF.
| Value | Error | Description | Specification |
|:------------|:--------------------------|:------------------------------|:----------------|
Expand Down

0 comments on commit 0bf810a

Please sign in to comment.