ocaml-h2 icon indicating copy to clipboard operation
ocaml-h2 copied to clipboard

Update hpack library

Open 314eter opened this issue 6 years ago • 9 comments

This is a first attempt to replace the internal hpack library by ocaml-hpack.

Most of the changes are superficial, except for the header table size handling, which was not implemented before.

314eter avatar Jul 01 '19 13:07 314eter

@314eter I was just waiting for the conformance tests to be run, and I was afraid this would happen, but there are some spec failures related to handling HPACK indexes and overflows.

Do you have a suggestion on how to fix these given how permissive your HPACK implementation is?

anmonteiro avatar Jul 02 '19 20:07 anmonteiro

I already fixed them in 314eter/ocaml-hpack@8077a8530c41cbac0fcba0537c9da0ab1d5771d1, but the tests have to be run again.

314eter avatar Jul 02 '19 23:07 314eter

Oh cool, let me trigger a new CI run

anmonteiro avatar Jul 02 '19 23:07 anmonteiro

I expected h2spec 4.3.1 to fail, but it didn't because of a bug that is fixed in 314eter/ocaml-hpack#10.

314eter avatar Jul 03 '19 16:07 314eter

@314eter I'm a little confused - so it will fail now if we update the dependency to include that new diff?

anmonteiro avatar Jul 03 '19 16:07 anmonteiro

Yes, it will, because h2spec 4.3.1 interprets the rfc more strict than I do. It doesn't fail at the moment because it tests whether a table size update at the end of a header block is rejected. If it had tested with a table size update in the middle of a header block, it wouldn't have been rejected and the test would have failed.

I didn't merge the fix yet because another possible solution is to adapt to the h2spec interpretation, but that requires more work.

314eter avatar Jul 03 '19 16:07 314eter

I was curious about the state of this PR -- wouldn't it be nice to just use the existing hpack package and not vendor a copy inside of this repository? I fail to understand what is missing from this PR to land.

hannesm avatar Jul 06 '23 09:07 hannesm

@hannesm did you run into any issues that this PR fixes?

anmonteiro avatar Jul 06 '23 15:07 anmonteiro

I remember I made some improvements, added fuzzing, and fixed a few bugs in ocaml-hpack after it was forked and vendored in ocaml-h2, and was still working on some other things. The bugs are probably still present in ocaml-h2. But I stopped working on hpack because everyone was using the h2 fork anyway.

If there is any interest, I can pick it up again.

314eter avatar Jul 07 '23 12:07 314eter