Skip to content

Commit 2fc53ec

Browse files
committed
use window update frame for error codes
1 parent 10a14bf commit 2fc53ec

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

yamux/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ Both Ping and Go Away messages should always use the 0 StreamID.
9797
The meaning of the length field depends on the message type:
9898

9999
* Data - provides the length of bytes following the header
100-
* Window update - provides a delta update to the window size
100+
* Window update:
101+
* If RST flag is not set:
102+
* Provides a delta update to the window size
103+
* If RST flag is set:
104+
* Contains an error code
101105
* Ping - Contains an opaque value, echoed back
102106
* Go Away - Contains an error code
103107

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

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

131-
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.
135+
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.
132136

133137
#### Flow Control
134138

0 commit comments

Comments
 (0)