Motivation:
Prior to bringing in my HTTP/2 encoder/decoder, I think my implementations of HTTP/2 frame flags as `OptionSet`s and settings as an enum (i.e. existentials) make for a nicer API, and provide somewhat more information for the compiler to work with when optimizing.
Modifications:
- `HTTP2Frame.FrameFlags` is now an `OptionSet`.
- `HTTP2Frame.FramePayload` now supports all current HTTP/2 frame types, can return their on-wire identifier, and can return the set of `HTTP2Frame.FrameFlags` that the frame allows.
- `HTTP2Setting` is now an enum with associated values, and includes the SETTINGS_ENABLE_CONNECT_PROTOCOL value.
- Added `NIOHTTP2Errors.InvalidSettings` error, used when bad settings are encountered by decoder.
- Updated tests to use the new `HTTP2Setting` type.
Result:
Not a lot changes, beyond the in-memory layout of some things. All these types still have nghttp2 conversion methods, and all tests still run successfully.
Motivation:
Many users of HTTP/2 will not want to interact with the HTTP/2 protocol
directly, but instead to write generic HTTP applications on top of an
abstraction layer. These codecs provide part of that abstraction layer.
Modifications:
Added more codecs, fleshed them out, wrote many tests.
Result:
Easier application writing.
Motivation:
The HTTP2StreamChannel needs to be aware of the HTTP/2 state machine,
at least at some level. This is to ensure it can map that state
machine onto the (unfortunately implicit) NIO stream state machine
and appropriately clean up resources like stream promises.
Modifications:
Lots. Added stream state tracking, refactored the frame structure,
stopped creating stream 0 as a sub-stream, and more.
Result:
We no longer crash when the curl TCP connection goes away.