Motivation:
We'd done all our development against newer copies of nghttp2, that
behaved a bit differently. We should support Ubuntu's copy, at least
while nghttp2 is relevant to us.
Modifications:
- Shimmed over a version difference.
- Fixed the tests to stop relying on differences.
- Removed the Swift 4.0.3 dockerfiles as we don't support Swift
4.0 anyway.
Result:
Users can build against Ubuntu 16.04's nghttp2 package.
Motivation:
Due to nghttp2's weird data provider model, all trailers go through a
similar send path as data frames. This includes the fact that the data
sender can go "idle". If the data sender is idle, and the user sends
trailers, we don't bother to tell nghttp2 to ask us for more data,
so the trailers sit there forever, feeling sad.
Modifications:
- Correctly restart the data provider when sending data.
Result:
Trailers will be emitted when the stream is idle.
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:
We shouldn't just crash if the client sends bad magic.
Changes:
Send an error through the pipeline instead of crashing on bad client
magic.
Result:
fewer crashes
Motivation:
Our dead stream cache should not cause us to crash when we can have more
active streams than the entire size of the cache. These things are
at least nominally unrelated.
Modifications:
Rewrote the code to avoid asserting that we'll always be able to shrink
down to the dead cache size.
Result:
Fewer crashes
Motivation:
Long-lived connections that have many inactive streams would cause
crashes. Crashes are, in my professional opinion, less than ideal
when they occur under expected usage cases.
Modifications:
- Fixed an inverted boolean check that would discard only *active*
streams.
- Made the cached stream count configurable, removing a TODO.
- Added tests.
Result:
Fewer crashes, better software.
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.