Testing 5.1/1 has the wrong requirement (need GOAWAY with STREAM_CLOSED not PROTOCOL_ERROR)
iLya2IK opened this issue · 3 comments
Testing 5.1/1 has the wrong requirement: "The endpoint MUST treat this as a connection error of type PROTOCOL_ERROR."
This is contrary to sec. 6.1 of RFC 7540:
"If a DATA frame is received whose stream is not in "open" or "half-closed (local)" state, the recipient MUST respond with a stream error (Section 5.4.2) of type STREAM_CLOSED."
5. Streams and Multiplexing
5.1. Stream States
using source address 127.0.0.1:51130
× 1: idle: Sends a DATA frame
-> The endpoint MUST treat this as a connection error of type PROTOCOL_ERROR.
Expected: GOAWAY Frame (Error Code: PROTOCOL_ERROR)
Connection closed
Agreed. Fixed in f03bb16.
I think that this is an unclear part of the specification.
@summerwind so why sending an RST is not supported?
ah nvm, I didn't realize that's the fix, but it's just not in the latest release.
EDIT: I ended up sending a go away in this case. It's always ok to send a conn error instead of a stream error as per the spec (5.4.1), and it's not clear which one it should be sent in this case. Plus, this way there is no need for historical stream state data, so I'd expect every server do this. For stream cancelling, a PING can be sent to avoid closing+freeing the stream too soon.