swift-nio/Sources/CNIOLLHTTP
Cory Benfield 6918034260
Update HTTP parser to LLHTTP (#2263)
Motivation:

The node.js HTTP parser library that we use has been unmaintained for some time. We should move to the maintained replacement, which is llhttp. This patch will update our dependency and bring us over to the new library, as well as make any changes we need.

Modifications:

This patch comes in 4 parts, each contained in a separate commit in the PR.

The first commit drops the existing http_parser code and updates some of the repo state for using llhttp.
The second commit rewrites the update script to bring in llhttp instead of http_parser.
The third runs the actual script. You can skip reviewing this except to sanity check the outcome.
The fourth commit updates the NIO code and the tests to get everything working.

In general the substance of the product modifications was minimal. The logic around keeping track of where we are in the buffer and how upgrades work has changed a bit, so that required some fiddling. I also had to add an error reporting path for the delegates to be able to throw specific errors that llhttp no longer checks for. Finally, I removed two tests that were a little overzealous and that llhttp does not police.

Result:

Back on the supported path.
2022-09-13 14:09:57 +01:00
..
include Update HTTP parser to LLHTTP (#2263) 2022-09-13 14:09:57 +01:00
LICENSE-MIT Update HTTP parser to LLHTTP (#2263) 2022-09-13 14:09:57 +01:00
c_nio_api.c Update HTTP parser to LLHTTP (#2263) 2022-09-13 14:09:57 +01:00
c_nio_http.c Update HTTP parser to LLHTTP (#2263) 2022-09-13 14:09:57 +01:00
c_nio_llhttp.c Update HTTP parser to LLHTTP (#2263) 2022-09-13 14:09:57 +01:00
update_and_patch_llhttp.sh Update HTTP parser to LLHTTP (#2263) 2022-09-13 14:09:57 +01:00