By setting up the handler in the handlerAdded hook, HTTP2Parser supports
being added dynamically in a channelRead event, after the channel has sent
the channelActive event.
motivation: support swift 4.2 and 5.0
changes:
* add docker-compose variants for 18.04/4.2 and 18.04/5.0
* update Dockerfile to more correctly handle swift distro urls
* update Dockerfile to more correctly handle curl
* drop redundant ubuntu prefix
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:
Child channels should not activate before their parents.
Modifications:
Delay activation if the parent channel is not currently active.
Activate during channelActive, if needed.
Result:
Easier to start HTTP/2 requests
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:
nghttp2 changed the error code it returns when the server sends a GOAWAY.
It's now `.cancelled` instead of `.refusedStream`.
Modifications:
Don't require a specific error code in the tests, just require that an
error matching the expected stream ID occurred.
Result:
Tests will pass on nghttp2-1.34.0.
Motivation:
We never supported Swift 4.0 in this repository and Swift 4.0 is quite a
pain mostly because of the Unsafe*Pointer API differences.
Changes:
Require 4.1
Result:
fewer lies, fixes#17
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:
When tests are run with sanitizers, in docker etc it's important to
disable timing sensitive tests.
Modifications:
make it possible to disable timing sensitive tests
Result:
swift-nio-release-tools happier
Motivation:
We should attribute all external code/data we make use of, even in unit
tests.
Modifications:
Added hpack-test-case to NOTICE.txt
Result:
More attribution
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:
This is the beginning of removing the dependency on `nghttp2`.
Modifications:
I've added a new library target, `NIOHPACK`, which contains all the necessary pieces to implement HPACK encoding as specified in RFC 7541. There are unit tests exercising all the code and some additional edge cases around integer encoding, along with some performance tests for the Huffman encode/decode process. The latter currently takes longer to decode than to encode, which is worrying, but this is only really noticeable when encoding > 16KB strings as a rule; therefore I've decided not to pull out the optimization hammer just yet. Included in the unit tests are the inputs and outputs from all the examples in RFC 7541 and RFC 7540.
I've tried to match the coding style from the repo, but some of my own idioms may have crept in here & there. Please let me know if you see anything wrong in that regard.
Currently the static header table and Huffman encoding tables are implemented as Swift `let`s. For the static header table that's ok (only 62 entries), but the Huffman table is huge. I'm debating whether it's worth having that in a plain C file somewhere, but I'm not sure what the tradeoffs are vs. performance. Right now it seems to only affect compilation time, but I may be wrong.
Result:
In general, nothing will change: nothing in NIOHTTP2 is using this library yet. That part is what I'm working on now.
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:
Our tests were failing as a result of the previous commit changing the
HTTP/2 lifecycle.
Modifications:
Fired channelActive in a few tests, correctly propagated
channelInactive.
Result:
Tests should pass.
Motivation:
The example server had slowly bitrotted over time: some minor fixes were
needed.
Modifications:
I fixed it!
Result:
The example server works against a basic curl command.
Motivation:
While the HTTP2StreamMultiplexer could create channels in response to
inbound request streams on the server side, there was no interface for
creating channels locally.
That would make having a HTTP/2 client kinda tricky!
Modifications:
Added HTTP2StreamMultiplexer.createStreamChannel.
Result:
Possible to write HTTP/2 clients.
Motivation:
When closing a stream channel, it must remove its channel handlers.
Modifications:
Call ChannelCore.removeHandlers on shutdown.
Result:
Handlers are removed on channel shutdown.
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: add required files for ci setup
changes:
* add sanity script to test for oss headers and linux tests
* add docker and docker-compose files for docker based tests
Motivation:
Users should know that the project is currently in a beta state: this
README makes that clear.
Modifications:
Amended the README.
Result:
More clarity