ninenines / cowlib

Support library for manipulating Web protocols.
ISC License
281 stars 172 forks source link

Add access function cow_http2:frame_stream_id/1 #108

Closed zuiderkwast closed 3 years ago

zuiderkwast commented 3 years ago

Returns the stream ID of a frame.

I implemented this in Cowboy in the Graceful shutdown PR with a todo that it probably belongs in Cowlib. If you agree, here is a PR. Once it's submitted, I can update the Cowboy PR to use this code instead.

Context: Once a GOAWAY frame has been sent with a LastStreamID, any received frame associated with StreamID > LastStreamID should be ignored.

Potentially (not sure), this can also be useful in Gun for ignoring pushed frames on new streams after sending GOAWAY.

zuiderkwast commented 3 years ago

Replaced by #109.