summerwind / h2spec

A conformance testing tool for HTTP/2 implementation.
MIT License
661 stars 73 forks source link

Permit connection error in place of stream error #10

Closed kazuho closed 9 years ago

kazuho commented 9 years ago

Draft-16 5.4.1 states:

In particular, an endpoint MAY choose to treat a stream error as a connection error.

Looking at https://github.com/summerwind/h2spec/search?utf8=✓&q=rststreamframe there seems to be three tests that expect RST_STREAM, but the two tests (6_9, 8_1) do not permit GOAWAY frames used in place.

summerwind commented 9 years ago

Nice catch! I had overlooked about that. I will change codes soon.

summerwind commented 9 years ago

Fixed. If you still have a problem, please reopen this issue.

kazuho commented 9 years ago

Thank you for the quick fix!

kazuho commented 9 years ago

As an afterthought, it might be worth to consider adding a strict mode that permits the peer to send connection errors (or to just close the connection) in place of stream errors.

note: draft-16 6.8 states: "An endpoint might choose to close a connection without sending GOAWAY for misbehaving peers", which IMO means that it is permitted for an implementation compliant to the spec to abruptly close the connection for any of the connection errors or stream errors, taking the statement in 5.4.1 (shown above) into consideration.