Skip to content

Commit

Permalink
use window update frame for error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
sukunrt committed Aug 28, 2024
1 parent 10a14bf commit 2fc53ec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions yamux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,11 @@ Both Ping and Go Away messages should always use the 0 StreamID.
The meaning of the length field depends on the message type:

* Data - provides the length of bytes following the header
* Window update - provides a delta update to the window size
* Window update:
* If RST flag is not set:
* Provides a delta update to the window size
* If RST flag is set:
* Contains an error code
* Ping - Contains an opaque value, echoed back
* Go Away - Contains an error code

Expand Down Expand Up @@ -128,7 +132,7 @@ This does a half-close indicating the sender will send no further data.

Once both sides have closed the connection, the stream is closed.

Alternatively, if an error occurs, the RST flag can be used to hard close a stream immediately. To provide an error on stream resets, the first four bytes of the data following the header can contain a bigendian 32bit unsigned integer error code. Implementations should discard any data following the 4 bytes of error code.
Alternatively, if an error occurs, the RST flag can be used to hard close a stream immediately. To provide an error code with the reset, use a window update frame with the RST flag set and set the Length field to the error code.

#### Flow Control

Expand Down

0 comments on commit 2fc53ec

Please sign in to comment.