-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Frame types that are Protocol Violations #1107
Conversation
Specify that certain frames on unidirectional streams tear down the connection. STREAM, STREAM_BLOCKED, and RST_STREAM can't be on a send-only, and MAX_STREAM_DATA and STOP_SENDING can't be received on a receive-only.
Fixed formatting error.
@@ -2097,6 +2100,9 @@ change in the initial limits (see {{zerortt-parameters}}). | |||
The MAX_STREAM_DATA frame (type=0x05) is used in flow control to inform a peer | |||
of the maximum amount of data that can be sent on a stream. | |||
|
|||
An endpoint that receives a MAX_STREAM_DATA frame for a receive-only stream | |||
MUST terminate the connection with error PROTOCOL_VIOLATION. | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about when receiving MAX_STREAM_DATA on a send or bidi stream but that has not yet been opened?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MAX_STREAM_DATA is defined in the state machine as one way to open a stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, thanks. But that only makes sense for bidi, or? If MAX_STREAM_DATA is received on a send stream way before the sender is ready to process it, what should it do? (I think there was some dicussion on related issues at some point).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In section 10.2.3 it says "The receiver only sends MAX_STREAM_DATA in the “Recv” state. " So I assume it would be a protocol error to send it in other states.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see now that this is for the receive end of bidirectional streams only. So for send-only streams, you're right.
However, for bidirectional streams, a node may open the stream and have that initial message be lost. Its receive direction will be in RECV (so it can send the frame) and can send MAX_STREAM_DATA, while nothing has happened at all at the peer.
Specify that certain frames on unidirectional streams tear down the connection. STREAM, STREAM_BLOCKED, and RST_STREAM can't be on a send-only, and MAX_STREAM_DATA and STOP_SENDING can't be received on a receive-only.
Fixes #1047