10 Commits
Author SHA1 Message Date
Jim Dovey 6f8f523684 Implementation of HPACK encoding and header tables (#10)
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.
2018-08-16 09:51:13 +01:00
Cory Benfield d17462f586 Fix example server.
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.
2018-05-18 17:53:21 +01:00
Cory Benfield c2d4a88b24 Flesh out HTTP2 to HTTP1 codecs. (#4)
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.
2018-05-18 11:35:26 +01:00
Cory Benfield 1ef32a0d3d Correct handling of stream IDs. 2018-04-27 15:40:18 +01:00
Cory Benfield d555f46cce Initial basic client support 2018-04-25 18:02:35 +01:00
Cory Benfield df69a91f18 Add stream ID channel option 2018-04-18 18:20:28 +01:00
Cory Benfield aae0dd7d17 Correct initialization of test server 2018-04-18 16:35:21 +01:00
Cory Benfield bab2bb7cfc Removed debugging handlers 2018-04-18 16:28:12 +01:00
Johannes Weiß 504c24939e very rough first steps towards the first handled HTTP/2 request 2018-04-11 15:06:12 +01:00
Johannes Weiß 03f90eac46 add NIOHTTP2Server main file 2018-03-03 11:49:05 +09:00