From 9337fb3f2ab2b5f38d7e98a194bde6f7e3d16c40 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Tue, 18 Jul 2023 20:45:53 +0100 Subject: [PATCH] Fix bump llhttp to v8.1.1 (#7367) (#7377) (cherry picked from commit 41e2c4c1fdf34d800bb9e4247cd9ebfc6904d9d7) --- .gitmodules | 2 +- docs/contributing.rst | 2 ++ tests/test_http_parser.py | 1 + vendor/README.rst | 23 +++++++++++++++++++++++ vendor/llhttp | 2 +- 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 vendor/README.rst diff --git a/.gitmodules b/.gitmodules index 1e901ef79f2..6edb2eea5b2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "vendor/llhttp"] path = vendor/llhttp url = https://github.com/nodejs/llhttp.git - branch = v8.1.1 + branch = v8.x diff --git a/docs/contributing.rst b/docs/contributing.rst index 10a4a4bc2d7..b1dfdf01139 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -110,6 +110,8 @@ Install pre-commit hooks: Congratulations, you are ready to run the test suite! +.. include:: ../vendor/README.rst + Run autoformatter ----------------- diff --git a/tests/test_http_parser.py b/tests/test_http_parser.py index cc30629dd0d..950c243ef6b 100644 --- a/tests/test_http_parser.py +++ b/tests/test_http_parser.py @@ -685,6 +685,7 @@ def test_http_response_parser_bad(response) -> None: response.feed_data(b"HTT/1\r\n\r\n") +@pytest.mark.skipif(not NO_EXTENSIONS, reason="Behaviour has changed in C parser") def test_http_response_parser_code_under_100(response) -> None: msg = response.feed_data(b"HTTP/1.1 99 test\r\n\r\n")[0][0][0] assert msg.code == 99 diff --git a/vendor/README.rst b/vendor/README.rst new file mode 100644 index 00000000000..1f10e20cce2 --- /dev/null +++ b/vendor/README.rst @@ -0,0 +1,23 @@ +LLHTTP +------ + +When building aiohttp from source, there is a pure Python parser used by default. +For better performance, you may want to build the higher performance C parser. + +To build this ``llhttp`` parser, first get/update the submodules (to update to a +newer release, add ``--remote`` and check the branch in ``.gitmodules``):: + + git submodule update --init --recursive + +Then build ``llhttp``:: + + cd vendor/llhttp/ + npm install + make + +Then build our parser:: + + cd - + make cythonize + +Then you can build or install it with ``python -m build`` or ``pip install -e .`` diff --git a/vendor/llhttp b/vendor/llhttp index 69d6db20085..7e18596bae8 160000 --- a/vendor/llhttp +++ b/vendor/llhttp @@ -1 +1 @@ -Subproject commit 69d6db2008508489d19267a0dcab30602b16fc5b +Subproject commit 7e18596bae8f63692ded9d3250d5d984fe90dcfb