summaryrefslogtreecommitdiffstats
path: root/third_party/python/aiohttp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /third_party/python/aiohttp
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/python/aiohttp')
-rw-r--r--third_party/python/aiohttp/CHANGES.rst1114
-rw-r--r--third_party/python/aiohttp/CONTRIBUTORS.txt342
-rw-r--r--third_party/python/aiohttp/LICENSE.txt13
-rw-r--r--third_party/python/aiohttp/MANIFEST.in20
-rw-r--r--third_party/python/aiohttp/Makefile188
-rw-r--r--third_party/python/aiohttp/PKG-INFO241
-rw-r--r--third_party/python/aiohttp/README.rst205
-rw-r--r--third_party/python/aiohttp/aiohttp.egg-info/PKG-INFO241
-rw-r--r--third_party/python/aiohttp/aiohttp.egg-info/SOURCES.txt290
-rw-r--r--third_party/python/aiohttp/aiohttp.egg-info/dependency_links.txt1
-rw-r--r--third_party/python/aiohttp/aiohttp.egg-info/not-zip-safe1
-rw-r--r--third_party/python/aiohttp/aiohttp.egg-info/requires.txt21
-rw-r--r--third_party/python/aiohttp/aiohttp.egg-info/top_level.txt1
-rw-r--r--third_party/python/aiohttp/aiohttp/.hash/_cparser.pxd.hash1
-rw-r--r--third_party/python/aiohttp/aiohttp/.hash/_find_header.pxd.hash1
-rw-r--r--third_party/python/aiohttp/aiohttp/.hash/_helpers.pyi.hash1
-rw-r--r--third_party/python/aiohttp/aiohttp/.hash/_helpers.pyx.hash1
-rw-r--r--third_party/python/aiohttp/aiohttp/.hash/_http_parser.pyx.hash1
-rw-r--r--third_party/python/aiohttp/aiohttp/.hash/_http_writer.pyx.hash1
-rw-r--r--third_party/python/aiohttp/aiohttp/.hash/_websocket.pyx.hash1
-rw-r--r--third_party/python/aiohttp/aiohttp/.hash/hdrs.py.hash1
-rw-r--r--third_party/python/aiohttp/aiohttp/__init__.py216
-rw-r--r--third_party/python/aiohttp/aiohttp/_cparser.pxd190
-rw-r--r--third_party/python/aiohttp/aiohttp/_find_header.c9870
-rw-r--r--third_party/python/aiohttp/aiohttp/_find_header.h14
-rw-r--r--third_party/python/aiohttp/aiohttp/_find_header.pxd2
-rw-r--r--third_party/python/aiohttp/aiohttp/_headers.pxi83
-rw-r--r--third_party/python/aiohttp/aiohttp/_helpers.c5712
-rw-r--r--third_party/python/aiohttp/aiohttp/_helpers.pyi6
-rw-r--r--third_party/python/aiohttp/aiohttp/_helpers.pyx35
-rw-r--r--third_party/python/aiohttp/aiohttp/_http_parser.c24512
-rw-r--r--third_party/python/aiohttp/aiohttp/_http_parser.pyx838
-rw-r--r--third_party/python/aiohttp/aiohttp/_http_writer.c6243
-rw-r--r--third_party/python/aiohttp/aiohttp/_http_writer.pyx163
-rw-r--r--third_party/python/aiohttp/aiohttp/_websocket.c3818
-rw-r--r--third_party/python/aiohttp/aiohttp/_websocket.pyx56
-rw-r--r--third_party/python/aiohttp/aiohttp/abc.py207
-rw-r--r--third_party/python/aiohttp/aiohttp/base_protocol.py90
-rw-r--r--third_party/python/aiohttp/aiohttp/client.py1305
-rw-r--r--third_party/python/aiohttp/aiohttp/client_exceptions.py342
-rw-r--r--third_party/python/aiohttp/aiohttp/client_proto.py251
-rw-r--r--third_party/python/aiohttp/aiohttp/client_reqrep.py1134
-rw-r--r--third_party/python/aiohttp/aiohttp/client_ws.py300
-rw-r--r--third_party/python/aiohttp/aiohttp/connector.py1456
-rw-r--r--third_party/python/aiohttp/aiohttp/cookiejar.py415
-rw-r--r--third_party/python/aiohttp/aiohttp/formdata.py172
-rw-r--r--third_party/python/aiohttp/aiohttp/hdrs.py114
-rw-r--r--third_party/python/aiohttp/aiohttp/helpers.py878
-rw-r--r--third_party/python/aiohttp/aiohttp/http.py70
-rw-r--r--third_party/python/aiohttp/aiohttp/http_exceptions.py107
-rw-r--r--third_party/python/aiohttp/aiohttp/http_parser.py969
-rw-r--r--third_party/python/aiohttp/aiohttp/http_websocket.py701
-rw-r--r--third_party/python/aiohttp/aiohttp/http_writer.py198
-rw-r--r--third_party/python/aiohttp/aiohttp/locks.py41
-rw-r--r--third_party/python/aiohttp/aiohttp/log.py8
-rw-r--r--third_party/python/aiohttp/aiohttp/multipart.py961
-rw-r--r--third_party/python/aiohttp/aiohttp/payload.py465
-rw-r--r--third_party/python/aiohttp/aiohttp/payload_streamer.py75
-rw-r--r--third_party/python/aiohttp/aiohttp/py.typed1
-rw-r--r--third_party/python/aiohttp/aiohttp/pytest_plugin.py391
-rw-r--r--third_party/python/aiohttp/aiohttp/resolver.py160
-rw-r--r--third_party/python/aiohttp/aiohttp/streams.py660
-rw-r--r--third_party/python/aiohttp/aiohttp/tcp_helpers.py37
-rw-r--r--third_party/python/aiohttp/aiohttp/test_utils.py706
-rw-r--r--third_party/python/aiohttp/aiohttp/tracing.py472
-rw-r--r--third_party/python/aiohttp/aiohttp/typedefs.py64
-rw-r--r--third_party/python/aiohttp/aiohttp/web.py588
-rw-r--r--third_party/python/aiohttp/aiohttp/web_app.py557
-rw-r--r--third_party/python/aiohttp/aiohttp/web_exceptions.py441
-rw-r--r--third_party/python/aiohttp/aiohttp/web_fileresponse.py288
-rw-r--r--third_party/python/aiohttp/aiohttp/web_log.py208
-rw-r--r--third_party/python/aiohttp/aiohttp/web_middlewares.py119
-rw-r--r--third_party/python/aiohttp/aiohttp/web_protocol.py679
-rw-r--r--third_party/python/aiohttp/aiohttp/web_request.py882
-rw-r--r--third_party/python/aiohttp/aiohttp/web_response.py825
-rw-r--r--third_party/python/aiohttp/aiohttp/web_routedef.py216
-rw-r--r--third_party/python/aiohttp/aiohttp/web_runner.py381
-rw-r--r--third_party/python/aiohttp/aiohttp/web_server.py62
-rw-r--r--third_party/python/aiohttp/aiohttp/web_urldispatcher.py1220
-rw-r--r--third_party/python/aiohttp/aiohttp/web_ws.py487
-rw-r--r--third_party/python/aiohttp/aiohttp/worker.py269
-rw-r--r--third_party/python/aiohttp/examples/__init__.py0
-rwxr-xr-xthird_party/python/aiohttp/examples/background_tasks.py66
-rwxr-xr-xthird_party/python/aiohttp/examples/cli_app.py51
-rwxr-xr-xthird_party/python/aiohttp/examples/client_auth.py23
-rwxr-xr-xthird_party/python/aiohttp/examples/client_json.py22
-rwxr-xr-xthird_party/python/aiohttp/examples/client_ws.py74
-rwxr-xr-xthird_party/python/aiohttp/examples/curl.py35
-rwxr-xr-xthird_party/python/aiohttp/examples/fake_server.py119
-rw-r--r--third_party/python/aiohttp/examples/lowlevel_srv.py26
-rw-r--r--third_party/python/aiohttp/examples/server.crt19
-rw-r--r--third_party/python/aiohttp/examples/server.csr16
-rw-r--r--third_party/python/aiohttp/examples/server.key27
-rw-r--r--third_party/python/aiohttp/examples/server_simple.py31
-rwxr-xr-xthird_party/python/aiohttp/examples/static_files.py9
-rwxr-xr-xthird_party/python/aiohttp/examples/web_classview.py62
-rwxr-xr-xthird_party/python/aiohttp/examples/web_cookies.py45
-rwxr-xr-xthird_party/python/aiohttp/examples/web_rewrite_headers_middleware.py29
-rwxr-xr-xthird_party/python/aiohttp/examples/web_srv.py58
-rw-r--r--third_party/python/aiohttp/examples/web_srv_route_deco.py60
-rw-r--r--third_party/python/aiohttp/examples/web_srv_route_table.py62
-rwxr-xr-xthird_party/python/aiohttp/examples/web_ws.py57
-rw-r--r--third_party/python/aiohttp/examples/websocket.html89
-rw-r--r--third_party/python/aiohttp/pyproject.toml19
-rw-r--r--third_party/python/aiohttp/setup.cfg141
-rw-r--r--third_party/python/aiohttp/setup.py54
-rw-r--r--third_party/python/aiohttp/vendor/README.rst23
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/.dockerignore6
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/.eslintrc.js31
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/.github/workflows/ci.yaml117
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/.gitignore6
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/.npmrc1
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/CMakeLists.txt115
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/CNAME1
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/CODE_OF_CONDUCT.md4
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/Dockerfile13
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/LICENSE-MIT22
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/Makefile94
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/README.md434
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/_config.yml1
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/bench/index.ts89
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/bin/build_wasm.ts95
-rwxr-xr-xthird_party/python/aiohttp/vendor/llhttp/bin/generate.ts101
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/build/c/llhttp.c18682
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/build/llhttp.h815
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/docs/releasing.md65
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/examples/wasm.ts248
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/images/http-loose-none.pngbin0 -> 3571702 bytes
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/images/http-strict-none.pngbin0 -> 4166480 bytes
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/libllhttp.pc.in10
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/package-lock.json2995
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/package.json59
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/common.gypi46
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/llhttp.gyp22
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/llhttp.ts10
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/llhttp/c-headers.ts106
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/llhttp/constants.ts536
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/llhttp/http.ts1208
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/llhttp/url.ts230
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/llhttp/utils.ts27
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/native/api.c462
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/native/api.h277
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/src/native/http.c150
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/fixtures/extra.c387
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/fixtures/index.ts88
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/fuzzers/fuzz_parser.c45
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/md-test.ts322
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/connection.md732
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/content-length.md434
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/finish.md69
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/invalid.md405
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/lenient-headers.md145
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/lenient-version.md23
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/method.md450
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/pausing.md381
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/pipelining.md66
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/sample.md586
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/transfer-encoding.md885
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/request/uri.md269
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/connection.md502
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/content-length.md158
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/finish.md23
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/invalid.md201
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/lenient-version.md20
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/pausing.md330
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/pipelining.md60
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/sample.md684
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/response/transfer-encoding.md410
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/test/url.md283
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/tsconfig.json15
-rw-r--r--third_party/python/aiohttp/vendor/llhttp/tslint.json14
171 files changed, 110698 insertions, 0 deletions
diff --git a/third_party/python/aiohttp/CHANGES.rst b/third_party/python/aiohttp/CHANGES.rst
new file mode 100644
index 0000000000..d929a0acc0
--- /dev/null
+++ b/third_party/python/aiohttp/CHANGES.rst
@@ -0,0 +1,1114 @@
+..
+ You should *NOT* be adding new change log entries to this file, this
+ file is managed by towncrier. You *may* edit previous change logs to
+ fix problems like typo corrections or such.
+ To add a new change log entry, please see
+ https://pip.pypa.io/en/latest/development/#adding-a-news-entry
+ we named the news folder "changes".
+
+ WARNING: Don't drop the next directive!
+
+.. towncrier release notes start
+
+3.8.5 (2023-07-19)
+==================
+
+Security bugfixes
+-----------------
+
+- Upgraded the vendored copy of llhttp_ to v8.1.1 -- by :user:`webknjaz`
+ and :user:`Dreamsorcerer`.
+
+ Thanks to :user:`sethmlarson` for reporting this and providing us with
+ comprehensive reproducer, workarounds and fixing details! For more
+ information, see
+ https://github.com/aio-libs/aiohttp/security/advisories/GHSA-45c4-8wx5-qw6w.
+
+ .. _llhttp: https://llhttp.org
+
+ `#7346 <https://github.com/aio-libs/aiohttp/issues/7346>`_
+
+
+Features
+--------
+
+- Added information to C parser exceptions to show which character caused the error. -- by :user:`Dreamsorcerer`
+
+ `#7366 <https://github.com/aio-libs/aiohttp/issues/7366>`_
+
+
+Bugfixes
+--------
+
+- Fixed a transport is :data:`None` error -- by :user:`Dreamsorcerer`.
+
+ `#3355 <https://github.com/aio-libs/aiohttp/issues/3355>`_
+
+
+
+----
+
+
+3.8.4 (2023-02-12)
+==================
+
+Bugfixes
+--------
+
+- Fixed incorrectly overwriting cookies with the same name and domain, but different path.
+ `#6638 <https://github.com/aio-libs/aiohttp/issues/6638>`_
+- Fixed ``ConnectionResetError`` not being raised after client disconnection in SSL environments.
+ `#7180 <https://github.com/aio-libs/aiohttp/issues/7180>`_
+
+
+----
+
+
+3.8.3 (2022-09-21)
+==================
+
+.. attention::
+
+ This is the last :doc:`aiohttp <index>` release tested under
+ Python 3.6. The 3.9 stream is dropping it from the CI and the
+ distribution package metadata.
+
+Bugfixes
+--------
+
+- Increased the upper boundary of the :doc:`multidict:index` dependency
+ to allow for the version 6 -- by :user:`hugovk`.
+
+ It used to be limited below version 7 in :doc:`aiohttp <index>` v3.8.1 but
+ was lowered in v3.8.2 via :pr:`6550` and never brought back, causing
+ problems with dependency pins when upgrading. :doc:`aiohttp <index>` v3.8.3
+ fixes that by recovering the original boundary of ``< 7``.
+ `#6950 <https://github.com/aio-libs/aiohttp/issues/6950>`_
+
+
+----
+
+
+3.8.2 (2022-09-20, subsequently yanked on 2022-09-21)
+=====================================================
+
+.. note::
+
+ This release has some compatibility fixes for Python 3.11 but it may
+ still have some quirks. Some tests are still flaky in the CI.
+
+.. caution::
+
+ This release has been yanked from PyPI. Modern pip will not pick it
+ up automatically. The reason is that is has ``multidict < 6`` set in
+ the distribution package metadata (see :pr:`6950`). Please, use
+ ``aiohttp ~= 3.8.3, != 3.8.1`` instead, if you can.
+
+Bugfixes
+--------
+
+- Added support for registering :rfc:`OPTIONS <9110#OPTIONS>`
+ HTTP method handlers via :py:class:`~aiohttp.web.RouteTableDef`.
+ `#4663 <https://github.com/aio-libs/aiohttp/issues/4663>`_
+- Started supporting :rfc:`authority-form <9112#authority-form>` and
+ :rfc:`absolute-form <9112#absolute-form>` URLs on the server-side.
+ `#6227 <https://github.com/aio-libs/aiohttp/issues/6227>`_
+- Fixed Python 3.11 incompatibilities by using Cython 0.29.25.
+ `#6396 <https://github.com/aio-libs/aiohttp/issues/6396>`_
+- Extended the ``sock`` argument typing declaration of the
+ :py:func:`~aiohttp.web.run_app` function as optionally
+ accepting iterables.
+ `#6401 <https://github.com/aio-libs/aiohttp/issues/6401>`_
+- Fixed a regression where :py:exc:`~asyncio.CancelledError`
+ occurs on client disconnection.
+ `#6719 <https://github.com/aio-libs/aiohttp/issues/6719>`_
+- Started exporting :py:class:`~aiohttp.web.PrefixedSubAppResource`
+ under :py:mod:`aiohttp.web` -- by :user:`Dreamsorcerer`.
+
+ This fixes a regression introduced by :pr:`3469`.
+ `#6889 <https://github.com/aio-libs/aiohttp/issues/6889>`_
+- Dropped the :class:`object` type possibility from
+ the :py:attr:`aiohttp.ClientSession.timeout`
+ property return type declaration.
+ `#6917 <https://github.com/aio-libs/aiohttp/issues/6917>`_,
+ `#6923 <https://github.com/aio-libs/aiohttp/issues/6923>`_
+
+
+Improved Documentation
+----------------------
+
+- Added clarification on configuring the app object with
+ settings such as a database connection.
+ `#4137 <https://github.com/aio-libs/aiohttp/issues/4137>`_
+- Extended the ``sock`` argument typing declaration of the
+ :py:func:`~aiohttp.web.run_app` function as optionally
+ accepting iterables.
+ `#6401 <https://github.com/aio-libs/aiohttp/issues/6401>`_
+- Dropped the :class:`object` type possibility from
+ the :py:attr:`aiohttp.ClientSession.timeout`
+ property return type declaration.
+ `#6917 <https://github.com/aio-libs/aiohttp/issues/6917>`_,
+ `#6923 <https://github.com/aio-libs/aiohttp/issues/6923>`_
+
+
+Deprecations and Removals
+-------------------------
+
+- Dropped Python 3.5 support, :doc:`aiohttp <index>` only works
+ under Python 3.6 and higher from now on.
+ `#4046 <https://github.com/aio-libs/aiohttp/issues/4046>`_
+
+
+Misc
+----
+
+- Removed a deprecated usage of :py:func:`pytest.warns(None)
+ <pytest.warns>` in tests.
+ `#6663 <https://github.com/aio-libs/aiohttp/issues/6663>`_
+- `#6369 <https://github.com/aio-libs/aiohttp/issues/6369>`_, `#6399 <https://github.com/aio-libs/aiohttp/issues/6399>`_, `#6550 <https://github.com/aio-libs/aiohttp/issues/6550>`_, `#6708 <https://github.com/aio-libs/aiohttp/issues/6708>`_, `#6757 <https://github.com/aio-libs/aiohttp/issues/6757>`_, `#6857 <https://github.com/aio-libs/aiohttp/issues/6857>`_, `#6872 <https://github.com/aio-libs/aiohttp/issues/6872>`_.
+
+
+----
+
+
+3.8.1 (2021-11-14)
+==================
+
+Bugfixes
+--------
+
+- Fix the error in handling the return value of `getaddrinfo`.
+ `getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family.
+ It will cause a index out of range error in aiohttp. For example, if user compile CPython with
+ `--disable-ipv6` option but his system enable the ipv6.
+ `#5901 <https://github.com/aio-libs/aiohttp/issues/5901>`_
+- Do not install "examples" as a top-level package.
+ `#6189 <https://github.com/aio-libs/aiohttp/issues/6189>`_
+- Restored ability to connect IPv6-only host.
+ `#6195 <https://github.com/aio-libs/aiohttp/issues/6195>`_
+- Remove ``Signal`` from ``__all__``, replace ``aiohttp.Signal`` with ``aiosignal.Signal`` in docs
+ `#6201 <https://github.com/aio-libs/aiohttp/issues/6201>`_
+- Made chunked encoding HTTP header check stricter.
+ `#6305 <https://github.com/aio-libs/aiohttp/issues/6305>`_
+
+
+Improved Documentation
+----------------------
+
+- update quick starter demo codes.
+ `#6240 <https://github.com/aio-libs/aiohttp/issues/6240>`_
+- Added an explanation of how tiny timeouts affect performance to the client reference document.
+ `#6274 <https://github.com/aio-libs/aiohttp/issues/6274>`_
+- Add flake8-docstrings to flake8 configuration, enable subset of checks.
+ `#6276 <https://github.com/aio-libs/aiohttp/issues/6276>`_
+- Added information on running complex applications with additional tasks/processes -- :user:`Dreamsorcerer`.
+ `#6278 <https://github.com/aio-libs/aiohttp/issues/6278>`_
+
+
+Misc
+----
+
+- `#6205 <https://github.com/aio-libs/aiohttp/issues/6205>`_
+
+
+----
+
+
+3.8.0 (2021-10-31)
+==================
+
+Features
+--------
+
+- Added a ``GunicornWebWorker`` feature for extending the aiohttp server configuration by allowing the 'wsgi' coroutine to return ``web.AppRunner`` object.
+ `#2988 <https://github.com/aio-libs/aiohttp/issues/2988>`_
+- Switch from ``http-parser`` to ``llhttp``
+ `#3561 <https://github.com/aio-libs/aiohttp/issues/3561>`_
+- Use Brotli instead of brotlipy
+ `#3803 <https://github.com/aio-libs/aiohttp/issues/3803>`_
+- Disable implicit switch-back to pure python mode. The build fails loudly if aiohttp
+ cannot be compiled with C Accelerators. Use AIOHTTP_NO_EXTENSIONS=1 to explicitly
+ disable C Extensions complication and switch to Pure-Python mode. Note that Pure-Python
+ mode is significantly slower than compiled one.
+ `#3828 <https://github.com/aio-libs/aiohttp/issues/3828>`_
+- Make access log use local time with timezone
+ `#3853 <https://github.com/aio-libs/aiohttp/issues/3853>`_
+- Implemented ``readuntil`` in ``StreamResponse``
+ `#4054 <https://github.com/aio-libs/aiohttp/issues/4054>`_
+- FileResponse now supports ETag.
+ `#4594 <https://github.com/aio-libs/aiohttp/issues/4594>`_
+- Add a request handler type alias ``aiohttp.typedefs.Handler``.
+ `#4686 <https://github.com/aio-libs/aiohttp/issues/4686>`_
+- ``AioHTTPTestCase`` is more async friendly now.
+
+ For people who use unittest and are used to use :py:exc:`~unittest.TestCase`
+ it will be easier to write new test cases like the sync version of the :py:exc:`~unittest.TestCase` class,
+ without using the decorator `@unittest_run_loop`, just `async def test_*`.
+ The only difference is that for the people using python3.7 and below a new dependency is needed, it is ``asynctestcase``.
+ `#4700 <https://github.com/aio-libs/aiohttp/issues/4700>`_
+- Add validation of HTTP header keys and values to prevent header injection.
+ `#4818 <https://github.com/aio-libs/aiohttp/issues/4818>`_
+- Add predicate to ``AbstractCookieJar.clear``.
+ Add ``AbstractCookieJar.clear_domain`` to clean all domain and subdomains cookies only.
+ `#4942 <https://github.com/aio-libs/aiohttp/issues/4942>`_
+- Add keepalive_timeout parameter to web.run_app.
+ `#5094 <https://github.com/aio-libs/aiohttp/issues/5094>`_
+- Tracing for client sent headers
+ `#5105 <https://github.com/aio-libs/aiohttp/issues/5105>`_
+- Make type hints for http parser stricter
+ `#5267 <https://github.com/aio-libs/aiohttp/issues/5267>`_
+- Add final declarations for constants.
+ `#5275 <https://github.com/aio-libs/aiohttp/issues/5275>`_
+- Switch to external frozenlist and aiosignal libraries.
+ `#5293 <https://github.com/aio-libs/aiohttp/issues/5293>`_
+- Don't send secure cookies by insecure transports.
+
+ By default, the transport is secure if https or wss scheme is used.
+ Use `CookieJar(treat_as_secure_origin="http://127.0.0.1")` to override the default security checker.
+ `#5571 <https://github.com/aio-libs/aiohttp/issues/5571>`_
+- Always create a new event loop in ``aiohttp.web.run_app()``.
+ This adds better compatibility with ``asyncio.run()`` or if trying to run multiple apps in sequence.
+ `#5572 <https://github.com/aio-libs/aiohttp/issues/5572>`_
+- Add ``aiohttp.pytest_plugin.AiohttpClient`` for static typing of pytest plugin.
+ `#5585 <https://github.com/aio-libs/aiohttp/issues/5585>`_
+- Added a ``socket_factory`` argument to ``BaseTestServer``.
+ `#5844 <https://github.com/aio-libs/aiohttp/issues/5844>`_
+- Add compression strategy parameter to enable_compression method.
+ `#5909 <https://github.com/aio-libs/aiohttp/issues/5909>`_
+- Added support for Python 3.10 to Github Actions CI/CD workflows and fix the related deprecation warnings -- :user:`Hanaasagi`.
+ `#5927 <https://github.com/aio-libs/aiohttp/issues/5927>`_
+- Switched ``chardet`` to ``charset-normalizer`` for guessing the HTTP payload body encoding -- :user:`Ousret`.
+ `#5930 <https://github.com/aio-libs/aiohttp/issues/5930>`_
+- Added optional auto_decompress argument for HttpRequestParser
+ `#5957 <https://github.com/aio-libs/aiohttp/issues/5957>`_
+- Added support for HTTPS proxies to the extent CPython's
+ :py:mod:`asyncio` supports it -- by :user:`bmbouter`,
+ :user:`jborean93` and :user:`webknjaz`.
+ `#5992 <https://github.com/aio-libs/aiohttp/issues/5992>`_
+- Added ``base_url`` parameter to the initializer of :class:`~aiohttp.ClientSession`.
+ `#6013 <https://github.com/aio-libs/aiohttp/issues/6013>`_
+- Add Trove classifier and create binary wheels for 3.10. -- :user:`hugovk`.
+ `#6079 <https://github.com/aio-libs/aiohttp/issues/6079>`_
+- Started shipping platform-specific wheels with the ``musl`` tag targeting typical Alpine Linux runtimes ā€” :user:`asvetlov`.
+ `#6139 <https://github.com/aio-libs/aiohttp/issues/6139>`_
+- Started shipping platform-specific arm64 wheels for Apple Silicon ā€” :user:`asvetlov`.
+ `#6139 <https://github.com/aio-libs/aiohttp/issues/6139>`_
+
+
+Bugfixes
+--------
+
+- Modify _drain_helper() to handle concurrent `await resp.write(...)` or `ws.send_json(...)` calls without race-condition.
+ `#2934 <https://github.com/aio-libs/aiohttp/issues/2934>`_
+- Started using `MultiLoopChildWatcher` when it's available under POSIX while setting up the test I/O loop.
+ `#3450 <https://github.com/aio-libs/aiohttp/issues/3450>`_
+- Only encode content-disposition filename parameter using percent-encoding.
+ Other parameters are encoded to quoted-string or RFC2231 extended parameter
+ value.
+ `#4012 <https://github.com/aio-libs/aiohttp/issues/4012>`_
+- Fixed HTTP client requests to honor ``no_proxy`` environment variables.
+ `#4431 <https://github.com/aio-libs/aiohttp/issues/4431>`_
+- Fix supporting WebSockets proxies configured via environment variables.
+ `#4648 <https://github.com/aio-libs/aiohttp/issues/4648>`_
+- Change return type on URLDispatcher to UrlMappingMatchInfo to improve type annotations.
+ `#4748 <https://github.com/aio-libs/aiohttp/issues/4748>`_
+- Ensure a cleanup context is cleaned up even when an exception occurs during startup.
+ `#4799 <https://github.com/aio-libs/aiohttp/issues/4799>`_
+- Added a new exception type for Unix socket client errors which provides a more useful error message.
+ `#4984 <https://github.com/aio-libs/aiohttp/issues/4984>`_
+- Remove Transfer-Encoding and Content-Type headers for 204 in StreamResponse
+ `#5106 <https://github.com/aio-libs/aiohttp/issues/5106>`_
+- Only depend on typing_extensions for Python <3.8
+ `#5107 <https://github.com/aio-libs/aiohttp/issues/5107>`_
+- Add ABNORMAL_CLOSURE and BAD_GATEWAY to WSCloseCode
+ `#5192 <https://github.com/aio-libs/aiohttp/issues/5192>`_
+- Fix cookies disappearing from HTTPExceptions.
+ `#5233 <https://github.com/aio-libs/aiohttp/issues/5233>`_
+- StaticResource prefixes no longer match URLs with a non-folder prefix. For example ``routes.static('/foo', '/foo')`` no longer matches the URL ``/foobar``. Previously, this would attempt to load the file ``/foo/ar``.
+ `#5250 <https://github.com/aio-libs/aiohttp/issues/5250>`_
+- Acquire the connection before running traces to prevent race condition.
+ `#5259 <https://github.com/aio-libs/aiohttp/issues/5259>`_
+- Add missing slots to ```_RequestContextManager`` and ``_WSRequestContextManager``
+ `#5329 <https://github.com/aio-libs/aiohttp/issues/5329>`_
+- Ensure sending a zero byte file does not throw an exception (round 2)
+ `#5380 <https://github.com/aio-libs/aiohttp/issues/5380>`_
+- Set "text/plain" when data is an empty string in client requests.
+ `#5392 <https://github.com/aio-libs/aiohttp/issues/5392>`_
+- Stop automatically releasing the ``ClientResponse`` object on calls to the ``ok`` property for the failed requests.
+ `#5403 <https://github.com/aio-libs/aiohttp/issues/5403>`_
+- Include query parameters from `params` keyword argument in tracing `URL`.
+ `#5432 <https://github.com/aio-libs/aiohttp/issues/5432>`_
+- Fix annotations
+ `#5466 <https://github.com/aio-libs/aiohttp/issues/5466>`_
+- Fixed the multipart POST requests processing to always release file
+ descriptors for the ``tempfile.Temporaryfile``-created
+ ``_io.BufferedRandom`` instances of files sent within multipart request
+ bodies via HTTP POST requests -- by :user:`webknjaz`.
+ `#5494 <https://github.com/aio-libs/aiohttp/issues/5494>`_
+- Fix 0 being incorrectly treated as an immediate timeout.
+ `#5527 <https://github.com/aio-libs/aiohttp/issues/5527>`_
+- Fixes failing tests when an environment variable <scheme>_proxy is set.
+ `#5554 <https://github.com/aio-libs/aiohttp/issues/5554>`_
+- Replace deprecated app handler design in ``tests/autobahn/server.py`` with call to ``web.run_app``; replace deprecated ``aiohttp.ws_connect`` calls in ``tests/autobahn/client.py`` with ``aiohttp.ClienSession.ws_connect``.
+ `#5606 <https://github.com/aio-libs/aiohttp/issues/5606>`_
+- Fixed test for ``HTTPUnauthorized`` that access the ``text`` argument. This is not used in any part of the code, so it's removed now.
+ `#5657 <https://github.com/aio-libs/aiohttp/issues/5657>`_
+- Remove incorrect default from docs
+ `#5727 <https://github.com/aio-libs/aiohttp/issues/5727>`_
+- Remove external test dependency to http://httpbin.org
+ `#5840 <https://github.com/aio-libs/aiohttp/issues/5840>`_
+- Don't cancel current task when entering a cancelled timer.
+ `#5853 <https://github.com/aio-libs/aiohttp/issues/5853>`_
+- Added ``params`` keyword argument to ``ClientSession.ws_connect``. -- :user:`hoh`.
+ `#5868 <https://github.com/aio-libs/aiohttp/issues/5868>`_
+- Uses :py:class:`~asyncio.ThreadedChildWatcher` under POSIX to allow setting up test loop in non-main thread.
+ `#5877 <https://github.com/aio-libs/aiohttp/issues/5877>`_
+- Fix the error in handling the return value of `getaddrinfo`.
+ `getaddrinfo` will return an `(int, bytes)` tuple, if CPython could not handle the address family.
+ It will cause a index out of range error in aiohttp. For example, if user compile CPython with
+ `--disable-ipv6` option but his system enable the ipv6.
+ `#5901 <https://github.com/aio-libs/aiohttp/issues/5901>`_
+- Removed the deprecated ``loop`` argument from the ``asyncio.sleep``/``gather`` calls
+ `#5905 <https://github.com/aio-libs/aiohttp/issues/5905>`_
+- Return ``None`` from ``request.if_modified_since``, ``request.if_unmodified_since``, ``request.if_range`` and ``response.last_modified`` when corresponding http date headers are invalid.
+ `#5925 <https://github.com/aio-libs/aiohttp/issues/5925>`_
+- Fix resetting `SIGCHLD` signals in Gunicorn aiohttp Worker to fix `subprocesses` that capture output having an incorrect `returncode`.
+ `#6130 <https://github.com/aio-libs/aiohttp/issues/6130>`_
+- Raise ``400: Content-Length can't be present with Transfer-Encoding`` if both ``Content-Length`` and ``Transfer-Encoding`` are sent by peer by both C and Python implementations
+ `#6182 <https://github.com/aio-libs/aiohttp/issues/6182>`_
+
+
+Improved Documentation
+----------------------
+
+- Refactored OpenAPI/Swagger aiohttp addons, added ``aio-openapi``
+ `#5326 <https://github.com/aio-libs/aiohttp/issues/5326>`_
+- Fixed docs on request cookies type, so it matches what is actually used in the code (a
+ read-only dictionary-like object).
+ `#5725 <https://github.com/aio-libs/aiohttp/issues/5725>`_
+- Documented that the HTTP client ``Authorization`` header is removed
+ on redirects to a different host or protocol.
+ `#5850 <https://github.com/aio-libs/aiohttp/issues/5850>`_
+
+
+Misc
+----
+
+- `#3927 <https://github.com/aio-libs/aiohttp/issues/3927>`_, `#4247 <https://github.com/aio-libs/aiohttp/issues/4247>`_, `#4247 <https://github.com/aio-libs/aiohttp/issues/4247>`_, `#5389 <https://github.com/aio-libs/aiohttp/issues/5389>`_, `#5457 <https://github.com/aio-libs/aiohttp/issues/5457>`_, `#5486 <https://github.com/aio-libs/aiohttp/issues/5486>`_, `#5494 <https://github.com/aio-libs/aiohttp/issues/5494>`_, `#5515 <https://github.com/aio-libs/aiohttp/issues/5515>`_, `#5625 <https://github.com/aio-libs/aiohttp/issues/5625>`_, `#5635 <https://github.com/aio-libs/aiohttp/issues/5635>`_, `#5648 <https://github.com/aio-libs/aiohttp/issues/5648>`_, `#5657 <https://github.com/aio-libs/aiohttp/issues/5657>`_, `#5890 <https://github.com/aio-libs/aiohttp/issues/5890>`_, `#5914 <https://github.com/aio-libs/aiohttp/issues/5914>`_, `#5932 <https://github.com/aio-libs/aiohttp/issues/5932>`_, `#6002 <https://github.com/aio-libs/aiohttp/issues/6002>`_, `#6045 <https://github.com/aio-libs/aiohttp/issues/6045>`_, `#6131 <https://github.com/aio-libs/aiohttp/issues/6131>`_, `#6156 <https://github.com/aio-libs/aiohttp/issues/6156>`_, `#6165 <https://github.com/aio-libs/aiohttp/issues/6165>`_, `#6166 <https://github.com/aio-libs/aiohttp/issues/6166>`_
+
+
+----
+
+
+3.7.4.post0 (2021-03-06)
+========================
+
+Misc
+----
+
+- Bumped upper bound of the ``chardet`` runtime dependency
+ to allow their v4.0 version stream.
+ `#5366 <https://github.com/aio-libs/aiohttp/issues/5366>`_
+
+
+----
+
+
+3.7.4 (2021-02-25)
+==================
+
+Bugfixes
+--------
+
+- **(SECURITY BUG)** Started preventing open redirects in the
+ ``aiohttp.web.normalize_path_middleware`` middleware. For
+ more details, see
+ https://github.com/aio-libs/aiohttp/security/advisories/GHSA-v6wp-4m6f-gcjg.
+
+ Thanks to `Beast Glatisant <https://github.com/g147>`__ for
+ finding the first instance of this issue and `Jelmer Vernooij
+ <https://jelmer.uk/>`__ for reporting and tracking it down
+ in aiohttp.
+ `#5497 <https://github.com/aio-libs/aiohttp/issues/5497>`_
+- Fix interpretation difference of the pure-Python and the Cython-based
+ HTTP parsers construct a ``yarl.URL`` object for HTTP request-target.
+
+ Before this fix, the Python parser would turn the URI's absolute-path
+ for ``//some-path`` into ``/`` while the Cython code preserved it as
+ ``//some-path``. Now, both do the latter.
+ `#5498 <https://github.com/aio-libs/aiohttp/issues/5498>`_
+
+
+----
+
+
+3.7.3 (2020-11-18)
+==================
+
+Features
+--------
+
+- Use Brotli instead of brotlipy
+ `#3803 <https://github.com/aio-libs/aiohttp/issues/3803>`_
+- Made exceptions pickleable. Also changed the repr of some exceptions.
+ `#4077 <https://github.com/aio-libs/aiohttp/issues/4077>`_
+
+
+Bugfixes
+--------
+
+- Raise a ClientResponseError instead of an AssertionError for a blank
+ HTTP Reason Phrase.
+ `#3532 <https://github.com/aio-libs/aiohttp/issues/3532>`_
+- Fix ``web_middlewares.normalize_path_middleware`` behavior for patch without slash.
+ `#3669 <https://github.com/aio-libs/aiohttp/issues/3669>`_
+- Fix overshadowing of overlapped sub-applications prefixes.
+ `#3701 <https://github.com/aio-libs/aiohttp/issues/3701>`_
+- Make `BaseConnector.close()` a coroutine and wait until the client closes all connections. Drop deprecated "with Connector():" syntax.
+ `#3736 <https://github.com/aio-libs/aiohttp/issues/3736>`_
+- Reset the ``sock_read`` timeout each time data is received for a ``aiohttp.client`` response.
+ `#3808 <https://github.com/aio-libs/aiohttp/issues/3808>`_
+- Fixed type annotation for add_view method of UrlDispatcher to accept any subclass of View
+ `#3880 <https://github.com/aio-libs/aiohttp/issues/3880>`_
+- Fixed querying the address families from DNS that the current host supports.
+ `#5156 <https://github.com/aio-libs/aiohttp/issues/5156>`_
+- Change return type of MultipartReader.__aiter__() and BodyPartReader.__aiter__() to AsyncIterator.
+ `#5163 <https://github.com/aio-libs/aiohttp/issues/5163>`_
+- Provide x86 Windows wheels.
+ `#5230 <https://github.com/aio-libs/aiohttp/issues/5230>`_
+
+
+Improved Documentation
+----------------------
+
+- Add documentation for ``aiohttp.web.FileResponse``.
+ `#3958 <https://github.com/aio-libs/aiohttp/issues/3958>`_
+- Removed deprecation warning in tracing example docs
+ `#3964 <https://github.com/aio-libs/aiohttp/issues/3964>`_
+- Fixed wrong "Usage" docstring of ``aiohttp.client.request``.
+ `#4603 <https://github.com/aio-libs/aiohttp/issues/4603>`_
+- Add aiohttp-pydantic to third party libraries
+ `#5228 <https://github.com/aio-libs/aiohttp/issues/5228>`_
+
+
+Misc
+----
+
+- `#4102 <https://github.com/aio-libs/aiohttp/issues/4102>`_
+
+
+----
+
+
+3.7.2 (2020-10-27)
+==================
+
+Bugfixes
+--------
+
+- Fixed static files handling for loops without ``.sendfile()`` support
+ `#5149 <https://github.com/aio-libs/aiohttp/issues/5149>`_
+
+
+----
+
+
+3.7.1 (2020-10-25)
+==================
+
+Bugfixes
+--------
+
+- Fixed a type error caused by the conditional import of `Protocol`.
+ `#5111 <https://github.com/aio-libs/aiohttp/issues/5111>`_
+- Server doesn't send Content-Length for 1xx or 204
+ `#4901 <https://github.com/aio-libs/aiohttp/issues/4901>`_
+- Fix run_app typing
+ `#4957 <https://github.com/aio-libs/aiohttp/issues/4957>`_
+- Always require ``typing_extensions`` library.
+ `#5107 <https://github.com/aio-libs/aiohttp/issues/5107>`_
+- Fix a variable-shadowing bug causing `ThreadedResolver.resolve` to
+ return the resolved IP as the ``hostname`` in each record, which prevented
+ validation of HTTPS connections.
+ `#5110 <https://github.com/aio-libs/aiohttp/issues/5110>`_
+- Added annotations to all public attributes.
+ `#5115 <https://github.com/aio-libs/aiohttp/issues/5115>`_
+- Fix flaky test_when_timeout_smaller_second
+ `#5116 <https://github.com/aio-libs/aiohttp/issues/5116>`_
+- Ensure sending a zero byte file does not throw an exception
+ `#5124 <https://github.com/aio-libs/aiohttp/issues/5124>`_
+- Fix a bug in ``web.run_app()`` about Python version checking on Windows
+ `#5127 <https://github.com/aio-libs/aiohttp/issues/5127>`_
+
+
+----
+
+
+3.7.0 (2020-10-24)
+==================
+
+Features
+--------
+
+- Response headers are now prepared prior to running ``on_response_prepare`` hooks, directly before headers are sent to the client.
+ `#1958 <https://github.com/aio-libs/aiohttp/issues/1958>`_
+- Add a ``quote_cookie`` option to ``CookieJar``, a way to skip quotation wrapping of cookies containing special characters.
+ `#2571 <https://github.com/aio-libs/aiohttp/issues/2571>`_
+- Call ``AccessLogger.log`` with the current exception available from ``sys.exc_info()``.
+ `#3557 <https://github.com/aio-libs/aiohttp/issues/3557>`_
+- `web.UrlDispatcher.add_routes` and `web.Application.add_routes` return a list
+ of registered `AbstractRoute` instances. `AbstractRouteDef.register` (and all
+ subclasses) return a list of registered resources registered resource.
+ `#3866 <https://github.com/aio-libs/aiohttp/issues/3866>`_
+- Added properties of default ClientSession params to ClientSession class so it is available for introspection
+ `#3882 <https://github.com/aio-libs/aiohttp/issues/3882>`_
+- Don't cancel web handler on peer disconnection, raise `OSError` on reading/writing instead.
+ `#4080 <https://github.com/aio-libs/aiohttp/issues/4080>`_
+- Implement BaseRequest.get_extra_info() to access a protocol transports' extra info.
+ `#4189 <https://github.com/aio-libs/aiohttp/issues/4189>`_
+- Added `ClientSession.timeout` property.
+ `#4191 <https://github.com/aio-libs/aiohttp/issues/4191>`_
+- allow use of SameSite in cookies.
+ `#4224 <https://github.com/aio-libs/aiohttp/issues/4224>`_
+- Use ``loop.sendfile()`` instead of custom implementation if available.
+ `#4269 <https://github.com/aio-libs/aiohttp/issues/4269>`_
+- Apply SO_REUSEADDR to test server's socket.
+ `#4393 <https://github.com/aio-libs/aiohttp/issues/4393>`_
+- Use .raw_host instead of slower .host in client API
+ `#4402 <https://github.com/aio-libs/aiohttp/issues/4402>`_
+- Allow configuring the buffer size of input stream by passing ``read_bufsize`` argument.
+ `#4453 <https://github.com/aio-libs/aiohttp/issues/4453>`_
+- Pass tests on Python 3.8 for Windows.
+ `#4513 <https://github.com/aio-libs/aiohttp/issues/4513>`_
+- Add `method` and `url` attributes to `TraceRequestChunkSentParams` and `TraceResponseChunkReceivedParams`.
+ `#4674 <https://github.com/aio-libs/aiohttp/issues/4674>`_
+- Add ClientResponse.ok property for checking status code under 400.
+ `#4711 <https://github.com/aio-libs/aiohttp/issues/4711>`_
+- Don't ceil timeouts that are smaller than 5 seconds.
+ `#4850 <https://github.com/aio-libs/aiohttp/issues/4850>`_
+- TCPSite now listens by default on all interfaces instead of just IPv4 when `None` is passed in as the host.
+ `#4894 <https://github.com/aio-libs/aiohttp/issues/4894>`_
+- Bump ``http_parser`` to 2.9.4
+ `#5070 <https://github.com/aio-libs/aiohttp/issues/5070>`_
+
+
+Bugfixes
+--------
+
+- Fix keepalive connections not being closed in time
+ `#3296 <https://github.com/aio-libs/aiohttp/issues/3296>`_
+- Fix failed websocket handshake leaving connection hanging.
+ `#3380 <https://github.com/aio-libs/aiohttp/issues/3380>`_
+- Fix tasks cancellation order on exit. The run_app task needs to be cancelled first for cleanup hooks to run with all tasks intact.
+ `#3805 <https://github.com/aio-libs/aiohttp/issues/3805>`_
+- Don't start heartbeat until _writer is set
+ `#4062 <https://github.com/aio-libs/aiohttp/issues/4062>`_
+- Fix handling of multipart file uploads without a content type.
+ `#4089 <https://github.com/aio-libs/aiohttp/issues/4089>`_
+- Preserve view handler function attributes across middlewares
+ `#4174 <https://github.com/aio-libs/aiohttp/issues/4174>`_
+- Fix the string representation of ``ServerDisconnectedError``.
+ `#4175 <https://github.com/aio-libs/aiohttp/issues/4175>`_
+- Raising RuntimeError when trying to get encoding from not read body
+ `#4214 <https://github.com/aio-libs/aiohttp/issues/4214>`_
+- Remove warning messages from noop.
+ `#4282 <https://github.com/aio-libs/aiohttp/issues/4282>`_
+- Raise ClientPayloadError if FormData re-processed.
+ `#4345 <https://github.com/aio-libs/aiohttp/issues/4345>`_
+- Fix a warning about unfinished task in ``web_protocol.py``
+ `#4408 <https://github.com/aio-libs/aiohttp/issues/4408>`_
+- Fixed 'deflate' compression. According to RFC 2616 now.
+ `#4506 <https://github.com/aio-libs/aiohttp/issues/4506>`_
+- Fixed OverflowError on platforms with 32-bit time_t
+ `#4515 <https://github.com/aio-libs/aiohttp/issues/4515>`_
+- Fixed request.body_exists returns wrong value for methods without body.
+ `#4528 <https://github.com/aio-libs/aiohttp/issues/4528>`_
+- Fix connecting to link-local IPv6 addresses.
+ `#4554 <https://github.com/aio-libs/aiohttp/issues/4554>`_
+- Fix a problem with connection waiters that are never awaited.
+ `#4562 <https://github.com/aio-libs/aiohttp/issues/4562>`_
+- Always make sure transport is not closing before reuse a connection.
+
+ Reuse a protocol based on keepalive in headers is unreliable.
+ For example, uWSGI will not support keepalive even it serves a
+ HTTP 1.1 request, except explicitly configure uWSGI with a
+ ``--http-keepalive`` option.
+
+ Servers designed like uWSGI could cause aiohttp intermittently
+ raise a ConnectionResetException when the protocol poll runs
+ out and some protocol is reused.
+ `#4587 <https://github.com/aio-libs/aiohttp/issues/4587>`_
+- Handle the last CRLF correctly even if it is received via separate TCP segment.
+ `#4630 <https://github.com/aio-libs/aiohttp/issues/4630>`_
+- Fix the register_resource function to validate route name before splitting it so that route name can include python keywords.
+ `#4691 <https://github.com/aio-libs/aiohttp/issues/4691>`_
+- Improve typing annotations for ``web.Request``, ``aiohttp.ClientResponse`` and
+ ``multipart`` module.
+ `#4736 <https://github.com/aio-libs/aiohttp/issues/4736>`_
+- Fix resolver task is not awaited when connector is cancelled
+ `#4795 <https://github.com/aio-libs/aiohttp/issues/4795>`_
+- Fix a bug "Aiohttp doesn't return any error on invalid request methods"
+ `#4798 <https://github.com/aio-libs/aiohttp/issues/4798>`_
+- Fix HEAD requests for static content.
+ `#4809 <https://github.com/aio-libs/aiohttp/issues/4809>`_
+- Fix incorrect size calculation for memoryview
+ `#4890 <https://github.com/aio-libs/aiohttp/issues/4890>`_
+- Add HTTPMove to _all__.
+ `#4897 <https://github.com/aio-libs/aiohttp/issues/4897>`_
+- Fixed the type annotations in the ``tracing`` module.
+ `#4912 <https://github.com/aio-libs/aiohttp/issues/4912>`_
+- Fix typing for multipart ``__aiter__``.
+ `#4931 <https://github.com/aio-libs/aiohttp/issues/4931>`_
+- Fix for race condition on connections in BaseConnector that leads to exceeding the connection limit.
+ `#4936 <https://github.com/aio-libs/aiohttp/issues/4936>`_
+- Add forced UTF-8 encoding for ``application/rdap+json`` responses.
+ `#4938 <https://github.com/aio-libs/aiohttp/issues/4938>`_
+- Fix inconsistency between Python and C http request parsers in parsing pct-encoded URL.
+ `#4972 <https://github.com/aio-libs/aiohttp/issues/4972>`_
+- Fix connection closing issue in HEAD request.
+ `#5012 <https://github.com/aio-libs/aiohttp/issues/5012>`_
+- Fix type hint on BaseRunner.addresses (from ``List[str]`` to ``List[Any]``)
+ `#5086 <https://github.com/aio-libs/aiohttp/issues/5086>`_
+- Make `web.run_app()` more responsive to Ctrl+C on Windows for Python < 3.8. It slightly
+ increases CPU load as a side effect.
+ `#5098 <https://github.com/aio-libs/aiohttp/issues/5098>`_
+
+
+Improved Documentation
+----------------------
+
+- Fix example code in client quick-start
+ `#3376 <https://github.com/aio-libs/aiohttp/issues/3376>`_
+- Updated the docs so there is no contradiction in ``ttl_dns_cache`` default value
+ `#3512 <https://github.com/aio-libs/aiohttp/issues/3512>`_
+- Add 'Deploy with SSL' to docs.
+ `#4201 <https://github.com/aio-libs/aiohttp/issues/4201>`_
+- Change typing of the secure argument on StreamResponse.set_cookie from ``Optional[str]`` to ``Optional[bool]``
+ `#4204 <https://github.com/aio-libs/aiohttp/issues/4204>`_
+- Changes ``ttl_dns_cache`` type from int to Optional[int].
+ `#4270 <https://github.com/aio-libs/aiohttp/issues/4270>`_
+- Simplify README hello word example and add a documentation page for people coming from requests.
+ `#4272 <https://github.com/aio-libs/aiohttp/issues/4272>`_
+- Improve some code examples in the documentation involving websockets and starting a simple HTTP site with an AppRunner.
+ `#4285 <https://github.com/aio-libs/aiohttp/issues/4285>`_
+- Fix typo in code example in Multipart docs
+ `#4312 <https://github.com/aio-libs/aiohttp/issues/4312>`_
+- Fix code example in Multipart section.
+ `#4314 <https://github.com/aio-libs/aiohttp/issues/4314>`_
+- Update contributing guide so new contributors read the most recent version of that guide. Update command used to create test coverage reporting.
+ `#4810 <https://github.com/aio-libs/aiohttp/issues/4810>`_
+- Spelling: Change "canonize" to "canonicalize".
+ `#4986 <https://github.com/aio-libs/aiohttp/issues/4986>`_
+- Add ``aiohttp-sse-client`` library to third party usage list.
+ `#5084 <https://github.com/aio-libs/aiohttp/issues/5084>`_
+
+
+Misc
+----
+
+- `#2856 <https://github.com/aio-libs/aiohttp/issues/2856>`_, `#4218 <https://github.com/aio-libs/aiohttp/issues/4218>`_, `#4250 <https://github.com/aio-libs/aiohttp/issues/4250>`_
+
+
+----
+
+
+3.6.3 (2020-10-12)
+==================
+
+Bugfixes
+--------
+
+- Pin yarl to ``<1.6.0`` to avoid buggy behavior that will be fixed by the next aiohttp
+ release.
+
+3.6.2 (2019-10-09)
+==================
+
+Features
+--------
+
+- Made exceptions pickleable. Also changed the repr of some exceptions.
+ `#4077 <https://github.com/aio-libs/aiohttp/issues/4077>`_
+- Use ``Iterable`` type hint instead of ``Sequence`` for ``Application`` *middleware*
+ parameter. `#4125 <https://github.com/aio-libs/aiohttp/issues/4125>`_
+
+
+Bugfixes
+--------
+
+- Reset the ``sock_read`` timeout each time data is received for a
+ ``aiohttp.ClientResponse``. `#3808
+ <https://github.com/aio-libs/aiohttp/issues/3808>`_
+- Fix handling of expired cookies so they are not stored in CookieJar.
+ `#4063 <https://github.com/aio-libs/aiohttp/issues/4063>`_
+- Fix misleading message in the string representation of ``ClientConnectorError``;
+ ``self.ssl == None`` means default SSL context, not SSL disabled `#4097
+ <https://github.com/aio-libs/aiohttp/issues/4097>`_
+- Don't clobber HTTP status when using FileResponse.
+ `#4106 <https://github.com/aio-libs/aiohttp/issues/4106>`_
+
+
+Improved Documentation
+----------------------
+
+- Added minimal required logging configuration to logging documentation.
+ `#2469 <https://github.com/aio-libs/aiohttp/issues/2469>`_
+- Update docs to reflect proxy support.
+ `#4100 <https://github.com/aio-libs/aiohttp/issues/4100>`_
+- Fix typo in code example in testing docs.
+ `#4108 <https://github.com/aio-libs/aiohttp/issues/4108>`_
+
+
+Misc
+----
+
+- `#4102 <https://github.com/aio-libs/aiohttp/issues/4102>`_
+
+
+----
+
+
+3.6.1 (2019-09-19)
+==================
+
+Features
+--------
+
+- Compatibility with Python 3.8.
+ `#4056 <https://github.com/aio-libs/aiohttp/issues/4056>`_
+
+
+Bugfixes
+--------
+
+- correct some exception string format
+ `#4068 <https://github.com/aio-libs/aiohttp/issues/4068>`_
+- Emit a warning when ``ssl.OP_NO_COMPRESSION`` is
+ unavailable because the runtime is built against
+ an outdated OpenSSL.
+ `#4052 <https://github.com/aio-libs/aiohttp/issues/4052>`_
+- Update multidict requirement to >= 4.5
+ `#4057 <https://github.com/aio-libs/aiohttp/issues/4057>`_
+
+
+Improved Documentation
+----------------------
+
+- Provide pytest-aiohttp namespace for pytest fixtures in docs.
+ `#3723 <https://github.com/aio-libs/aiohttp/issues/3723>`_
+
+
+----
+
+
+3.6.0 (2019-09-06)
+==================
+
+Features
+--------
+
+- Add support for Named Pipes (Site and Connector) under Windows. This feature requires
+ Proactor event loop to work. `#3629
+ <https://github.com/aio-libs/aiohttp/issues/3629>`_
+- Removed ``Transfer-Encoding: chunked`` header from websocket responses to be
+ compatible with more http proxy servers. `#3798
+ <https://github.com/aio-libs/aiohttp/issues/3798>`_
+- Accept non-GET request for starting websocket handshake on server side.
+ `#3980 <https://github.com/aio-libs/aiohttp/issues/3980>`_
+
+
+Bugfixes
+--------
+
+- Raise a ClientResponseError instead of an AssertionError for a blank
+ HTTP Reason Phrase.
+ `#3532 <https://github.com/aio-libs/aiohttp/issues/3532>`_
+- Fix an issue where cookies would sometimes not be set during a redirect.
+ `#3576 <https://github.com/aio-libs/aiohttp/issues/3576>`_
+- Change normalize_path_middleware to use 308 redirect instead of 301.
+
+ This behavior should prevent clients from being unable to use PUT/POST
+ methods on endpoints that are redirected because of a trailing slash.
+ `#3579 <https://github.com/aio-libs/aiohttp/issues/3579>`_
+- Drop the processed task from ``all_tasks()`` list early. It prevents logging about a
+ task with unhandled exception when the server is used in conjunction with
+ ``asyncio.run()``. `#3587 <https://github.com/aio-libs/aiohttp/issues/3587>`_
+- ``Signal`` type annotation changed from ``Signal[Callable[['TraceConfig'],
+ Awaitable[None]]]`` to ``Signal[Callable[ClientSession, SimpleNamespace, ...]``.
+ `#3595 <https://github.com/aio-libs/aiohttp/issues/3595>`_
+- Use sanitized URL as Location header in redirects
+ `#3614 <https://github.com/aio-libs/aiohttp/issues/3614>`_
+- Improve typing annotations for multipart.py along with changes required
+ by mypy in files that references multipart.py.
+ `#3621 <https://github.com/aio-libs/aiohttp/issues/3621>`_
+- Close session created inside ``aiohttp.request`` when unhandled exception occurs
+ `#3628 <https://github.com/aio-libs/aiohttp/issues/3628>`_
+- Cleanup per-chunk data in generic data read. Memory leak fixed.
+ `#3631 <https://github.com/aio-libs/aiohttp/issues/3631>`_
+- Use correct type for add_view and family
+ `#3633 <https://github.com/aio-libs/aiohttp/issues/3633>`_
+- Fix _keepalive field in __slots__ of ``RequestHandler``.
+ `#3644 <https://github.com/aio-libs/aiohttp/issues/3644>`_
+- Properly handle ConnectionResetError, to silence the "Cannot write to closing
+ transport" exception when clients disconnect uncleanly.
+ `#3648 <https://github.com/aio-libs/aiohttp/issues/3648>`_
+- Suppress pytest warnings due to ``test_utils`` classes
+ `#3660 <https://github.com/aio-libs/aiohttp/issues/3660>`_
+- Fix overshadowing of overlapped sub-application prefixes.
+ `#3701 <https://github.com/aio-libs/aiohttp/issues/3701>`_
+- Fixed return type annotation for WSMessage.json()
+ `#3720 <https://github.com/aio-libs/aiohttp/issues/3720>`_
+- Properly expose TooManyRedirects publicly as documented.
+ `#3818 <https://github.com/aio-libs/aiohttp/issues/3818>`_
+- Fix missing brackets for IPv6 in proxy CONNECT request
+ `#3841 <https://github.com/aio-libs/aiohttp/issues/3841>`_
+- Make the signature of ``aiohttp.test_utils.TestClient.request`` match
+ ``asyncio.ClientSession.request`` according to the docs `#3852
+ <https://github.com/aio-libs/aiohttp/issues/3852>`_
+- Use correct style for re-exported imports, makes mypy ``--strict`` mode happy.
+ `#3868 <https://github.com/aio-libs/aiohttp/issues/3868>`_
+- Fixed type annotation for add_view method of UrlDispatcher to accept any subclass of
+ View `#3880 <https://github.com/aio-libs/aiohttp/issues/3880>`_
+- Made cython HTTP parser set Reason-Phrase of the response to an empty string if it is
+ missing. `#3906 <https://github.com/aio-libs/aiohttp/issues/3906>`_
+- Add URL to the string representation of ClientResponseError.
+ `#3959 <https://github.com/aio-libs/aiohttp/issues/3959>`_
+- Accept ``istr`` keys in ``LooseHeaders`` type hints.
+ `#3976 <https://github.com/aio-libs/aiohttp/issues/3976>`_
+- Fixed race conditions in _resolve_host caching and throttling when tracing is enabled.
+ `#4013 <https://github.com/aio-libs/aiohttp/issues/4013>`_
+- For URLs like "unix://localhost/..." set Host HTTP header to "localhost" instead of
+ "localhost:None". `#4039 <https://github.com/aio-libs/aiohttp/issues/4039>`_
+
+
+Improved Documentation
+----------------------
+
+- Modify documentation for Background Tasks to remove deprecated usage of event loop.
+ `#3526 <https://github.com/aio-libs/aiohttp/issues/3526>`_
+- use ``if __name__ == '__main__':`` in server examples.
+ `#3775 <https://github.com/aio-libs/aiohttp/issues/3775>`_
+- Update documentation reference to the default access logger.
+ `#3783 <https://github.com/aio-libs/aiohttp/issues/3783>`_
+- Improve documentation for ``web.BaseRequest.path`` and ``web.BaseRequest.raw_path``.
+ `#3791 <https://github.com/aio-libs/aiohttp/issues/3791>`_
+- Removed deprecation warning in tracing example docs
+ `#3964 <https://github.com/aio-libs/aiohttp/issues/3964>`_
+
+
+----
+
+
+3.5.4 (2019-01-12)
+==================
+
+Bugfixes
+--------
+
+- Fix stream ``.read()`` / ``.readany()`` / ``.iter_any()`` which used to return a
+ partial content only in case of compressed content
+ `#3525 <https://github.com/aio-libs/aiohttp/issues/3525>`_
+
+
+3.5.3 (2019-01-10)
+==================
+
+Bugfixes
+--------
+
+- Fix type stubs for ``aiohttp.web.run_app(access_log=True)`` and fix edge case of
+ ``access_log=True`` and the event loop being in debug mode. `#3504
+ <https://github.com/aio-libs/aiohttp/issues/3504>`_
+- Fix ``aiohttp.ClientTimeout`` type annotations to accept ``None`` for fields
+ `#3511 <https://github.com/aio-libs/aiohttp/issues/3511>`_
+- Send custom per-request cookies even if session jar is empty
+ `#3515 <https://github.com/aio-libs/aiohttp/issues/3515>`_
+- Restore Linux binary wheels publishing on PyPI
+
+----
+
+
+3.5.2 (2019-01-08)
+==================
+
+Features
+--------
+
+- ``FileResponse`` from ``web_fileresponse.py`` uses a ``ThreadPoolExecutor`` to work
+ with files asynchronously. I/O based payloads from ``payload.py`` uses a
+ ``ThreadPoolExecutor`` to work with I/O objects asynchronously. `#3313
+ <https://github.com/aio-libs/aiohttp/issues/3313>`_
+- Internal Server Errors in plain text if the browser does not support HTML.
+ `#3483 <https://github.com/aio-libs/aiohttp/issues/3483>`_
+
+
+Bugfixes
+--------
+
+- Preserve MultipartWriter parts headers on write. Refactor the way how
+ ``Payload.headers`` are handled. Payload instances now always have headers and
+ Content-Type defined. Fix Payload Content-Disposition header reset after initial
+ creation. `#3035 <https://github.com/aio-libs/aiohttp/issues/3035>`_
+- Log suppressed exceptions in ``GunicornWebWorker``.
+ `#3464 <https://github.com/aio-libs/aiohttp/issues/3464>`_
+- Remove wildcard imports.
+ `#3468 <https://github.com/aio-libs/aiohttp/issues/3468>`_
+- Use the same task for app initialization and web server handling in gunicorn workers.
+ It allows to use Python3.7 context vars smoothly.
+ `#3471 <https://github.com/aio-libs/aiohttp/issues/3471>`_
+- Fix handling of chunked+gzipped response when first chunk does not give uncompressed
+ data `#3477 <https://github.com/aio-libs/aiohttp/issues/3477>`_
+- Replace ``collections.MutableMapping`` with ``collections.abc.MutableMapping`` to
+ avoid a deprecation warning. `#3480
+ <https://github.com/aio-libs/aiohttp/issues/3480>`_
+- ``Payload.size`` type annotation changed from ``Optional[float]`` to
+ ``Optional[int]``. `#3484 <https://github.com/aio-libs/aiohttp/issues/3484>`_
+- Ignore done tasks when cancels pending activities on ``web.run_app`` finalization.
+ `#3497 <https://github.com/aio-libs/aiohttp/issues/3497>`_
+
+
+Improved Documentation
+----------------------
+
+- Add documentation for ``aiohttp.web.HTTPException``.
+ `#3490 <https://github.com/aio-libs/aiohttp/issues/3490>`_
+
+
+Misc
+----
+
+- `#3487 <https://github.com/aio-libs/aiohttp/issues/3487>`_
+
+
+----
+
+
+3.5.1 (2018-12-24)
+====================
+
+- Fix a regression about ``ClientSession._requote_redirect_url`` modification in debug
+ mode.
+
+3.5.0 (2018-12-22)
+====================
+
+Features
+--------
+
+- The library type annotations are checked in strict mode now.
+- Add support for setting cookies for individual request (`#2387
+ <https://github.com/aio-libs/aiohttp/pull/2387>`_)
+- Application.add_domain implementation (`#2809
+ <https://github.com/aio-libs/aiohttp/pull/2809>`_)
+- The default ``app`` in the request returned by ``test_utils.make_mocked_request`` can
+ now have objects assigned to it and retrieved using the ``[]`` operator. (`#3174
+ <https://github.com/aio-libs/aiohttp/pull/3174>`_)
+- Make ``request.url`` accessible when transport is closed. (`#3177
+ <https://github.com/aio-libs/aiohttp/pull/3177>`_)
+- Add ``zlib_executor_size`` argument to ``Response`` constructor to allow compression
+ to run in a background executor to avoid blocking the main thread and potentially
+ triggering health check failures. (`#3205
+ <https://github.com/aio-libs/aiohttp/pull/3205>`_)
+- Enable users to set ``ClientTimeout`` in ``aiohttp.request`` (`#3213
+ <https://github.com/aio-libs/aiohttp/pull/3213>`_)
+- Don't raise a warning if ``NETRC`` environment variable is not set and ``~/.netrc``
+ file doesn't exist. (`#3267 <https://github.com/aio-libs/aiohttp/pull/3267>`_)
+- Add default logging handler to web.run_app If the ``Application.debug``` flag is set
+ and the default logger ``aiohttp.access`` is used, access logs will now be output
+ using a *stderr* ``StreamHandler`` if no handlers are attached. Furthermore, if the
+ default logger has no log level set, the log level will be set to ``DEBUG``. (`#3324
+ <https://github.com/aio-libs/aiohttp/pull/3324>`_)
+- Add method argument to ``session.ws_connect()``. Sometimes server API requires a
+ different HTTP method for WebSocket connection establishment. For example, ``Docker
+ exec`` needs POST. (`#3378 <https://github.com/aio-libs/aiohttp/pull/3378>`_)
+- Create a task per request handling. (`#3406
+ <https://github.com/aio-libs/aiohttp/pull/3406>`_)
+
+
+Bugfixes
+--------
+
+- Enable passing ``access_log_class`` via ``handler_args`` (`#3158
+ <https://github.com/aio-libs/aiohttp/pull/3158>`_)
+- Return empty bytes with end-of-chunk marker in empty stream reader. (`#3186
+ <https://github.com/aio-libs/aiohttp/pull/3186>`_)
+- Accept ``CIMultiDictProxy`` instances for ``headers`` argument in ``web.Response``
+ constructor. (`#3207 <https://github.com/aio-libs/aiohttp/pull/3207>`_)
+- Don't uppercase HTTP method in parser (`#3233
+ <https://github.com/aio-libs/aiohttp/pull/3233>`_)
+- Make method match regexp RFC-7230 compliant (`#3235
+ <https://github.com/aio-libs/aiohttp/pull/3235>`_)
+- Add ``app.pre_frozen`` state to properly handle startup signals in
+ sub-applications. (`#3237 <https://github.com/aio-libs/aiohttp/pull/3237>`_)
+- Enhanced parsing and validation of helpers.BasicAuth.decode. (`#3239
+ <https://github.com/aio-libs/aiohttp/pull/3239>`_)
+- Change imports from collections module in preparation for 3.8. (`#3258
+ <https://github.com/aio-libs/aiohttp/pull/3258>`_)
+- Ensure Host header is added first to ClientRequest to better replicate browser (`#3265
+ <https://github.com/aio-libs/aiohttp/pull/3265>`_)
+- Fix forward compatibility with Python 3.8: importing ABCs directly from the
+ collections module will not be supported anymore. (`#3273
+ <https://github.com/aio-libs/aiohttp/pull/3273>`_)
+- Keep the query string by ``normalize_path_middleware``. (`#3278
+ <https://github.com/aio-libs/aiohttp/pull/3278>`_)
+- Fix missing parameter ``raise_for_status`` for aiohttp.request() (`#3290
+ <https://github.com/aio-libs/aiohttp/pull/3290>`_)
+- Bracket IPv6 addresses in the HOST header (`#3304
+ <https://github.com/aio-libs/aiohttp/pull/3304>`_)
+- Fix default message for server ping and pong frames. (`#3308
+ <https://github.com/aio-libs/aiohttp/pull/3308>`_)
+- Fix tests/test_connector.py typo and tests/autobahn/server.py duplicate loop
+ def. (`#3337 <https://github.com/aio-libs/aiohttp/pull/3337>`_)
+- Fix false-negative indicator end_of_HTTP_chunk in StreamReader.readchunk function
+ (`#3361 <https://github.com/aio-libs/aiohttp/pull/3361>`_)
+- Release HTTP response before raising status exception (`#3364
+ <https://github.com/aio-libs/aiohttp/pull/3364>`_)
+- Fix task cancellation when ``sendfile()`` syscall is used by static file
+ handling. (`#3383 <https://github.com/aio-libs/aiohttp/pull/3383>`_)
+- Fix stack trace for ``asyncio.TimeoutError`` which was not logged, when it is caught
+ in the handler. (`#3414 <https://github.com/aio-libs/aiohttp/pull/3414>`_)
+
+
+Improved Documentation
+----------------------
+
+- Improve documentation of ``Application.make_handler`` parameters. (`#3152
+ <https://github.com/aio-libs/aiohttp/pull/3152>`_)
+- Fix BaseRequest.raw_headers doc. (`#3215
+ <https://github.com/aio-libs/aiohttp/pull/3215>`_)
+- Fix typo in TypeError exception reason in ``web.Application._handle`` (`#3229
+ <https://github.com/aio-libs/aiohttp/pull/3229>`_)
+- Make server access log format placeholder %b documentation reflect
+ behavior and docstring. (`#3307 <https://github.com/aio-libs/aiohttp/pull/3307>`_)
+
+
+Deprecations and Removals
+-------------------------
+
+- Deprecate modification of ``session.requote_redirect_url`` (`#2278
+ <https://github.com/aio-libs/aiohttp/pull/2278>`_)
+- Deprecate ``stream.unread_data()`` (`#3260
+ <https://github.com/aio-libs/aiohttp/pull/3260>`_)
+- Deprecated use of boolean in ``resp.enable_compression()`` (`#3318
+ <https://github.com/aio-libs/aiohttp/pull/3318>`_)
+- Encourage creation of aiohttp public objects inside a coroutine (`#3331
+ <https://github.com/aio-libs/aiohttp/pull/3331>`_)
+- Drop dead ``Connection.detach()`` and ``Connection.writer``. Both methods were broken
+ for more than 2 years. (`#3358 <https://github.com/aio-libs/aiohttp/pull/3358>`_)
+- Deprecate ``app.loop``, ``request.loop``, ``client.loop`` and ``connector.loop``
+ properties. (`#3374 <https://github.com/aio-libs/aiohttp/pull/3374>`_)
+- Deprecate explicit debug argument. Use asyncio debug mode instead. (`#3381
+ <https://github.com/aio-libs/aiohttp/pull/3381>`_)
+- Deprecate body parameter in HTTPException (and derived classes) constructor. (`#3385
+ <https://github.com/aio-libs/aiohttp/pull/3385>`_)
+- Deprecate bare connector close, use ``async with connector:`` and ``await
+ connector.close()`` instead. (`#3417
+ <https://github.com/aio-libs/aiohttp/pull/3417>`_)
+- Deprecate obsolete ``read_timeout`` and ``conn_timeout`` in ``ClientSession``
+ constructor. (`#3438 <https://github.com/aio-libs/aiohttp/pull/3438>`_)
+
+
+Misc
+----
+
+- #3341, #3351
diff --git a/third_party/python/aiohttp/CONTRIBUTORS.txt b/third_party/python/aiohttp/CONTRIBUTORS.txt
new file mode 100644
index 0000000000..6c2fabbdec
--- /dev/null
+++ b/third_party/python/aiohttp/CONTRIBUTORS.txt
@@ -0,0 +1,342 @@
+- Contributors -
+----------------
+A. Jesse Jiryu Davis
+Adam Bannister
+Adam Cooper
+Adam Horacek
+Adam Mills
+Adrian Krupa
+AdriƔn Chaves
+Ahmed Tahri
+Alan Tse
+Alec Hanefeld
+Alejandro GĆ³mez
+Aleksandr Danshyn
+Aleksey Kutepov
+Alex Hayes
+Alex Key
+Alex Khomchenko
+Alex Kuzmenko
+Alex Lisovoy
+Alexander Bayandin
+Alexander Karpinsky
+Alexander Koshevoy
+Alexander Malev
+Alexander Mohr
+Alexander Shorin
+Alexander Travov
+Alexandru Mihai
+Alexey Firsov
+Alexey Popravka
+Alexey Stepanov
+Amin Etesamian
+Amit Tulshyan
+Amy Boyle
+Anas El Amraoui
+Anders Melchiorsen
+Andrei Ursulenko
+Andrej Antonov
+Andrew Leech
+Andrew Lytvyn
+Andrew Svetlov
+Andrew Zhou
+Andrii Soldatenko
+Anes Abismail
+Antoine Pietri
+Anton Kasyanov
+Anton Zhdan-Pushkin
+Arseny Timoniq
+Artem Yushkovskiy
+Arthur Darcet
+Austin Scola
+Ben Bader
+Ben Greiner
+Ben Timby
+Benedikt Reinartz
+Bob Haddleton
+Boris Feld
+Boyi Chen
+Brett Cannon
+Brian Bouterse
+Brian C. Lane
+Brian Muller
+Bruce Merry
+Bruno Souza Cabral
+Bryan Kok
+Bryce Drennan
+Carl George
+Cecile Tonglet
+Chien-Wei Huang
+Chih-Yuan Chen
+Chris AtLee
+Chris Laws
+Chris Moore
+Christopher Schmitt
+Claudiu Popa
+Colin Dunklau
+Cong Xu
+Damien NadƩ
+Dan King
+Dan Xu
+Daniel GarcĆ­a
+Daniel Grossmann-Kavanagh
+Daniel Nelson
+Danny Song
+David Bibb
+David Michael Brown
+Denilson Amorim
+Denis Matiychuk
+Denis Moshensky
+Dennis Kliban
+Dima Veselov
+Dimitar Dimitrov
+Dmitriy Safonov
+Dmitry Doroshev
+Dmitry Erlikh
+Dmitry Lukashin
+Dmitry Marakasov
+Dmitry Shamov
+Dmitry Trofimov
+Dmytro Bohomiakov
+Dmytro Kuznetsov
+Dustin J. Mitchell
+Eduard Iskandarov
+Eli Ribble
+Elizabeth Leddy
+Enrique Saez
+Eric Sheng
+Erich Healy
+Erik Peterson
+Eugene Chernyshov
+Eugene Naydenov
+Eugene Nikolaiev
+Eugene Tolmachev
+Evan Kepner
+Evert Lammerts
+Felix Yan
+Fernanda GuimarĆ£es
+FichteFoll
+Florian Scheffler
+Franek Magiera
+Frederik Gladhorn
+Frederik Peter Aalund
+Gabriel Tremblay
+Gary Wilson Jr.
+Gennady Andreyev
+Georges Dubus
+Greg Holt
+Gregory Haynes
+Gus Goulart
+Gustavo Carneiro
+GĆ¼nther Jena
+Hans Adema
+Harmon Y.
+Harry Liu
+Hiroshi Ogawa
+Hrishikesh Paranjape
+Hu Bo
+Hugh Young
+Hugo Herter
+Hugo van Kemenade
+Hynek Schlawack
+Igor Alexandrov
+Igor Davydenko
+Igor Mozharovsky
+Igor Pavlov
+Illia Volochii
+Ilya Chichak
+Ilya Gruzinov
+Ingmar Steen
+Jacob Champion
+Jaesung Lee
+Jake Davis
+Jakob Ackermann
+Jakub Wilk
+Jan Buchar
+Jashandeep Sohi
+Jens Steinhauser
+Jeonghun Lee
+Jeongkyu Shin
+Jeroen van der Heijden
+Jesus Cea
+Jian Zeng
+Jinkyu Yi
+Joel Watts
+Jon Nabozny
+Jonas KrĆ¼ger Svensson
+Jonas Obrist
+Jonathan Wright
+Jonny Tan
+Joongi Kim
+Jordan Borean
+Josep Cugat
+Josh Junon
+Joshu Coats
+Julia Tsemusheva
+Julien Duponchelle
+Jungkook Park
+Junjie Tao
+Junyeong Jeong
+Justas Trimailovas
+Justin Foo
+Justin Turner Arthur
+Kay Zheng
+Kevin Samuel
+Kimmo Parviainen-Jalanko
+Kirill Klenov
+Kirill Malovitsa
+Konstantin Valetov
+Krzysztof Blazewicz
+Kyrylo Perevozchikov
+Kyungmin Lee
+Lars P. SĆøndergaard
+Liu Hua
+Louis-Philippe Huberdeau
+LoĆÆc Lajeanne
+Lu Gong
+Lubomir Gelo
+Ludovic Gasc
+Luis Pedrosa
+Lukasz Marcin Dobrzanski
+Makc Belousow
+Manuel Miranda
+Marat Sharafutdinov
+Marco Paolini
+Mariano Anaya
+Mariusz Masztalerczuk
+Marko Kohtala
+Martijn Pieters
+Martin Melka
+Martin Richard
+Mathias Frƶjdman
+Mathieu DugrƩ
+Matthieu Hauglustaine
+Matthieu Rigal
+Meet Mangukiya
+Michael Ihnatenko
+Michał GĆ³rny
+Mikhail Burshteyn
+Mikhail Kashkin
+Mikhail Lukyanchenko
+Mikhail Nacharov
+Misha Behersky
+Mitchell Ferree
+Morgan Delahaye-Prat
+Moss Collum
+Mun Gwan-gyeong
+Navid Sheikhol
+Nicolas Braem
+Nikolay Kim
+Nikolay Novik
+Nikolay Tiunov
+NƔndor MƔtravƶlgyi
+Oisin Aylward
+Olaf Conradi
+Pahaz Blinov
+Panagiotis Kolokotronis
+Pankaj Pandey
+Pau Freixes
+Paul Colomiets
+Paulius Å ileikis
+Paulus Schoutsen
+Pavel Kamaev
+Pavel Polyakov
+Pavel Sapezhko
+Pavol Vargovčƭk
+Pawel Kowalski
+Pawel Miech
+Pepe Osca
+Philipp A.
+Pieter van Beek
+Qiao Han
+Rafael Viotti
+Raphael Bialon
+RaĆŗl Cumplido
+Required Field
+Robert Lu
+Robert Nikolich
+Roman Podoliaka
+Samuel Colvin
+Sean Hunt
+Sebastian Acuna
+Sebastian Hanula
+Sebastian HĆ¼ther
+Sebastien Geffroy
+SeongSoo Cho
+Sergey Ninua
+Sergey Skripnick
+Serhii Charykov
+Serhii Kostel
+Serhiy Storchaka
+Simon Kennedy
+Sin-Woo Bang
+Stanislas Plum
+Stanislav Prokop
+Stefan Tjarks
+Stepan Pletnev
+Stephan Jaensch
+Stephen Cirelli
+Stephen Granade
+Steven Seguin
+Sunghyun Hwang
+Sunit Deshpande
+Sviatoslav Bulbakha
+Sviatoslav Sydorenko
+Taha Jahangir
+Taras Voinarovskyi
+Terence Honles
+Thanos Lefteris
+Thijs Vermeir
+Thomas Forbes
+Thomas Grainger
+Tolga Tezel
+Tomasz Trebski
+Toshiaki Tanaka
+Trinh Hoang Nhu
+Vadim Suharnikov
+Vaibhav Sagar
+Vamsi Krishna Avula
+Vasiliy Faronov
+Vasyl Baran
+Viacheslav Greshilov
+Victor Collod
+Victor Kovtun
+Vikas Kawadia
+Viktor Danyliuk
+Ville SkyttƤ
+Vincent Maillol
+Vitalik Verhovodov
+Vitaly Haritonsky
+Vitaly Magerya
+Vladimir Kamarzin
+Vladimir Kozlovski
+Vladimir Rutsky
+Vladimir Shulyak
+Vladimir Zakharov
+Vladyslav Bohaichuk
+Vladyslav Bondar
+W. Trevor King
+Wei Lin
+Weiwei Wang
+Will Fatherley
+Will McGugan
+Willem de Groot
+William Grzybowski
+William S.
+Wilson Ong
+Yang Zhou
+Yannick Koechlin
+Yannick PĆ©roux
+Ye Cao
+Yegor Roganov
+Yifei Kong
+Young-Ho Cha
+Yuriy Shatrov
+Yury Pliner
+Yury Selivanov
+Yusuke Tsutsumi
+Yuval Ofir
+Zeal Wierslee
+Zlatan Sičanica
+ŠœŠ°Ń€Šŗ ŠšŠ¾Ń€ŠµŠ½Š±ŠµŃ€Š³
+Š”ŠµŠ¼Ń‘Š½ ŠœŠ°Ń€ŃŒŃŃŠøŠ½
diff --git a/third_party/python/aiohttp/LICENSE.txt b/third_party/python/aiohttp/LICENSE.txt
new file mode 100644
index 0000000000..e497a322f2
--- /dev/null
+++ b/third_party/python/aiohttp/LICENSE.txt
@@ -0,0 +1,13 @@
+ Copyright aio-libs contributors.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
diff --git a/third_party/python/aiohttp/MANIFEST.in b/third_party/python/aiohttp/MANIFEST.in
new file mode 100644
index 0000000000..05084efddb
--- /dev/null
+++ b/third_party/python/aiohttp/MANIFEST.in
@@ -0,0 +1,20 @@
+include LICENSE.txt
+include CHANGES.rst
+include README.rst
+include CONTRIBUTORS.txt
+include Makefile
+graft aiohttp
+graft docs
+graft examples
+graft tests
+recursive-include vendor *
+global-include aiohttp *.pyi
+global-exclude *.pyc
+global-exclude *.pyd
+global-exclude *.so
+global-exclude *.lib
+global-exclude *.dll
+global-exclude *.a
+global-exclude *.obj
+exclude aiohttp/*.html
+prune docs/_build
diff --git a/third_party/python/aiohttp/Makefile b/third_party/python/aiohttp/Makefile
new file mode 100644
index 0000000000..5769d2a128
--- /dev/null
+++ b/third_party/python/aiohttp/Makefile
@@ -0,0 +1,188 @@
+# Some simple testing tasks (sorry, UNIX only).
+
+to-hash-one = $(dir $1).hash/$(addsuffix .hash,$(notdir $1))
+to-hash = $(foreach fname,$1,$(call to-hash-one,$(fname)))
+
+CYS := $(wildcard aiohttp/*.pyx) $(wildcard aiohttp/*.pyi) $(wildcard aiohttp/*.pxd)
+PYXS := $(wildcard aiohttp/*.pyx)
+CS := $(wildcard aiohttp/*.c)
+PYS := $(wildcard aiohttp/*.py)
+IN := doc-spelling lint cython dev
+ALLS := $(sort $(CYS) $(CS) $(PYS) $(REQS))
+
+
+.PHONY: all
+all: test
+
+tst:
+ @echo $(call to-hash,requirements/cython.txt)
+ @echo $(call to-hash,aiohttp/%.pyx)
+
+
+# Recipe from https://www.cmcrossroads.com/article/rebuilding-when-files-checksum-changes
+FORCE:
+
+# check_sum.py works perfectly fine but slow when called for every file from $(ALLS)
+# (perhaps even several times for each file).
+# That is why much less readable but faster solution exists
+ifneq (, $(shell which sha256sum))
+%.hash: FORCE
+ $(eval $@_ABS := $(abspath $@))
+ $(eval $@_NAME := $($@_ABS))
+ $(eval $@_HASHDIR := $(dir $($@_ABS)))
+ $(eval $@_TMP := $($@_HASHDIR)../$(notdir $($@_ABS)))
+ $(eval $@_ORIG := $(subst /.hash/../,/,$(basename $($@_TMP))))
+ @#echo ==== $($@_ABS) $($@_HASHDIR) $($@_NAME) $($@_TMP) $($@_ORIG)
+ @if ! (sha256sum --check $($@_ABS) 1>/dev/null 2>/dev/null); then \
+ mkdir -p $($@_HASHDIR); \
+ echo re-hash $($@_ORIG); \
+ sha256sum $($@_ORIG) > $($@_ABS); \
+ fi
+else
+%.hash: FORCE
+ @./tools/check_sum.py $@ # --debug
+endif
+
+# Enumerate intermediate files to don't remove them automatically.
+.SECONDARY: $(call to-hash,$(ALLS))
+
+.update-pip:
+ @python -m pip install --upgrade pip
+
+.install-cython: .update-pip $(call to-hash,requirements/cython.txt)
+ @python -m pip install -r requirements/cython.txt -c requirements/constraints.txt
+ @touch .install-cython
+
+aiohttp/_find_header.c: $(call to-hash,aiohttp/hdrs.py ./tools/gen.py)
+ ./tools/gen.py
+
+# _find_headers generator creates _headers.pyi as well
+aiohttp/%.c: aiohttp/%.pyx $(call to-hash,$(CYS)) aiohttp/_find_header.c
+ cython -3 -o $@ $< -I aiohttp
+
+vendor/llhttp/node_modules: vendor/llhttp/package.json
+ cd vendor/llhttp; npm install
+
+.llhttp-gen: vendor/llhttp/node_modules
+ $(MAKE) -C vendor/llhttp generate
+ @touch .llhttp-gen
+
+.PHONY: generate-llhttp
+generate-llhttp: .llhttp-gen
+
+.PHONY: cythonize
+cythonize: .install-cython $(PYXS:.pyx=.c)
+
+.install-deps: .install-cython $(PYXS:.pyx=.c) $(call to-hash,$(CYS) $(REQS))
+ @python -m pip install -r requirements/dev.txt -c requirements/constraints.txt
+ @touch .install-deps
+
+.PHONY: lint
+lint: fmt mypy
+
+.PHONY: fmt format
+fmt format:
+ python -m pre_commit run --all-files --show-diff-on-failure
+
+.PHONY: mypy
+mypy:
+ mypy
+
+.develop: .install-deps generate-llhttp $(call to-hash,$(PYS) $(CYS) $(CS))
+ python -m pip install -e . -c requirements/constraints.txt
+ @touch .develop
+
+.PHONY: test
+test: .develop
+ @pytest -q
+
+.PHONY: vtest
+vtest: .develop
+ @pytest -s -v
+
+.PHONY: vvtest
+vvtest: .develop
+ @pytest -vv
+
+
+define run_tests_in_docker
+ DOCKER_BUILDKIT=1 docker build --build-arg PYTHON_VERSION=$(1) --build-arg AIOHTTP_NO_EXTENSIONS=$(2) -t "aiohttp-test-$(1)-$(2)" -f tools/testing/Dockerfile .
+ docker run --rm -ti -v `pwd`:/src -w /src "aiohttp-test-$(1)-$(2)" $(TEST_SPEC)
+endef
+
+.PHONY: test-3.7-no-extensions test-3.7 test-3.8-no-extensions test-3.8 test-3.9-no-extensions test-3.9 test-3.10-no-extensions test-3.10
+test-3.7-no-extensions:
+ $(call run_tests_in_docker,3.7,y)
+test-3.7:
+ $(call run_tests_in_docker,3.7,n)
+test-3.8-no-extensions:
+ $(call run_tests_in_docker,3.8,y)
+test-3.8:
+ $(call run_tests_in_docker,3.8,n)
+test-3.9-no-extensions:
+ $(call run_tests_in_docker,3.9,y)
+test-3.9:
+ $(call run_tests_in_docker,3.9,n)
+test-3.10-no-extensions:
+ $(call run_tests_in_docker,3.10,y)
+test-3.10:
+ $(call run_tests_in_docker,3.10,n)
+
+.PHONY: clean
+clean:
+ @rm -rf `find . -name __pycache__`
+ @rm -rf `find . -name .hash`
+ @rm -rf `find . -name .md5` # old styling
+ @rm -f `find . -type f -name '*.py[co]' `
+ @rm -f `find . -type f -name '*~' `
+ @rm -f `find . -type f -name '.*~' `
+ @rm -f `find . -type f -name '@*' `
+ @rm -f `find . -type f -name '#*#' `
+ @rm -f `find . -type f -name '*.orig' `
+ @rm -f `find . -type f -name '*.rej' `
+ @rm -f `find . -type f -name '*.md5' ` # old styling
+ @rm -f .coverage
+ @rm -rf htmlcov
+ @rm -rf build
+ @rm -rf cover
+ @make -C docs clean
+ @python setup.py clean
+ @rm -f aiohttp/*.so
+ @rm -f aiohttp/*.pyd
+ @rm -f aiohttp/*.html
+ @rm -f aiohttp/_frozenlist.c
+ @rm -f aiohttp/_find_header.c
+ @rm -f aiohttp/_http_parser.c
+ @rm -f aiohttp/_http_writer.c
+ @rm -f aiohttp/_websocket.c
+ @rm -rf .tox
+ @rm -f .develop
+ @rm -f .flake
+ @rm -rf aiohttp.egg-info
+ @rm -f .install-deps
+ @rm -f .install-cython
+ @rm -rf vendor/llhttp/node_modules
+ @rm -f .llhttp-gen
+ @$(MAKE) -C vendor/llhttp clean
+
+.PHONY: doc
+doc:
+ @make -C docs html SPHINXOPTS="-W --keep-going -n -E"
+ @echo "open file://`pwd`/docs/_build/html/index.html"
+
+.PHONY: doc-spelling
+doc-spelling:
+ @make -C docs spelling SPHINXOPTS="-W --keep-going -n -E"
+
+.PHONY: compile-deps
+compile-deps: .update-pip $(REQS)
+ pip-compile --no-header --allow-unsafe -q --strip-extras \
+ -o requirements/constraints.txt \
+ requirements/constraints.in
+
+.PHONY: install
+install: .update-pip
+ @python -m pip install -r requirements/dev.txt -c requirements/constraints.txt
+
+.PHONY: install-dev
+install-dev: .develop
diff --git a/third_party/python/aiohttp/PKG-INFO b/third_party/python/aiohttp/PKG-INFO
new file mode 100644
index 0000000000..3793ae23d1
--- /dev/null
+++ b/third_party/python/aiohttp/PKG-INFO
@@ -0,0 +1,241 @@
+Metadata-Version: 2.1
+Name: aiohttp
+Version: 3.8.5
+Summary: Async http client/server framework (asyncio)
+Home-page: https://github.com/aio-libs/aiohttp
+Maintainer: aiohttp team <team@aiohttp.org>
+Maintainer-email: team@aiohttp.org
+License: Apache 2
+Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org
+Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org
+Project-URL: CI: GitHub Actions, https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI
+Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/aiohttp
+Project-URL: Docs: Changelog, https://docs.aiohttp.org/en/stable/changes.html
+Project-URL: Docs: RTD, https://docs.aiohttp.org
+Project-URL: GitHub: issues, https://github.com/aio-libs/aiohttp/issues
+Project-URL: GitHub: repo, https://github.com/aio-libs/aiohttp
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Framework :: AsyncIO
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: MacOS :: MacOS X
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Topic :: Internet :: WWW/HTTP
+Requires-Python: >=3.6
+Description-Content-Type: text/x-rst
+Provides-Extra: speedups
+License-File: LICENSE.txt
+
+==================================
+Async http client/server framework
+==================================
+
+.. image:: https://raw.githubusercontent.com/aio-libs/aiohttp/master/docs/aiohttp-plain.svg
+ :height: 64px
+ :width: 64px
+ :alt: aiohttp logo
+
+|
+
+.. image:: https://github.com/aio-libs/aiohttp/workflows/CI/badge.svg
+ :target: https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI
+ :alt: GitHub Actions status for master branch
+
+.. image:: https://codecov.io/gh/aio-libs/aiohttp/branch/master/graph/badge.svg
+ :target: https://codecov.io/gh/aio-libs/aiohttp
+ :alt: codecov.io status for master branch
+
+.. image:: https://badge.fury.io/py/aiohttp.svg
+ :target: https://pypi.org/project/aiohttp
+ :alt: Latest PyPI package version
+
+.. image:: https://readthedocs.org/projects/aiohttp/badge/?version=latest
+ :target: https://docs.aiohttp.org/
+ :alt: Latest Read The Docs
+
+.. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs:matrix.org
+ :alt: Matrix Room ā€” #aio-libs:matrix.org
+
+.. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs-space:matrix.org
+ :alt: Matrix Space ā€” #aio-libs-space:matrix.org
+
+
+Key Features
+============
+
+- Supports both client and server side of HTTP protocol.
+- Supports both client and server Web-Sockets out-of-the-box and avoids
+ Callback Hell.
+- Provides Web-server with middlewares and plugable routing.
+
+
+Getting started
+===============
+
+Client
+------
+
+To get something from the web:
+
+.. code-block:: python
+
+ import aiohttp
+ import asyncio
+
+ async def main():
+
+ async with aiohttp.ClientSession() as session:
+ async with session.get('http://python.org') as response:
+
+ print("Status:", response.status)
+ print("Content-type:", response.headers['content-type'])
+
+ html = await response.text()
+ print("Body:", html[:15], "...")
+
+ asyncio.run(main())
+
+This prints:
+
+.. code-block::
+
+ Status: 200
+ Content-type: text/html; charset=utf-8
+ Body: <!doctype html> ...
+
+Coming from `requests <https://requests.readthedocs.io/>`_ ? Read `why we need so many lines <https://aiohttp.readthedocs.io/en/latest/http_request_lifecycle.html>`_.
+
+Server
+------
+
+An example using a simple server:
+
+.. code-block:: python
+
+ # examples/server_simple.py
+ from aiohttp import web
+
+ async def handle(request):
+ name = request.match_info.get('name', "Anonymous")
+ text = "Hello, " + name
+ return web.Response(text=text)
+
+ async def wshandle(request):
+ ws = web.WebSocketResponse()
+ await ws.prepare(request)
+
+ async for msg in ws:
+ if msg.type == web.WSMsgType.text:
+ await ws.send_str("Hello, {}".format(msg.data))
+ elif msg.type == web.WSMsgType.binary:
+ await ws.send_bytes(msg.data)
+ elif msg.type == web.WSMsgType.close:
+ break
+
+ return ws
+
+
+ app = web.Application()
+ app.add_routes([web.get('/', handle),
+ web.get('/echo', wshandle),
+ web.get('/{name}', handle)])
+
+ if __name__ == '__main__':
+ web.run_app(app)
+
+
+Documentation
+=============
+
+https://aiohttp.readthedocs.io/
+
+
+Demos
+=====
+
+https://github.com/aio-libs/aiohttp-demos
+
+
+External links
+==============
+
+* `Third party libraries
+ <http://aiohttp.readthedocs.io/en/latest/third_party.html>`_
+* `Built with aiohttp
+ <http://aiohttp.readthedocs.io/en/latest/built_with.html>`_
+* `Powered by aiohttp
+ <http://aiohttp.readthedocs.io/en/latest/powered_by.html>`_
+
+Feel free to make a Pull Request for adding your link to these pages!
+
+
+Communication channels
+======================
+
+*aio-libs discourse group*: https://aio-libs.discourse.group
+
+*gitter chat* https://gitter.im/aio-libs/Lobby
+
+We support `Stack Overflow
+<https://stackoverflow.com/questions/tagged/aiohttp>`_.
+Please add *aiohttp* tag to your question there.
+
+Requirements
+============
+
+- Python >= 3.6
+- async-timeout_
+- attrs_
+- charset-normalizer_
+- multidict_
+- yarl_
+- frozenlist_
+
+Optionally you may install the cChardet_ and aiodns_ libraries (highly
+recommended for sake of speed).
+
+.. _charset-normalizer: https://pypi.org/project/charset-normalizer
+.. _aiodns: https://pypi.python.org/pypi/aiodns
+.. _attrs: https://github.com/python-attrs/attrs
+.. _multidict: https://pypi.python.org/pypi/multidict
+.. _frozenlist: https://pypi.org/project/frozenlist/
+.. _yarl: https://pypi.python.org/pypi/yarl
+.. _async-timeout: https://pypi.python.org/pypi/async_timeout
+.. _cChardet: https://pypi.python.org/pypi/cchardet
+
+License
+=======
+
+``aiohttp`` is offered under the Apache 2 license.
+
+
+Keepsafe
+========
+
+The aiohttp community would like to thank Keepsafe
+(https://www.getkeepsafe.com) for its support in the early days of
+the project.
+
+
+Source code
+===========
+
+The latest developer version is available in a GitHub repository:
+https://github.com/aio-libs/aiohttp
+
+Benchmarks
+==========
+
+If you are interested in efficiency, the AsyncIO community maintains a
+list of benchmarks on the official wiki:
+https://github.com/python/asyncio/wiki/Benchmarks
diff --git a/third_party/python/aiohttp/README.rst b/third_party/python/aiohttp/README.rst
new file mode 100644
index 0000000000..5841cbcb54
--- /dev/null
+++ b/third_party/python/aiohttp/README.rst
@@ -0,0 +1,205 @@
+==================================
+Async http client/server framework
+==================================
+
+.. image:: https://raw.githubusercontent.com/aio-libs/aiohttp/master/docs/aiohttp-plain.svg
+ :height: 64px
+ :width: 64px
+ :alt: aiohttp logo
+
+|
+
+.. image:: https://github.com/aio-libs/aiohttp/workflows/CI/badge.svg
+ :target: https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI
+ :alt: GitHub Actions status for master branch
+
+.. image:: https://codecov.io/gh/aio-libs/aiohttp/branch/master/graph/badge.svg
+ :target: https://codecov.io/gh/aio-libs/aiohttp
+ :alt: codecov.io status for master branch
+
+.. image:: https://badge.fury.io/py/aiohttp.svg
+ :target: https://pypi.org/project/aiohttp
+ :alt: Latest PyPI package version
+
+.. image:: https://readthedocs.org/projects/aiohttp/badge/?version=latest
+ :target: https://docs.aiohttp.org/
+ :alt: Latest Read The Docs
+
+.. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs:matrix.org
+ :alt: Matrix Room ā€” #aio-libs:matrix.org
+
+.. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs-space:matrix.org
+ :alt: Matrix Space ā€” #aio-libs-space:matrix.org
+
+
+Key Features
+============
+
+- Supports both client and server side of HTTP protocol.
+- Supports both client and server Web-Sockets out-of-the-box and avoids
+ Callback Hell.
+- Provides Web-server with middlewares and plugable routing.
+
+
+Getting started
+===============
+
+Client
+------
+
+To get something from the web:
+
+.. code-block:: python
+
+ import aiohttp
+ import asyncio
+
+ async def main():
+
+ async with aiohttp.ClientSession() as session:
+ async with session.get('http://python.org') as response:
+
+ print("Status:", response.status)
+ print("Content-type:", response.headers['content-type'])
+
+ html = await response.text()
+ print("Body:", html[:15], "...")
+
+ asyncio.run(main())
+
+This prints:
+
+.. code-block::
+
+ Status: 200
+ Content-type: text/html; charset=utf-8
+ Body: <!doctype html> ...
+
+Coming from `requests <https://requests.readthedocs.io/>`_ ? Read `why we need so many lines <https://aiohttp.readthedocs.io/en/latest/http_request_lifecycle.html>`_.
+
+Server
+------
+
+An example using a simple server:
+
+.. code-block:: python
+
+ # examples/server_simple.py
+ from aiohttp import web
+
+ async def handle(request):
+ name = request.match_info.get('name', "Anonymous")
+ text = "Hello, " + name
+ return web.Response(text=text)
+
+ async def wshandle(request):
+ ws = web.WebSocketResponse()
+ await ws.prepare(request)
+
+ async for msg in ws:
+ if msg.type == web.WSMsgType.text:
+ await ws.send_str("Hello, {}".format(msg.data))
+ elif msg.type == web.WSMsgType.binary:
+ await ws.send_bytes(msg.data)
+ elif msg.type == web.WSMsgType.close:
+ break
+
+ return ws
+
+
+ app = web.Application()
+ app.add_routes([web.get('/', handle),
+ web.get('/echo', wshandle),
+ web.get('/{name}', handle)])
+
+ if __name__ == '__main__':
+ web.run_app(app)
+
+
+Documentation
+=============
+
+https://aiohttp.readthedocs.io/
+
+
+Demos
+=====
+
+https://github.com/aio-libs/aiohttp-demos
+
+
+External links
+==============
+
+* `Third party libraries
+ <http://aiohttp.readthedocs.io/en/latest/third_party.html>`_
+* `Built with aiohttp
+ <http://aiohttp.readthedocs.io/en/latest/built_with.html>`_
+* `Powered by aiohttp
+ <http://aiohttp.readthedocs.io/en/latest/powered_by.html>`_
+
+Feel free to make a Pull Request for adding your link to these pages!
+
+
+Communication channels
+======================
+
+*aio-libs discourse group*: https://aio-libs.discourse.group
+
+*gitter chat* https://gitter.im/aio-libs/Lobby
+
+We support `Stack Overflow
+<https://stackoverflow.com/questions/tagged/aiohttp>`_.
+Please add *aiohttp* tag to your question there.
+
+Requirements
+============
+
+- Python >= 3.6
+- async-timeout_
+- attrs_
+- charset-normalizer_
+- multidict_
+- yarl_
+- frozenlist_
+
+Optionally you may install the cChardet_ and aiodns_ libraries (highly
+recommended for sake of speed).
+
+.. _charset-normalizer: https://pypi.org/project/charset-normalizer
+.. _aiodns: https://pypi.python.org/pypi/aiodns
+.. _attrs: https://github.com/python-attrs/attrs
+.. _multidict: https://pypi.python.org/pypi/multidict
+.. _frozenlist: https://pypi.org/project/frozenlist/
+.. _yarl: https://pypi.python.org/pypi/yarl
+.. _async-timeout: https://pypi.python.org/pypi/async_timeout
+.. _cChardet: https://pypi.python.org/pypi/cchardet
+
+License
+=======
+
+``aiohttp`` is offered under the Apache 2 license.
+
+
+Keepsafe
+========
+
+The aiohttp community would like to thank Keepsafe
+(https://www.getkeepsafe.com) for its support in the early days of
+the project.
+
+
+Source code
+===========
+
+The latest developer version is available in a GitHub repository:
+https://github.com/aio-libs/aiohttp
+
+Benchmarks
+==========
+
+If you are interested in efficiency, the AsyncIO community maintains a
+list of benchmarks on the official wiki:
+https://github.com/python/asyncio/wiki/Benchmarks
diff --git a/third_party/python/aiohttp/aiohttp.egg-info/PKG-INFO b/third_party/python/aiohttp/aiohttp.egg-info/PKG-INFO
new file mode 100644
index 0000000000..3793ae23d1
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp.egg-info/PKG-INFO
@@ -0,0 +1,241 @@
+Metadata-Version: 2.1
+Name: aiohttp
+Version: 3.8.5
+Summary: Async http client/server framework (asyncio)
+Home-page: https://github.com/aio-libs/aiohttp
+Maintainer: aiohttp team <team@aiohttp.org>
+Maintainer-email: team@aiohttp.org
+License: Apache 2
+Project-URL: Chat: Matrix, https://matrix.to/#/#aio-libs:matrix.org
+Project-URL: Chat: Matrix Space, https://matrix.to/#/#aio-libs-space:matrix.org
+Project-URL: CI: GitHub Actions, https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI
+Project-URL: Coverage: codecov, https://codecov.io/github/aio-libs/aiohttp
+Project-URL: Docs: Changelog, https://docs.aiohttp.org/en/stable/changes.html
+Project-URL: Docs: RTD, https://docs.aiohttp.org
+Project-URL: GitHub: issues, https://github.com/aio-libs/aiohttp/issues
+Project-URL: GitHub: repo, https://github.com/aio-libs/aiohttp
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Framework :: AsyncIO
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: Apache Software License
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: MacOS :: MacOS X
+Classifier: Operating System :: Microsoft :: Windows
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Topic :: Internet :: WWW/HTTP
+Requires-Python: >=3.6
+Description-Content-Type: text/x-rst
+Provides-Extra: speedups
+License-File: LICENSE.txt
+
+==================================
+Async http client/server framework
+==================================
+
+.. image:: https://raw.githubusercontent.com/aio-libs/aiohttp/master/docs/aiohttp-plain.svg
+ :height: 64px
+ :width: 64px
+ :alt: aiohttp logo
+
+|
+
+.. image:: https://github.com/aio-libs/aiohttp/workflows/CI/badge.svg
+ :target: https://github.com/aio-libs/aiohttp/actions?query=workflow%3ACI
+ :alt: GitHub Actions status for master branch
+
+.. image:: https://codecov.io/gh/aio-libs/aiohttp/branch/master/graph/badge.svg
+ :target: https://codecov.io/gh/aio-libs/aiohttp
+ :alt: codecov.io status for master branch
+
+.. image:: https://badge.fury.io/py/aiohttp.svg
+ :target: https://pypi.org/project/aiohttp
+ :alt: Latest PyPI package version
+
+.. image:: https://readthedocs.org/projects/aiohttp/badge/?version=latest
+ :target: https://docs.aiohttp.org/
+ :alt: Latest Read The Docs
+
+.. image:: https://img.shields.io/matrix/aio-libs:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs:matrix.org
+ :alt: Matrix Room ā€” #aio-libs:matrix.org
+
+.. image:: https://img.shields.io/matrix/aio-libs-space:matrix.org?label=Discuss%20on%20Matrix%20at%20%23aio-libs-space%3Amatrix.org&logo=matrix&server_fqdn=matrix.org&style=flat
+ :target: https://matrix.to/#/%23aio-libs-space:matrix.org
+ :alt: Matrix Space ā€” #aio-libs-space:matrix.org
+
+
+Key Features
+============
+
+- Supports both client and server side of HTTP protocol.
+- Supports both client and server Web-Sockets out-of-the-box and avoids
+ Callback Hell.
+- Provides Web-server with middlewares and plugable routing.
+
+
+Getting started
+===============
+
+Client
+------
+
+To get something from the web:
+
+.. code-block:: python
+
+ import aiohttp
+ import asyncio
+
+ async def main():
+
+ async with aiohttp.ClientSession() as session:
+ async with session.get('http://python.org') as response:
+
+ print("Status:", response.status)
+ print("Content-type:", response.headers['content-type'])
+
+ html = await response.text()
+ print("Body:", html[:15], "...")
+
+ asyncio.run(main())
+
+This prints:
+
+.. code-block::
+
+ Status: 200
+ Content-type: text/html; charset=utf-8
+ Body: <!doctype html> ...
+
+Coming from `requests <https://requests.readthedocs.io/>`_ ? Read `why we need so many lines <https://aiohttp.readthedocs.io/en/latest/http_request_lifecycle.html>`_.
+
+Server
+------
+
+An example using a simple server:
+
+.. code-block:: python
+
+ # examples/server_simple.py
+ from aiohttp import web
+
+ async def handle(request):
+ name = request.match_info.get('name', "Anonymous")
+ text = "Hello, " + name
+ return web.Response(text=text)
+
+ async def wshandle(request):
+ ws = web.WebSocketResponse()
+ await ws.prepare(request)
+
+ async for msg in ws:
+ if msg.type == web.WSMsgType.text:
+ await ws.send_str("Hello, {}".format(msg.data))
+ elif msg.type == web.WSMsgType.binary:
+ await ws.send_bytes(msg.data)
+ elif msg.type == web.WSMsgType.close:
+ break
+
+ return ws
+
+
+ app = web.Application()
+ app.add_routes([web.get('/', handle),
+ web.get('/echo', wshandle),
+ web.get('/{name}', handle)])
+
+ if __name__ == '__main__':
+ web.run_app(app)
+
+
+Documentation
+=============
+
+https://aiohttp.readthedocs.io/
+
+
+Demos
+=====
+
+https://github.com/aio-libs/aiohttp-demos
+
+
+External links
+==============
+
+* `Third party libraries
+ <http://aiohttp.readthedocs.io/en/latest/third_party.html>`_
+* `Built with aiohttp
+ <http://aiohttp.readthedocs.io/en/latest/built_with.html>`_
+* `Powered by aiohttp
+ <http://aiohttp.readthedocs.io/en/latest/powered_by.html>`_
+
+Feel free to make a Pull Request for adding your link to these pages!
+
+
+Communication channels
+======================
+
+*aio-libs discourse group*: https://aio-libs.discourse.group
+
+*gitter chat* https://gitter.im/aio-libs/Lobby
+
+We support `Stack Overflow
+<https://stackoverflow.com/questions/tagged/aiohttp>`_.
+Please add *aiohttp* tag to your question there.
+
+Requirements
+============
+
+- Python >= 3.6
+- async-timeout_
+- attrs_
+- charset-normalizer_
+- multidict_
+- yarl_
+- frozenlist_
+
+Optionally you may install the cChardet_ and aiodns_ libraries (highly
+recommended for sake of speed).
+
+.. _charset-normalizer: https://pypi.org/project/charset-normalizer
+.. _aiodns: https://pypi.python.org/pypi/aiodns
+.. _attrs: https://github.com/python-attrs/attrs
+.. _multidict: https://pypi.python.org/pypi/multidict
+.. _frozenlist: https://pypi.org/project/frozenlist/
+.. _yarl: https://pypi.python.org/pypi/yarl
+.. _async-timeout: https://pypi.python.org/pypi/async_timeout
+.. _cChardet: https://pypi.python.org/pypi/cchardet
+
+License
+=======
+
+``aiohttp`` is offered under the Apache 2 license.
+
+
+Keepsafe
+========
+
+The aiohttp community would like to thank Keepsafe
+(https://www.getkeepsafe.com) for its support in the early days of
+the project.
+
+
+Source code
+===========
+
+The latest developer version is available in a GitHub repository:
+https://github.com/aio-libs/aiohttp
+
+Benchmarks
+==========
+
+If you are interested in efficiency, the AsyncIO community maintains a
+list of benchmarks on the official wiki:
+https://github.com/python/asyncio/wiki/Benchmarks
diff --git a/third_party/python/aiohttp/aiohttp.egg-info/SOURCES.txt b/third_party/python/aiohttp/aiohttp.egg-info/SOURCES.txt
new file mode 100644
index 0000000000..2ec53fcad1
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp.egg-info/SOURCES.txt
@@ -0,0 +1,290 @@
+CHANGES.rst
+CONTRIBUTORS.txt
+LICENSE.txt
+MANIFEST.in
+Makefile
+README.rst
+pyproject.toml
+setup.cfg
+setup.py
+aiohttp/__init__.py
+aiohttp/_cparser.pxd
+aiohttp/_find_header.c
+aiohttp/_find_header.h
+aiohttp/_find_header.pxd
+aiohttp/_headers.pxi
+aiohttp/_helpers.c
+aiohttp/_helpers.pyi
+aiohttp/_helpers.pyx
+aiohttp/_http_parser.c
+aiohttp/_http_parser.pyx
+aiohttp/_http_writer.c
+aiohttp/_http_writer.pyx
+aiohttp/_websocket.c
+aiohttp/_websocket.pyx
+aiohttp/abc.py
+aiohttp/base_protocol.py
+aiohttp/client.py
+aiohttp/client_exceptions.py
+aiohttp/client_proto.py
+aiohttp/client_reqrep.py
+aiohttp/client_ws.py
+aiohttp/connector.py
+aiohttp/cookiejar.py
+aiohttp/formdata.py
+aiohttp/hdrs.py
+aiohttp/helpers.py
+aiohttp/http.py
+aiohttp/http_exceptions.py
+aiohttp/http_parser.py
+aiohttp/http_websocket.py
+aiohttp/http_writer.py
+aiohttp/locks.py
+aiohttp/log.py
+aiohttp/multipart.py
+aiohttp/payload.py
+aiohttp/payload_streamer.py
+aiohttp/py.typed
+aiohttp/pytest_plugin.py
+aiohttp/resolver.py
+aiohttp/streams.py
+aiohttp/tcp_helpers.py
+aiohttp/test_utils.py
+aiohttp/tracing.py
+aiohttp/typedefs.py
+aiohttp/web.py
+aiohttp/web_app.py
+aiohttp/web_exceptions.py
+aiohttp/web_fileresponse.py
+aiohttp/web_log.py
+aiohttp/web_middlewares.py
+aiohttp/web_protocol.py
+aiohttp/web_request.py
+aiohttp/web_response.py
+aiohttp/web_routedef.py
+aiohttp/web_runner.py
+aiohttp/web_server.py
+aiohttp/web_urldispatcher.py
+aiohttp/web_ws.py
+aiohttp/worker.py
+aiohttp.egg-info/PKG-INFO
+aiohttp.egg-info/SOURCES.txt
+aiohttp.egg-info/dependency_links.txt
+aiohttp.egg-info/not-zip-safe
+aiohttp.egg-info/requires.txt
+aiohttp.egg-info/top_level.txt
+aiohttp/.hash/_cparser.pxd.hash
+aiohttp/.hash/_find_header.pxd.hash
+aiohttp/.hash/_helpers.pyi.hash
+aiohttp/.hash/_helpers.pyx.hash
+aiohttp/.hash/_http_parser.pyx.hash
+aiohttp/.hash/_http_writer.pyx.hash
+aiohttp/.hash/_websocket.pyx.hash
+aiohttp/.hash/hdrs.py.hash
+docs/Makefile
+docs/abc.rst
+docs/aiohttp-icon.svg
+docs/aiohttp-plain.svg
+docs/built_with.rst
+docs/changes.rst
+docs/client.rst
+docs/client_advanced.rst
+docs/client_quickstart.rst
+docs/client_reference.rst
+docs/conf.py
+docs/contributing.rst
+docs/deployment.rst
+docs/essays.rst
+docs/external.rst
+docs/faq.rst
+docs/favicon.ico
+docs/glossary.rst
+docs/http_request_lifecycle.rst
+docs/index.rst
+docs/logging.rst
+docs/make.bat
+docs/migration_to_2xx.rst
+docs/misc.rst
+docs/multipart.rst
+docs/multipart_reference.rst
+docs/new_router.rst
+docs/old-logo.png
+docs/old-logo.svg
+docs/powered_by.rst
+docs/spelling_wordlist.txt
+docs/streams.rst
+docs/structures.rst
+docs/testing.rst
+docs/third_party.rst
+docs/tracing_reference.rst
+docs/utilities.rst
+docs/web.rst
+docs/web_advanced.rst
+docs/web_lowlevel.rst
+docs/web_quickstart.rst
+docs/web_reference.rst
+docs/websocket_utilities.rst
+docs/whats_new_1_1.rst
+docs/whats_new_3_0.rst
+docs/_snippets/cchardet-unmaintained-admonition.rst
+docs/_static/css/logo-adjustments.css
+examples/__init__.py
+examples/background_tasks.py
+examples/cli_app.py
+examples/client_auth.py
+examples/client_json.py
+examples/client_ws.py
+examples/curl.py
+examples/fake_server.py
+examples/lowlevel_srv.py
+examples/server.crt
+examples/server.csr
+examples/server.key
+examples/server_simple.py
+examples/static_files.py
+examples/web_classview.py
+examples/web_cookies.py
+examples/web_rewrite_headers_middleware.py
+examples/web_srv.py
+examples/web_srv_route_deco.py
+examples/web_srv_route_table.py
+examples/web_ws.py
+examples/websocket.html
+tests/aiohttp.jpg
+tests/aiohttp.png
+tests/conftest.py
+tests/data.unknown_mime_type
+tests/data.zero_bytes
+tests/hello.txt.gz
+tests/sample.txt
+tests/test___all__.py
+tests/test_base_protocol.py
+tests/test_circular_imports.py
+tests/test_classbasedview.py
+tests/test_client_connection.py
+tests/test_client_exceptions.py
+tests/test_client_fingerprint.py
+tests/test_client_functional.py
+tests/test_client_proto.py
+tests/test_client_request.py
+tests/test_client_response.py
+tests/test_client_session.py
+tests/test_client_ws.py
+tests/test_client_ws_functional.py
+tests/test_connector.py
+tests/test_cookiejar.py
+tests/test_flowcontrol_streams.py
+tests/test_formdata.py
+tests/test_helpers.py
+tests/test_http_exceptions.py
+tests/test_http_parser.py
+tests/test_http_writer.py
+tests/test_locks.py
+tests/test_loop.py
+tests/test_multipart.py
+tests/test_multipart_helpers.py
+tests/test_payload.py
+tests/test_proxy.py
+tests/test_proxy_functional.py
+tests/test_pytest_plugin.py
+tests/test_resolver.py
+tests/test_route_def.py
+tests/test_run_app.py
+tests/test_streams.py
+tests/test_tcp_helpers.py
+tests/test_test_utils.py
+tests/test_tracing.py
+tests/test_urldispatch.py
+tests/test_web_app.py
+tests/test_web_cli.py
+tests/test_web_exceptions.py
+tests/test_web_functional.py
+tests/test_web_log.py
+tests/test_web_middleware.py
+tests/test_web_request.py
+tests/test_web_request_handler.py
+tests/test_web_response.py
+tests/test_web_runner.py
+tests/test_web_sendfile.py
+tests/test_web_sendfile_functional.py
+tests/test_web_server.py
+tests/test_web_urldispatcher.py
+tests/test_web_websocket.py
+tests/test_web_websocket_functional.py
+tests/test_websocket_handshake.py
+tests/test_websocket_parser.py
+tests/test_websocket_writer.py
+tests/test_worker.py
+tests/autobahn/Dockerfile.aiohttp
+tests/autobahn/Dockerfile.autobahn
+tests/autobahn/test_autobahn.py
+tests/autobahn/client/client.py
+tests/autobahn/client/fuzzingserver.json
+tests/autobahn/server/fuzzingclient.json
+tests/autobahn/server/server.py
+vendor/README.rst
+vendor/llhttp/.dockerignore
+vendor/llhttp/.eslintrc.js
+vendor/llhttp/.git
+vendor/llhttp/.gitignore
+vendor/llhttp/.npmrc
+vendor/llhttp/CMakeLists.txt
+vendor/llhttp/CNAME
+vendor/llhttp/CODE_OF_CONDUCT.md
+vendor/llhttp/Dockerfile
+vendor/llhttp/LICENSE-MIT
+vendor/llhttp/Makefile
+vendor/llhttp/README.md
+vendor/llhttp/_config.yml
+vendor/llhttp/libllhttp.pc.in
+vendor/llhttp/package-lock.json
+vendor/llhttp/package.json
+vendor/llhttp/tsconfig.json
+vendor/llhttp/tslint.json
+vendor/llhttp/.github/workflows/ci.yaml
+vendor/llhttp/bench/index.ts
+vendor/llhttp/bin/build_wasm.ts
+vendor/llhttp/bin/generate.ts
+vendor/llhttp/build/llhttp.h
+vendor/llhttp/build/c/llhttp.c
+vendor/llhttp/docs/releasing.md
+vendor/llhttp/examples/wasm.ts
+vendor/llhttp/images/http-loose-none.png
+vendor/llhttp/images/http-strict-none.png
+vendor/llhttp/src/common.gypi
+vendor/llhttp/src/llhttp.gyp
+vendor/llhttp/src/llhttp.ts
+vendor/llhttp/src/llhttp/c-headers.ts
+vendor/llhttp/src/llhttp/constants.ts
+vendor/llhttp/src/llhttp/http.ts
+vendor/llhttp/src/llhttp/url.ts
+vendor/llhttp/src/llhttp/utils.ts
+vendor/llhttp/src/native/api.c
+vendor/llhttp/src/native/api.h
+vendor/llhttp/src/native/http.c
+vendor/llhttp/test/md-test.ts
+vendor/llhttp/test/url.md
+vendor/llhttp/test/fixtures/extra.c
+vendor/llhttp/test/fixtures/index.ts
+vendor/llhttp/test/fuzzers/fuzz_parser.c
+vendor/llhttp/test/request/connection.md
+vendor/llhttp/test/request/content-length.md
+vendor/llhttp/test/request/finish.md
+vendor/llhttp/test/request/invalid.md
+vendor/llhttp/test/request/lenient-headers.md
+vendor/llhttp/test/request/lenient-version.md
+vendor/llhttp/test/request/method.md
+vendor/llhttp/test/request/pausing.md
+vendor/llhttp/test/request/pipelining.md
+vendor/llhttp/test/request/sample.md
+vendor/llhttp/test/request/transfer-encoding.md
+vendor/llhttp/test/request/uri.md
+vendor/llhttp/test/response/connection.md
+vendor/llhttp/test/response/content-length.md
+vendor/llhttp/test/response/finish.md
+vendor/llhttp/test/response/invalid.md
+vendor/llhttp/test/response/lenient-version.md
+vendor/llhttp/test/response/pausing.md
+vendor/llhttp/test/response/pipelining.md
+vendor/llhttp/test/response/sample.md
+vendor/llhttp/test/response/transfer-encoding.md \ No newline at end of file
diff --git a/third_party/python/aiohttp/aiohttp.egg-info/dependency_links.txt b/third_party/python/aiohttp/aiohttp.egg-info/dependency_links.txt
new file mode 100644
index 0000000000..8b13789179
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/third_party/python/aiohttp/aiohttp.egg-info/not-zip-safe b/third_party/python/aiohttp/aiohttp.egg-info/not-zip-safe
new file mode 100644
index 0000000000..8b13789179
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp.egg-info/not-zip-safe
@@ -0,0 +1 @@
+
diff --git a/third_party/python/aiohttp/aiohttp.egg-info/requires.txt b/third_party/python/aiohttp/aiohttp.egg-info/requires.txt
new file mode 100644
index 0000000000..7c8bd86824
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp.egg-info/requires.txt
@@ -0,0 +1,21 @@
+attrs>=17.3.0
+charset-normalizer<4.0,>=2.0
+multidict<7.0,>=4.5
+async_timeout<5.0,>=4.0.0a3
+yarl<2.0,>=1.0
+frozenlist>=1.1.1
+aiosignal>=1.1.2
+
+[:python_version < "3.7"]
+idna-ssl>=1.0
+
+[:python_version < "3.8"]
+asynctest==0.13.0
+typing_extensions>=3.7.4
+
+[speedups]
+aiodns
+Brotli
+
+[speedups:python_version < "3.10"]
+cchardet
diff --git a/third_party/python/aiohttp/aiohttp.egg-info/top_level.txt b/third_party/python/aiohttp/aiohttp.egg-info/top_level.txt
new file mode 100644
index 0000000000..ee4ba4f3d7
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp.egg-info/top_level.txt
@@ -0,0 +1 @@
+aiohttp
diff --git a/third_party/python/aiohttp/aiohttp/.hash/_cparser.pxd.hash b/third_party/python/aiohttp/aiohttp/.hash/_cparser.pxd.hash
new file mode 100644
index 0000000000..a4c37d2086
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/.hash/_cparser.pxd.hash
@@ -0,0 +1 @@
+e6d134d56d5f516ab2b5c3b295d0d440a3bef911f4384d506204018895a1f833 /home/runner/work/aiohttp/aiohttp/aiohttp/_cparser.pxd
diff --git a/third_party/python/aiohttp/aiohttp/.hash/_find_header.pxd.hash b/third_party/python/aiohttp/aiohttp/.hash/_find_header.pxd.hash
new file mode 100644
index 0000000000..f006c2de5d
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/.hash/_find_header.pxd.hash
@@ -0,0 +1 @@
+d067f01423cddb3c442933b5fcc039b18ab651fcec1bc91c577693aafc25cf78 /home/runner/work/aiohttp/aiohttp/aiohttp/_find_header.pxd
diff --git a/third_party/python/aiohttp/aiohttp/.hash/_helpers.pyi.hash b/third_party/python/aiohttp/aiohttp/.hash/_helpers.pyi.hash
new file mode 100644
index 0000000000..6a30d6325b
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/.hash/_helpers.pyi.hash
@@ -0,0 +1 @@
+6682a22524b9d4fc442e123672622be7bdfb6238d9709b7b15b2113b7ca6d52b /home/runner/work/aiohttp/aiohttp/aiohttp/_helpers.pyi
diff --git a/third_party/python/aiohttp/aiohttp/.hash/_helpers.pyx.hash b/third_party/python/aiohttp/aiohttp/.hash/_helpers.pyx.hash
new file mode 100644
index 0000000000..8f38727d78
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/.hash/_helpers.pyx.hash
@@ -0,0 +1 @@
+5de2db35fb795ffe227e2f1007c8ba4f2ad1b9aca28cc48edc80c779203cf6e3 /home/runner/work/aiohttp/aiohttp/aiohttp/_helpers.pyx
diff --git a/third_party/python/aiohttp/aiohttp/.hash/_http_parser.pyx.hash b/third_party/python/aiohttp/aiohttp/.hash/_http_parser.pyx.hash
new file mode 100644
index 0000000000..5f541ed052
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/.hash/_http_parser.pyx.hash
@@ -0,0 +1 @@
+43bc2c42b9dbb09c19d0782c7aefd1a656a039b31c57a9fa809f82c2807eeaa9 /home/runner/work/aiohttp/aiohttp/aiohttp/_http_parser.pyx
diff --git a/third_party/python/aiohttp/aiohttp/.hash/_http_writer.pyx.hash b/third_party/python/aiohttp/aiohttp/.hash/_http_writer.pyx.hash
new file mode 100644
index 0000000000..8e1aaab044
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/.hash/_http_writer.pyx.hash
@@ -0,0 +1 @@
+6881c0a7c838655e646c645d99971efaf5e310bc3633a7c62b226e39d81842ac /home/runner/work/aiohttp/aiohttp/aiohttp/_http_writer.pyx
diff --git a/third_party/python/aiohttp/aiohttp/.hash/_websocket.pyx.hash b/third_party/python/aiohttp/aiohttp/.hash/_websocket.pyx.hash
new file mode 100644
index 0000000000..ddbb4c7a6f
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/.hash/_websocket.pyx.hash
@@ -0,0 +1 @@
+d57b8e48d0c26f20ebcc5e6e300da2b2a6aeb12b3c9768d64cb0e53432ccf48a /home/runner/work/aiohttp/aiohttp/aiohttp/_websocket.pyx
diff --git a/third_party/python/aiohttp/aiohttp/.hash/hdrs.py.hash b/third_party/python/aiohttp/aiohttp/.hash/hdrs.py.hash
new file mode 100644
index 0000000000..1c8653f6b3
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/.hash/hdrs.py.hash
@@ -0,0 +1 @@
+a30351c34760a1d7835b2a1b0552e463cf1d2db90da0cdb473313dc66e34a031 /home/runner/work/aiohttp/aiohttp/aiohttp/hdrs.py
diff --git a/third_party/python/aiohttp/aiohttp/__init__.py b/third_party/python/aiohttp/aiohttp/__init__.py
new file mode 100644
index 0000000000..317a47bbad
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/__init__.py
@@ -0,0 +1,216 @@
+__version__ = "3.8.5"
+
+from typing import Tuple
+
+from . import hdrs as hdrs
+from .client import (
+ BaseConnector as BaseConnector,
+ ClientConnectionError as ClientConnectionError,
+ ClientConnectorCertificateError as ClientConnectorCertificateError,
+ ClientConnectorError as ClientConnectorError,
+ ClientConnectorSSLError as ClientConnectorSSLError,
+ ClientError as ClientError,
+ ClientHttpProxyError as ClientHttpProxyError,
+ ClientOSError as ClientOSError,
+ ClientPayloadError as ClientPayloadError,
+ ClientProxyConnectionError as ClientProxyConnectionError,
+ ClientRequest as ClientRequest,
+ ClientResponse as ClientResponse,
+ ClientResponseError as ClientResponseError,
+ ClientSession as ClientSession,
+ ClientSSLError as ClientSSLError,
+ ClientTimeout as ClientTimeout,
+ ClientWebSocketResponse as ClientWebSocketResponse,
+ ContentTypeError as ContentTypeError,
+ Fingerprint as Fingerprint,
+ InvalidURL as InvalidURL,
+ NamedPipeConnector as NamedPipeConnector,
+ RequestInfo as RequestInfo,
+ ServerConnectionError as ServerConnectionError,
+ ServerDisconnectedError as ServerDisconnectedError,
+ ServerFingerprintMismatch as ServerFingerprintMismatch,
+ ServerTimeoutError as ServerTimeoutError,
+ TCPConnector as TCPConnector,
+ TooManyRedirects as TooManyRedirects,
+ UnixConnector as UnixConnector,
+ WSServerHandshakeError as WSServerHandshakeError,
+ request as request,
+)
+from .cookiejar import CookieJar as CookieJar, DummyCookieJar as DummyCookieJar
+from .formdata import FormData as FormData
+from .helpers import BasicAuth, ChainMapProxy, ETag
+from .http import (
+ HttpVersion as HttpVersion,
+ HttpVersion10 as HttpVersion10,
+ HttpVersion11 as HttpVersion11,
+ WebSocketError as WebSocketError,
+ WSCloseCode as WSCloseCode,
+ WSMessage as WSMessage,
+ WSMsgType as WSMsgType,
+)
+from .multipart import (
+ BadContentDispositionHeader as BadContentDispositionHeader,
+ BadContentDispositionParam as BadContentDispositionParam,
+ BodyPartReader as BodyPartReader,
+ MultipartReader as MultipartReader,
+ MultipartWriter as MultipartWriter,
+ content_disposition_filename as content_disposition_filename,
+ parse_content_disposition as parse_content_disposition,
+)
+from .payload import (
+ PAYLOAD_REGISTRY as PAYLOAD_REGISTRY,
+ AsyncIterablePayload as AsyncIterablePayload,
+ BufferedReaderPayload as BufferedReaderPayload,
+ BytesIOPayload as BytesIOPayload,
+ BytesPayload as BytesPayload,
+ IOBasePayload as IOBasePayload,
+ JsonPayload as JsonPayload,
+ Payload as Payload,
+ StringIOPayload as StringIOPayload,
+ StringPayload as StringPayload,
+ TextIOPayload as TextIOPayload,
+ get_payload as get_payload,
+ payload_type as payload_type,
+)
+from .payload_streamer import streamer as streamer
+from .resolver import (
+ AsyncResolver as AsyncResolver,
+ DefaultResolver as DefaultResolver,
+ ThreadedResolver as ThreadedResolver,
+)
+from .streams import (
+ EMPTY_PAYLOAD as EMPTY_PAYLOAD,
+ DataQueue as DataQueue,
+ EofStream as EofStream,
+ FlowControlDataQueue as FlowControlDataQueue,
+ StreamReader as StreamReader,
+)
+from .tracing import (
+ TraceConfig as TraceConfig,
+ TraceConnectionCreateEndParams as TraceConnectionCreateEndParams,
+ TraceConnectionCreateStartParams as TraceConnectionCreateStartParams,
+ TraceConnectionQueuedEndParams as TraceConnectionQueuedEndParams,
+ TraceConnectionQueuedStartParams as TraceConnectionQueuedStartParams,
+ TraceConnectionReuseconnParams as TraceConnectionReuseconnParams,
+ TraceDnsCacheHitParams as TraceDnsCacheHitParams,
+ TraceDnsCacheMissParams as TraceDnsCacheMissParams,
+ TraceDnsResolveHostEndParams as TraceDnsResolveHostEndParams,
+ TraceDnsResolveHostStartParams as TraceDnsResolveHostStartParams,
+ TraceRequestChunkSentParams as TraceRequestChunkSentParams,
+ TraceRequestEndParams as TraceRequestEndParams,
+ TraceRequestExceptionParams as TraceRequestExceptionParams,
+ TraceRequestRedirectParams as TraceRequestRedirectParams,
+ TraceRequestStartParams as TraceRequestStartParams,
+ TraceResponseChunkReceivedParams as TraceResponseChunkReceivedParams,
+)
+
+__all__: Tuple[str, ...] = (
+ "hdrs",
+ # client
+ "BaseConnector",
+ "ClientConnectionError",
+ "ClientConnectorCertificateError",
+ "ClientConnectorError",
+ "ClientConnectorSSLError",
+ "ClientError",
+ "ClientHttpProxyError",
+ "ClientOSError",
+ "ClientPayloadError",
+ "ClientProxyConnectionError",
+ "ClientResponse",
+ "ClientRequest",
+ "ClientResponseError",
+ "ClientSSLError",
+ "ClientSession",
+ "ClientTimeout",
+ "ClientWebSocketResponse",
+ "ContentTypeError",
+ "Fingerprint",
+ "InvalidURL",
+ "RequestInfo",
+ "ServerConnectionError",
+ "ServerDisconnectedError",
+ "ServerFingerprintMismatch",
+ "ServerTimeoutError",
+ "TCPConnector",
+ "TooManyRedirects",
+ "UnixConnector",
+ "NamedPipeConnector",
+ "WSServerHandshakeError",
+ "request",
+ # cookiejar
+ "CookieJar",
+ "DummyCookieJar",
+ # formdata
+ "FormData",
+ # helpers
+ "BasicAuth",
+ "ChainMapProxy",
+ "ETag",
+ # http
+ "HttpVersion",
+ "HttpVersion10",
+ "HttpVersion11",
+ "WSMsgType",
+ "WSCloseCode",
+ "WSMessage",
+ "WebSocketError",
+ # multipart
+ "BadContentDispositionHeader",
+ "BadContentDispositionParam",
+ "BodyPartReader",
+ "MultipartReader",
+ "MultipartWriter",
+ "content_disposition_filename",
+ "parse_content_disposition",
+ # payload
+ "AsyncIterablePayload",
+ "BufferedReaderPayload",
+ "BytesIOPayload",
+ "BytesPayload",
+ "IOBasePayload",
+ "JsonPayload",
+ "PAYLOAD_REGISTRY",
+ "Payload",
+ "StringIOPayload",
+ "StringPayload",
+ "TextIOPayload",
+ "get_payload",
+ "payload_type",
+ # payload_streamer
+ "streamer",
+ # resolver
+ "AsyncResolver",
+ "DefaultResolver",
+ "ThreadedResolver",
+ # streams
+ "DataQueue",
+ "EMPTY_PAYLOAD",
+ "EofStream",
+ "FlowControlDataQueue",
+ "StreamReader",
+ # tracing
+ "TraceConfig",
+ "TraceConnectionCreateEndParams",
+ "TraceConnectionCreateStartParams",
+ "TraceConnectionQueuedEndParams",
+ "TraceConnectionQueuedStartParams",
+ "TraceConnectionReuseconnParams",
+ "TraceDnsCacheHitParams",
+ "TraceDnsCacheMissParams",
+ "TraceDnsResolveHostEndParams",
+ "TraceDnsResolveHostStartParams",
+ "TraceRequestChunkSentParams",
+ "TraceRequestEndParams",
+ "TraceRequestExceptionParams",
+ "TraceRequestRedirectParams",
+ "TraceRequestStartParams",
+ "TraceResponseChunkReceivedParams",
+)
+
+try:
+ from .worker import GunicornUVLoopWebWorker, GunicornWebWorker
+
+ __all__ += ("GunicornWebWorker", "GunicornUVLoopWebWorker")
+except ImportError: # pragma: no cover
+ pass
diff --git a/third_party/python/aiohttp/aiohttp/_cparser.pxd b/third_party/python/aiohttp/aiohttp/_cparser.pxd
new file mode 100644
index 0000000000..165dd61d8a
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_cparser.pxd
@@ -0,0 +1,190 @@
+from libc.stdint cimport (
+ int8_t,
+ int16_t,
+ int32_t,
+ int64_t,
+ uint8_t,
+ uint16_t,
+ uint32_t,
+ uint64_t,
+)
+
+
+cdef extern from "../vendor/llhttp/build/llhttp.h":
+
+ struct llhttp__internal_s:
+ int32_t _index
+ void* _span_pos0
+ void* _span_cb0
+ int32_t error
+ const char* reason
+ const char* error_pos
+ void* data
+ void* _current
+ uint64_t content_length
+ uint8_t type
+ uint8_t method
+ uint8_t http_major
+ uint8_t http_minor
+ uint8_t header_state
+ uint8_t lenient_flags
+ uint8_t upgrade
+ uint8_t finish
+ uint16_t flags
+ uint16_t status_code
+ void* settings
+
+ ctypedef llhttp__internal_s llhttp__internal_t
+ ctypedef llhttp__internal_t llhttp_t
+
+ ctypedef int (*llhttp_data_cb)(llhttp_t*, const char *at, size_t length) except -1
+ ctypedef int (*llhttp_cb)(llhttp_t*) except -1
+
+ struct llhttp_settings_s:
+ llhttp_cb on_message_begin
+ llhttp_data_cb on_url
+ llhttp_data_cb on_status
+ llhttp_data_cb on_header_field
+ llhttp_data_cb on_header_value
+ llhttp_cb on_headers_complete
+ llhttp_data_cb on_body
+ llhttp_cb on_message_complete
+ llhttp_cb on_chunk_header
+ llhttp_cb on_chunk_complete
+
+ llhttp_cb on_url_complete
+ llhttp_cb on_status_complete
+ llhttp_cb on_header_field_complete
+ llhttp_cb on_header_value_complete
+
+ ctypedef llhttp_settings_s llhttp_settings_t
+
+ enum llhttp_errno:
+ HPE_OK,
+ HPE_INTERNAL,
+ HPE_STRICT,
+ HPE_LF_EXPECTED,
+ HPE_UNEXPECTED_CONTENT_LENGTH,
+ HPE_CLOSED_CONNECTION,
+ HPE_INVALID_METHOD,
+ HPE_INVALID_URL,
+ HPE_INVALID_CONSTANT,
+ HPE_INVALID_VERSION,
+ HPE_INVALID_HEADER_TOKEN,
+ HPE_INVALID_CONTENT_LENGTH,
+ HPE_INVALID_CHUNK_SIZE,
+ HPE_INVALID_STATUS,
+ HPE_INVALID_EOF_STATE,
+ HPE_INVALID_TRANSFER_ENCODING,
+ HPE_CB_MESSAGE_BEGIN,
+ HPE_CB_HEADERS_COMPLETE,
+ HPE_CB_MESSAGE_COMPLETE,
+ HPE_CB_CHUNK_HEADER,
+ HPE_CB_CHUNK_COMPLETE,
+ HPE_PAUSED,
+ HPE_PAUSED_UPGRADE,
+ HPE_USER
+
+ ctypedef llhttp_errno llhttp_errno_t
+
+ enum llhttp_flags:
+ F_CONNECTION_KEEP_ALIVE,
+ F_CONNECTION_CLOSE,
+ F_CONNECTION_UPGRADE,
+ F_CHUNKED,
+ F_UPGRADE,
+ F_CONTENT_LENGTH,
+ F_SKIPBODY,
+ F_TRAILING,
+ F_TRANSFER_ENCODING
+
+ enum llhttp_lenient_flags:
+ LENIENT_HEADERS,
+ LENIENT_CHUNKED_LENGTH
+
+ enum llhttp_type:
+ HTTP_REQUEST,
+ HTTP_RESPONSE,
+ HTTP_BOTH
+
+ enum llhttp_finish_t:
+ HTTP_FINISH_SAFE,
+ HTTP_FINISH_SAFE_WITH_CB,
+ HTTP_FINISH_UNSAFE
+
+ enum llhttp_method:
+ HTTP_DELETE,
+ HTTP_GET,
+ HTTP_HEAD,
+ HTTP_POST,
+ HTTP_PUT,
+ HTTP_CONNECT,
+ HTTP_OPTIONS,
+ HTTP_TRACE,
+ HTTP_COPY,
+ HTTP_LOCK,
+ HTTP_MKCOL,
+ HTTP_MOVE,
+ HTTP_PROPFIND,
+ HTTP_PROPPATCH,
+ HTTP_SEARCH,
+ HTTP_UNLOCK,
+ HTTP_BIND,
+ HTTP_REBIND,
+ HTTP_UNBIND,
+ HTTP_ACL,
+ HTTP_REPORT,
+ HTTP_MKACTIVITY,
+ HTTP_CHECKOUT,
+ HTTP_MERGE,
+ HTTP_MSEARCH,
+ HTTP_NOTIFY,
+ HTTP_SUBSCRIBE,
+ HTTP_UNSUBSCRIBE,
+ HTTP_PATCH,
+ HTTP_PURGE,
+ HTTP_MKCALENDAR,
+ HTTP_LINK,
+ HTTP_UNLINK,
+ HTTP_SOURCE,
+ HTTP_PRI,
+ HTTP_DESCRIBE,
+ HTTP_ANNOUNCE,
+ HTTP_SETUP,
+ HTTP_PLAY,
+ HTTP_PAUSE,
+ HTTP_TEARDOWN,
+ HTTP_GET_PARAMETER,
+ HTTP_SET_PARAMETER,
+ HTTP_REDIRECT,
+ HTTP_RECORD,
+ HTTP_FLUSH
+
+ ctypedef llhttp_method llhttp_method_t;
+
+ void llhttp_settings_init(llhttp_settings_t* settings)
+ void llhttp_init(llhttp_t* parser, llhttp_type type,
+ const llhttp_settings_t* settings)
+
+ llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len)
+ llhttp_errno_t llhttp_finish(llhttp_t* parser)
+
+ int llhttp_message_needs_eof(const llhttp_t* parser)
+
+ int llhttp_should_keep_alive(const llhttp_t* parser)
+
+ void llhttp_pause(llhttp_t* parser)
+ void llhttp_resume(llhttp_t* parser)
+
+ void llhttp_resume_after_upgrade(llhttp_t* parser)
+
+ llhttp_errno_t llhttp_get_errno(const llhttp_t* parser)
+ const char* llhttp_get_error_reason(const llhttp_t* parser)
+ void llhttp_set_error_reason(llhttp_t* parser, const char* reason)
+ const char* llhttp_get_error_pos(const llhttp_t* parser)
+ const char* llhttp_errno_name(llhttp_errno_t err)
+
+ const char* llhttp_method_name(llhttp_method_t method)
+
+ void llhttp_set_lenient_headers(llhttp_t* parser, int enabled)
+ void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled)
diff --git a/third_party/python/aiohttp/aiohttp/_find_header.c b/third_party/python/aiohttp/aiohttp/_find_header.c
new file mode 100644
index 0000000000..012cba33ac
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_find_header.c
@@ -0,0 +1,9870 @@
+/* The file is autogenerated from aiohttp/hdrs.py
+Run ./tools/gen.py to update it after the origin changing. */
+
+#include "_find_header.h"
+
+#define NEXT_CHAR() \
+{ \
+ count++; \
+ if (count == size) { \
+ /* end of search */ \
+ return -1; \
+ } \
+ pchar++; \
+ ch = *pchar; \
+ last = (count == size -1); \
+} while(0);
+
+int
+find_header(const char *str, int size)
+{
+ char *pchar = str;
+ int last;
+ char ch;
+ int count = -1;
+ pchar--;
+
+
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto A;
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto C;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto C;
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto D;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto D;
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto E;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto E;
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto F;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto F;
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto H;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto H;
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto I;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto I;
+ case 'K':
+ if (last) {
+ return -1;
+ }
+ goto K;
+ case 'k':
+ if (last) {
+ return -1;
+ }
+ goto K;
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto L;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto L;
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto M;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto M;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto O;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto O;
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto P;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto P;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto R;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto R;
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto S;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto S;
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto T;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto T;
+ case 'U':
+ if (last) {
+ return -1;
+ }
+ goto U;
+ case 'u':
+ if (last) {
+ return -1;
+ }
+ goto U;
+ case 'V':
+ if (last) {
+ return -1;
+ }
+ goto V;
+ case 'v':
+ if (last) {
+ return -1;
+ }
+ goto V;
+ case 'W':
+ if (last) {
+ return -1;
+ }
+ goto W;
+ case 'w':
+ if (last) {
+ return -1;
+ }
+ goto W;
+ case 'X':
+ if (last) {
+ return -1;
+ }
+ goto X;
+ case 'x':
+ if (last) {
+ return -1;
+ }
+ goto X;
+ default:
+ return -1;
+ }
+
+A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto AC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto AC;
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto AG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto AG;
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto AL;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto AL;
+ case 'U':
+ if (last) {
+ return -1;
+ }
+ goto AU;
+ case 'u':
+ if (last) {
+ return -1;
+ }
+ goto AU;
+ default:
+ return -1;
+ }
+
+AC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto ACC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto ACC;
+ default:
+ return -1;
+ }
+
+ACC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCE;
+ default:
+ return -1;
+ }
+
+ACCE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto ACCEP;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto ACCEP;
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto ACCES;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto ACCES;
+ default:
+ return -1;
+ }
+
+ACCEP:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 0;
+ }
+ goto ACCEPT;
+ case 't':
+ if (last) {
+ return 0;
+ }
+ goto ACCEPT;
+ default:
+ return -1;
+ }
+
+ACCEPT:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_;
+ default:
+ return -1;
+ }
+
+ACCEPT_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_C;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_C;
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_E;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_E;
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_L;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_L;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_R;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_R;
+ default:
+ return -1;
+ }
+
+ACCEPT_C:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CH;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CH;
+ default:
+ return -1;
+ }
+
+ACCEPT_CH:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CHA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CHA;
+ default:
+ return -1;
+ }
+
+ACCEPT_CHA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CHAR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CHAR;
+ default:
+ return -1;
+ }
+
+ACCEPT_CHAR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CHARS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CHARS;
+ default:
+ return -1;
+ }
+
+ACCEPT_CHARS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CHARSE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_CHARSE;
+ default:
+ return -1;
+ }
+
+ACCEPT_CHARSE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 1;
+ }
+ goto ACCEPT_CHARSET;
+ case 't':
+ if (last) {
+ return 1;
+ }
+ goto ACCEPT_CHARSET;
+ default:
+ return -1;
+ }
+
+ACCEPT_E:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_EN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_EN;
+ default:
+ return -1;
+ }
+
+ACCEPT_EN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENC;
+ default:
+ return -1;
+ }
+
+ACCEPT_ENC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENCO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENCO;
+ default:
+ return -1;
+ }
+
+ACCEPT_ENCO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENCOD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENCOD;
+ default:
+ return -1;
+ }
+
+ACCEPT_ENCOD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENCODI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENCODI;
+ default:
+ return -1;
+ }
+
+ACCEPT_ENCODI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENCODIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_ENCODIN;
+ default:
+ return -1;
+ }
+
+ACCEPT_ENCODIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return 2;
+ }
+ goto ACCEPT_ENCODING;
+ case 'g':
+ if (last) {
+ return 2;
+ }
+ goto ACCEPT_ENCODING;
+ default:
+ return -1;
+ }
+
+ACCEPT_L:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LA;
+ default:
+ return -1;
+ }
+
+ACCEPT_LA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LAN;
+ default:
+ return -1;
+ }
+
+ACCEPT_LAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LANG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LANG;
+ default:
+ return -1;
+ }
+
+ACCEPT_LANG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'U':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LANGU;
+ case 'u':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LANGU;
+ default:
+ return -1;
+ }
+
+ACCEPT_LANGU:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LANGUA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LANGUA;
+ default:
+ return -1;
+ }
+
+ACCEPT_LANGUA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LANGUAG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_LANGUAG;
+ default:
+ return -1;
+ }
+
+ACCEPT_LANGUAG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 3;
+ }
+ goto ACCEPT_LANGUAGE;
+ case 'e':
+ if (last) {
+ return 3;
+ }
+ goto ACCEPT_LANGUAGE;
+ default:
+ return -1;
+ }
+
+ACCEPT_R:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_RA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_RA;
+ default:
+ return -1;
+ }
+
+ACCEPT_RA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_RAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_RAN;
+ default:
+ return -1;
+ }
+
+ACCEPT_RAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_RANG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_RANG;
+ default:
+ return -1;
+ }
+
+ACCEPT_RANG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_RANGE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCEPT_RANGE;
+ default:
+ return -1;
+ }
+
+ACCEPT_RANGE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 4;
+ }
+ goto ACCEPT_RANGES;
+ case 's':
+ if (last) {
+ return 4;
+ }
+ goto ACCEPT_RANGES;
+ default:
+ return -1;
+ }
+
+ACCES:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS;
+ default:
+ return -1;
+ }
+
+ACCESS:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_;
+ default:
+ return -1;
+ }
+
+ACCESS_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_C;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_C;
+ default:
+ return -1;
+ }
+
+ACCESS_C:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CO;
+ default:
+ return -1;
+ }
+
+ACCESS_CO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CON;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CON;
+ default:
+ return -1;
+ }
+
+ACCESS_CON:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONT;
+ default:
+ return -1;
+ }
+
+ACCESS_CONT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTR;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTRO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTRO;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTRO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_A;
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_E;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_E;
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_M;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_M;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_R;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_R;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_AL;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_AL;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_AL:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALL;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALL;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALL:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLO;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'W':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW;
+ case 'w':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_C;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_C;
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_H;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_H;
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_M;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_M;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_O;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_O;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_C:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CR;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CRE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CRE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CRE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CRED;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CRED;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CRED:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CREDE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDEN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDEN;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CREDEN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENT;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CREDENT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENTI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENTI;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CREDENTI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENTIA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENTIA;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CREDENTIA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENTIAL;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENTIAL;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_CREDENTIAL:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 5;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENTIALS;
+ case 's':
+ if (last) {
+ return 5;
+ }
+ goto ACCESS_CONTROL_ALLOW_CREDENTIALS;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_H:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_HE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEA;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_HEA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEAD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEAD;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_HEAD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEADE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEADE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_HEADE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEADER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEADER;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_HEADER:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 6;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEADERS;
+ case 's':
+ if (last) {
+ return 6;
+ }
+ goto ACCESS_CONTROL_ALLOW_HEADERS;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_M:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_ME;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_ME;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_ME:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_MET;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_MET;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_MET:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_METH;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_METH;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_METH:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_METHO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_METHO;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_METHO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_METHOD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_METHOD;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_METHOD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 7;
+ }
+ goto ACCESS_CONTROL_ALLOW_METHODS;
+ case 's':
+ if (last) {
+ return 7;
+ }
+ goto ACCESS_CONTROL_ALLOW_METHODS;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_O:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_OR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_OR;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_OR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_ORI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_ORI;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_ORI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_ORIG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_ORIG;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_ORIG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_ORIGI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_ALLOW_ORIGI;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_ALLOW_ORIGI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 8;
+ }
+ goto ACCESS_CONTROL_ALLOW_ORIGIN;
+ case 'n':
+ if (last) {
+ return 8;
+ }
+ goto ACCESS_CONTROL_ALLOW_ORIGIN;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_E:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'X':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EX;
+ case 'x':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EX;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EX:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXP;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXP;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXP:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPO;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOS;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOSE:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOSE_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_H;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_H;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOSE_H:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOSE_HE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEA;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOSE_HEA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEAD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEAD;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOSE_HEAD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEADE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEADE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOSE_HEADE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEADER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEADER;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_EXPOSE_HEADER:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 9;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEADERS;
+ case 's':
+ if (last) {
+ return 9;
+ }
+ goto ACCESS_CONTROL_EXPOSE_HEADERS;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_M:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MA;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_MA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'X':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MAX;
+ case 'x':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MAX;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_MAX:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MAX_;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_MAX_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MAX_A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MAX_A;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_MAX_A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MAX_AG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_MAX_AG;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_MAX_AG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 10;
+ }
+ goto ACCESS_CONTROL_MAX_AGE;
+ case 'e':
+ if (last) {
+ return 10;
+ }
+ goto ACCESS_CONTROL_MAX_AGE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_R:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_RE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_RE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_RE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'Q':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQ;
+ case 'q':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQ;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQ:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'U':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQU;
+ case 'u':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQU;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQU:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUES;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUES;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUES:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_H;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_H;
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_M;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_M;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_H:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_HE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEA;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_HEA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEAD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEAD;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_HEAD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEADE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEADE;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_HEADE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEADER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEADER;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_HEADER:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 11;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEADERS;
+ case 's':
+ if (last) {
+ return 11;
+ }
+ goto ACCESS_CONTROL_REQUEST_HEADERS;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_M:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_ME;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_ME;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_ME:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_MET;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_MET;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_MET:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_METH;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_METH;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_METH:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_METHO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ACCESS_CONTROL_REQUEST_METHO;
+ default:
+ return -1;
+ }
+
+ACCESS_CONTROL_REQUEST_METHO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return 12;
+ }
+ goto ACCESS_CONTROL_REQUEST_METHOD;
+ case 'd':
+ if (last) {
+ return 12;
+ }
+ goto ACCESS_CONTROL_REQUEST_METHOD;
+ default:
+ return -1;
+ }
+
+AG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 13;
+ }
+ goto AGE;
+ case 'e':
+ if (last) {
+ return 13;
+ }
+ goto AGE;
+ default:
+ return -1;
+ }
+
+AL:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto ALL;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto ALL;
+ default:
+ return -1;
+ }
+
+ALL:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto ALLO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto ALLO;
+ default:
+ return -1;
+ }
+
+ALLO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'W':
+ if (last) {
+ return 14;
+ }
+ goto ALLOW;
+ case 'w':
+ if (last) {
+ return 14;
+ }
+ goto ALLOW;
+ default:
+ return -1;
+ }
+
+AU:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto AUT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto AUT;
+ default:
+ return -1;
+ }
+
+AUT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto AUTH;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto AUTH;
+ default:
+ return -1;
+ }
+
+AUTH:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto AUTHO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto AUTHO;
+ default:
+ return -1;
+ }
+
+AUTHO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto AUTHOR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto AUTHOR;
+ default:
+ return -1;
+ }
+
+AUTHOR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORI;
+ default:
+ return -1;
+ }
+
+AUTHORI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'Z':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZ;
+ case 'z':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZ;
+ default:
+ return -1;
+ }
+
+AUTHORIZ:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZA;
+ default:
+ return -1;
+ }
+
+AUTHORIZA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZAT;
+ default:
+ return -1;
+ }
+
+AUTHORIZAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZATI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZATI;
+ default:
+ return -1;
+ }
+
+AUTHORIZATI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZATIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto AUTHORIZATIO;
+ default:
+ return -1;
+ }
+
+AUTHORIZATIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 15;
+ }
+ goto AUTHORIZATION;
+ case 'n':
+ if (last) {
+ return 15;
+ }
+ goto AUTHORIZATION;
+ default:
+ return -1;
+ }
+
+C:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto CA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto CA;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CO;
+ default:
+ return -1;
+ }
+
+CA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto CAC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto CAC;
+ default:
+ return -1;
+ }
+
+CAC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto CACH;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto CACH;
+ default:
+ return -1;
+ }
+
+CACH:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto CACHE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto CACHE;
+ default:
+ return -1;
+ }
+
+CACHE:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_;
+ default:
+ return -1;
+ }
+
+CACHE_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_C;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_C;
+ default:
+ return -1;
+ }
+
+CACHE_C:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CO;
+ default:
+ return -1;
+ }
+
+CACHE_CO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CON;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CON;
+ default:
+ return -1;
+ }
+
+CACHE_CON:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CONT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CONT;
+ default:
+ return -1;
+ }
+
+CACHE_CONT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CONTR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CONTR;
+ default:
+ return -1;
+ }
+
+CACHE_CONTR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CONTRO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CACHE_CONTRO;
+ default:
+ return -1;
+ }
+
+CACHE_CONTRO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return 16;
+ }
+ goto CACHE_CONTROL;
+ case 'l':
+ if (last) {
+ return 16;
+ }
+ goto CACHE_CONTROL;
+ default:
+ return -1;
+ }
+
+CO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CON;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CON;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto COO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto COO;
+ default:
+ return -1;
+ }
+
+CON:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONN;
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto CONT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto CONT;
+ default:
+ return -1;
+ }
+
+CONN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto CONNE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto CONNE;
+ default:
+ return -1;
+ }
+
+CONNE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto CONNEC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto CONNEC;
+ default:
+ return -1;
+ }
+
+CONNEC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto CONNECT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto CONNECT;
+ default:
+ return -1;
+ }
+
+CONNECT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto CONNECTI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto CONNECTI;
+ default:
+ return -1;
+ }
+
+CONNECTI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CONNECTIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CONNECTIO;
+ default:
+ return -1;
+ }
+
+CONNECTIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 17;
+ }
+ goto CONNECTION;
+ case 'n':
+ if (last) {
+ return 17;
+ }
+ goto CONNECTION;
+ default:
+ return -1;
+ }
+
+CONT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto CONTE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto CONTE;
+ default:
+ return -1;
+ }
+
+CONTE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTEN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTEN;
+ default:
+ return -1;
+ }
+
+CONTEN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT;
+ default:
+ return -1;
+ }
+
+CONTENT:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_;
+ default:
+ return -1;
+ }
+
+CONTENT_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_D;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_D;
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_E;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_E;
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_L;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_L;
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_M;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_M;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_R;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_R;
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_T;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_T;
+ default:
+ return -1;
+ }
+
+CONTENT_D:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DI;
+ default:
+ return -1;
+ }
+
+CONTENT_DI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DIS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DIS;
+ default:
+ return -1;
+ }
+
+CONTENT_DIS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISP;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISP;
+ default:
+ return -1;
+ }
+
+CONTENT_DISP:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPO;
+ default:
+ return -1;
+ }
+
+CONTENT_DISPO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOS;
+ default:
+ return -1;
+ }
+
+CONTENT_DISPOS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOSI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOSI;
+ default:
+ return -1;
+ }
+
+CONTENT_DISPOSI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOSIT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOSIT;
+ default:
+ return -1;
+ }
+
+CONTENT_DISPOSIT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOSITI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOSITI;
+ default:
+ return -1;
+ }
+
+CONTENT_DISPOSITI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOSITIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_DISPOSITIO;
+ default:
+ return -1;
+ }
+
+CONTENT_DISPOSITIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 18;
+ }
+ goto CONTENT_DISPOSITION;
+ case 'n':
+ if (last) {
+ return 18;
+ }
+ goto CONTENT_DISPOSITION;
+ default:
+ return -1;
+ }
+
+CONTENT_E:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_EN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_EN;
+ default:
+ return -1;
+ }
+
+CONTENT_EN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENC;
+ default:
+ return -1;
+ }
+
+CONTENT_ENC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENCO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENCO;
+ default:
+ return -1;
+ }
+
+CONTENT_ENCO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENCOD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENCOD;
+ default:
+ return -1;
+ }
+
+CONTENT_ENCOD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENCODI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENCODI;
+ default:
+ return -1;
+ }
+
+CONTENT_ENCODI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENCODIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_ENCODIN;
+ default:
+ return -1;
+ }
+
+CONTENT_ENCODIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return 19;
+ }
+ goto CONTENT_ENCODING;
+ case 'g':
+ if (last) {
+ return 19;
+ }
+ goto CONTENT_ENCODING;
+ default:
+ return -1;
+ }
+
+CONTENT_L:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LA;
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LE;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LO;
+ default:
+ return -1;
+ }
+
+CONTENT_LA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LAN;
+ default:
+ return -1;
+ }
+
+CONTENT_LAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LANG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LANG;
+ default:
+ return -1;
+ }
+
+CONTENT_LANG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'U':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LANGU;
+ case 'u':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LANGU;
+ default:
+ return -1;
+ }
+
+CONTENT_LANGU:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LANGUA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LANGUA;
+ default:
+ return -1;
+ }
+
+CONTENT_LANGUA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LANGUAG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LANGUAG;
+ default:
+ return -1;
+ }
+
+CONTENT_LANGUAG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 20;
+ }
+ goto CONTENT_LANGUAGE;
+ case 'e':
+ if (last) {
+ return 20;
+ }
+ goto CONTENT_LANGUAGE;
+ default:
+ return -1;
+ }
+
+CONTENT_LE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LEN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LEN;
+ default:
+ return -1;
+ }
+
+CONTENT_LEN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LENG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LENG;
+ default:
+ return -1;
+ }
+
+CONTENT_LENG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LENGT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LENGT;
+ default:
+ return -1;
+ }
+
+CONTENT_LENGT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return 21;
+ }
+ goto CONTENT_LENGTH;
+ case 'h':
+ if (last) {
+ return 21;
+ }
+ goto CONTENT_LENGTH;
+ default:
+ return -1;
+ }
+
+CONTENT_LO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOC;
+ default:
+ return -1;
+ }
+
+CONTENT_LOC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOCA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOCA;
+ default:
+ return -1;
+ }
+
+CONTENT_LOCA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOCAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOCAT;
+ default:
+ return -1;
+ }
+
+CONTENT_LOCAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOCATI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOCATI;
+ default:
+ return -1;
+ }
+
+CONTENT_LOCATI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOCATIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_LOCATIO;
+ default:
+ return -1;
+ }
+
+CONTENT_LOCATIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 22;
+ }
+ goto CONTENT_LOCATION;
+ case 'n':
+ if (last) {
+ return 22;
+ }
+ goto CONTENT_LOCATION;
+ default:
+ return -1;
+ }
+
+CONTENT_M:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_MD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_MD;
+ default:
+ return -1;
+ }
+
+CONTENT_MD:
+ NEXT_CHAR();
+ switch (ch) {
+ case '5':
+ if (last) {
+ return 23;
+ }
+ goto CONTENT_MD5;
+ default:
+ return -1;
+ }
+
+CONTENT_R:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_RA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_RA;
+ default:
+ return -1;
+ }
+
+CONTENT_RA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_RAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_RAN;
+ default:
+ return -1;
+ }
+
+CONTENT_RAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_RANG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_RANG;
+ default:
+ return -1;
+ }
+
+CONTENT_RANG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 24;
+ }
+ goto CONTENT_RANGE;
+ case 'e':
+ if (last) {
+ return 24;
+ }
+ goto CONTENT_RANGE;
+ default:
+ return -1;
+ }
+
+CONTENT_T:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TR;
+ case 'Y':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TY;
+ case 'y':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TY;
+ default:
+ return -1;
+ }
+
+CONTENT_TR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRA;
+ default:
+ return -1;
+ }
+
+CONTENT_TRA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRAN;
+ default:
+ return -1;
+ }
+
+CONTENT_TRAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANS;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSF;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSF;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSF:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFE;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_E;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_E;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER_E:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_EN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_EN;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER_EN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENC;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER_ENC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENCO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENCO;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER_ENCO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENCOD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENCOD;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER_ENCOD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENCODI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENCODI;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER_ENCODI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENCODIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TRANSFER_ENCODIN;
+ default:
+ return -1;
+ }
+
+CONTENT_TRANSFER_ENCODIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return 25;
+ }
+ goto CONTENT_TRANSFER_ENCODING;
+ case 'g':
+ if (last) {
+ return 25;
+ }
+ goto CONTENT_TRANSFER_ENCODING;
+ default:
+ return -1;
+ }
+
+CONTENT_TY:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TYP;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto CONTENT_TYP;
+ default:
+ return -1;
+ }
+
+CONTENT_TYP:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 26;
+ }
+ goto CONTENT_TYPE;
+ case 'e':
+ if (last) {
+ return 26;
+ }
+ goto CONTENT_TYPE;
+ default:
+ return -1;
+ }
+
+COO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'K':
+ if (last) {
+ return -1;
+ }
+ goto COOK;
+ case 'k':
+ if (last) {
+ return -1;
+ }
+ goto COOK;
+ default:
+ return -1;
+ }
+
+COOK:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto COOKI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto COOKI;
+ default:
+ return -1;
+ }
+
+COOKI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 27;
+ }
+ goto COOKIE;
+ case 'e':
+ if (last) {
+ return 27;
+ }
+ goto COOKIE;
+ default:
+ return -1;
+ }
+
+D:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto DA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto DA;
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto DE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto DE;
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto DI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto DI;
+ default:
+ return -1;
+ }
+
+DA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto DAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto DAT;
+ default:
+ return -1;
+ }
+
+DAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 28;
+ }
+ goto DATE;
+ case 'e':
+ if (last) {
+ return 28;
+ }
+ goto DATE;
+ default:
+ return -1;
+ }
+
+DE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto DES;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto DES;
+ default:
+ return -1;
+ }
+
+DES:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto DEST;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto DEST;
+ default:
+ return -1;
+ }
+
+DEST:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto DESTI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto DESTI;
+ default:
+ return -1;
+ }
+
+DESTI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto DESTIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto DESTIN;
+ default:
+ return -1;
+ }
+
+DESTIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto DESTINA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto DESTINA;
+ default:
+ return -1;
+ }
+
+DESTINA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto DESTINAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto DESTINAT;
+ default:
+ return -1;
+ }
+
+DESTINAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto DESTINATI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto DESTINATI;
+ default:
+ return -1;
+ }
+
+DESTINATI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto DESTINATIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto DESTINATIO;
+ default:
+ return -1;
+ }
+
+DESTINATIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 29;
+ }
+ goto DESTINATION;
+ case 'n':
+ if (last) {
+ return 29;
+ }
+ goto DESTINATION;
+ default:
+ return -1;
+ }
+
+DI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto DIG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto DIG;
+ default:
+ return -1;
+ }
+
+DIG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto DIGE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto DIGE;
+ default:
+ return -1;
+ }
+
+DIGE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto DIGES;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto DIGES;
+ default:
+ return -1;
+ }
+
+DIGES:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 30;
+ }
+ goto DIGEST;
+ case 't':
+ if (last) {
+ return 30;
+ }
+ goto DIGEST;
+ default:
+ return -1;
+ }
+
+E:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto ET;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto ET;
+ case 'X':
+ if (last) {
+ return -1;
+ }
+ goto EX;
+ case 'x':
+ if (last) {
+ return -1;
+ }
+ goto EX;
+ default:
+ return -1;
+ }
+
+ET:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto ETA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto ETA;
+ default:
+ return -1;
+ }
+
+ETA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return 31;
+ }
+ goto ETAG;
+ case 'g':
+ if (last) {
+ return 31;
+ }
+ goto ETAG;
+ default:
+ return -1;
+ }
+
+EX:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto EXP;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto EXP;
+ default:
+ return -1;
+ }
+
+EXP:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto EXPE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto EXPE;
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto EXPI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto EXPI;
+ default:
+ return -1;
+ }
+
+EXPE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto EXPEC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto EXPEC;
+ default:
+ return -1;
+ }
+
+EXPEC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 32;
+ }
+ goto EXPECT;
+ case 't':
+ if (last) {
+ return 32;
+ }
+ goto EXPECT;
+ default:
+ return -1;
+ }
+
+EXPI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto EXPIR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto EXPIR;
+ default:
+ return -1;
+ }
+
+EXPIR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto EXPIRE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto EXPIRE;
+ default:
+ return -1;
+ }
+
+EXPIRE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 33;
+ }
+ goto EXPIRES;
+ case 's':
+ if (last) {
+ return 33;
+ }
+ goto EXPIRES;
+ default:
+ return -1;
+ }
+
+F:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto FO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto FO;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto FR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto FR;
+ default:
+ return -1;
+ }
+
+FO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto FOR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto FOR;
+ default:
+ return -1;
+ }
+
+FOR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'W':
+ if (last) {
+ return -1;
+ }
+ goto FORW;
+ case 'w':
+ if (last) {
+ return -1;
+ }
+ goto FORW;
+ default:
+ return -1;
+ }
+
+FORW:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto FORWA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto FORWA;
+ default:
+ return -1;
+ }
+
+FORWA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto FORWAR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto FORWAR;
+ default:
+ return -1;
+ }
+
+FORWAR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto FORWARD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto FORWARD;
+ default:
+ return -1;
+ }
+
+FORWARD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto FORWARDE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto FORWARDE;
+ default:
+ return -1;
+ }
+
+FORWARDE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return 34;
+ }
+ goto FORWARDED;
+ case 'd':
+ if (last) {
+ return 34;
+ }
+ goto FORWARDED;
+ default:
+ return -1;
+ }
+
+FR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto FRO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto FRO;
+ default:
+ return -1;
+ }
+
+FRO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'M':
+ if (last) {
+ return 35;
+ }
+ goto FROM;
+ case 'm':
+ if (last) {
+ return 35;
+ }
+ goto FROM;
+ default:
+ return -1;
+ }
+
+H:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto HO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto HO;
+ default:
+ return -1;
+ }
+
+HO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto HOS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto HOS;
+ default:
+ return -1;
+ }
+
+HOS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 36;
+ }
+ goto HOST;
+ case 't':
+ if (last) {
+ return 36;
+ }
+ goto HOST;
+ default:
+ return -1;
+ }
+
+I:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto IF;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto IF;
+ default:
+ return -1;
+ }
+
+IF:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto IF_;
+ default:
+ return -1;
+ }
+
+IF_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto IF_M;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto IF_M;
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto IF_N;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto IF_N;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto IF_R;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto IF_R;
+ case 'U':
+ if (last) {
+ return -1;
+ }
+ goto IF_U;
+ case 'u':
+ if (last) {
+ return -1;
+ }
+ goto IF_U;
+ default:
+ return -1;
+ }
+
+IF_M:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto IF_MA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto IF_MA;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto IF_MO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto IF_MO;
+ default:
+ return -1;
+ }
+
+IF_MA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto IF_MAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto IF_MAT;
+ default:
+ return -1;
+ }
+
+IF_MAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto IF_MATC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto IF_MATC;
+ default:
+ return -1;
+ }
+
+IF_MATC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return 37;
+ }
+ goto IF_MATCH;
+ case 'h':
+ if (last) {
+ return 37;
+ }
+ goto IF_MATCH;
+ default:
+ return -1;
+ }
+
+IF_MO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto IF_MOD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto IF_MOD;
+ default:
+ return -1;
+ }
+
+IF_MOD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODI;
+ default:
+ return -1;
+ }
+
+IF_MODI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIF;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIF;
+ default:
+ return -1;
+ }
+
+IF_MODIF:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFI;
+ default:
+ return -1;
+ }
+
+IF_MODIFI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIE;
+ default:
+ return -1;
+ }
+
+IF_MODIFIE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED;
+ default:
+ return -1;
+ }
+
+IF_MODIFIED:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_;
+ default:
+ return -1;
+ }
+
+IF_MODIFIED_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_S;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_S;
+ default:
+ return -1;
+ }
+
+IF_MODIFIED_S:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_SI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_SI;
+ default:
+ return -1;
+ }
+
+IF_MODIFIED_SI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_SIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_SIN;
+ default:
+ return -1;
+ }
+
+IF_MODIFIED_SIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_SINC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto IF_MODIFIED_SINC;
+ default:
+ return -1;
+ }
+
+IF_MODIFIED_SINC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 38;
+ }
+ goto IF_MODIFIED_SINCE;
+ case 'e':
+ if (last) {
+ return 38;
+ }
+ goto IF_MODIFIED_SINCE;
+ default:
+ return -1;
+ }
+
+IF_N:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto IF_NO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto IF_NO;
+ default:
+ return -1;
+ }
+
+IF_NO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto IF_NON;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto IF_NON;
+ default:
+ return -1;
+ }
+
+IF_NON:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE;
+ default:
+ return -1;
+ }
+
+IF_NONE:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_;
+ default:
+ return -1;
+ }
+
+IF_NONE_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_M;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_M;
+ default:
+ return -1;
+ }
+
+IF_NONE_M:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_MA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_MA;
+ default:
+ return -1;
+ }
+
+IF_NONE_MA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_MAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_MAT;
+ default:
+ return -1;
+ }
+
+IF_NONE_MAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_MATC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto IF_NONE_MATC;
+ default:
+ return -1;
+ }
+
+IF_NONE_MATC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return 39;
+ }
+ goto IF_NONE_MATCH;
+ case 'h':
+ if (last) {
+ return 39;
+ }
+ goto IF_NONE_MATCH;
+ default:
+ return -1;
+ }
+
+IF_R:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto IF_RA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto IF_RA;
+ default:
+ return -1;
+ }
+
+IF_RA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto IF_RAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto IF_RAN;
+ default:
+ return -1;
+ }
+
+IF_RAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto IF_RANG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto IF_RANG;
+ default:
+ return -1;
+ }
+
+IF_RANG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 40;
+ }
+ goto IF_RANGE;
+ case 'e':
+ if (last) {
+ return 40;
+ }
+ goto IF_RANGE;
+ default:
+ return -1;
+ }
+
+IF_U:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto IF_UN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto IF_UN;
+ default:
+ return -1;
+ }
+
+IF_UN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNM;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNM;
+ default:
+ return -1;
+ }
+
+IF_UNM:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMO;
+ default:
+ return -1;
+ }
+
+IF_UNMO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMOD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMOD;
+ default:
+ return -1;
+ }
+
+IF_UNMOD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODI;
+ default:
+ return -1;
+ }
+
+IF_UNMODI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIF;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIF;
+ default:
+ return -1;
+ }
+
+IF_UNMODIF:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFI;
+ default:
+ return -1;
+ }
+
+IF_UNMODIFI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIE;
+ default:
+ return -1;
+ }
+
+IF_UNMODIFIE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED;
+ default:
+ return -1;
+ }
+
+IF_UNMODIFIED:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_;
+ default:
+ return -1;
+ }
+
+IF_UNMODIFIED_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_S;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_S;
+ default:
+ return -1;
+ }
+
+IF_UNMODIFIED_S:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_SI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_SI;
+ default:
+ return -1;
+ }
+
+IF_UNMODIFIED_SI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_SIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_SIN;
+ default:
+ return -1;
+ }
+
+IF_UNMODIFIED_SIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_SINC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto IF_UNMODIFIED_SINC;
+ default:
+ return -1;
+ }
+
+IF_UNMODIFIED_SINC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 41;
+ }
+ goto IF_UNMODIFIED_SINCE;
+ case 'e':
+ if (last) {
+ return 41;
+ }
+ goto IF_UNMODIFIED_SINCE;
+ default:
+ return -1;
+ }
+
+K:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto KE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto KE;
+ default:
+ return -1;
+ }
+
+KE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto KEE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto KEE;
+ default:
+ return -1;
+ }
+
+KEE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto KEEP;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto KEEP;
+ default:
+ return -1;
+ }
+
+KEEP:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_;
+ default:
+ return -1;
+ }
+
+KEEP_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_A;
+ default:
+ return -1;
+ }
+
+KEEP_A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_AL;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_AL;
+ default:
+ return -1;
+ }
+
+KEEP_AL:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_ALI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_ALI;
+ default:
+ return -1;
+ }
+
+KEEP_ALI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'V':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_ALIV;
+ case 'v':
+ if (last) {
+ return -1;
+ }
+ goto KEEP_ALIV;
+ default:
+ return -1;
+ }
+
+KEEP_ALIV:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 42;
+ }
+ goto KEEP_ALIVE;
+ case 'e':
+ if (last) {
+ return 42;
+ }
+ goto KEEP_ALIVE;
+ default:
+ return -1;
+ }
+
+L:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto LA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto LA;
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto LI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto LI;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto LO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto LO;
+ default:
+ return -1;
+ }
+
+LA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto LAS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto LAS;
+ default:
+ return -1;
+ }
+
+LAS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto LAST;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto LAST;
+ default:
+ return -1;
+ }
+
+LAST:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto LAST_;
+ default:
+ return -1;
+ }
+
+LAST_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto LAST_E;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto LAST_E;
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto LAST_M;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto LAST_M;
+ default:
+ return -1;
+ }
+
+LAST_E:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'V':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EV;
+ case 'v':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EV;
+ default:
+ return -1;
+ }
+
+LAST_EV:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVE;
+ default:
+ return -1;
+ }
+
+LAST_EVE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVEN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVEN;
+ default:
+ return -1;
+ }
+
+LAST_EVEN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVENT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVENT;
+ default:
+ return -1;
+ }
+
+LAST_EVENT:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVENT_;
+ default:
+ return -1;
+ }
+
+LAST_EVENT_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVENT_I;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto LAST_EVENT_I;
+ default:
+ return -1;
+ }
+
+LAST_EVENT_I:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return 43;
+ }
+ goto LAST_EVENT_ID;
+ case 'd':
+ if (last) {
+ return 43;
+ }
+ goto LAST_EVENT_ID;
+ default:
+ return -1;
+ }
+
+LAST_M:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MO;
+ default:
+ return -1;
+ }
+
+LAST_MO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MOD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MOD;
+ default:
+ return -1;
+ }
+
+LAST_MOD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MODI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MODI;
+ default:
+ return -1;
+ }
+
+LAST_MODI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MODIF;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MODIF;
+ default:
+ return -1;
+ }
+
+LAST_MODIF:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MODIFI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MODIFI;
+ default:
+ return -1;
+ }
+
+LAST_MODIFI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MODIFIE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto LAST_MODIFIE;
+ default:
+ return -1;
+ }
+
+LAST_MODIFIE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return 44;
+ }
+ goto LAST_MODIFIED;
+ case 'd':
+ if (last) {
+ return 44;
+ }
+ goto LAST_MODIFIED;
+ default:
+ return -1;
+ }
+
+LI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto LIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto LIN;
+ default:
+ return -1;
+ }
+
+LIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'K':
+ if (last) {
+ return 45;
+ }
+ goto LINK;
+ case 'k':
+ if (last) {
+ return 45;
+ }
+ goto LINK;
+ default:
+ return -1;
+ }
+
+LO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto LOC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto LOC;
+ default:
+ return -1;
+ }
+
+LOC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto LOCA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto LOCA;
+ default:
+ return -1;
+ }
+
+LOCA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto LOCAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto LOCAT;
+ default:
+ return -1;
+ }
+
+LOCAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto LOCATI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto LOCATI;
+ default:
+ return -1;
+ }
+
+LOCATI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto LOCATIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto LOCATIO;
+ default:
+ return -1;
+ }
+
+LOCATIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 46;
+ }
+ goto LOCATION;
+ case 'n':
+ if (last) {
+ return 46;
+ }
+ goto LOCATION;
+ default:
+ return -1;
+ }
+
+M:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto MA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto MA;
+ default:
+ return -1;
+ }
+
+MA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'X':
+ if (last) {
+ return -1;
+ }
+ goto MAX;
+ case 'x':
+ if (last) {
+ return -1;
+ }
+ goto MAX;
+ default:
+ return -1;
+ }
+
+MAX:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto MAX_;
+ default:
+ return -1;
+ }
+
+MAX_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto MAX_F;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto MAX_F;
+ default:
+ return -1;
+ }
+
+MAX_F:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FO;
+ default:
+ return -1;
+ }
+
+MAX_FO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FOR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FOR;
+ default:
+ return -1;
+ }
+
+MAX_FOR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'W':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FORW;
+ case 'w':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FORW;
+ default:
+ return -1;
+ }
+
+MAX_FORW:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FORWA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FORWA;
+ default:
+ return -1;
+ }
+
+MAX_FORWA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FORWAR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FORWAR;
+ default:
+ return -1;
+ }
+
+MAX_FORWAR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FORWARD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto MAX_FORWARD;
+ default:
+ return -1;
+ }
+
+MAX_FORWARD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 47;
+ }
+ goto MAX_FORWARDS;
+ case 's':
+ if (last) {
+ return 47;
+ }
+ goto MAX_FORWARDS;
+ default:
+ return -1;
+ }
+
+O:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto OR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto OR;
+ default:
+ return -1;
+ }
+
+OR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto ORI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto ORI;
+ default:
+ return -1;
+ }
+
+ORI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto ORIG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto ORIG;
+ default:
+ return -1;
+ }
+
+ORIG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto ORIGI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto ORIGI;
+ default:
+ return -1;
+ }
+
+ORIGI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 48;
+ }
+ goto ORIGIN;
+ case 'n':
+ if (last) {
+ return 48;
+ }
+ goto ORIGIN;
+ default:
+ return -1;
+ }
+
+P:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto PR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto PR;
+ default:
+ return -1;
+ }
+
+PR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto PRA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto PRA;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto PRO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto PRO;
+ default:
+ return -1;
+ }
+
+PRA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto PRAG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto PRAG;
+ default:
+ return -1;
+ }
+
+PRAG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'M':
+ if (last) {
+ return -1;
+ }
+ goto PRAGM;
+ case 'm':
+ if (last) {
+ return -1;
+ }
+ goto PRAGM;
+ default:
+ return -1;
+ }
+
+PRAGM:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return 49;
+ }
+ goto PRAGMA;
+ case 'a':
+ if (last) {
+ return 49;
+ }
+ goto PRAGMA;
+ default:
+ return -1;
+ }
+
+PRO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'X':
+ if (last) {
+ return -1;
+ }
+ goto PROX;
+ case 'x':
+ if (last) {
+ return -1;
+ }
+ goto PROX;
+ default:
+ return -1;
+ }
+
+PROX:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'Y':
+ if (last) {
+ return -1;
+ }
+ goto PROXY;
+ case 'y':
+ if (last) {
+ return -1;
+ }
+ goto PROXY;
+ default:
+ return -1;
+ }
+
+PROXY:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_;
+ default:
+ return -1;
+ }
+
+PROXY_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_A;
+ default:
+ return -1;
+ }
+
+PROXY_A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'U':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AU;
+ case 'u':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AU;
+ default:
+ return -1;
+ }
+
+PROXY_AU:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUT;
+ default:
+ return -1;
+ }
+
+PROXY_AUT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTH;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTH;
+ default:
+ return -1;
+ }
+
+PROXY_AUTH:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHE;
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHO;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHEN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHEN;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHEN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENT;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHENT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENTI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENTI;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHENTI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENTIC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENTIC;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHENTIC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENTICA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENTICA;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHENTICA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENTICAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHENTICAT;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHENTICAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 50;
+ }
+ goto PROXY_AUTHENTICATE;
+ case 'e':
+ if (last) {
+ return 50;
+ }
+ goto PROXY_AUTHENTICATE;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHOR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHOR;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHOR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORI;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHORI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'Z':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZ;
+ case 'z':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZ;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHORIZ:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZA;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHORIZA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZAT;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHORIZAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZATI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZATI;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHORIZATI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZATIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto PROXY_AUTHORIZATIO;
+ default:
+ return -1;
+ }
+
+PROXY_AUTHORIZATIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 51;
+ }
+ goto PROXY_AUTHORIZATION;
+ case 'n':
+ if (last) {
+ return 51;
+ }
+ goto PROXY_AUTHORIZATION;
+ default:
+ return -1;
+ }
+
+R:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto RA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto RA;
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto RE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto RE;
+ default:
+ return -1;
+ }
+
+RA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto RAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto RAN;
+ default:
+ return -1;
+ }
+
+RAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto RANG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto RANG;
+ default:
+ return -1;
+ }
+
+RANG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 52;
+ }
+ goto RANGE;
+ case 'e':
+ if (last) {
+ return 52;
+ }
+ goto RANGE;
+ default:
+ return -1;
+ }
+
+RE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto REF;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto REF;
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto RET;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto RET;
+ default:
+ return -1;
+ }
+
+REF:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto REFE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto REFE;
+ default:
+ return -1;
+ }
+
+REFE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto REFER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto REFER;
+ default:
+ return -1;
+ }
+
+REFER:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto REFERE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto REFERE;
+ default:
+ return -1;
+ }
+
+REFERE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return 53;
+ }
+ goto REFERER;
+ case 'r':
+ if (last) {
+ return 53;
+ }
+ goto REFERER;
+ default:
+ return -1;
+ }
+
+RET:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto RETR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto RETR;
+ default:
+ return -1;
+ }
+
+RETR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'Y':
+ if (last) {
+ return -1;
+ }
+ goto RETRY;
+ case 'y':
+ if (last) {
+ return -1;
+ }
+ goto RETRY;
+ default:
+ return -1;
+ }
+
+RETRY:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_;
+ default:
+ return -1;
+ }
+
+RETRY_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_A;
+ default:
+ return -1;
+ }
+
+RETRY_A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_AF;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_AF;
+ default:
+ return -1;
+ }
+
+RETRY_AF:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_AFT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_AFT;
+ default:
+ return -1;
+ }
+
+RETRY_AFT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_AFTE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto RETRY_AFTE;
+ default:
+ return -1;
+ }
+
+RETRY_AFTE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return 54;
+ }
+ goto RETRY_AFTER;
+ case 'r':
+ if (last) {
+ return 54;
+ }
+ goto RETRY_AFTER;
+ default:
+ return -1;
+ }
+
+S:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SE;
+ default:
+ return -1;
+ }
+
+SE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto SEC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto SEC;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto SER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto SER;
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto SET;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto SET;
+ default:
+ return -1;
+ }
+
+SEC:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto SEC_;
+ default:
+ return -1;
+ }
+
+SEC_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'W':
+ if (last) {
+ return -1;
+ }
+ goto SEC_W;
+ case 'w':
+ if (last) {
+ return -1;
+ }
+ goto SEC_W;
+ default:
+ return -1;
+ }
+
+SEC_W:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WE;
+ default:
+ return -1;
+ }
+
+SEC_WE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'B':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEB;
+ case 'b':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEB;
+ default:
+ return -1;
+ }
+
+SEC_WEB:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBS;
+ default:
+ return -1;
+ }
+
+SEC_WEBS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSO;
+ default:
+ return -1;
+ }
+
+SEC_WEBSO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOC;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'K':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCK;
+ case 'k':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCK;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCK:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKE;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_A;
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_E;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_E;
+ case 'K':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_K;
+ case 'k':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_K;
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_P;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_P;
+ case 'V':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_V;
+ case 'v':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_V;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_AC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_AC;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_AC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_ACC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_ACC;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_ACC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_ACCE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_ACCE;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_ACCE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_ACCEP;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_ACCEP;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_ACCEP:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 55;
+ }
+ goto SEC_WEBSOCKET_ACCEPT;
+ case 't':
+ if (last) {
+ return 55;
+ }
+ goto SEC_WEBSOCKET_ACCEPT;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_E:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'X':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EX;
+ case 'x':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EX;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_EX:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXT;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_EXT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTE;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_EXTE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTEN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTEN;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_EXTEN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTENS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTENS;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_EXTENS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTENSI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTENSI;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_EXTENSI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTENSIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTENSIO;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_EXTENSIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTENSION;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_EXTENSION;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_EXTENSION:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return 56;
+ }
+ goto SEC_WEBSOCKET_EXTENSIONS;
+ case 's':
+ if (last) {
+ return 56;
+ }
+ goto SEC_WEBSOCKET_EXTENSIONS;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_K:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_KE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_KE;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_KE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'Y':
+ if (last) {
+ return 57;
+ }
+ goto SEC_WEBSOCKET_KEY;
+ case 'y':
+ if (last) {
+ return 57;
+ }
+ goto SEC_WEBSOCKET_KEY;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_KEY:
+ NEXT_CHAR();
+ switch (ch) {
+ case '1':
+ if (last) {
+ return 58;
+ }
+ goto SEC_WEBSOCKET_KEY1;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_P:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PR;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_PR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PRO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PRO;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_PRO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PROT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PROT;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_PROT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PROTO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PROTO;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_PROTO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PROTOC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PROTOC;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_PROTOC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PROTOCO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_PROTOCO;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_PROTOCO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return 59;
+ }
+ goto SEC_WEBSOCKET_PROTOCOL;
+ case 'l':
+ if (last) {
+ return 59;
+ }
+ goto SEC_WEBSOCKET_PROTOCOL;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_V:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VE;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_VE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VER;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_VER:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VERS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VERS;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_VERS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VERSI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VERSI;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_VERSI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VERSIO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto SEC_WEBSOCKET_VERSIO;
+ default:
+ return -1;
+ }
+
+SEC_WEBSOCKET_VERSIO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return 60;
+ }
+ goto SEC_WEBSOCKET_VERSION;
+ case 'n':
+ if (last) {
+ return 60;
+ }
+ goto SEC_WEBSOCKET_VERSION;
+ default:
+ return -1;
+ }
+
+SER:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'V':
+ if (last) {
+ return -1;
+ }
+ goto SERV;
+ case 'v':
+ if (last) {
+ return -1;
+ }
+ goto SERV;
+ default:
+ return -1;
+ }
+
+SERV:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto SERVE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto SERVE;
+ default:
+ return -1;
+ }
+
+SERVE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return 61;
+ }
+ goto SERVER;
+ case 'r':
+ if (last) {
+ return 61;
+ }
+ goto SERVER;
+ default:
+ return -1;
+ }
+
+SET:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto SET_;
+ default:
+ return -1;
+ }
+
+SET_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto SET_C;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto SET_C;
+ default:
+ return -1;
+ }
+
+SET_C:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto SET_CO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto SET_CO;
+ default:
+ return -1;
+ }
+
+SET_CO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto SET_COO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto SET_COO;
+ default:
+ return -1;
+ }
+
+SET_COO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'K':
+ if (last) {
+ return -1;
+ }
+ goto SET_COOK;
+ case 'k':
+ if (last) {
+ return -1;
+ }
+ goto SET_COOK;
+ default:
+ return -1;
+ }
+
+SET_COOK:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto SET_COOKI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto SET_COOKI;
+ default:
+ return -1;
+ }
+
+SET_COOKI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 62;
+ }
+ goto SET_COOKIE;
+ case 'e':
+ if (last) {
+ return 62;
+ }
+ goto SET_COOKIE;
+ default:
+ return -1;
+ }
+
+T:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 63;
+ }
+ goto TE;
+ case 'e':
+ if (last) {
+ return 63;
+ }
+ goto TE;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto TR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto TR;
+ default:
+ return -1;
+ }
+
+TR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto TRA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto TRA;
+ default:
+ return -1;
+ }
+
+TRA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto TRAI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto TRAI;
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto TRAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto TRAN;
+ default:
+ return -1;
+ }
+
+TRAI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'L':
+ if (last) {
+ return -1;
+ }
+ goto TRAIL;
+ case 'l':
+ if (last) {
+ return -1;
+ }
+ goto TRAIL;
+ default:
+ return -1;
+ }
+
+TRAIL:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto TRAILE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto TRAILE;
+ default:
+ return -1;
+ }
+
+TRAILE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return 64;
+ }
+ goto TRAILER;
+ case 'r':
+ if (last) {
+ return 64;
+ }
+ goto TRAILER;
+ default:
+ return -1;
+ }
+
+TRAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto TRANS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto TRANS;
+ default:
+ return -1;
+ }
+
+TRANS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto TRANSF;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto TRANSF;
+ default:
+ return -1;
+ }
+
+TRANSF:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFE;
+ default:
+ return -1;
+ }
+
+TRANSFE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER;
+ default:
+ return -1;
+ }
+
+TRANSFER:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_;
+ default:
+ return -1;
+ }
+
+TRANSFER_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_E;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_E;
+ default:
+ return -1;
+ }
+
+TRANSFER_E:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_EN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_EN;
+ default:
+ return -1;
+ }
+
+TRANSFER_EN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENC;
+ default:
+ return -1;
+ }
+
+TRANSFER_ENC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENCO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENCO;
+ default:
+ return -1;
+ }
+
+TRANSFER_ENCO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENCOD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENCOD;
+ default:
+ return -1;
+ }
+
+TRANSFER_ENCOD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENCODI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENCODI;
+ default:
+ return -1;
+ }
+
+TRANSFER_ENCODI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENCODIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto TRANSFER_ENCODIN;
+ default:
+ return -1;
+ }
+
+TRANSFER_ENCODIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return 65;
+ }
+ goto TRANSFER_ENCODING;
+ case 'g':
+ if (last) {
+ return 65;
+ }
+ goto TRANSFER_ENCODING;
+ default:
+ return -1;
+ }
+
+U:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto UR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto UR;
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto UP;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto UP;
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto US;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto US;
+ default:
+ return -1;
+ }
+
+UR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return 66;
+ }
+ goto URI;
+ case 'i':
+ if (last) {
+ return 66;
+ }
+ goto URI;
+ default:
+ return -1;
+ }
+
+UP:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto UPG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto UPG;
+ default:
+ return -1;
+ }
+
+UPG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto UPGR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto UPGR;
+ default:
+ return -1;
+ }
+
+UPGR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto UPGRA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto UPGRA;
+ default:
+ return -1;
+ }
+
+UPGRA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto UPGRAD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto UPGRAD;
+ default:
+ return -1;
+ }
+
+UPGRAD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 67;
+ }
+ goto UPGRADE;
+ case 'e':
+ if (last) {
+ return 67;
+ }
+ goto UPGRADE;
+ default:
+ return -1;
+ }
+
+US:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto USE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto USE;
+ default:
+ return -1;
+ }
+
+USE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto USER;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto USER;
+ default:
+ return -1;
+ }
+
+USER:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto USER_;
+ default:
+ return -1;
+ }
+
+USER_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto USER_A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto USER_A;
+ default:
+ return -1;
+ }
+
+USER_A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto USER_AG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto USER_AG;
+ default:
+ return -1;
+ }
+
+USER_AG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto USER_AGE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto USER_AGE;
+ default:
+ return -1;
+ }
+
+USER_AGE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto USER_AGEN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto USER_AGEN;
+ default:
+ return -1;
+ }
+
+USER_AGEN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 68;
+ }
+ goto USER_AGENT;
+ case 't':
+ if (last) {
+ return 68;
+ }
+ goto USER_AGENT;
+ default:
+ return -1;
+ }
+
+V:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto VA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto VA;
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto VI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto VI;
+ default:
+ return -1;
+ }
+
+VA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto VAR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto VAR;
+ default:
+ return -1;
+ }
+
+VAR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'Y':
+ if (last) {
+ return 69;
+ }
+ goto VARY;
+ case 'y':
+ if (last) {
+ return 69;
+ }
+ goto VARY;
+ default:
+ return -1;
+ }
+
+VI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return 70;
+ }
+ goto VIA;
+ case 'a':
+ if (last) {
+ return 70;
+ }
+ goto VIA;
+ default:
+ return -1;
+ }
+
+W:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'W':
+ if (last) {
+ return -1;
+ }
+ goto WW;
+ case 'w':
+ if (last) {
+ return -1;
+ }
+ goto WW;
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto WA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto WA;
+ default:
+ return -1;
+ }
+
+WW:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'W':
+ if (last) {
+ return -1;
+ }
+ goto WWW;
+ case 'w':
+ if (last) {
+ return -1;
+ }
+ goto WWW;
+ default:
+ return -1;
+ }
+
+WWW:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto WWW_;
+ default:
+ return -1;
+ }
+
+WWW_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto WWW_A;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto WWW_A;
+ default:
+ return -1;
+ }
+
+WWW_A:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'U':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AU;
+ case 'u':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AU;
+ default:
+ return -1;
+ }
+
+WWW_AU:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUT;
+ default:
+ return -1;
+ }
+
+WWW_AUT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTH;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTH;
+ default:
+ return -1;
+ }
+
+WWW_AUTH:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHE;
+ default:
+ return -1;
+ }
+
+WWW_AUTHE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHEN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHEN;
+ default:
+ return -1;
+ }
+
+WWW_AUTHEN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENT;
+ default:
+ return -1;
+ }
+
+WWW_AUTHENT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENTI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENTI;
+ default:
+ return -1;
+ }
+
+WWW_AUTHENTI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'C':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENTIC;
+ case 'c':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENTIC;
+ default:
+ return -1;
+ }
+
+WWW_AUTHENTIC:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENTICA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENTICA;
+ default:
+ return -1;
+ }
+
+WWW_AUTHENTICA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENTICAT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto WWW_AUTHENTICAT;
+ default:
+ return -1;
+ }
+
+WWW_AUTHENTICAT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return 71;
+ }
+ goto WWW_AUTHENTICATE;
+ case 'e':
+ if (last) {
+ return 71;
+ }
+ goto WWW_AUTHENTICATE;
+ default:
+ return -1;
+ }
+
+WA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto WAN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto WAN;
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto WAR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto WAR;
+ default:
+ return -1;
+ }
+
+WAN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto WANT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto WANT;
+ default:
+ return -1;
+ }
+
+WANT:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto WANT_;
+ default:
+ return -1;
+ }
+
+WANT_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto WANT_D;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto WANT_D;
+ default:
+ return -1;
+ }
+
+WANT_D:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto WANT_DI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto WANT_DI;
+ default:
+ return -1;
+ }
+
+WANT_DI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return -1;
+ }
+ goto WANT_DIG;
+ case 'g':
+ if (last) {
+ return -1;
+ }
+ goto WANT_DIG;
+ default:
+ return -1;
+ }
+
+WANT_DIG:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto WANT_DIGE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto WANT_DIGE;
+ default:
+ return -1;
+ }
+
+WANT_DIGE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto WANT_DIGES;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto WANT_DIGES;
+ default:
+ return -1;
+ }
+
+WANT_DIGES:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 72;
+ }
+ goto WANT_DIGEST;
+ case 't':
+ if (last) {
+ return 72;
+ }
+ goto WANT_DIGEST;
+ default:
+ return -1;
+ }
+
+WAR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto WARN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto WARN;
+ default:
+ return -1;
+ }
+
+WARN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'I':
+ if (last) {
+ return -1;
+ }
+ goto WARNI;
+ case 'i':
+ if (last) {
+ return -1;
+ }
+ goto WARNI;
+ default:
+ return -1;
+ }
+
+WARNI:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'N':
+ if (last) {
+ return -1;
+ }
+ goto WARNIN;
+ case 'n':
+ if (last) {
+ return -1;
+ }
+ goto WARNIN;
+ default:
+ return -1;
+ }
+
+WARNIN:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'G':
+ if (last) {
+ return 73;
+ }
+ goto WARNING;
+ case 'g':
+ if (last) {
+ return 73;
+ }
+ goto WARNING;
+ default:
+ return -1;
+ }
+
+X:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto X_;
+ default:
+ return -1;
+ }
+
+X_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto X_F;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto X_F;
+ default:
+ return -1;
+ }
+
+X_F:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto X_FO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto X_FO;
+ default:
+ return -1;
+ }
+
+X_FO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto X_FOR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto X_FOR;
+ default:
+ return -1;
+ }
+
+X_FOR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'W':
+ if (last) {
+ return -1;
+ }
+ goto X_FORW;
+ case 'w':
+ if (last) {
+ return -1;
+ }
+ goto X_FORW;
+ default:
+ return -1;
+ }
+
+X_FORW:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'A':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWA;
+ case 'a':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWA;
+ default:
+ return -1;
+ }
+
+X_FORWA:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWAR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWAR;
+ default:
+ return -1;
+ }
+
+X_FORWAR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARD;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARD;
+ default:
+ return -1;
+ }
+
+X_FORWARD:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'E':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDE;
+ case 'e':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDE;
+ default:
+ return -1;
+ }
+
+X_FORWARDE:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'D':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED;
+ case 'd':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED;
+ default:
+ return -1;
+ }
+
+X_FORWARDED:
+ NEXT_CHAR();
+ switch (ch) {
+ case '-':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'F':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_F;
+ case 'f':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_F;
+ case 'H':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_H;
+ case 'h':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_H;
+ case 'P':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_P;
+ case 'p':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_P;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_F:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_FO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_FO;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_FO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return 74;
+ }
+ goto X_FORWARDED_FOR;
+ case 'r':
+ if (last) {
+ return 74;
+ }
+ goto X_FORWARDED_FOR;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_H:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_HO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_HO;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_HO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'S':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_HOS;
+ case 's':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_HOS;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_HOS:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return 75;
+ }
+ goto X_FORWARDED_HOST;
+ case 't':
+ if (last) {
+ return 75;
+ }
+ goto X_FORWARDED_HOST;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_P:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'R':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_PR;
+ case 'r':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_PR;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_PR:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_PRO;
+ case 'o':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_PRO;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_PRO:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'T':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_PROT;
+ case 't':
+ if (last) {
+ return -1;
+ }
+ goto X_FORWARDED_PROT;
+ default:
+ return -1;
+ }
+
+X_FORWARDED_PROT:
+ NEXT_CHAR();
+ switch (ch) {
+ case 'O':
+ if (last) {
+ return 76;
+ }
+ goto X_FORWARDED_PROTO;
+ case 'o':
+ if (last) {
+ return 76;
+ }
+ goto X_FORWARDED_PROTO;
+ default:
+ return -1;
+ }
+
+ACCEPT_CHARSET:
+ACCEPT_ENCODING:
+ACCEPT_LANGUAGE:
+ACCEPT_RANGES:
+ACCESS_CONTROL_ALLOW_CREDENTIALS:
+ACCESS_CONTROL_ALLOW_HEADERS:
+ACCESS_CONTROL_ALLOW_METHODS:
+ACCESS_CONTROL_ALLOW_ORIGIN:
+ACCESS_CONTROL_EXPOSE_HEADERS:
+ACCESS_CONTROL_MAX_AGE:
+ACCESS_CONTROL_REQUEST_HEADERS:
+ACCESS_CONTROL_REQUEST_METHOD:
+AGE:
+ALLOW:
+AUTHORIZATION:
+CACHE_CONTROL:
+CONNECTION:
+CONTENT_DISPOSITION:
+CONTENT_ENCODING:
+CONTENT_LANGUAGE:
+CONTENT_LENGTH:
+CONTENT_LOCATION:
+CONTENT_MD5:
+CONTENT_RANGE:
+CONTENT_TRANSFER_ENCODING:
+CONTENT_TYPE:
+COOKIE:
+DATE:
+DESTINATION:
+DIGEST:
+ETAG:
+EXPECT:
+EXPIRES:
+FORWARDED:
+FROM:
+HOST:
+IF_MATCH:
+IF_MODIFIED_SINCE:
+IF_NONE_MATCH:
+IF_RANGE:
+IF_UNMODIFIED_SINCE:
+KEEP_ALIVE:
+LAST_EVENT_ID:
+LAST_MODIFIED:
+LINK:
+LOCATION:
+MAX_FORWARDS:
+ORIGIN:
+PRAGMA:
+PROXY_AUTHENTICATE:
+PROXY_AUTHORIZATION:
+RANGE:
+REFERER:
+RETRY_AFTER:
+SEC_WEBSOCKET_ACCEPT:
+SEC_WEBSOCKET_EXTENSIONS:
+SEC_WEBSOCKET_KEY1:
+SEC_WEBSOCKET_PROTOCOL:
+SEC_WEBSOCKET_VERSION:
+SERVER:
+SET_COOKIE:
+TE:
+TRAILER:
+TRANSFER_ENCODING:
+UPGRADE:
+URI:
+USER_AGENT:
+VARY:
+VIA:
+WANT_DIGEST:
+WARNING:
+WWW_AUTHENTICATE:
+X_FORWARDED_FOR:
+X_FORWARDED_HOST:
+X_FORWARDED_PROTO:
+missing:
+ /* nothing found */
+ return -1;
+}
diff --git a/third_party/python/aiohttp/aiohttp/_find_header.h b/third_party/python/aiohttp/aiohttp/_find_header.h
new file mode 100644
index 0000000000..99b7b4f828
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_find_header.h
@@ -0,0 +1,14 @@
+#ifndef _FIND_HEADERS_H
+#define _FIND_HEADERS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int find_header(const char *str, int size);
+
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/third_party/python/aiohttp/aiohttp/_find_header.pxd b/third_party/python/aiohttp/aiohttp/_find_header.pxd
new file mode 100644
index 0000000000..37a6c37268
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_find_header.pxd
@@ -0,0 +1,2 @@
+cdef extern from "_find_header.h":
+ int find_header(char *, int)
diff --git a/third_party/python/aiohttp/aiohttp/_headers.pxi b/third_party/python/aiohttp/aiohttp/_headers.pxi
new file mode 100644
index 0000000000..3744721d47
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_headers.pxi
@@ -0,0 +1,83 @@
+# The file is autogenerated from aiohttp/hdrs.py
+# Run ./tools/gen.py to update it after the origin changing.
+
+from . import hdrs
+cdef tuple headers = (
+ hdrs.ACCEPT,
+ hdrs.ACCEPT_CHARSET,
+ hdrs.ACCEPT_ENCODING,
+ hdrs.ACCEPT_LANGUAGE,
+ hdrs.ACCEPT_RANGES,
+ hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS,
+ hdrs.ACCESS_CONTROL_ALLOW_HEADERS,
+ hdrs.ACCESS_CONTROL_ALLOW_METHODS,
+ hdrs.ACCESS_CONTROL_ALLOW_ORIGIN,
+ hdrs.ACCESS_CONTROL_EXPOSE_HEADERS,
+ hdrs.ACCESS_CONTROL_MAX_AGE,
+ hdrs.ACCESS_CONTROL_REQUEST_HEADERS,
+ hdrs.ACCESS_CONTROL_REQUEST_METHOD,
+ hdrs.AGE,
+ hdrs.ALLOW,
+ hdrs.AUTHORIZATION,
+ hdrs.CACHE_CONTROL,
+ hdrs.CONNECTION,
+ hdrs.CONTENT_DISPOSITION,
+ hdrs.CONTENT_ENCODING,
+ hdrs.CONTENT_LANGUAGE,
+ hdrs.CONTENT_LENGTH,
+ hdrs.CONTENT_LOCATION,
+ hdrs.CONTENT_MD5,
+ hdrs.CONTENT_RANGE,
+ hdrs.CONTENT_TRANSFER_ENCODING,
+ hdrs.CONTENT_TYPE,
+ hdrs.COOKIE,
+ hdrs.DATE,
+ hdrs.DESTINATION,
+ hdrs.DIGEST,
+ hdrs.ETAG,
+ hdrs.EXPECT,
+ hdrs.EXPIRES,
+ hdrs.FORWARDED,
+ hdrs.FROM,
+ hdrs.HOST,
+ hdrs.IF_MATCH,
+ hdrs.IF_MODIFIED_SINCE,
+ hdrs.IF_NONE_MATCH,
+ hdrs.IF_RANGE,
+ hdrs.IF_UNMODIFIED_SINCE,
+ hdrs.KEEP_ALIVE,
+ hdrs.LAST_EVENT_ID,
+ hdrs.LAST_MODIFIED,
+ hdrs.LINK,
+ hdrs.LOCATION,
+ hdrs.MAX_FORWARDS,
+ hdrs.ORIGIN,
+ hdrs.PRAGMA,
+ hdrs.PROXY_AUTHENTICATE,
+ hdrs.PROXY_AUTHORIZATION,
+ hdrs.RANGE,
+ hdrs.REFERER,
+ hdrs.RETRY_AFTER,
+ hdrs.SEC_WEBSOCKET_ACCEPT,
+ hdrs.SEC_WEBSOCKET_EXTENSIONS,
+ hdrs.SEC_WEBSOCKET_KEY,
+ hdrs.SEC_WEBSOCKET_KEY1,
+ hdrs.SEC_WEBSOCKET_PROTOCOL,
+ hdrs.SEC_WEBSOCKET_VERSION,
+ hdrs.SERVER,
+ hdrs.SET_COOKIE,
+ hdrs.TE,
+ hdrs.TRAILER,
+ hdrs.TRANSFER_ENCODING,
+ hdrs.URI,
+ hdrs.UPGRADE,
+ hdrs.USER_AGENT,
+ hdrs.VARY,
+ hdrs.VIA,
+ hdrs.WWW_AUTHENTICATE,
+ hdrs.WANT_DIGEST,
+ hdrs.WARNING,
+ hdrs.X_FORWARDED_FOR,
+ hdrs.X_FORWARDED_HOST,
+ hdrs.X_FORWARDED_PROTO,
+)
diff --git a/third_party/python/aiohttp/aiohttp/_helpers.c b/third_party/python/aiohttp/aiohttp/_helpers.c
new file mode 100644
index 0000000000..d6400b28e2
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_helpers.c
@@ -0,0 +1,5712 @@
+/* Generated by Cython 0.29.32 */
+
+#ifndef PY_SSIZE_T_CLEAN
+#define PY_SSIZE_T_CLEAN
+#endif /* PY_SSIZE_T_CLEAN */
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+ #error Cython requires Python 2.6+ or Python 3.3+.
+#else
+#define CYTHON_ABI "0_29_32"
+#define CYTHON_HEX_VERSION 0x001D20F0
+#define CYTHON_FUTURE_DIVISION 1
+#include <stddef.h>
+#ifndef offsetof
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#define __PYX_COMMA ,
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x02070000
+ #define HAVE_LONG_LONG
+ #endif
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #if PY_VERSION_HEX < 0x03050000
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
+ #endif
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
+ #endif
+#elif defined(PY_NOGIL)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #ifndef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 1
+ #endif
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+#else
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
+ #define CYTHON_USE_PYTYPE_LOOKUP 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #if PY_VERSION_HEX >= 0x030B00A4
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #elif !defined(CYTHON_FAST_THREAD_STATE)
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
+ #endif
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+ #endif
+ #ifndef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
+ #endif
+ #if PY_VERSION_HEX >= 0x030B00A4
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #elif !defined(CYTHON_USE_EXC_INFO_STACK)
+ #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
+ #endif
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #if PY_MAJOR_VERSION < 3
+ #include "longintrepr.h"
+ #endif
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+ #ifdef SIZEOF_VOID_P
+ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
+ #endif
+#endif
+#ifndef __has_attribute
+ #define __has_attribute(x) 0
+#endif
+#ifndef __has_cpp_attribute
+ #define __has_cpp_attribute(x) 0
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+#ifdef _MSC_VER
+ #ifndef _MSC_STDINT_H_
+ #if _MSC_VER < 1300
+ typedef unsigned char uint8_t;
+ typedef unsigned int uint32_t;
+ #else
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int32 uint32_t;
+ #endif
+ #endif
+#else
+ #include <stdint.h>
+#endif
+#ifndef CYTHON_FALLTHROUGH
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+ #if __has_cpp_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH [[fallthrough]]
+ #elif __has_cpp_attribute(clang::fallthrough)
+ #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
+ #elif __has_cpp_attribute(gnu::fallthrough)
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
+ #endif
+ #endif
+ #ifndef CYTHON_FALLTHROUGH
+ #if __has_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
+ #else
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+ #if defined(__clang__ ) && defined(__apple_build_version__)
+ #if __apple_build_version__ < 7000000
+ #undef CYTHON_FALLTHROUGH
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+#endif
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_DefaultClassType PyType_Type
+#if PY_VERSION_HEX >= 0x030B00A1
+ static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
+ PyObject *code, PyObject *c, PyObject* n, PyObject *v,
+ PyObject *fv, PyObject *cell, PyObject* fn,
+ PyObject *name, int fline, PyObject *lnos) {
+ PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
+ PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
+ const char *fn_cstr=NULL;
+ const char *name_cstr=NULL;
+ PyCodeObject* co=NULL;
+ PyObject *type, *value, *traceback;
+ PyErr_Fetch(&type, &value, &traceback);
+ if (!(kwds=PyDict_New())) goto end;
+ if (!(argcount=PyLong_FromLong(a))) goto end;
+ if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
+ if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
+ if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
+ if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
+ if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
+ if (!(nlocals=PyLong_FromLong(l))) goto end;
+ if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
+ if (!(stacksize=PyLong_FromLong(s))) goto end;
+ if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
+ if (!(flags=PyLong_FromLong(f))) goto end;
+ if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
+ if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
+ if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
+ if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
+ if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
+ if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
+ if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
+ Py_XDECREF((PyObject*)co);
+ co = (PyCodeObject*)call_result;
+ call_result = NULL;
+ if (0) {
+ cleanup_code_too:
+ Py_XDECREF((PyObject*)co);
+ co = NULL;
+ }
+ end:
+ Py_XDECREF(kwds);
+ Py_XDECREF(argcount);
+ Py_XDECREF(posonlyargcount);
+ Py_XDECREF(kwonlyargcount);
+ Py_XDECREF(nlocals);
+ Py_XDECREF(stacksize);
+ Py_XDECREF(replace);
+ Py_XDECREF(call_result);
+ Py_XDECREF(empty);
+ if (type) {
+ PyErr_Restore(type, value, traceback);
+ }
+ return co;
+ }
+#else
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+#endif
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#ifndef Py_TPFLAGS_CHECKTYPES
+ #define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
+ #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#ifndef METH_STACKLESS
+ #define METH_STACKLESS 0
+#endif
+#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
+ #ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ #endif
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
+ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+ #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
+ #define PyMem_RawMalloc(n) PyMem_Malloc(n)
+ #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
+ #define PyMem_RawFree(p) PyMem_Free(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
+#endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+ #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
+#include "pythread.h"
+#define Py_tss_NEEDS_INIT 0
+typedef int Py_tss_t;
+static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
+ *key = PyThread_create_key();
+ return 0;
+}
+static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
+ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
+ *key = Py_tss_NEEDS_INIT;
+ return key;
+}
+static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
+ PyObject_Free(key);
+}
+static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
+ return *key != Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
+ PyThread_delete_key(*key);
+ *key = Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
+ return PyThread_set_key_value(*key, value);
+}
+static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
+ return PyThread_get_key_value(*key);
+}
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n) PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
+#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
+#else
+#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #if defined(PyUnicode_IS_READY)
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #else
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #endif
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
+ #endif
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
+ #endif
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#ifndef PyObject_Unicode
+ #define PyObject_Unicode PyObject_Str
+#endif
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#if PY_VERSION_HEX >= 0x030900A4
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
+#else
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
+#endif
+#if CYTHON_ASSUME_SAFE_MACROS
+ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
+#else
+ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
+ #else
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+ #endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+#endif
+
+#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
+ #if !defined(_USE_MATH_DEFINES)
+ #define _USE_MATH_DEFINES
+ #endif
+#endif
+#include <math.h>
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
+#endif
+
+#define __PYX_MARK_ERR_POS(f_index, lineno) \
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#define __PYX_HAVE__aiohttp___helpers
+#define __PYX_HAVE_API__aiohttp___helpers
+/* Early includes */
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
+ return (size_t) i < (size_t) limit;
+}
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER)
+ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
+#if CYTHON_ASSUME_SAFE_MACROS
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
+
+static PyObject *__pyx_m = NULL;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_cython_runtime = NULL;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "aiohttp/_helpers.pyx",
+ "stringsource",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_7aiohttp_8_helpers_reify;
+
+/* "aiohttp/_helpers.pyx":1
+ * cdef class reify: # <<<<<<<<<<<<<<
+ * """Use as a class method decorator. It operates almost exactly like
+ * the Python `@property` decorator, but it puts the result of the
+ */
+struct __pyx_obj_7aiohttp_8_helpers_reify {
+ PyObject_HEAD
+ PyObject *wrapped;
+ PyObject *name;
+};
+
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ if (acquire_gil) {\
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ PyGILState_Release(__pyx_gilstate_save);\
+ } else {\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext()\
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_XDECREF(tmp);\
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_DECREF(tmp);\
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+/* GetBuiltinName.proto */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+/* RaiseDoubleKeywords.proto */
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
+ const char* function_name);
+
+/* RaiseArgTupleInvalid.proto */
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
+ __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck);
+
+/* ObjectGetItem.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
+#else
+#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
+#endif
+
+/* GetTopmostException.proto */
+#if CYTHON_USE_EXC_INFO_STACK
+static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
+#endif
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred() PyErr_Occurred()
+#endif
+
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#define __Pyx_BUILD_ASSERT_EXPR(cond)\
+ (sizeof(char [1 - 2*!(cond)]) - 1)
+#ifndef Py_MEMBER_SIZE
+#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
+#endif
+#if CYTHON_FAST_PYCALL
+ static size_t __pyx_pyframe_localsplus_offset = 0;
+ #include "frameobject.h"
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+ #define __Pxy_PyFrame_Initialize_Offsets()\
+ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
+ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
+ #define __Pyx_PyFrame_GetLocalsplus(frame)\
+ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
+#endif // CYTHON_FAST_PYCALL
+#endif
+
+/* PyObjectCall.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+/* PyObjectCall2Args.proto */
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
+
+/* PyObjectCallMethO.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+/* PyObjectCallOneArg.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+/* GetAttr.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+/* GetAttr3.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
+
+/* PyDictVersioning.proto */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
+#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
+#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
+ (version_var) = __PYX_GET_DICT_VERSION(dict);\
+ (cache_var) = (value);
+#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
+ static PY_UINT64_T __pyx_dict_version = 0;\
+ static PyObject *__pyx_dict_cached_value = NULL;\
+ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
+ (VAR) = __pyx_dict_cached_value;\
+ } else {\
+ (VAR) = __pyx_dict_cached_value = (LOOKUP);\
+ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
+ }\
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
+#else
+#define __PYX_GET_DICT_VERSION(dict) (0)
+#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
+#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
+#endif
+
+/* GetModuleGlobalName.proto */
+#if CYTHON_USE_DICT_VERSIONS
+#define __Pyx_GetModuleGlobalName(var, name) {\
+ static PY_UINT64_T __pyx_dict_version = 0;\
+ static PyObject *__pyx_dict_cached_value = NULL;\
+ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
+ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
+ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
+}
+#define __Pyx_GetModuleGlobalNameUncached(var, name) {\
+ PY_UINT64_T __pyx_dict_version;\
+ PyObject *__pyx_dict_cached_value;\
+ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
+}
+static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
+#else
+#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
+#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
+static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
+#endif
+
+/* PySequenceContains.proto */
+static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
+ int result = PySequence_Contains(seq, item);
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
+}
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+/* ImportFrom.proto */
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+/* HasAttr.proto */
+static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
+
+/* PyObject_GenericGetAttrNoDict.proto */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
+#endif
+
+/* PyObject_GenericGetAttr.proto */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
+#endif
+
+/* PyObjectGetAttrStrNoError.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
+
+/* SetupReduce.proto */
+static int __Pyx_setup_reduce(PyObject* type_obj);
+
+/* CLineInTraceback.proto */
+#ifdef CYTHON_CLINE_IN_TRACEBACK
+#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
+#else
+static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
+#endif
+
+/* CodeObjectCache.proto */
+typedef struct {
+ PyCodeObject* code_object;
+ int code_line;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+/* AddTraceback.proto */
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+/* GCCDiagnostics.proto */
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+#define __Pyx_HAS_GCC_DIAGNOSTIC
+#endif
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
+
+/* CheckBinaryVersion.proto */
+static int __Pyx_check_binary_version(void);
+
+/* InitStrings.proto */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'aiohttp._helpers' */
+static PyTypeObject *__pyx_ptype_7aiohttp_8_helpers_reify = 0;
+static PyObject *__pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(struct __pyx_obj_7aiohttp_8_helpers_reify *, PyObject *); /*proto*/
+#define __Pyx_MODULE_NAME "aiohttp._helpers"
+extern int __pyx_module_is_main_aiohttp___helpers;
+int __pyx_module_is_main_aiohttp___helpers = 0;
+
+/* Implementation of 'aiohttp._helpers' */
+static PyObject *__pyx_builtin_KeyError;
+static PyObject *__pyx_builtin_AttributeError;
+static const char __pyx_k_doc[] = "__doc__";
+static const char __pyx_k_new[] = "__new__";
+static const char __pyx_k_dict[] = "__dict__";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_name[] = "__name__";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_cache[] = "_cache";
+static const char __pyx_k_reify[] = "reify";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_pickle[] = "pickle";
+static const char __pyx_k_reduce[] = "__reduce__";
+static const char __pyx_k_update[] = "update";
+static const char __pyx_k_wrapped[] = "wrapped";
+static const char __pyx_k_KeyError[] = "KeyError";
+static const char __pyx_k_getstate[] = "__getstate__";
+static const char __pyx_k_pyx_type[] = "__pyx_type";
+static const char __pyx_k_setstate[] = "__setstate__";
+static const char __pyx_k_pyx_state[] = "__pyx_state";
+static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
+static const char __pyx_k_pyx_result[] = "__pyx_result";
+static const char __pyx_k_PickleError[] = "PickleError";
+static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
+static const char __pyx_k_stringsource[] = "stringsource";
+static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
+static const char __pyx_k_AttributeError[] = "AttributeError";
+static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
+static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
+static const char __pyx_k_aiohttp__helpers[] = "aiohttp._helpers";
+static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
+static const char __pyx_k_pyx_unpickle_reify[] = "__pyx_unpickle_reify";
+static const char __pyx_k_reified_property_is_read_only[] = "reified property is read-only";
+static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))";
+static PyObject *__pyx_n_s_AttributeError;
+static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
+static PyObject *__pyx_n_s_KeyError;
+static PyObject *__pyx_n_s_PickleError;
+static PyObject *__pyx_n_s_aiohttp__helpers;
+static PyObject *__pyx_n_s_cache;
+static PyObject *__pyx_n_s_cline_in_traceback;
+static PyObject *__pyx_n_s_dict;
+static PyObject *__pyx_n_s_doc;
+static PyObject *__pyx_n_s_getstate;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_new;
+static PyObject *__pyx_n_s_pickle;
+static PyObject *__pyx_n_s_pyx_PickleError;
+static PyObject *__pyx_n_s_pyx_checksum;
+static PyObject *__pyx_n_s_pyx_result;
+static PyObject *__pyx_n_s_pyx_state;
+static PyObject *__pyx_n_s_pyx_type;
+static PyObject *__pyx_n_s_pyx_unpickle_reify;
+static PyObject *__pyx_n_s_reduce;
+static PyObject *__pyx_n_s_reduce_cython;
+static PyObject *__pyx_n_s_reduce_ex;
+static PyObject *__pyx_kp_u_reified_property_is_read_only;
+static PyObject *__pyx_n_s_reify;
+static PyObject *__pyx_n_s_setstate;
+static PyObject *__pyx_n_s_setstate_cython;
+static PyObject *__pyx_kp_s_stringsource;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_update;
+static PyObject *__pyx_n_s_wrapped;
+static int __pyx_pf_7aiohttp_8_helpers_5reify___init__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_wrapped); /* proto */
+static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_2__get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_owner); /* proto */
+static int __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_value); /* proto */
+static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
+static PyObject *__pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
+static PyObject *__pyx_tp_new_7aiohttp_8_helpers_reify(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_int_88416349;
+static PyObject *__pyx_int_124832655;
+static PyObject *__pyx_int_250410337;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_codeobj__4;
+/* Late includes */
+
+/* "aiohttp/_helpers.pyx":13
+ * cdef object name
+ *
+ * def __init__(self, wrapped): # <<<<<<<<<<<<<<
+ * self.wrapped = wrapped
+ * self.name = wrapped.__name__
+ */
+
+/* Python wrapper */
+static int __pyx_pw_7aiohttp_8_helpers_5reify_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_7aiohttp_8_helpers_5reify_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_wrapped = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_wrapped,0};
+ PyObject* values[1] = {0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_wrapped)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 13, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ }
+ __pyx_v_wrapped = values[0];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 13, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify___init__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), __pyx_v_wrapped);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_7aiohttp_8_helpers_5reify___init__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_wrapped) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "aiohttp/_helpers.pyx":14
+ *
+ * def __init__(self, wrapped):
+ * self.wrapped = wrapped # <<<<<<<<<<<<<<
+ * self.name = wrapped.__name__
+ *
+ */
+ __Pyx_INCREF(__pyx_v_wrapped);
+ __Pyx_GIVEREF(__pyx_v_wrapped);
+ __Pyx_GOTREF(__pyx_v_self->wrapped);
+ __Pyx_DECREF(__pyx_v_self->wrapped);
+ __pyx_v_self->wrapped = __pyx_v_wrapped;
+
+ /* "aiohttp/_helpers.pyx":15
+ * def __init__(self, wrapped):
+ * self.wrapped = wrapped
+ * self.name = wrapped.__name__ # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_wrapped, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_self->name);
+ __Pyx_DECREF(__pyx_v_self->name);
+ __pyx_v_self->name = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_helpers.pyx":13
+ * cdef object name
+ *
+ * def __init__(self, wrapped): # <<<<<<<<<<<<<<
+ * self.wrapped = wrapped
+ * self.name = wrapped.__name__
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_helpers.pyx":18
+ *
+ * @property
+ * def __doc__(self): # <<<<<<<<<<<<<<
+ * return self.wrapped.__doc__
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_7__doc_____get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "aiohttp/_helpers.pyx":19
+ * @property
+ * def __doc__(self):
+ * return self.wrapped.__doc__ # <<<<<<<<<<<<<<
+ *
+ * def __get__(self, inst, owner):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->wrapped, __pyx_n_s_doc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_helpers.pyx":18
+ *
+ * @property
+ * def __doc__(self): # <<<<<<<<<<<<<<
+ * return self.wrapped.__doc__
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__doc__.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_helpers.pyx":21
+ * return self.wrapped.__doc__
+ *
+ * def __get__(self, inst, owner): # <<<<<<<<<<<<<<
+ * try:
+ * try:
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_owner); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_3__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_owner) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_2__get__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v_inst), ((PyObject *)__pyx_v_owner));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_2__get__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_owner) {
+ PyObject *__pyx_v_val = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ int __pyx_t_14;
+ int __pyx_t_15;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "aiohttp/_helpers.pyx":22
+ *
+ * def __get__(self, inst, owner):
+ * try: # <<<<<<<<<<<<<<
+ * try:
+ * return inst._cache[self.name]
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "aiohttp/_helpers.pyx":23
+ * def __get__(self, inst, owner):
+ * try:
+ * try: # <<<<<<<<<<<<<<
+ * return inst._cache[self.name]
+ * except KeyError:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_6);
+ /*try:*/ {
+
+ /* "aiohttp/_helpers.pyx":24
+ * try:
+ * try:
+ * return inst._cache[self.name] # <<<<<<<<<<<<<<
+ * except KeyError:
+ * val = self.wrapped(inst)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_inst, __pyx_n_s_cache); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 24, __pyx_L9_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_PyObject_GetItem(__pyx_t_7, __pyx_v_self->name); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 24, __pyx_L9_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __pyx_r = __pyx_t_8;
+ __pyx_t_8 = 0;
+ goto __pyx_L13_try_return;
+
+ /* "aiohttp/_helpers.pyx":23
+ * def __get__(self, inst, owner):
+ * try:
+ * try: # <<<<<<<<<<<<<<
+ * return inst._cache[self.name]
+ * except KeyError:
+ */
+ }
+ __pyx_L9_error:;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+ /* "aiohttp/_helpers.pyx":25
+ * try:
+ * return inst._cache[self.name]
+ * except KeyError: # <<<<<<<<<<<<<<
+ * val = self.wrapped(inst)
+ * inst._cache[self.name] = val
+ */
+ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_10) < 0) __PYX_ERR(0, 25, __pyx_L11_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_10);
+
+ /* "aiohttp/_helpers.pyx":26
+ * return inst._cache[self.name]
+ * except KeyError:
+ * val = self.wrapped(inst) # <<<<<<<<<<<<<<
+ * inst._cache[self.name] = val
+ * return val
+ */
+ __Pyx_INCREF(__pyx_v_self->wrapped);
+ __pyx_t_12 = __pyx_v_self->wrapped; __pyx_t_13 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
+ __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
+ if (likely(__pyx_t_13)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_13);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_12, function);
+ }
+ }
+ __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_12, __pyx_t_13, __pyx_v_inst) : __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_inst);
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 26, __pyx_L11_except_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __pyx_v_val = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_helpers.pyx":27
+ * except KeyError:
+ * val = self.wrapped(inst)
+ * inst._cache[self.name] = val # <<<<<<<<<<<<<<
+ * return val
+ * except AttributeError:
+ */
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_inst, __pyx_n_s_cache); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 27, __pyx_L11_except_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ if (unlikely(PyObject_SetItem(__pyx_t_11, __pyx_v_self->name, __pyx_v_val) < 0)) __PYX_ERR(0, 27, __pyx_L11_except_error)
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+
+ /* "aiohttp/_helpers.pyx":28
+ * val = self.wrapped(inst)
+ * inst._cache[self.name] = val
+ * return val # <<<<<<<<<<<<<<
+ * except AttributeError:
+ * if inst is None:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_val);
+ __pyx_r = __pyx_v_val;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ goto __pyx_L12_except_return;
+ }
+ goto __pyx_L11_except_error;
+ __pyx_L11_except_error:;
+
+ /* "aiohttp/_helpers.pyx":23
+ * def __get__(self, inst, owner):
+ * try:
+ * try: # <<<<<<<<<<<<<<
+ * return inst._cache[self.name]
+ * except KeyError:
+ */
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+ goto __pyx_L3_error;
+ __pyx_L13_try_return:;
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+ goto __pyx_L7_try_return;
+ __pyx_L12_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
+ goto __pyx_L7_try_return;
+ }
+
+ /* "aiohttp/_helpers.pyx":22
+ *
+ * def __get__(self, inst, owner):
+ * try: # <<<<<<<<<<<<<<
+ * try:
+ * return inst._cache[self.name]
+ */
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+ /* "aiohttp/_helpers.pyx":29
+ * inst._cache[self.name] = val
+ * return val
+ * except AttributeError: # <<<<<<<<<<<<<<
+ * if inst is None:
+ * return self
+ */
+ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_10, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 29, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
+
+ /* "aiohttp/_helpers.pyx":30
+ * return val
+ * except AttributeError:
+ * if inst is None: # <<<<<<<<<<<<<<
+ * return self
+ * raise
+ */
+ __pyx_t_14 = (__pyx_v_inst == Py_None);
+ __pyx_t_15 = (__pyx_t_14 != 0);
+ if (__pyx_t_15) {
+
+ /* "aiohttp/_helpers.pyx":31
+ * except AttributeError:
+ * if inst is None:
+ * return self # <<<<<<<<<<<<<<
+ * raise
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __pyx_r = ((PyObject *)__pyx_v_self);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ goto __pyx_L6_except_return;
+
+ /* "aiohttp/_helpers.pyx":30
+ * return val
+ * except AttributeError:
+ * if inst is None: # <<<<<<<<<<<<<<
+ * return self
+ * raise
+ */
+ }
+
+ /* "aiohttp/_helpers.pyx":32
+ * if inst is None:
+ * return self
+ * raise # <<<<<<<<<<<<<<
+ *
+ * def __set__(self, inst, value):
+ */
+ __Pyx_GIVEREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_ErrRestoreWithState(__pyx_t_10, __pyx_t_7, __pyx_t_8);
+ __pyx_t_10 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0;
+ __PYX_ERR(0, 32, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_helpers.pyx":22
+ *
+ * def __get__(self, inst, owner):
+ * try: # <<<<<<<<<<<<<<
+ * try:
+ * return inst._cache[self.name]
+ */
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L7_try_return:;
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L0;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_helpers.pyx":21
+ * return self.wrapped.__doc__
+ *
+ * def __get__(self, inst, owner): # <<<<<<<<<<<<<<
+ * try:
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_val);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_helpers.pyx":34
+ * raise
+ *
+ * def __set__(self, inst, value): # <<<<<<<<<<<<<<
+ * raise AttributeError("reified property is read-only")
+ */
+
+/* Python wrapper */
+static int __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_inst, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v_inst), ((PyObject *)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_7aiohttp_8_helpers_5reify_4__set__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_inst, CYTHON_UNUSED PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__set__", 0);
+
+ /* "aiohttp/_helpers.pyx":35
+ *
+ * def __set__(self, inst, value):
+ * raise AttributeError("reified property is read-only") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 35, __pyx_L1_error)
+
+ /* "aiohttp/_helpers.pyx":34
+ * raise
+ *
+ * def __set__(self, inst, value): # <<<<<<<<<<<<<<
+ * raise AttributeError("reified property is read-only")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef tuple state
+ * cdef object _dict
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_6__reduce_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self) {
+ PyObject *__pyx_v_state = 0;
+ PyObject *__pyx_v__dict = 0;
+ int __pyx_v_use_setstate;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":5
+ * cdef object _dict
+ * cdef bint use_setstate
+ * state = (self.name, self.wrapped) # <<<<<<<<<<<<<<
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_self->name);
+ __Pyx_GIVEREF(__pyx_v_self->name);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
+ __Pyx_INCREF(__pyx_v_self->wrapped);
+ __Pyx_GIVEREF(__pyx_v_self->wrapped);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->wrapped);
+ __pyx_v_state = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":6
+ * cdef bint use_setstate
+ * state = (self.name, self.wrapped)
+ * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
+ * if _dict is not None:
+ * state += (_dict,)
+ */
+ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v__dict = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":7
+ * state = (self.name, self.wrapped)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ __pyx_t_2 = (__pyx_v__dict != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":8
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ * state += (_dict,) # <<<<<<<<<<<<<<
+ * use_setstate = True
+ * else:
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v__dict);
+ __Pyx_GIVEREF(__pyx_v__dict);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
+ __pyx_t_4 = 0;
+
+ /* "(tree fragment)":9
+ * if _dict is not None:
+ * state += (_dict,)
+ * use_setstate = True # <<<<<<<<<<<<<<
+ * else:
+ * use_setstate = self.name is not None or self.wrapped is not None
+ */
+ __pyx_v_use_setstate = 1;
+
+ /* "(tree fragment)":7
+ * state = (self.name, self.wrapped)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ goto __pyx_L3;
+ }
+
+ /* "(tree fragment)":11
+ * use_setstate = True
+ * else:
+ * use_setstate = self.name is not None or self.wrapped is not None # <<<<<<<<<<<<<<
+ * if use_setstate:
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
+ */
+ /*else*/ {
+ __pyx_t_2 = (__pyx_v_self->name != Py_None);
+ __pyx_t_5 = (__pyx_t_2 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->wrapped != Py_None);
+ __pyx_t_2 = (__pyx_t_5 != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ __pyx_v_use_setstate = __pyx_t_3;
+ }
+ __pyx_L3:;
+
+ /* "(tree fragment)":12
+ * else:
+ * use_setstate = self.name is not None or self.wrapped is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_use_setstate != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":13
+ * use_setstate = self.name is not None or self.wrapped is not None
+ * if use_setstate:
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state # <<<<<<<<<<<<<<
+ * else:
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_reify); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_124832655);
+ __Pyx_GIVEREF(__pyx_int_124832655);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_124832655);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
+ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":12
+ * else:
+ * use_setstate = self.name is not None or self.wrapped is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
+ * else:
+ */
+ }
+
+ /* "(tree fragment)":15
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, None), state
+ * else:
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state) # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_reify__set_state(self, __pyx_state)
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_reify); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_124832655);
+ __Pyx_GIVEREF(__pyx_int_124832655);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_124832655);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef tuple state
+ * cdef object _dict
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_state);
+ __Pyx_XDECREF(__pyx_v__dict);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":16
+ * else:
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_reify__set_state(self, __pyx_state)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_8_helpers_5reify_8__setstate_cython__(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":17
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_reify__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
+ */
+ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":16
+ * else:
+ * return __pyx_unpickle_reify, (type(self), 0x770cb8f, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_reify__set_state(self, __pyx_state)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._helpers.reify.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_7aiohttp_8_helpers_1__pyx_unpickle_reify = {"__pyx_unpickle_reify", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_7aiohttp_8_helpers_1__pyx_unpickle_reify(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v___pyx_type = 0;
+ long __pyx_v___pyx_checksum;
+ PyObject *__pyx_v___pyx_state = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_unpickle_reify (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_reify") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v___pyx_type = values[0];
+ __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
+ __pyx_v___pyx_state = values[2];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_reify", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_8_helpers___pyx_unpickle_reify(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_v___pyx_PickleError = 0;
+ PyObject *__pyx_v___pyx_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_reify", 0);
+
+ /* "(tree fragment)":4
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0x770cb8f, 0xeecf561, 0x545205d): # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))" % __pyx_checksum)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__2, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":5
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0x770cb8f, 0xeecf561, 0x545205d):
+ * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))" % __pyx_checksum)
+ * __pyx_result = reify.__new__(__pyx_type)
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_PickleError);
+ __Pyx_GIVEREF(__pyx_n_s_PickleError);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v___pyx_PickleError = __pyx_t_1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "(tree fragment)":6
+ * if __pyx_checksum not in (0x770cb8f, 0xeecf561, 0x545205d):
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))" % __pyx_checksum) # <<<<<<<<<<<<<<
+ * __pyx_result = reify.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_INCREF(__pyx_v___pyx_PickleError);
+ __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(1, 6, __pyx_L1_error)
+
+ /* "(tree fragment)":4
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0x770cb8f, 0xeecf561, 0x545205d): # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))" % __pyx_checksum)
+ */
+ }
+
+ /* "(tree fragment)":7
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))" % __pyx_checksum)
+ * __pyx_result = reify.__new__(__pyx_type) # <<<<<<<<<<<<<<
+ * if __pyx_state is not None:
+ * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7aiohttp_8_helpers_reify), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v___pyx_result = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "(tree fragment)":8
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))" % __pyx_checksum)
+ * __pyx_result = reify.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+
+ /* "(tree fragment)":9
+ * __pyx_result = reify.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
+ * return __pyx_result
+ * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
+ */
+ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(((struct __pyx_obj_7aiohttp_8_helpers_reify *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "(tree fragment)":8
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))" % __pyx_checksum)
+ * __pyx_result = reify.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ }
+
+ /* "(tree fragment)":10
+ * if __pyx_state is not None:
+ * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
+ * return __pyx_result # <<<<<<<<<<<<<<
+ * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v___pyx_result);
+ __pyx_r = __pyx_v___pyx_result;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v___pyx_PickleError);
+ __Pyx_XDECREF(__pyx_v___pyx_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":11
+ * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
+ * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
+ */
+
+static PyObject *__pyx_f_7aiohttp_8_helpers___pyx_unpickle_reify__set_state(struct __pyx_obj_7aiohttp_8_helpers_reify *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_reify__set_state", 0);
+
+ /* "(tree fragment)":12
+ * return __pyx_result
+ * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1] # <<<<<<<<<<<<<<
+ * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[2])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->name);
+ __Pyx_DECREF(__pyx_v___pyx_result->name);
+ __pyx_v___pyx_result->name = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->wrapped);
+ __Pyx_DECREF(__pyx_v___pyx_result->wrapped);
+ __pyx_v___pyx_result->wrapped = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":13
+ * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
+ * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[2])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(1, 13, __pyx_L1_error)
+ }
+ __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
+ __pyx_t_4 = ((__pyx_t_3 > 2) != 0);
+ if (__pyx_t_4) {
+ } else {
+ __pyx_t_2 = __pyx_t_4;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_4 != 0);
+ __pyx_t_2 = __pyx_t_5;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "(tree fragment)":14
+ * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
+ * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[2]) # <<<<<<<<<<<<<<
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 14, __pyx_L1_error)
+ }
+ __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_8)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":13
+ * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
+ * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[2])
+ */
+ }
+
+ /* "(tree fragment)":11
+ * __pyx_unpickle_reify__set_state(<reify> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_reify__set_state(reify __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.name = __pyx_state[0]; __pyx_result.wrapped = __pyx_state[1]
+ * if len(__pyx_state) > 2 and hasattr(__pyx_result, '__dict__'):
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("aiohttp._helpers.__pyx_unpickle_reify__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_tp_new_7aiohttp_8_helpers_reify(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_7aiohttp_8_helpers_reify *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_7aiohttp_8_helpers_reify *)o);
+ p->wrapped = Py_None; Py_INCREF(Py_None);
+ p->name = Py_None; Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_7aiohttp_8_helpers_reify(PyObject *o) {
+ struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->wrapped);
+ Py_CLEAR(p->name);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_7aiohttp_8_helpers_reify(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
+ if (p->wrapped) {
+ e = (*v)(p->wrapped, a); if (e) return e;
+ }
+ if (p->name) {
+ e = (*v)(p->name, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_7aiohttp_8_helpers_reify(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_7aiohttp_8_helpers_reify *p = (struct __pyx_obj_7aiohttp_8_helpers_reify *)o;
+ tmp = ((PyObject*)p->wrapped);
+ p->wrapped = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->name);
+ p->name = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyObject *__pyx_tp_descr_get_7aiohttp_8_helpers_reify(PyObject *o, PyObject *i, PyObject *c) {
+ PyObject *r = 0;
+ if (!i) i = Py_None;
+ if (!c) c = Py_None;
+ r = __pyx_pw_7aiohttp_8_helpers_5reify_3__get__(o, i, c);
+ return r;
+}
+
+static int __pyx_tp_descr_set_7aiohttp_8_helpers_reify(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_pw_7aiohttp_8_helpers_5reify_5__set__(o, i, v);
+ }
+ else {
+ PyErr_SetString(PyExc_NotImplementedError, "__delete__");
+ return -1;
+ }
+}
+
+static PyObject *__pyx_getprop_7aiohttp_8_helpers_5reify___doc__(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_8_helpers_5reify_7__doc___1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_7aiohttp_8_helpers_reify[] = {
+ {"__reduce_cython__", (PyCFunction)__pyx_pw_7aiohttp_8_helpers_5reify_7__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw_7aiohttp_8_helpers_5reify_9__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_7aiohttp_8_helpers_reify[] = {
+ {(char *)"__doc__", __pyx_getprop_7aiohttp_8_helpers_5reify___doc__, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_7aiohttp_8_helpers_reify = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._helpers.reify", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_8_helpers_reify), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_8_helpers_reify, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ "Use as a class method decorator. It operates almost exactly like\n the Python `@property` decorator, but it puts the result of the\n method it decorates into the instance dict after the first call,\n effectively replacing the function it decorates with an instance\n variable. It is, in Python parlance, a data descriptor.\n\n ", /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_8_helpers_reify, /*tp_traverse*/
+ __pyx_tp_clear_7aiohttp_8_helpers_reify, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_7aiohttp_8_helpers_reify, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_7aiohttp_8_helpers_reify, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ __pyx_tp_descr_get_7aiohttp_8_helpers_reify, /*tp_descr_get*/
+ __pyx_tp_descr_set_7aiohttp_8_helpers_reify, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_pw_7aiohttp_8_helpers_5reify_1__init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_8_helpers_reify, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec__helpers(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+ {Py_mod_create, (void*)__pyx_pymod_create},
+ {Py_mod_exec, (void*)__pyx_pymod_exec__helpers},
+ {0, NULL}
+};
+#endif
+
+static struct PyModuleDef __pyx_moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "_helpers",
+ 0, /* m_doc */
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ 0, /* m_size */
+ #else
+ -1, /* m_size */
+ #endif
+ __pyx_methods /* m_methods */,
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_moduledef_slots, /* m_slots */
+ #else
+ NULL, /* m_reload */
+ #endif
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+#ifndef CYTHON_SMALL_CODE
+#if defined(__clang__)
+ #define CYTHON_SMALL_CODE
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+ #define CYTHON_SMALL_CODE __attribute__((cold))
+#else
+ #define CYTHON_SMALL_CODE
+#endif
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
+ {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
+ {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
+ {&__pyx_n_s_aiohttp__helpers, __pyx_k_aiohttp__helpers, sizeof(__pyx_k_aiohttp__helpers), 0, 0, 1, 1},
+ {&__pyx_n_s_cache, __pyx_k_cache, sizeof(__pyx_k_cache), 0, 0, 1, 1},
+ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
+ {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
+ {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
+ {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
+ {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_unpickle_reify, __pyx_k_pyx_unpickle_reify, sizeof(__pyx_k_pyx_unpickle_reify), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
+ {&__pyx_kp_u_reified_property_is_read_only, __pyx_k_reified_property_is_read_only, sizeof(__pyx_k_reified_property_is_read_only), 0, 1, 0, 0},
+ {&__pyx_n_s_reify, __pyx_k_reify, sizeof(__pyx_k_reify), 0, 0, 1, 1},
+ {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
+ {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
+ {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
+ {&__pyx_n_s_wrapped, __pyx_k_wrapped, sizeof(__pyx_k_wrapped), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 25, __pyx_L1_error)
+ __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 29, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "aiohttp/_helpers.pyx":35
+ *
+ * def __set__(self, inst, value):
+ * raise AttributeError("reified property is read-only") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_reified_property_is_read_only); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+
+ /* "(tree fragment)":4
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0x770cb8f, 0xeecf561, 0x545205d): # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x770cb8f, 0xeecf561, 0x545205d) = (name, wrapped))" % __pyx_checksum)
+ */
+ __pyx_tuple__2 = PyTuple_Pack(3, __pyx_int_124832655, __pyx_int_250410337, __pyx_int_88416349); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+ __pyx_tuple__3 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+ __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_reify, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_88416349 = PyInt_FromLong(88416349L); if (unlikely(!__pyx_int_88416349)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_124832655 = PyInt_FromLong(124832655L); if (unlikely(!__pyx_int_124832655)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_250410337 = PyInt_FromLong(250410337L); if (unlikely(!__pyx_int_250410337)) __PYX_ERR(0, 1, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
+
+static int __Pyx_modinit_global_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
+ /*--- Global init code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_variable_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
+ /*--- Variable export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
+ /*--- Function export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_type_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
+ /*--- Type init code ---*/
+ if (PyType_Ready(&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_8_helpers_reify.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_8_helpers_reify.tp_dictoffset && __pyx_type_7aiohttp_8_helpers_reify.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_8_helpers_reify.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_reify, (PyObject *)&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7aiohttp_8_helpers_reify) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_ptype_7aiohttp_8_helpers_reify = &__pyx_type_7aiohttp_8_helpers_reify;
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_type_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
+ /*--- Type import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_variable_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
+ /*--- Variable import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
+ /*--- Function import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+
+#ifndef CYTHON_NO_PYINIT_EXPORT
+#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#elif PY_MAJOR_VERSION < 3
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" void
+#else
+#define __Pyx_PyMODINIT_FUNC void
+#endif
+#else
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
+#else
+#define __Pyx_PyMODINIT_FUNC PyObject *
+#endif
+#endif
+
+
+#if PY_MAJOR_VERSION < 3
+__Pyx_PyMODINIT_FUNC init_helpers(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC init_helpers(void)
+#else
+__Pyx_PyMODINIT_FUNC PyInit__helpers(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC PyInit__helpers(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+ return PyModuleDef_Init(&__pyx_moduledef);
+}
+static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
+ #if PY_VERSION_HEX >= 0x030700A1
+ static PY_INT64_T main_interpreter_id = -1;
+ PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
+ if (main_interpreter_id == -1) {
+ main_interpreter_id = current_id;
+ return (unlikely(current_id == -1)) ? -1 : 0;
+ } else if (unlikely(main_interpreter_id != current_id))
+ #else
+ static PyInterpreterState *main_interpreter = NULL;
+ PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
+ if (!main_interpreter) {
+ main_interpreter = current_interpreter;
+ } else if (unlikely(main_interpreter != current_interpreter))
+ #endif
+ {
+ PyErr_SetString(
+ PyExc_ImportError,
+ "Interpreter change detected - this module can only be loaded into one interpreter per process.");
+ return -1;
+ }
+ return 0;
+}
+static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
+ PyObject *value = PyObject_GetAttrString(spec, from_name);
+ int result = 0;
+ if (likely(value)) {
+ if (allow_none || value != Py_None) {
+ result = PyDict_SetItemString(moddict, to_name, value);
+ }
+ Py_DECREF(value);
+ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ } else {
+ result = -1;
+ }
+ return result;
+}
+static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+ PyObject *module = NULL, *moddict, *modname;
+ if (__Pyx_check_single_interpreter())
+ return NULL;
+ if (__pyx_m)
+ return __Pyx_NewRef(__pyx_m);
+ modname = PyObject_GetAttrString(spec, "name");
+ if (unlikely(!modname)) goto bad;
+ module = PyModule_NewObject(modname);
+ Py_DECREF(modname);
+ if (unlikely(!module)) goto bad;
+ moddict = PyModule_GetDict(module);
+ if (unlikely(!moddict)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
+ return module;
+bad:
+ Py_XDECREF(module);
+ return NULL;
+}
+
+
+static CYTHON_SMALL_CODE int __pyx_pymod_exec__helpers(PyObject *__pyx_pyinit_module)
+#endif
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ if (__pyx_m) {
+ if (__pyx_m == __pyx_pyinit_module) return 0;
+ PyErr_SetString(PyExc_RuntimeError, "Module '_helpers' has already been imported. Re-initialisation is not supported.");
+ return -1;
+ }
+ #elif PY_MAJOR_VERSION >= 3
+ if (__pyx_m) return __Pyx_NewRef(__pyx_m);
+ #endif
+ #if CYTHON_REFNANNY
+__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+}
+#endif
+ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__helpers(void)", 0);
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pxy_PyFrame_Initialize_Offsets
+ __Pxy_PyFrame_Initialize_Offsets();
+ #endif
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pyx_CyFunction_USED
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ PyEval_InitThreads();
+ #endif
+ /*--- Module creation code ---*/
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_m = __pyx_pyinit_module;
+ Py_INCREF(__pyx_m);
+ #else
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_helpers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_b);
+ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_cython_runtime);
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ /*--- Initialize various global constants etc. ---*/
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ if (__pyx_module_is_main_aiohttp___helpers) {
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "aiohttp._helpers")) {
+ if (unlikely(PyDict_SetItemString(modules, "aiohttp._helpers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Constants init code ---*/
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Global type/function init code ---*/
+ (void)__Pyx_modinit_global_init_code();
+ (void)__Pyx_modinit_variable_export_code();
+ (void)__Pyx_modinit_function_export_code();
+ if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ (void)__Pyx_modinit_type_import_code();
+ (void)__Pyx_modinit_variable_import_code();
+ (void)__Pyx_modinit_function_import_code();
+ /*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_reify(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7aiohttp_8_helpers_1__pyx_unpickle_reify, NULL, __pyx_n_s_aiohttp__helpers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_reify, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_helpers.pyx":1
+ * cdef class reify: # <<<<<<<<<<<<<<
+ * """Use as a class method decorator. It operates almost exactly like
+ * the Python `@property` decorator, but it puts the result of the
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init aiohttp._helpers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_CLEAR(__pyx_m);
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init aiohttp._helpers");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ return (__pyx_m != NULL) ? 0 : -1;
+ #elif PY_MAJOR_VERSION >= 3
+ return __pyx_m;
+ #else
+ return;
+ #endif
+}
+
+/* --- Runtime support code --- */
+/* Refnanny */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule(modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, "RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+/* PyObjectGetAttrStr */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#endif
+
+/* GetBuiltinName */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+/* RaiseDoubleKeywords */
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+/* ParseKeywords */
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+/* RaiseArgTupleInvalid */
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+/* GetItemInt */
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+ PyObject *r;
+ if (!j) return NULL;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ return r;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ Py_ssize_t wrapped_i = i;
+ if (wraparound & unlikely(i < 0)) {
+ wrapped_i += PyList_GET_SIZE(o);
+ }
+ if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
+ PyObject *r = PyList_GET_ITEM(o, wrapped_i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ Py_ssize_t wrapped_i = i;
+ if (wraparound & unlikely(i < 0)) {
+ wrapped_i += PyTuple_GET_SIZE(o);
+ }
+ if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
+ if (is_list || PyList_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
+ if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
+ PyObject *r = PyList_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ else if (PyTuple_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ } else {
+ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+ if (likely(m && m->sq_item)) {
+ if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+ Py_ssize_t l = m->sq_length(o);
+ if (likely(l >= 0)) {
+ i += l;
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ return NULL;
+ PyErr_Clear();
+ }
+ }
+ return m->sq_item(o, i);
+ }
+ }
+#else
+ if (is_list || PySequence_Check(o)) {
+ return PySequence_GetItem(o, i);
+ }
+#endif
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+/* ObjectGetItem */
+#if CYTHON_USE_TYPE_SLOTS
+static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
+ PyObject *runerr;
+ Py_ssize_t key_value;
+ PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
+ if (unlikely(!(m && m->sq_item))) {
+ PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
+ return NULL;
+ }
+ key_value = __Pyx_PyIndex_AsSsize_t(index);
+ if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
+ return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
+ }
+ if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
+ PyErr_Clear();
+ PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
+ }
+ return NULL;
+}
+static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
+ PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
+ if (likely(m && m->mp_subscript)) {
+ return m->mp_subscript(obj, key);
+ }
+ return __Pyx_PyObject_GetIndex(obj, key);
+}
+#endif
+
+/* GetTopmostException */
+#if CYTHON_USE_EXC_INFO_STACK
+static _PyErr_StackItem *
+__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
+{
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
+ exc_info->previous_item != NULL)
+ {
+ exc_info = exc_info->previous_item;
+ }
+ return exc_info;
+}
+#endif
+
+/* SaveResetException */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
+ *type = exc_info->exc_type;
+ *value = exc_info->exc_value;
+ *tb = exc_info->exc_traceback;
+ #else
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ #endif
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ tmp_type = exc_info->exc_type;
+ tmp_value = exc_info->exc_value;
+ tmp_tb = exc_info->exc_traceback;
+ exc_info->exc_type = type;
+ exc_info->exc_value = value;
+ exc_info->exc_traceback = tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+#endif
+
+/* PyErrExceptionMatches */
+#if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ if (unlikely(PyTuple_Check(err)))
+ return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+ return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
+}
+#endif
+
+/* GetException */
+#if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
+#endif
+{
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_FAST_THREAD_STATE
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ #if CYTHON_USE_EXC_INFO_STACK
+ {
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ tmp_type = exc_info->exc_type;
+ tmp_value = exc_info->exc_value;
+ tmp_tb = exc_info->exc_traceback;
+ exc_info->exc_type = local_type;
+ exc_info->exc_value = local_value;
+ exc_info->exc_traceback = local_tb;
+ }
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+/* PyCFunctionFastCall */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ int flags = PyCFunction_GET_FLAGS(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
+ return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
+ } else {
+ return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
+ }
+}
+#endif
+
+/* PyFunctionFastCall */
+#if CYTHON_FAST_PYCALL
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, (int)nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, (int)nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif
+#endif
+
+/* PyObjectCall */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = Py_TYPE(func)->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCall2Args */
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
+ PyObject *args, *result = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(function)) {
+ PyObject *args[2] = {arg1, arg2};
+ return __Pyx_PyFunction_FastCall(function, args, 2);
+ }
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(function)) {
+ PyObject *args[2] = {arg1, arg2};
+ return __Pyx_PyCFunction_FastCall(function, args, 2);
+ }
+ #endif
+ args = PyTuple_New(2);
+ if (unlikely(!args)) goto done;
+ Py_INCREF(arg1);
+ PyTuple_SET_ITEM(args, 0, arg1);
+ Py_INCREF(arg2);
+ PyTuple_SET_ITEM(args, 1, arg2);
+ Py_INCREF(function);
+ result = __Pyx_PyObject_Call(function, args, NULL);
+ Py_DECREF(args);
+ Py_DECREF(function);
+done:
+ return result;
+}
+
+/* PyObjectCallMethO */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallOneArg */
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
+ if (likely(PyCFunction_Check(func))) {
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (__Pyx_PyFastCFunction_Check(func)) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+#endif
+
+/* PyErrFetchRestore */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+}
+#endif
+
+/* RaiseException */
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
+ instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+ if (cause) {
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+/* GetAttr */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_USE_TYPE_SLOTS
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+/* GetAttr3 */
+static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+ return NULL;
+ __Pyx_PyErr_Clear();
+ Py_INCREF(d);
+ return d;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
+ PyObject *r = __Pyx_GetAttr(o, n);
+ return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
+}
+
+/* PyDictVersioning */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
+ PyObject **dictptr = NULL;
+ Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
+ if (offset) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
+#else
+ dictptr = _PyObject_GetDictPtr(obj);
+#endif
+ }
+ return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
+}
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
+ return 0;
+ return obj_dict_version == __Pyx_get_object_dict_version(obj);
+}
+#endif
+
+/* GetModuleGlobalName */
+#if CYTHON_USE_DICT_VERSIONS
+static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
+#else
+static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
+#endif
+{
+ PyObject *result;
+#if !CYTHON_AVOID_BORROWED_REFS
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
+ result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ } else if (unlikely(PyErr_Occurred())) {
+ return NULL;
+ }
+#else
+ result = PyDict_GetItem(__pyx_d, name);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ }
+#endif
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ }
+ PyErr_Clear();
+#endif
+ return __Pyx_GetBuiltinName(name);
+}
+
+/* Import */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* ImportFrom */
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+/* HasAttr */
+static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
+ PyObject *r;
+ if (unlikely(!__Pyx_PyBaseString_Check(n))) {
+ PyErr_SetString(PyExc_TypeError,
+ "hasattr(): attribute name must be string");
+ return -1;
+ }
+ r = __Pyx_GetAttr(o, n);
+ if (unlikely(!r)) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ Py_DECREF(r);
+ return 1;
+ }
+}
+
+/* PyObject_GenericGetAttrNoDict */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
+ PyErr_Format(PyExc_AttributeError,
+#if PY_MAJOR_VERSION >= 3
+ "'%.50s' object has no attribute '%U'",
+ tp->tp_name, attr_name);
+#else
+ "'%.50s' object has no attribute '%.400s'",
+ tp->tp_name, PyString_AS_STRING(attr_name));
+#endif
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
+ PyObject *descr;
+ PyTypeObject *tp = Py_TYPE(obj);
+ if (unlikely(!PyString_Check(attr_name))) {
+ return PyObject_GenericGetAttr(obj, attr_name);
+ }
+ assert(!tp->tp_dictoffset);
+ descr = _PyType_Lookup(tp, attr_name);
+ if (unlikely(!descr)) {
+ return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
+ }
+ Py_INCREF(descr);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
+ #endif
+ {
+ descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
+ if (unlikely(f)) {
+ PyObject *res = f(descr, obj, (PyObject *)tp);
+ Py_DECREF(descr);
+ return res;
+ }
+ }
+ return descr;
+}
+#endif
+
+/* PyObject_GenericGetAttr */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
+ if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
+ return PyObject_GenericGetAttr(obj, attr_name);
+ }
+ return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
+}
+#endif
+
+/* PyObjectGetAttrStrNoError */
+static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+ __Pyx_PyErr_Clear();
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
+ return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
+ }
+#endif
+ result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
+ if (unlikely(!result)) {
+ __Pyx_PyObject_GetAttrStr_ClearAttributeError();
+ }
+ return result;
+}
+
+/* SetupReduce */
+static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
+ int ret;
+ PyObject *name_attr;
+ name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
+ if (likely(name_attr)) {
+ ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
+ } else {
+ ret = -1;
+ }
+ if (unlikely(ret < 0)) {
+ PyErr_Clear();
+ ret = 0;
+ }
+ Py_XDECREF(name_attr);
+ return ret;
+}
+static int __Pyx_setup_reduce(PyObject* type_obj) {
+ int ret = 0;
+ PyObject *object_reduce = NULL;
+ PyObject *object_getstate = NULL;
+ PyObject *object_reduce_ex = NULL;
+ PyObject *reduce = NULL;
+ PyObject *reduce_ex = NULL;
+ PyObject *reduce_cython = NULL;
+ PyObject *setstate = NULL;
+ PyObject *setstate_cython = NULL;
+ PyObject *getstate = NULL;
+#if CYTHON_USE_PYTYPE_LOOKUP
+ getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
+#else
+ getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
+ if (!getstate && PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
+#endif
+ if (getstate) {
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
+#else
+ object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
+ if (!object_getstate && PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
+#endif
+ if (object_getstate != getstate) {
+ goto __PYX_GOOD;
+ }
+ }
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
+#else
+ object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
+#endif
+ reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
+ if (reduce_ex == object_reduce_ex) {
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
+#else
+ object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
+#endif
+ reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
+ if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
+ reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
+ if (likely(reduce_cython)) {
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ } else if (reduce == object_reduce || PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
+ setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
+ if (!setstate) PyErr_Clear();
+ if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
+ setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
+ if (likely(setstate_cython)) {
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ } else if (!setstate || PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
+ }
+ PyType_Modified((PyTypeObject*)type_obj);
+ }
+ }
+ goto __PYX_GOOD;
+__PYX_BAD:
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
+ ret = -1;
+__PYX_GOOD:
+#if !CYTHON_USE_PYTYPE_LOOKUP
+ Py_XDECREF(object_reduce);
+ Py_XDECREF(object_reduce_ex);
+ Py_XDECREF(object_getstate);
+ Py_XDECREF(getstate);
+#endif
+ Py_XDECREF(reduce);
+ Py_XDECREF(reduce_ex);
+ Py_XDECREF(reduce_cython);
+ Py_XDECREF(setstate);
+ Py_XDECREF(setstate_cython);
+ return ret;
+}
+
+/* CLineInTraceback */
+#ifndef CYTHON_CLINE_IN_TRACEBACK
+static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
+ PyObject *use_cline;
+ PyObject *ptype, *pvalue, *ptraceback;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject **cython_runtime_dict;
+#endif
+ if (unlikely(!__pyx_cython_runtime)) {
+ return c_line;
+ }
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+#if CYTHON_COMPILING_IN_CPYTHON
+ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
+ if (likely(cython_runtime_dict)) {
+ __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
+ use_cline, *cython_runtime_dict,
+ __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
+ } else
+#endif
+ {
+ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
+ if (use_cline_obj) {
+ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
+ Py_DECREF(use_cline_obj);
+ } else {
+ PyErr_Clear();
+ use_cline = NULL;
+ }
+ }
+ if (!use_cline) {
+ c_line = 0;
+ (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
+ }
+ else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
+ c_line = 0;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ return c_line;
+}
+#endif
+
+/* CodeObjectCache */
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = start + (end - start) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+/* AddTraceback */
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = NULL;
+ PyObject *py_funcname = NULL;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_srcfile = NULL;
+ py_srcfile = PyString_FromString(filename);
+ if (!py_srcfile) goto bad;
+ #endif
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ if (!py_funcname) goto bad;
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ if (!py_funcname) goto bad;
+ funcname = PyUnicode_AsUTF8(py_funcname);
+ if (!funcname) goto bad;
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ if (!py_funcname) goto bad;
+ #endif
+ }
+ #if PY_MAJOR_VERSION < 3
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ #else
+ py_code = PyCode_NewEmpty(filename, funcname, py_line);
+ #endif
+ Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
+ return py_code;
+bad:
+ Py_XDECREF(py_funcname);
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_srcfile);
+ #endif
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject *ptype, *pvalue, *ptraceback;
+ if (c_line) {
+ c_line = __Pyx_CLineForTraceback(tstate, c_line);
+ }
+ py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
+ if (!py_code) {
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) {
+ /* If the code object creation fails, then we should clear the
+ fetched exception references and propagate the new exception */
+ Py_XDECREF(ptype);
+ Py_XDECREF(pvalue);
+ Py_XDECREF(ptraceback);
+ goto bad;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ tstate, /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+/* CIntFromPyVerify */
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntFromPy */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const long neg_one = (long) -1, const_zero = (long) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+/* CIntToPy */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const long neg_one = (long) -1, const_zero = (long) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntFromPy */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const int neg_one = (int) -1, const_zero = (int) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+/* FastTypeChecks */
+#if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+ while (a) {
+ a = a->tp_base;
+ if (a == b)
+ return 1;
+ }
+ return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+ PyObject *mro;
+ if (a == b) return 1;
+ mro = a->tp_mro;
+ if (likely(mro)) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(mro);
+ for (i = 0; i < n; i++) {
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+ return 1;
+ }
+ return 0;
+ }
+ return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+ PyObject *exception, *value, *tb;
+ int res;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&exception, &value, &tb);
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ if (!res) {
+ res = PyObject_IsSubclass(err, exc_type2);
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ }
+ __Pyx_ErrRestore(exception, value, tb);
+ return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+ if (!res) {
+ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+ }
+ return res;
+}
+#endif
+static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ assert(PyExceptionClass_Check(exc_type));
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ PyObject *t = PyTuple_GET_ITEM(tuple, i);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(exc_type == t)) return 1;
+ #endif
+ if (likely(PyExceptionClass_Check(t))) {
+ if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
+ } else {
+ }
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+ if (likely(err == exc_type)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ if (likely(PyExceptionClass_Check(exc_type))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+ } else if (likely(PyTuple_Check(exc_type))) {
+ return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
+ } else {
+ }
+ }
+ return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+ assert(PyExceptionClass_Check(exc_type1));
+ assert(PyExceptionClass_Check(exc_type2));
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+ }
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
+/* CheckBinaryVersion */
+static int __Pyx_check_binary_version(void) {
+ char ctversion[5];
+ int same=1, i, found_dot;
+ const char* rt_from_call = Py_GetVersion();
+ PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ found_dot = 0;
+ for (i = 0; i < 4; i++) {
+ if (!ctversion[i]) {
+ same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
+ break;
+ }
+ if (rt_from_call[i] != ctversion[i]) {
+ same = 0;
+ break;
+ }
+ }
+ if (!same) {
+ char rtversion[5] = {'\0'};
+ char message[200];
+ for (i=0; i<4; ++i) {
+ if (rt_from_call[i] == '.') {
+ if (found_dot) break;
+ found_dot = 1;
+ } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
+ break;
+ }
+ rtversion[i] = rt_from_call[i];
+ }
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+/* InitStrings */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ if (PyObject_Hash(*t->p) == -1)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+}
+#else
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (likely(PyUnicode_IS_ASCII(o))) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+ return __Pyx_PyUnicode_AsStringAndSize(o, length);
+ } else
+#endif
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
+ int retval;
+ if (unlikely(!x)) return -1;
+ retval = __Pyx_PyObject_IsTrue(x);
+ Py_DECREF(x);
+ return retval;
+}
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+ if (PyLong_Check(result)) {
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "__int__ returned non-int (type %.200s). "
+ "The ability to return an instance of a strict subclass of int "
+ "is deprecated, and may be removed in a future version of Python.",
+ Py_TYPE(result)->tp_name)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ return result;
+ }
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ type_name, type_name, Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
+ PyNumberMethods *m;
+#endif
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x) || PyLong_Check(x)))
+#else
+ if (likely(PyLong_Check(x)))
+#endif
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
+ m = Py_TYPE(x)->tp_as_number;
+ #if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = m->nb_long(x);
+ }
+ #else
+ if (likely(m && m->nb_int)) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ #endif
+#else
+ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+ res = PyNumber_Int(x);
+ }
+#endif
+ if (likely(res)) {
+#if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
+#else
+ if (unlikely(!PyLong_CheckExact(res))) {
+#endif
+ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(b);
+ }
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
+ if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
+ return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
+#if PY_MAJOR_VERSION < 3
+ } else if (likely(PyInt_CheckExact(o))) {
+ return PyInt_AS_LONG(o);
+#endif
+ } else {
+ Py_ssize_t ival;
+ PyObject *x;
+ x = PyNumber_Index(o);
+ if (!x) return -1;
+ ival = PyInt_AsLong(x);
+ Py_DECREF(x);
+ return ival;
+ }
+}
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
+ return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/third_party/python/aiohttp/aiohttp/_helpers.pyi b/third_party/python/aiohttp/aiohttp/_helpers.pyi
new file mode 100644
index 0000000000..1e35893702
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_helpers.pyi
@@ -0,0 +1,6 @@
+from typing import Any
+
+class reify:
+ def __init__(self, wrapped: Any) -> None: ...
+ def __get__(self, inst: Any, owner: Any) -> Any: ...
+ def __set__(self, inst: Any, value: Any) -> None: ...
diff --git a/third_party/python/aiohttp/aiohttp/_helpers.pyx b/third_party/python/aiohttp/aiohttp/_helpers.pyx
new file mode 100644
index 0000000000..665f367c5d
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_helpers.pyx
@@ -0,0 +1,35 @@
+cdef class reify:
+ """Use as a class method decorator. It operates almost exactly like
+ the Python `@property` decorator, but it puts the result of the
+ method it decorates into the instance dict after the first call,
+ effectively replacing the function it decorates with an instance
+ variable. It is, in Python parlance, a data descriptor.
+
+ """
+
+ cdef object wrapped
+ cdef object name
+
+ def __init__(self, wrapped):
+ self.wrapped = wrapped
+ self.name = wrapped.__name__
+
+ @property
+ def __doc__(self):
+ return self.wrapped.__doc__
+
+ def __get__(self, inst, owner):
+ try:
+ try:
+ return inst._cache[self.name]
+ except KeyError:
+ val = self.wrapped(inst)
+ inst._cache[self.name] = val
+ return val
+ except AttributeError:
+ if inst is None:
+ return self
+ raise
+
+ def __set__(self, inst, value):
+ raise AttributeError("reified property is read-only")
diff --git a/third_party/python/aiohttp/aiohttp/_http_parser.c b/third_party/python/aiohttp/aiohttp/_http_parser.c
new file mode 100644
index 0000000000..fc42d82a23
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_http_parser.c
@@ -0,0 +1,24512 @@
+/* Generated by Cython 0.29.32 */
+
+#ifndef PY_SSIZE_T_CLEAN
+#define PY_SSIZE_T_CLEAN
+#endif /* PY_SSIZE_T_CLEAN */
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+ #error Cython requires Python 2.6+ or Python 3.3+.
+#else
+#define CYTHON_ABI "0_29_32"
+#define CYTHON_HEX_VERSION 0x001D20F0
+#define CYTHON_FUTURE_DIVISION 1
+#include <stddef.h>
+#ifndef offsetof
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#define __PYX_COMMA ,
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x02070000
+ #define HAVE_LONG_LONG
+ #endif
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #if PY_VERSION_HEX < 0x03050000
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
+ #endif
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
+ #endif
+#elif defined(PY_NOGIL)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #ifndef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 1
+ #endif
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+#else
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
+ #define CYTHON_USE_PYTYPE_LOOKUP 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #if PY_VERSION_HEX >= 0x030B00A4
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #elif !defined(CYTHON_FAST_THREAD_STATE)
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
+ #endif
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+ #endif
+ #ifndef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
+ #endif
+ #if PY_VERSION_HEX >= 0x030B00A4
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #elif !defined(CYTHON_USE_EXC_INFO_STACK)
+ #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
+ #endif
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #if PY_MAJOR_VERSION < 3
+ #include "longintrepr.h"
+ #endif
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+ #ifdef SIZEOF_VOID_P
+ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
+ #endif
+#endif
+#ifndef __has_attribute
+ #define __has_attribute(x) 0
+#endif
+#ifndef __has_cpp_attribute
+ #define __has_cpp_attribute(x) 0
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+#ifdef _MSC_VER
+ #ifndef _MSC_STDINT_H_
+ #if _MSC_VER < 1300
+ typedef unsigned char uint8_t;
+ typedef unsigned int uint32_t;
+ #else
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int32 uint32_t;
+ #endif
+ #endif
+#else
+ #include <stdint.h>
+#endif
+#ifndef CYTHON_FALLTHROUGH
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+ #if __has_cpp_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH [[fallthrough]]
+ #elif __has_cpp_attribute(clang::fallthrough)
+ #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
+ #elif __has_cpp_attribute(gnu::fallthrough)
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
+ #endif
+ #endif
+ #ifndef CYTHON_FALLTHROUGH
+ #if __has_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
+ #else
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+ #if defined(__clang__ ) && defined(__apple_build_version__)
+ #if __apple_build_version__ < 7000000
+ #undef CYTHON_FALLTHROUGH
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+#endif
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_DefaultClassType PyType_Type
+#if PY_VERSION_HEX >= 0x030B00A1
+ static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
+ PyObject *code, PyObject *c, PyObject* n, PyObject *v,
+ PyObject *fv, PyObject *cell, PyObject* fn,
+ PyObject *name, int fline, PyObject *lnos) {
+ PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
+ PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
+ const char *fn_cstr=NULL;
+ const char *name_cstr=NULL;
+ PyCodeObject* co=NULL;
+ PyObject *type, *value, *traceback;
+ PyErr_Fetch(&type, &value, &traceback);
+ if (!(kwds=PyDict_New())) goto end;
+ if (!(argcount=PyLong_FromLong(a))) goto end;
+ if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
+ if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
+ if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
+ if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
+ if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
+ if (!(nlocals=PyLong_FromLong(l))) goto end;
+ if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
+ if (!(stacksize=PyLong_FromLong(s))) goto end;
+ if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
+ if (!(flags=PyLong_FromLong(f))) goto end;
+ if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
+ if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
+ if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
+ if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
+ if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
+ if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
+ if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
+ Py_XDECREF((PyObject*)co);
+ co = (PyCodeObject*)call_result;
+ call_result = NULL;
+ if (0) {
+ cleanup_code_too:
+ Py_XDECREF((PyObject*)co);
+ co = NULL;
+ }
+ end:
+ Py_XDECREF(kwds);
+ Py_XDECREF(argcount);
+ Py_XDECREF(posonlyargcount);
+ Py_XDECREF(kwonlyargcount);
+ Py_XDECREF(nlocals);
+ Py_XDECREF(stacksize);
+ Py_XDECREF(replace);
+ Py_XDECREF(call_result);
+ Py_XDECREF(empty);
+ if (type) {
+ PyErr_Restore(type, value, traceback);
+ }
+ return co;
+ }
+#else
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+#endif
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#ifndef Py_TPFLAGS_CHECKTYPES
+ #define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
+ #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#ifndef METH_STACKLESS
+ #define METH_STACKLESS 0
+#endif
+#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
+ #ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ #endif
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
+ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+ #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
+ #define PyMem_RawMalloc(n) PyMem_Malloc(n)
+ #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
+ #define PyMem_RawFree(p) PyMem_Free(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
+#endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+ #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
+#include "pythread.h"
+#define Py_tss_NEEDS_INIT 0
+typedef int Py_tss_t;
+static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
+ *key = PyThread_create_key();
+ return 0;
+}
+static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
+ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
+ *key = Py_tss_NEEDS_INIT;
+ return key;
+}
+static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
+ PyObject_Free(key);
+}
+static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
+ return *key != Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
+ PyThread_delete_key(*key);
+ *key = Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
+ return PyThread_set_key_value(*key, value);
+}
+static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
+ return PyThread_get_key_value(*key);
+}
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n) PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
+#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
+#else
+#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #if defined(PyUnicode_IS_READY)
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #else
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #endif
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
+ #endif
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
+ #endif
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#ifndef PyObject_Unicode
+ #define PyObject_Unicode PyObject_Str
+#endif
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#if PY_VERSION_HEX >= 0x030900A4
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
+#else
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
+#endif
+#if CYTHON_ASSUME_SAFE_MACROS
+ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
+#else
+ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
+ #else
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+ #endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+#endif
+
+#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
+ #if !defined(_USE_MATH_DEFINES)
+ #define _USE_MATH_DEFINES
+ #endif
+#endif
+#include <math.h>
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
+#endif
+
+#define __PYX_MARK_ERR_POS(f_index, lineno) \
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#define __PYX_HAVE__aiohttp___http_parser
+#define __PYX_HAVE_API__aiohttp___http_parser
+/* Early includes */
+#include <string.h>
+#include <stdio.h>
+#include "pythread.h"
+#include <limits.h>
+#include <stdint.h>
+#include "../vendor/llhttp/build/llhttp.h"
+#include "_find_header.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
+ return (size_t) i < (size_t) limit;
+}
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER)
+ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
+#if CYTHON_ASSUME_SAFE_MACROS
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
+
+static PyObject *__pyx_m = NULL;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_cython_runtime = NULL;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "aiohttp/_http_parser.pyx",
+ "stringsource",
+ "type.pxd",
+ "bool.pxd",
+ "complex.pxd",
+ "aiohttp/_headers.pxi",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage;
+struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage;
+struct __pyx_obj_7aiohttp_12_http_parser_HttpParser;
+struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser;
+struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser;
+struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__;
+struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr;
+struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__;
+struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr;
+struct __pyx_opt_args_7aiohttp_12_http_parser_10HttpParser__init;
+
+/* "aiohttp/_http_parser.pyx":328
+ *
+ * cdef _init(
+ * self, cparser.llhttp_type mode, # <<<<<<<<<<<<<<
+ * object protocol, object loop, int limit,
+ * object timer=None,
+ */
+struct __pyx_opt_args_7aiohttp_12_http_parser_10HttpParser__init {
+ int __pyx_n;
+ PyObject *timer;
+ size_t max_line_size;
+ size_t max_headers;
+ size_t max_field_size;
+ PyObject *payload_exception;
+ int response_with_body;
+ int read_until_eof;
+ int auto_decompress;
+};
+
+/* "aiohttp/_http_parser.pyx":110
+ *
+ * @cython.freelist(DEFAULT_FREELIST_SIZE)
+ * cdef class RawRequestMessage: # <<<<<<<<<<<<<<
+ * cdef readonly str method
+ * cdef readonly str path
+ */
+struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage {
+ PyObject_HEAD
+ PyObject *method;
+ PyObject *path;
+ PyObject *version;
+ PyObject *headers;
+ PyObject *raw_headers;
+ PyObject *should_close;
+ PyObject *compression;
+ PyObject *upgrade;
+ PyObject *chunked;
+ PyObject *url;
+};
+
+
+/* "aiohttp/_http_parser.pyx":210
+ *
+ * @cython.freelist(DEFAULT_FREELIST_SIZE)
+ * cdef class RawResponseMessage: # <<<<<<<<<<<<<<
+ * cdef readonly object version # HttpVersion
+ * cdef readonly int code
+ */
+struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage {
+ PyObject_HEAD
+ PyObject *version;
+ int code;
+ PyObject *reason;
+ PyObject *headers;
+ PyObject *raw_headers;
+ PyObject *should_close;
+ PyObject *compression;
+ PyObject *upgrade;
+ PyObject *chunked;
+};
+
+
+/* "aiohttp/_http_parser.pyx":272
+ *
+ * @cython.internal
+ * cdef class HttpParser: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+struct __pyx_obj_7aiohttp_12_http_parser_HttpParser {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *__pyx_vtab;
+ llhttp_t *_cparser;
+ llhttp_settings_t *_csettings;
+ PyObject *_raw_name;
+ PyObject *_raw_value;
+ int _has_value;
+ PyObject *_protocol;
+ PyObject *_loop;
+ PyObject *_timer;
+ size_t _max_line_size;
+ size_t _max_field_size;
+ size_t _max_headers;
+ int _response_with_body;
+ int _read_until_eof;
+ int _started;
+ PyObject *_url;
+ PyObject *_buf;
+ PyObject *_path;
+ PyObject *_reason;
+ PyObject *_headers;
+ PyObject *_raw_headers;
+ int _upgraded;
+ PyObject *_messages;
+ PyObject *_payload;
+ int _payload_error;
+ PyObject *_payload_exception;
+ PyObject *_last_error;
+ int _auto_decompress;
+ int _limit;
+ PyObject *_content_encoding;
+ Py_buffer py_buf;
+};
+
+
+/* "aiohttp/_http_parser.pyx":574
+ *
+ *
+ * cdef class HttpRequestParser(HttpParser): # <<<<<<<<<<<<<<
+ *
+ * def __init__(
+ */
+struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser __pyx_base;
+};
+
+
+/* "aiohttp/_http_parser.pyx":638
+ *
+ *
+ * cdef class HttpResponseParser(HttpParser): # <<<<<<<<<<<<<<
+ *
+ * def __init__(
+ */
+struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser __pyx_base;
+};
+
+
+/* "aiohttp/_http_parser.pyx":135
+ * self.url = url
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * info = []
+ * info.append(("method", self.method))
+ */
+struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ {
+ PyObject_HEAD
+ PyObject *__pyx_v_info;
+};
+
+
+/* "aiohttp/_http_parser.pyx":147
+ * info.append(("chunked", self.chunked))
+ * info.append(("url", self.url))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info) # <<<<<<<<<<<<<<
+ * return '<RawRequestMessage(' + sinfo + ')>'
+ *
+ */
+struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr {
+ PyObject_HEAD
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *__pyx_outer_scope;
+ PyObject *__pyx_v_name;
+ PyObject *__pyx_v_val;
+};
+
+
+/* "aiohttp/_http_parser.pyx":233
+ * self.chunked = chunked
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * info = []
+ * info.append(("version", self.version))
+ */
+struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ {
+ PyObject_HEAD
+ PyObject *__pyx_v_info;
+};
+
+
+/* "aiohttp/_http_parser.pyx":244
+ * info.append(("upgrade", self.upgrade))
+ * info.append(("chunked", self.chunked))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info) # <<<<<<<<<<<<<<
+ * return '<RawResponseMessage(' + sinfo + ')>'
+ *
+ */
+struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr {
+ PyObject_HEAD
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *__pyx_outer_scope;
+ PyObject *__pyx_v_name;
+ PyObject *__pyx_v_val;
+};
+
+
+
+/* "aiohttp/_http_parser.pyx":272
+ *
+ * @cython.internal
+ * cdef class HttpParser: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser {
+ PyObject *(*_init)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *, enum llhttp_type, PyObject *, PyObject *, int, struct __pyx_opt_args_7aiohttp_12_http_parser_10HttpParser__init *__pyx_optional_args);
+ PyObject *(*_process_header)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *);
+ PyObject *(*_on_header_field)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *, char *, size_t);
+ PyObject *(*_on_header_value)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *, char *, size_t);
+ PyObject *(*_on_headers_complete)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *);
+ PyObject *(*_on_message_complete)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *);
+ PyObject *(*_on_chunk_header)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *);
+ PyObject *(*_on_chunk_complete)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *);
+ PyObject *(*_on_status_complete)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *);
+ PyObject *(*http_version)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *);
+};
+static struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *__pyx_vtabptr_7aiohttp_12_http_parser_HttpParser;
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser_http_version(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *);
+
+
+/* "aiohttp/_http_parser.pyx":574
+ *
+ *
+ * cdef class HttpRequestParser(HttpParser): # <<<<<<<<<<<<<<
+ *
+ * def __init__(
+ */
+
+struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpRequestParser {
+ struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser __pyx_base;
+};
+static struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpRequestParser *__pyx_vtabptr_7aiohttp_12_http_parser_HttpRequestParser;
+
+
+/* "aiohttp/_http_parser.pyx":638
+ *
+ *
+ * cdef class HttpResponseParser(HttpParser): # <<<<<<<<<<<<<<
+ *
+ * def __init__(
+ */
+
+struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpResponseParser {
+ struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser __pyx_base;
+};
+static struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpResponseParser *__pyx_vtabptr_7aiohttp_12_http_parser_HttpResponseParser;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ if (acquire_gil) {\
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ PyGILState_Release(__pyx_gilstate_save);\
+ } else {\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext()\
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_XDECREF(tmp);\
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_DECREF(tmp);\
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+/* GetBuiltinName.proto */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
+ __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck);
+
+/* decode_c_string_utf16.proto */
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = 0;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = -1;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = 1;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+
+/* decode_c_bytes.proto */
+static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
+ const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+
+/* decode_bytes.proto */
+static CYTHON_INLINE PyObject* __Pyx_decode_bytes(
+ PyObject* string, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ return __Pyx_decode_c_bytes(
+ PyBytes_AS_STRING(string), PyBytes_GET_SIZE(string),
+ start, stop, encoding, errors, decode_func);
+}
+
+/* RaiseArgTupleInvalid.proto */
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+/* RaiseDoubleKeywords.proto */
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
+ const char* function_name);
+
+/* None.proto */
+static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
+
+/* RaiseTooManyValuesToUnpack.proto */
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+
+/* RaiseNeedMoreValuesToUnpack.proto */
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+/* IterFinish.proto */
+static CYTHON_INLINE int __Pyx_IterFinish(void);
+
+/* UnpackItemEndCheck.proto */
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
+static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len)) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ __Pyx_SET_SIZE(list, len + 1);
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#endif
+
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ __Pyx_SET_SIZE(list, len + 1);
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+/* KeywordStringCheck.proto */
+static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
+
+/* ExtTypeTest.proto */
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+/* PyDictContains.proto */
+static CYTHON_INLINE int __Pyx_PyDict_ContainsTF(PyObject* item, PyObject* dict, int eq) {
+ int result = PyDict_Contains(dict, item);
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
+}
+
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
+#define __Pyx_PyObject_Dict_GetItem(obj, name)\
+ (likely(PyDict_CheckExact(obj)) ?\
+ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
+#else
+#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
+#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred() PyErr_Occurred()
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* GetAttr.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+/* GetAttr3.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
+
+/* PyDictVersioning.proto */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
+#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
+#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
+ (version_var) = __PYX_GET_DICT_VERSION(dict);\
+ (cache_var) = (value);
+#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
+ static PY_UINT64_T __pyx_dict_version = 0;\
+ static PyObject *__pyx_dict_cached_value = NULL;\
+ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
+ (VAR) = __pyx_dict_cached_value;\
+ } else {\
+ (VAR) = __pyx_dict_cached_value = (LOOKUP);\
+ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
+ }\
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
+#else
+#define __PYX_GET_DICT_VERSION(dict) (0)
+#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
+#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
+#endif
+
+/* GetModuleGlobalName.proto */
+#if CYTHON_USE_DICT_VERSIONS
+#define __Pyx_GetModuleGlobalName(var, name) {\
+ static PY_UINT64_T __pyx_dict_version = 0;\
+ static PyObject *__pyx_dict_cached_value = NULL;\
+ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
+ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
+ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
+}
+#define __Pyx_GetModuleGlobalNameUncached(var, name) {\
+ PY_UINT64_T __pyx_dict_version;\
+ PyObject *__pyx_dict_cached_value;\
+ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
+}
+static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
+#else
+#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
+#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
+static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#define __Pyx_BUILD_ASSERT_EXPR(cond)\
+ (sizeof(char [1 - 2*!(cond)]) - 1)
+#ifndef Py_MEMBER_SIZE
+#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
+#endif
+#if CYTHON_FAST_PYCALL
+ static size_t __pyx_pyframe_localsplus_offset = 0;
+ #include "frameobject.h"
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+ #define __Pxy_PyFrame_Initialize_Offsets()\
+ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
+ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
+ #define __Pyx_PyFrame_GetLocalsplus(frame)\
+ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
+#endif // CYTHON_FAST_PYCALL
+#endif
+
+/* PyObjectCall.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+/* PyObjectCallMethO.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+/* PyObjectCallNoArg.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyObjectCallOneArg.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+/* PyObjectCall2Args.proto */
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
+
+/* PySequenceContains.proto */
+static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
+ int result = PySequence_Contains(seq, item);
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
+}
+
+/* RaiseException.proto */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+/* IncludeStringH.proto */
+#include <string.h>
+
+/* BytesEquals.proto */
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+
+/* UnicodeEquals.proto */
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+
+/* SliceObject.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
+ PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
+ int has_cstart, int has_cstop, int wraparound);
+
+/* decode_bytearray.proto */
+static CYTHON_INLINE PyObject* __Pyx_decode_bytearray(
+ PyObject* string, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ return __Pyx_decode_c_bytes(
+ PyByteArray_AS_STRING(string), PyByteArray_GET_SIZE(string),
+ start, stop, encoding, errors, decode_func);
+}
+
+/* GetItemIntUnicode.proto */
+#define __Pyx_GetItemInt_Unicode(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Unicode_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "string index out of range"), (Py_UCS4)-1))
+static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
+ int wraparound, int boundscheck);
+
+/* PyUnicode_Substring.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
+ PyObject* text, Py_ssize_t start, Py_ssize_t stop);
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* GetTopmostException.proto */
+#if CYTHON_USE_EXC_INFO_STACK
+static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
+#endif
+
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+/* ImportFrom.proto */
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+/* HasAttr.proto */
+static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
+
+/* PyObject_GenericGetAttrNoDict.proto */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
+#endif
+
+/* PyObject_GenericGetAttr.proto */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
+#endif
+
+/* PyObjectGetAttrStrNoError.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
+
+/* SetupReduce.proto */
+static int __Pyx_setup_reduce(PyObject* type_obj);
+
+/* SetVTable.proto */
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+/* TypeImport.proto */
+#ifndef __PYX_HAVE_RT_ImportType_proto
+#define __PYX_HAVE_RT_ImportType_proto
+enum __Pyx_ImportType_CheckSize {
+ __Pyx_ImportType_CheckSize_Error = 0,
+ __Pyx_ImportType_CheckSize_Warn = 1,
+ __Pyx_ImportType_CheckSize_Ignore = 2
+};
+static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
+#endif
+
+/* decode_c_string.proto */
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
+
+/* CLineInTraceback.proto */
+#ifdef CYTHON_CLINE_IN_TRACEBACK
+#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
+#else
+static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
+#endif
+
+/* CodeObjectCache.proto */
+typedef struct {
+ PyCodeObject* code_object;
+ int code_line;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+/* AddTraceback.proto */
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+/* GCCDiagnostics.proto */
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+#define __Pyx_HAS_GCC_DIAGNOSTIC
+#endif
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE enum llhttp_method __Pyx_PyInt_As_enum__llhttp_method(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
+
+/* FetchCommonType.proto */
+static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
+
+/* PyObjectGetMethod.proto */
+static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
+
+/* PyObjectCallMethod1.proto */
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
+
+/* CoroutineBase.proto */
+typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
+#if CYTHON_USE_EXC_INFO_STACK
+#define __Pyx_ExcInfoStruct _PyErr_StackItem
+#else
+typedef struct {
+ PyObject *exc_type;
+ PyObject *exc_value;
+ PyObject *exc_traceback;
+} __Pyx_ExcInfoStruct;
+#endif
+typedef struct {
+ PyObject_HEAD
+ __pyx_coroutine_body_t body;
+ PyObject *closure;
+ __Pyx_ExcInfoStruct gi_exc_state;
+ PyObject *gi_weakreflist;
+ PyObject *classobj;
+ PyObject *yieldfrom;
+ PyObject *gi_name;
+ PyObject *gi_qualname;
+ PyObject *gi_modulename;
+ PyObject *gi_code;
+ PyObject *gi_frame;
+ int resume_label;
+ char is_running;
+} __pyx_CoroutineObject;
+static __pyx_CoroutineObject *__Pyx__Coroutine_New(
+ PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
+ PyObject *name, PyObject *qualname, PyObject *module_name);
+static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
+ __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
+ PyObject *name, PyObject *qualname, PyObject *module_name);
+static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
+static int __Pyx_Coroutine_clear(PyObject *self);
+static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
+static PyObject *__Pyx_Coroutine_Close(PyObject *self);
+static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
+#if CYTHON_USE_EXC_INFO_STACK
+#define __Pyx_Coroutine_SwapException(self)
+#define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
+#else
+#define __Pyx_Coroutine_SwapException(self) {\
+ __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
+ __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
+ }
+#define __Pyx_Coroutine_ResetAndClearException(self) {\
+ __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
+ (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
+ }
+#endif
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
+ __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
+#else
+#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
+ __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
+#endif
+static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
+static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
+
+/* PatchModuleWithCoroutine.proto */
+static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
+
+/* PatchGeneratorABC.proto */
+static int __Pyx_patch_abc(void);
+
+/* Generator.proto */
+#define __Pyx_Generator_USED
+static PyTypeObject *__pyx_GeneratorType = 0;
+#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
+#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
+ __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
+static PyObject *__Pyx_Generator_Next(PyObject *self);
+static int __pyx_Generator_init(void);
+
+/* CheckBinaryVersion.proto */
+static int __Pyx_check_binary_version(void);
+
+/* InitStrings.proto */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__init(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, enum llhttp_type __pyx_v_mode, PyObject *__pyx_v_protocol, PyObject *__pyx_v_loop, int __pyx_v_limit, struct __pyx_opt_args_7aiohttp_12_http_parser_10HttpParser__init *__pyx_optional_args); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__process_header(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_header_field(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, char *__pyx_v_at, size_t __pyx_v_length); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_header_value(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, char *__pyx_v_at, size_t __pyx_v_length); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_headers_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_message_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_chunk_header(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_chunk_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_status_complete(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser_http_version(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_17HttpRequestParser__on_status_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *__pyx_v_self); /* proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_18HttpResponseParser__on_status_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *__pyx_v_self); /* proto*/
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'libc.limits' */
+
+/* Module declarations from 'cython' */
+
+/* Module declarations from 'aiohttp' */
+
+/* Module declarations from 'libc.stdint' */
+
+/* Module declarations from 'aiohttp._cparser' */
+
+/* Module declarations from 'aiohttp._find_header' */
+
+/* Module declarations from 'aiohttp._http_parser' */
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser_RawRequestMessage = 0;
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser_RawResponseMessage = 0;
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser_HttpParser = 0;
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser_HttpRequestParser = 0;
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser_HttpResponseParser = 0;
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct____repr__ = 0;
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr = 0;
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ = 0;
+static PyTypeObject *__pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_headers = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_URL = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_URL_build = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_CIMultiDict = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_CIMultiDictProxy = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_HttpVersion = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_HttpVersion10 = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_HttpVersion11 = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_SEC_WEBSOCKET_KEY1 = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_CONTENT_ENCODING = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_EMPTY_PAYLOAD = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_StreamReader = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser_DeflateBuffer = 0;
+static PyObject *__pyx_v_7aiohttp_12_http_parser__http_method = 0;
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_extend(PyObject *, char const *, size_t); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_http_method_str(int); /*proto*/
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_find_header(PyObject *); /*proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser__new_request_message(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *, int, PyObject *, int, int, PyObject *); /*proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser__new_response_message(PyObject *, int, PyObject *, PyObject *, PyObject *, int, PyObject *, int, int); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_message_begin(llhttp_t *); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_url(llhttp_t *, char const *, size_t); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_status(llhttp_t *, char const *, size_t); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_header_field(llhttp_t *, char const *, size_t); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_header_value(llhttp_t *, char const *, size_t); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_headers_complete(llhttp_t *); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_body(llhttp_t *, char const *, size_t); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_message_complete(llhttp_t *); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_chunk_header(llhttp_t *); /*proto*/
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_chunk_complete(llhttp_t *); /*proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser_parser_error_from_errno(llhttp_t *, PyObject *, PyObject *); /*proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser___pyx_unpickle_RawRequestMessage__set_state(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *, PyObject *); /*proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_parser___pyx_unpickle_RawResponseMessage__set_state(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *, PyObject *); /*proto*/
+#define __Pyx_MODULE_NAME "aiohttp._http_parser"
+extern int __pyx_module_is_main_aiohttp___http_parser;
+int __pyx_module_is_main_aiohttp___http_parser = 0;
+
+/* Implementation of 'aiohttp._http_parser' */
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_BaseException;
+static const char __pyx_k_[] = "=";
+static const char __pyx_k_i[] = "i";
+static const char __pyx_k_r[] = "{}:\n\n {!r}\n {}";
+static const char __pyx_k_TE[] = "TE";
+static const char __pyx_k__2[] = ", ";
+static const char __pyx_k__3[] = ")>";
+static const char __pyx_k__4[] = "\n";
+static const char __pyx_k__6[] = " ";
+static const char __pyx_k__7[] = "^";
+static const char __pyx_k__8[] = "";
+static const char __pyx_k_br[] = "br";
+static const char __pyx_k_AGE[] = "AGE";
+static const char __pyx_k_URI[] = "URI";
+static const char __pyx_k_URL[] = "URL";
+static const char __pyx_k_VIA[] = "VIA";
+static const char __pyx_k__11[] = "?";
+static const char __pyx_k__12[] = "#";
+static const char __pyx_k_add[] = "add";
+static const char __pyx_k_all[] = "__all__";
+static const char __pyx_k_new[] = "__new__";
+static const char __pyx_k_url[] = "url";
+static const char __pyx_k_DATE[] = "DATE";
+static const char __pyx_k_ETAG[] = "ETAG";
+static const char __pyx_k_FROM[] = "FROM";
+static const char __pyx_k_HOST[] = "HOST";
+static const char __pyx_k_LINK[] = "LINK";
+static const char __pyx_k_VARY[] = "VARY";
+static const char __pyx_k_args[] = "args";
+static const char __pyx_k_code[] = "code";
+static const char __pyx_k_dict[] = "__dict__";
+static const char __pyx_k_gzip[] = "gzip";
+static const char __pyx_k_hdrs[] = "hdrs";
+static const char __pyx_k_loop[] = "loop";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_name[] = "__name__";
+static const char __pyx_k_path[] = "path";
+static const char __pyx_k_send[] = "send";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_yarl[] = "yarl";
+static const char __pyx_k_ALLOW[] = "ALLOW";
+static const char __pyx_k_RANGE[] = "RANGE";
+static const char __pyx_k_URL_2[] = "_URL";
+static const char __pyx_k_build[] = "build";
+static const char __pyx_k_close[] = "close";
+static const char __pyx_k_limit[] = "limit";
+static const char __pyx_k_lower[] = "lower";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_split[] = "split";
+static const char __pyx_k_throw[] = "throw";
+static const char __pyx_k_timer[] = "timer";
+static const char __pyx_k_ACCEPT[] = "ACCEPT";
+static const char __pyx_k_COOKIE[] = "COOKIE";
+static const char __pyx_k_DIGEST[] = "DIGEST";
+static const char __pyx_k_EXPECT[] = "EXPECT";
+static const char __pyx_k_ORIGIN[] = "ORIGIN";
+static const char __pyx_k_PRAGMA[] = "PRAGMA";
+static const char __pyx_k_SERVER[] = "SERVER";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_method[] = "method";
+static const char __pyx_k_pickle[] = "pickle";
+static const char __pyx_k_reason[] = "reason";
+static const char __pyx_k_reduce[] = "__reduce__";
+static const char __pyx_k_rsplit[] = "rsplit";
+static const char __pyx_k_update[] = "update";
+static const char __pyx_k_EXPIRES[] = "EXPIRES";
+static const char __pyx_k_REFERER[] = "REFERER";
+static const char __pyx_k_TRAILER[] = "TRAILER";
+static const char __pyx_k_UPGRADE[] = "UPGRADE";
+static const char __pyx_k_WARNING[] = "WARNING";
+static const char __pyx_k_aiohttp[] = "aiohttp";
+static const char __pyx_k_chunked[] = "chunked";
+static const char __pyx_k_deflate[] = "deflate";
+static const char __pyx_k_encoded[] = "encoded";
+static const char __pyx_k_genexpr[] = "genexpr";
+static const char __pyx_k_headers[] = "headers";
+static const char __pyx_k_streams[] = "streams";
+static const char __pyx_k_unknown[] = "<unknown>";
+static const char __pyx_k_upgrade[] = "upgrade";
+static const char __pyx_k_version[] = "version";
+static const char __pyx_k_IF_MATCH[] = "IF_MATCH";
+static const char __pyx_k_IF_RANGE[] = "IF_RANGE";
+static const char __pyx_k_LOCATION[] = "LOCATION";
+static const char __pyx_k_feed_eof[] = "feed_eof";
+static const char __pyx_k_fragment[] = "fragment";
+static const char __pyx_k_getstate[] = "__getstate__";
+static const char __pyx_k_protocol[] = "protocol";
+static const char __pyx_k_pyx_type[] = "__pyx_type";
+static const char __pyx_k_setstate[] = "__setstate__";
+static const char __pyx_k_FORWARDED[] = "FORWARDED";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_authority[] = "authority";
+static const char __pyx_k_feed_data[] = "feed_data";
+static const char __pyx_k_multidict[] = "multidict";
+static const char __pyx_k_pyx_state[] = "__pyx_state";
+static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
+static const char __pyx_k_CONNECTION[] = "CONNECTION";
+static const char __pyx_k_KEEP_ALIVE[] = "KEEP_ALIVE";
+static const char __pyx_k_SET_COOKIE[] = "SET_COOKIE";
+static const char __pyx_k_USER_AGENT[] = "USER_AGENT";
+static const char __pyx_k_pyx_result[] = "__pyx_result";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_CIMultiDict[] = "CIMultiDict";
+static const char __pyx_k_CONTENT_MD5[] = "CONTENT_MD5";
+static const char __pyx_k_DESTINATION[] = "DESTINATION";
+static const char __pyx_k_HttpVersion[] = "HttpVersion";
+static const char __pyx_k_LineTooLong[] = "LineTooLong";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_PickleError[] = "PickleError";
+static const char __pyx_k_RETRY_AFTER[] = "RETRY_AFTER";
+static const char __pyx_k_WANT_DIGEST[] = "WANT_DIGEST";
+static const char __pyx_k_compression[] = "compression";
+static const char __pyx_k_http_parser[] = "http_parser";
+static const char __pyx_k_http_writer[] = "http_writer";
+static const char __pyx_k_max_headers[] = "max_headers";
+static const char __pyx_k_raw_headers[] = "raw_headers";
+static const char __pyx_k_CONTENT_TYPE[] = "CONTENT_TYPE";
+static const char __pyx_k_MAX_FORWARDS[] = "MAX_FORWARDS";
+static const char __pyx_k_StreamReader[] = "StreamReader";
+static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
+static const char __pyx_k_query_string[] = "query_string";
+static const char __pyx_k_should_close[] = "should_close";
+static const char __pyx_k_stringsource[] = "stringsource";
+static const char __pyx_k_ACCEPT_RANGES[] = "ACCEPT_RANGES";
+static const char __pyx_k_AUTHORIZATION[] = "AUTHORIZATION";
+static const char __pyx_k_BadStatusLine[] = "BadStatusLine";
+static const char __pyx_k_BaseException[] = "BaseException";
+static const char __pyx_k_CACHE_CONTROL[] = "CACHE_CONTROL";
+static const char __pyx_k_CIMultiDict_2[] = "_CIMultiDict";
+static const char __pyx_k_CONTENT_RANGE[] = "CONTENT_RANGE";
+static const char __pyx_k_DeflateBuffer[] = "DeflateBuffer";
+static const char __pyx_k_EMPTY_PAYLOAD[] = "EMPTY_PAYLOAD";
+static const char __pyx_k_HttpVersion10[] = "HttpVersion10";
+static const char __pyx_k_HttpVersion11[] = "HttpVersion11";
+static const char __pyx_k_HttpVersion_2[] = "_HttpVersion";
+static const char __pyx_k_IF_NONE_MATCH[] = "IF_NONE_MATCH";
+static const char __pyx_k_InvalidHeader[] = "InvalidHeader";
+static const char __pyx_k_LAST_EVENT_ID[] = "LAST_EVENT_ID";
+static const char __pyx_k_LAST_MODIFIED[] = "LAST_MODIFIED";
+static const char __pyx_k_max_line_size[] = "max_line_size";
+static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
+static const char __pyx_k_set_exception[] = "set_exception";
+static const char __pyx_k_ACCEPT_CHARSET[] = "ACCEPT_CHARSET";
+static const char __pyx_k_BadHttpMessage[] = "BadHttpMessage";
+static const char __pyx_k_CONTENT_LENGTH[] = "CONTENT_LENGTH";
+static const char __pyx_k_StreamReader_2[] = "_StreamReader";
+static const char __pyx_k_max_field_size[] = "max_field_size";
+static const char __pyx_k_read_until_eof[] = "read_until_eof";
+static const char __pyx_k_ACCEPT_ENCODING[] = "ACCEPT_ENCODING";
+static const char __pyx_k_ACCEPT_LANGUAGE[] = "ACCEPT_LANGUAGE";
+static const char __pyx_k_DeflateBuffer_2[] = "_DeflateBuffer";
+static const char __pyx_k_EMPTY_PAYLOAD_2[] = "_EMPTY_PAYLOAD";
+static const char __pyx_k_HttpVersion10_2[] = "_HttpVersion10";
+static const char __pyx_k_HttpVersion11_2[] = "_HttpVersion11";
+static const char __pyx_k_InvalidURLError[] = "InvalidURLError";
+static const char __pyx_k_X_FORWARDED_FOR[] = "X_FORWARDED_FOR";
+static const char __pyx_k_auto_decompress[] = "auto_decompress";
+static const char __pyx_k_http_exceptions[] = "http_exceptions";
+static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
+static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
+static const char __pyx_k_CIMultiDictProxy[] = "CIMultiDictProxy";
+static const char __pyx_k_CONTENT_ENCODING[] = "CONTENT_ENCODING";
+static const char __pyx_k_CONTENT_LANGUAGE[] = "CONTENT_LANGUAGE";
+static const char __pyx_k_CONTENT_LOCATION[] = "CONTENT_LOCATION";
+static const char __pyx_k_WWW_AUTHENTICATE[] = "WWW_AUTHENTICATE";
+static const char __pyx_k_X_FORWARDED_HOST[] = "X_FORWARDED_HOST";
+static const char __pyx_k_HttpRequestParser[] = "HttpRequestParser";
+static const char __pyx_k_IF_MODIFIED_SINCE[] = "IF_MODIFIED_SINCE";
+static const char __pyx_k_RawRequestMessage[] = "<RawRequestMessage(";
+static const char __pyx_k_SEC_WEBSOCKET_KEY[] = "SEC_WEBSOCKET_KEY";
+static const char __pyx_k_TRANSFER_ENCODING[] = "TRANSFER_ENCODING";
+static const char __pyx_k_X_FORWARDED_PROTO[] = "X_FORWARDED_PROTO";
+static const char __pyx_k_payload_exception[] = "payload_exception";
+static const char __pyx_k_CIMultiDictProxy_2[] = "_CIMultiDictProxy";
+static const char __pyx_k_ContentLengthError[] = "ContentLengthError";
+static const char __pyx_k_HttpResponseParser[] = "HttpResponseParser";
+static const char __pyx_k_PROXY_AUTHENTICATE[] = "PROXY_AUTHENTICATE";
+static const char __pyx_k_RawResponseMessage[] = "<RawResponseMessage(";
+static const char __pyx_k_SEC_WEBSOCKET_KEY1[] = "SEC_WEBSOCKET_KEY1";
+static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
+static const char __pyx_k_response_with_body[] = "response_with_body";
+static const char __pyx_k_CONTENT_DISPOSITION[] = "CONTENT_DISPOSITION";
+static const char __pyx_k_IF_UNMODIFIED_SINCE[] = "IF_UNMODIFIED_SINCE";
+static const char __pyx_k_PROXY_AUTHORIZATION[] = "PROXY_AUTHORIZATION";
+static const char __pyx_k_RawRequestMessage_2[] = "RawRequestMessage";
+static const char __pyx_k_PayloadEncodingError[] = "PayloadEncodingError";
+static const char __pyx_k_RawResponseMessage_2[] = "RawResponseMessage";
+static const char __pyx_k_SEC_WEBSOCKET_ACCEPT[] = "SEC_WEBSOCKET_ACCEPT";
+static const char __pyx_k_aiohttp__http_parser[] = "aiohttp._http_parser";
+static const char __pyx_k_SEC_WEBSOCKET_VERSION[] = "SEC_WEBSOCKET_VERSION";
+static const char __pyx_k_TransferEncodingError[] = "TransferEncodingError";
+static const char __pyx_k_repr___locals_genexpr[] = "__repr__.<locals>.genexpr";
+static const char __pyx_k_ACCESS_CONTROL_MAX_AGE[] = "ACCESS_CONTROL_MAX_AGE";
+static const char __pyx_k_SEC_WEBSOCKET_PROTOCOL[] = "SEC_WEBSOCKET_PROTOCOL";
+static const char __pyx_k_Header_name_is_too_long[] = "Header name is too long";
+static const char __pyx_k_Status_line_is_too_long[] = "Status line is too long";
+static const char __pyx_k_Header_value_is_too_long[] = "Header value is too long";
+static const char __pyx_k_SEC_WEBSOCKET_EXTENSIONS[] = "SEC_WEBSOCKET_EXTENSIONS";
+static const char __pyx_k_end_http_chunk_receiving[] = "end_http_chunk_receiving";
+static const char __pyx_k_CONTENT_TRANSFER_ENCODING[] = "CONTENT_TRANSFER_ENCODING";
+static const char __pyx_k_begin_http_chunk_receiving[] = "begin_http_chunk_receiving";
+static const char __pyx_k_ACCESS_CONTROL_ALLOW_ORIGIN[] = "ACCESS_CONTROL_ALLOW_ORIGIN";
+static const char __pyx_k_ACCESS_CONTROL_ALLOW_HEADERS[] = "ACCESS_CONTROL_ALLOW_HEADERS";
+static const char __pyx_k_ACCESS_CONTROL_ALLOW_METHODS[] = "ACCESS_CONTROL_ALLOW_METHODS";
+static const char __pyx_k_ACCESS_CONTROL_EXPOSE_HEADERS[] = "ACCESS_CONTROL_EXPOSE_HEADERS";
+static const char __pyx_k_ACCESS_CONTROL_REQUEST_METHOD[] = "ACCESS_CONTROL_REQUEST_METHOD";
+static const char __pyx_k_ACCESS_CONTROL_REQUEST_HEADERS[] = "ACCESS_CONTROL_REQUEST_HEADERS";
+static const char __pyx_k_pyx_unpickle_RawRequestMessage[] = "__pyx_unpickle_RawRequestMessage";
+static const char __pyx_k_pyx_unpickle_RawResponseMessag[] = "__pyx_unpickle_RawResponseMessage";
+static const char __pyx_k_ACCESS_CONTROL_ALLOW_CREDENTIALS[] = "ACCESS_CONTROL_ALLOW_CREDENTIALS";
+static const char __pyx_k_Incompatible_checksums_0x_x_vs_0[] = "Incompatible checksums (0x%x vs (0x1408252, 0xf602a9f, 0x03e51e3) = (chunked, compression, headers, method, path, raw_headers, should_close, upgrade, url, version))";
+static const char __pyx_k_Not_enough_data_for_satisfy_cont[] = "Not enough data for satisfy content length header.";
+static const char __pyx_k_Not_enough_data_for_satisfy_tran[] = "Not enough data for satisfy transfer length header.";
+static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
+static const char __pyx_k_Incompatible_checksums_0x_x_vs_0_2[] = "Incompatible checksums (0x%x vs (0xc7706dc, 0xcb2b2ba, 0x4febc0e) = (chunked, code, compression, headers, raw_headers, reason, should_close, upgrade, version))";
+static PyObject *__pyx_kp_u_;
+static PyObject *__pyx_n_s_ACCEPT;
+static PyObject *__pyx_n_s_ACCEPT_CHARSET;
+static PyObject *__pyx_n_s_ACCEPT_ENCODING;
+static PyObject *__pyx_n_s_ACCEPT_LANGUAGE;
+static PyObject *__pyx_n_s_ACCEPT_RANGES;
+static PyObject *__pyx_n_s_ACCESS_CONTROL_ALLOW_CREDENTIALS;
+static PyObject *__pyx_n_s_ACCESS_CONTROL_ALLOW_HEADERS;
+static PyObject *__pyx_n_s_ACCESS_CONTROL_ALLOW_METHODS;
+static PyObject *__pyx_n_s_ACCESS_CONTROL_ALLOW_ORIGIN;
+static PyObject *__pyx_n_s_ACCESS_CONTROL_EXPOSE_HEADERS;
+static PyObject *__pyx_n_s_ACCESS_CONTROL_MAX_AGE;
+static PyObject *__pyx_n_s_ACCESS_CONTROL_REQUEST_HEADERS;
+static PyObject *__pyx_n_s_ACCESS_CONTROL_REQUEST_METHOD;
+static PyObject *__pyx_n_s_AGE;
+static PyObject *__pyx_n_s_ALLOW;
+static PyObject *__pyx_n_s_AUTHORIZATION;
+static PyObject *__pyx_n_s_BadHttpMessage;
+static PyObject *__pyx_n_s_BadStatusLine;
+static PyObject *__pyx_n_s_BaseException;
+static PyObject *__pyx_n_s_CACHE_CONTROL;
+static PyObject *__pyx_n_s_CIMultiDict;
+static PyObject *__pyx_n_s_CIMultiDictProxy;
+static PyObject *__pyx_n_s_CIMultiDictProxy_2;
+static PyObject *__pyx_n_s_CIMultiDict_2;
+static PyObject *__pyx_n_s_CONNECTION;
+static PyObject *__pyx_n_s_CONTENT_DISPOSITION;
+static PyObject *__pyx_n_s_CONTENT_ENCODING;
+static PyObject *__pyx_n_s_CONTENT_LANGUAGE;
+static PyObject *__pyx_n_s_CONTENT_LENGTH;
+static PyObject *__pyx_n_s_CONTENT_LOCATION;
+static PyObject *__pyx_n_s_CONTENT_MD5;
+static PyObject *__pyx_n_s_CONTENT_RANGE;
+static PyObject *__pyx_n_s_CONTENT_TRANSFER_ENCODING;
+static PyObject *__pyx_n_s_CONTENT_TYPE;
+static PyObject *__pyx_n_s_COOKIE;
+static PyObject *__pyx_n_s_ContentLengthError;
+static PyObject *__pyx_n_s_DATE;
+static PyObject *__pyx_n_s_DESTINATION;
+static PyObject *__pyx_n_s_DIGEST;
+static PyObject *__pyx_n_s_DeflateBuffer;
+static PyObject *__pyx_n_s_DeflateBuffer_2;
+static PyObject *__pyx_n_s_EMPTY_PAYLOAD;
+static PyObject *__pyx_n_s_EMPTY_PAYLOAD_2;
+static PyObject *__pyx_n_s_ETAG;
+static PyObject *__pyx_n_s_EXPECT;
+static PyObject *__pyx_n_s_EXPIRES;
+static PyObject *__pyx_n_s_FORWARDED;
+static PyObject *__pyx_n_s_FROM;
+static PyObject *__pyx_n_s_HOST;
+static PyObject *__pyx_kp_u_Header_name_is_too_long;
+static PyObject *__pyx_kp_u_Header_value_is_too_long;
+static PyObject *__pyx_n_s_HttpRequestParser;
+static PyObject *__pyx_n_u_HttpRequestParser;
+static PyObject *__pyx_n_s_HttpResponseParser;
+static PyObject *__pyx_n_u_HttpResponseParser;
+static PyObject *__pyx_n_s_HttpVersion;
+static PyObject *__pyx_n_s_HttpVersion10;
+static PyObject *__pyx_n_s_HttpVersion10_2;
+static PyObject *__pyx_n_s_HttpVersion11;
+static PyObject *__pyx_n_s_HttpVersion11_2;
+static PyObject *__pyx_n_s_HttpVersion_2;
+static PyObject *__pyx_n_s_IF_MATCH;
+static PyObject *__pyx_n_s_IF_MODIFIED_SINCE;
+static PyObject *__pyx_n_s_IF_NONE_MATCH;
+static PyObject *__pyx_n_s_IF_RANGE;
+static PyObject *__pyx_n_s_IF_UNMODIFIED_SINCE;
+static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0;
+static PyObject *__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2;
+static PyObject *__pyx_n_s_InvalidHeader;
+static PyObject *__pyx_n_s_InvalidURLError;
+static PyObject *__pyx_n_s_KEEP_ALIVE;
+static PyObject *__pyx_n_s_LAST_EVENT_ID;
+static PyObject *__pyx_n_s_LAST_MODIFIED;
+static PyObject *__pyx_n_s_LINK;
+static PyObject *__pyx_n_s_LOCATION;
+static PyObject *__pyx_n_s_LineTooLong;
+static PyObject *__pyx_n_s_MAX_FORWARDS;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_kp_u_Not_enough_data_for_satisfy_cont;
+static PyObject *__pyx_kp_u_Not_enough_data_for_satisfy_tran;
+static PyObject *__pyx_n_s_ORIGIN;
+static PyObject *__pyx_n_s_PRAGMA;
+static PyObject *__pyx_n_s_PROXY_AUTHENTICATE;
+static PyObject *__pyx_n_s_PROXY_AUTHORIZATION;
+static PyObject *__pyx_n_s_PayloadEncodingError;
+static PyObject *__pyx_n_s_PickleError;
+static PyObject *__pyx_n_s_RANGE;
+static PyObject *__pyx_n_s_REFERER;
+static PyObject *__pyx_n_s_RETRY_AFTER;
+static PyObject *__pyx_kp_u_RawRequestMessage;
+static PyObject *__pyx_n_s_RawRequestMessage_2;
+static PyObject *__pyx_n_u_RawRequestMessage_2;
+static PyObject *__pyx_kp_u_RawResponseMessage;
+static PyObject *__pyx_n_s_RawResponseMessage_2;
+static PyObject *__pyx_n_u_RawResponseMessage_2;
+static PyObject *__pyx_n_s_SEC_WEBSOCKET_ACCEPT;
+static PyObject *__pyx_n_s_SEC_WEBSOCKET_EXTENSIONS;
+static PyObject *__pyx_n_s_SEC_WEBSOCKET_KEY;
+static PyObject *__pyx_n_s_SEC_WEBSOCKET_KEY1;
+static PyObject *__pyx_n_s_SEC_WEBSOCKET_PROTOCOL;
+static PyObject *__pyx_n_s_SEC_WEBSOCKET_VERSION;
+static PyObject *__pyx_n_s_SERVER;
+static PyObject *__pyx_n_s_SET_COOKIE;
+static PyObject *__pyx_kp_u_Status_line_is_too_long;
+static PyObject *__pyx_n_s_StreamReader;
+static PyObject *__pyx_n_s_StreamReader_2;
+static PyObject *__pyx_n_s_TE;
+static PyObject *__pyx_n_s_TRAILER;
+static PyObject *__pyx_n_s_TRANSFER_ENCODING;
+static PyObject *__pyx_n_s_TransferEncodingError;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_n_s_UPGRADE;
+static PyObject *__pyx_n_s_URI;
+static PyObject *__pyx_n_s_URL;
+static PyObject *__pyx_n_s_URL_2;
+static PyObject *__pyx_n_s_USER_AGENT;
+static PyObject *__pyx_n_s_VARY;
+static PyObject *__pyx_n_s_VIA;
+static PyObject *__pyx_n_s_WANT_DIGEST;
+static PyObject *__pyx_n_s_WARNING;
+static PyObject *__pyx_n_s_WWW_AUTHENTICATE;
+static PyObject *__pyx_n_s_X_FORWARDED_FOR;
+static PyObject *__pyx_n_s_X_FORWARDED_HOST;
+static PyObject *__pyx_n_s_X_FORWARDED_PROTO;
+static PyObject *__pyx_kp_u__11;
+static PyObject *__pyx_kp_u__12;
+static PyObject *__pyx_kp_u__2;
+static PyObject *__pyx_kp_u__3;
+static PyObject *__pyx_kp_b__4;
+static PyObject *__pyx_kp_u__6;
+static PyObject *__pyx_kp_u__7;
+static PyObject *__pyx_n_s__8;
+static PyObject *__pyx_kp_b__8;
+static PyObject *__pyx_kp_u__8;
+static PyObject *__pyx_n_s_add;
+static PyObject *__pyx_n_s_aiohttp;
+static PyObject *__pyx_n_s_aiohttp__http_parser;
+static PyObject *__pyx_n_s_all;
+static PyObject *__pyx_n_s_args;
+static PyObject *__pyx_n_s_authority;
+static PyObject *__pyx_n_s_auto_decompress;
+static PyObject *__pyx_n_s_begin_http_chunk_receiving;
+static PyObject *__pyx_n_u_br;
+static PyObject *__pyx_n_s_build;
+static PyObject *__pyx_n_s_chunked;
+static PyObject *__pyx_n_u_chunked;
+static PyObject *__pyx_n_s_cline_in_traceback;
+static PyObject *__pyx_n_s_close;
+static PyObject *__pyx_n_s_code;
+static PyObject *__pyx_n_u_code;
+static PyObject *__pyx_n_s_compression;
+static PyObject *__pyx_n_u_compression;
+static PyObject *__pyx_n_u_deflate;
+static PyObject *__pyx_n_s_dict;
+static PyObject *__pyx_n_s_encoded;
+static PyObject *__pyx_n_s_end_http_chunk_receiving;
+static PyObject *__pyx_n_s_feed_data;
+static PyObject *__pyx_n_s_feed_eof;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_fragment;
+static PyObject *__pyx_n_s_genexpr;
+static PyObject *__pyx_n_s_getstate;
+static PyObject *__pyx_n_u_gzip;
+static PyObject *__pyx_n_s_hdrs;
+static PyObject *__pyx_n_s_headers;
+static PyObject *__pyx_n_u_headers;
+static PyObject *__pyx_n_s_http_exceptions;
+static PyObject *__pyx_n_s_http_parser;
+static PyObject *__pyx_n_s_http_writer;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_limit;
+static PyObject *__pyx_n_s_loop;
+static PyObject *__pyx_n_s_lower;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_max_field_size;
+static PyObject *__pyx_n_s_max_headers;
+static PyObject *__pyx_n_s_max_line_size;
+static PyObject *__pyx_n_s_method;
+static PyObject *__pyx_n_u_method;
+static PyObject *__pyx_n_s_multidict;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_new;
+static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
+static PyObject *__pyx_n_s_path;
+static PyObject *__pyx_n_u_path;
+static PyObject *__pyx_n_s_payload_exception;
+static PyObject *__pyx_n_s_pickle;
+static PyObject *__pyx_n_s_protocol;
+static PyObject *__pyx_n_s_pyx_PickleError;
+static PyObject *__pyx_n_s_pyx_checksum;
+static PyObject *__pyx_n_s_pyx_result;
+static PyObject *__pyx_n_s_pyx_state;
+static PyObject *__pyx_n_s_pyx_type;
+static PyObject *__pyx_n_s_pyx_unpickle_RawRequestMessage;
+static PyObject *__pyx_n_s_pyx_unpickle_RawResponseMessag;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_query_string;
+static PyObject *__pyx_kp_u_r;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_raw_headers;
+static PyObject *__pyx_n_u_raw_headers;
+static PyObject *__pyx_n_s_read_until_eof;
+static PyObject *__pyx_n_s_reason;
+static PyObject *__pyx_n_u_reason;
+static PyObject *__pyx_n_s_reduce;
+static PyObject *__pyx_n_s_reduce_cython;
+static PyObject *__pyx_n_s_reduce_ex;
+static PyObject *__pyx_n_s_repr___locals_genexpr;
+static PyObject *__pyx_n_s_response_with_body;
+static PyObject *__pyx_n_s_rsplit;
+static PyObject *__pyx_n_s_send;
+static PyObject *__pyx_n_s_set_exception;
+static PyObject *__pyx_n_s_setstate;
+static PyObject *__pyx_n_s_setstate_cython;
+static PyObject *__pyx_n_s_should_close;
+static PyObject *__pyx_n_u_should_close;
+static PyObject *__pyx_n_s_split;
+static PyObject *__pyx_n_s_streams;
+static PyObject *__pyx_kp_s_stringsource;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_throw;
+static PyObject *__pyx_n_s_timer;
+static PyObject *__pyx_kp_u_unknown;
+static PyObject *__pyx_n_s_update;
+static PyObject *__pyx_n_s_upgrade;
+static PyObject *__pyx_n_u_upgrade;
+static PyObject *__pyx_n_s_url;
+static PyObject *__pyx_n_u_url;
+static PyObject *__pyx_n_s_version;
+static PyObject *__pyx_n_u_version;
+static PyObject *__pyx_n_s_yarl;
+static int __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage___init__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_path, PyObject *__pyx_v_version, PyObject *__pyx_v_headers, PyObject *__pyx_v_raw_headers, PyObject *__pyx_v_should_close, PyObject *__pyx_v_compression, PyObject *__pyx_v_upgrade, PyObject *__pyx_v_chunked, PyObject *__pyx_v_url); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_8__repr___genexpr(PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_2__repr__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_4_replace(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self, PyObject *__pyx_v_dct); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_6method___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_4path___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7version___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7headers___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_11raw_headers___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_12should_close___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_11compression___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7upgrade___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7chunked___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_3url___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_6__reduce_cython__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_8__setstate_cython__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
+static int __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage___init__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self, PyObject *__pyx_v_version, PyObject *__pyx_v_code, PyObject *__pyx_v_reason, PyObject *__pyx_v_headers, PyObject *__pyx_v_raw_headers, PyObject *__pyx_v_should_close, PyObject *__pyx_v_compression, PyObject *__pyx_v_upgrade, PyObject *__pyx_v_chunked); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_8__repr___genexpr(PyObject *__pyx_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_2__repr__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7version___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_4code___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_6reason___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7headers___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_11raw_headers___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_12should_close___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_11compression___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7upgrade___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7chunked___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_4__reduce_cython__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_6__setstate_cython__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
+static int __pyx_pf_7aiohttp_12_http_parser_10HttpParser___cinit__(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto */
+static void __pyx_pf_7aiohttp_12_http_parser_10HttpParser_2__dealloc__(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_4feed_eof(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_6feed_data(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_8set_upgraded(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, PyObject *__pyx_v_val); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
+static int __pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser___init__(struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *__pyx_v_self, PyObject *__pyx_v_protocol, PyObject *__pyx_v_loop, int __pyx_v_limit, PyObject *__pyx_v_timer, size_t __pyx_v_max_line_size, size_t __pyx_v_max_headers, size_t __pyx_v_max_field_size, PyObject *__pyx_v_payload_exception, int __pyx_v_response_with_body, int __pyx_v_read_until_eof, int __pyx_v_auto_decompress); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
+static int __pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser___init__(struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *__pyx_v_self, PyObject *__pyx_v_protocol, PyObject *__pyx_v_loop, int __pyx_v_limit, PyObject *__pyx_v_timer, size_t __pyx_v_max_line_size, size_t __pyx_v_max_headers, size_t __pyx_v_max_field_size, PyObject *__pyx_v_payload_exception, int __pyx_v_response_with_body, int __pyx_v_read_until_eof, int __pyx_v_auto_decompress); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser___pyx_unpickle_RawRequestMessage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_2__pyx_unpickle_RawResponseMessage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_RawRequestMessage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_RawResponseMessage(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_HttpParser(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_HttpRequestParser(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_HttpResponseParser(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct____repr__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_4084195;
+static PyObject *__pyx_int_21004882;
+static PyObject *__pyx_int_83803150;
+static PyObject *__pyx_int_209127132;
+static PyObject *__pyx_int_213037754;
+static PyObject *__pyx_int_257960607;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__13;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__15;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_tuple__17;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__19;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_codeobj__21;
+static PyObject *__pyx_codeobj__23;
+/* Late includes */
+
+/* "aiohttp/_http_parser.pyx":74
+ *
+ *
+ * cdef inline object extend(object buf, const char* at, size_t length): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t s
+ * cdef char* ptr
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_extend(PyObject *__pyx_v_buf, char const *__pyx_v_at, size_t __pyx_v_length) {
+ Py_ssize_t __pyx_v_s;
+ char *__pyx_v_ptr;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("extend", 0);
+
+ /* "aiohttp/_http_parser.pyx":77
+ * cdef Py_ssize_t s
+ * cdef char* ptr
+ * s = PyByteArray_Size(buf) # <<<<<<<<<<<<<<
+ * PyByteArray_Resize(buf, s + length)
+ * ptr = PyByteArray_AsString(buf)
+ */
+ __pyx_t_1 = PyByteArray_Size(__pyx_v_buf); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 77, __pyx_L1_error)
+ __pyx_v_s = __pyx_t_1;
+
+ /* "aiohttp/_http_parser.pyx":78
+ * cdef char* ptr
+ * s = PyByteArray_Size(buf)
+ * PyByteArray_Resize(buf, s + length) # <<<<<<<<<<<<<<
+ * ptr = PyByteArray_AsString(buf)
+ * memcpy(ptr + s, at, length)
+ */
+ __pyx_t_2 = PyByteArray_Resize(__pyx_v_buf, (__pyx_v_s + __pyx_v_length)); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 78, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":79
+ * s = PyByteArray_Size(buf)
+ * PyByteArray_Resize(buf, s + length)
+ * ptr = PyByteArray_AsString(buf) # <<<<<<<<<<<<<<
+ * memcpy(ptr + s, at, length)
+ *
+ */
+ __pyx_v_ptr = PyByteArray_AsString(__pyx_v_buf);
+
+ /* "aiohttp/_http_parser.pyx":80
+ * PyByteArray_Resize(buf, s + length)
+ * ptr = PyByteArray_AsString(buf)
+ * memcpy(ptr + s, at, length) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (void)(memcpy((__pyx_v_ptr + __pyx_v_s), __pyx_v_at, __pyx_v_length));
+
+ /* "aiohttp/_http_parser.pyx":74
+ *
+ *
+ * cdef inline object extend(object buf, const char* at, size_t length): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t s
+ * cdef char* ptr
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":92
+ *
+ *
+ * cdef inline str http_method_str(int i): # <<<<<<<<<<<<<<
+ * if i < METHODS_COUNT:
+ * return <str>_http_method[i]
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_http_method_str(int __pyx_v_i) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("http_method_str", 0);
+
+ /* "aiohttp/_http_parser.pyx":93
+ *
+ * cdef inline str http_method_str(int i):
+ * if i < METHODS_COUNT: # <<<<<<<<<<<<<<
+ * return <str>_http_method[i]
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_i < 46) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_parser.pyx":94
+ * cdef inline str http_method_str(int i):
+ * if i < METHODS_COUNT:
+ * return <str>_http_method[i] # <<<<<<<<<<<<<<
+ * else:
+ * return "<unknown>"
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(__pyx_v_7aiohttp_12_http_parser__http_method == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 94, __pyx_L1_error)
+ }
+ __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_7aiohttp_12_http_parser__http_method, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 94, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject*)__pyx_t_2));
+ __pyx_r = ((PyObject*)__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":93
+ *
+ * cdef inline str http_method_str(int i):
+ * if i < METHODS_COUNT: # <<<<<<<<<<<<<<
+ * return <str>_http_method[i]
+ * else:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":96
+ * return <str>_http_method[i]
+ * else:
+ * return "<unknown>" # <<<<<<<<<<<<<<
+ *
+ * cdef inline object find_header(bytes raw_header):
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_kp_u_unknown);
+ __pyx_r = __pyx_kp_u_unknown;
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":92
+ *
+ *
+ * cdef inline str http_method_str(int i): # <<<<<<<<<<<<<<
+ * if i < METHODS_COUNT:
+ * return <str>_http_method[i]
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("aiohttp._http_parser.http_method_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":98
+ * return "<unknown>"
+ *
+ * cdef inline object find_header(bytes raw_header): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t size
+ * cdef char *buf
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_find_header(PyObject *__pyx_v_raw_header) {
+ Py_ssize_t __pyx_v_size;
+ char *__pyx_v_buf;
+ int __pyx_v_idx;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("find_header", 0);
+
+ /* "aiohttp/_http_parser.pyx":102
+ * cdef char *buf
+ * cdef int idx
+ * PyBytes_AsStringAndSize(raw_header, &buf, &size) # <<<<<<<<<<<<<<
+ * idx = _find_header.find_header(buf, size)
+ * if idx == -1:
+ */
+ __pyx_t_1 = PyBytes_AsStringAndSize(__pyx_v_raw_header, (&__pyx_v_buf), (&__pyx_v_size)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 102, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":103
+ * cdef int idx
+ * PyBytes_AsStringAndSize(raw_header, &buf, &size)
+ * idx = _find_header.find_header(buf, size) # <<<<<<<<<<<<<<
+ * if idx == -1:
+ * return raw_header.decode('utf-8', 'surrogateescape')
+ */
+ __pyx_v_idx = find_header(__pyx_v_buf, __pyx_v_size);
+
+ /* "aiohttp/_http_parser.pyx":104
+ * PyBytes_AsStringAndSize(raw_header, &buf, &size)
+ * idx = _find_header.find_header(buf, size)
+ * if idx == -1: # <<<<<<<<<<<<<<
+ * return raw_header.decode('utf-8', 'surrogateescape')
+ * return headers[idx]
+ */
+ __pyx_t_2 = ((__pyx_v_idx == -1L) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":105
+ * idx = _find_header.find_header(buf, size)
+ * if idx == -1:
+ * return raw_header.decode('utf-8', 'surrogateescape') # <<<<<<<<<<<<<<
+ * return headers[idx]
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(__pyx_v_raw_header == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
+ __PYX_ERR(0, 105, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_decode_bytes(__pyx_v_raw_header, 0, PY_SSIZE_T_MAX, NULL, ((char const *)"surrogateescape"), PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":104
+ * PyBytes_AsStringAndSize(raw_header, &buf, &size)
+ * idx = _find_header.find_header(buf, size)
+ * if idx == -1: # <<<<<<<<<<<<<<
+ * return raw_header.decode('utf-8', 'surrogateescape')
+ * return headers[idx]
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":106
+ * if idx == -1:
+ * return raw_header.decode('utf-8', 'surrogateescape')
+ * return headers[idx] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(__pyx_v_7aiohttp_12_http_parser_headers == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 106, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_GetItemInt_Tuple(__pyx_v_7aiohttp_12_http_parser_headers, __pyx_v_idx, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 106, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":98
+ * return "<unknown>"
+ *
+ * cdef inline object find_header(bytes raw_header): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t size
+ * cdef char *buf
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("aiohttp._http_parser.find_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":122
+ * cdef readonly object url # yarl.URL
+ *
+ * def __init__(self, method, path, version, headers, raw_headers, # <<<<<<<<<<<<<<
+ * should_close, compression, upgrade, chunked, url):
+ * self.method = method
+ */
+
+/* Python wrapper */
+static int __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_method = 0;
+ PyObject *__pyx_v_path = 0;
+ PyObject *__pyx_v_version = 0;
+ PyObject *__pyx_v_headers = 0;
+ PyObject *__pyx_v_raw_headers = 0;
+ PyObject *__pyx_v_should_close = 0;
+ PyObject *__pyx_v_compression = 0;
+ PyObject *__pyx_v_upgrade = 0;
+ PyObject *__pyx_v_chunked = 0;
+ PyObject *__pyx_v_url = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_path,&__pyx_n_s_version,&__pyx_n_s_headers,&__pyx_n_s_raw_headers,&__pyx_n_s_should_close,&__pyx_n_s_compression,&__pyx_n_s_upgrade,&__pyx_n_s_chunked,&__pyx_n_s_url,0};
+ PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+ CYTHON_FALLTHROUGH;
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ CYTHON_FALLTHROUGH;
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ CYTHON_FALLTHROUGH;
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ CYTHON_FALLTHROUGH;
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 1); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_version)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 2); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_headers)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 3); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raw_headers)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 4); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 5:
+ if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_should_close)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 5); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 6:
+ if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 6); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 7:
+ if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_upgrade)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 7); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 8:
+ if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunked)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 8); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 9:
+ if (likely((values[9] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_url)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, 9); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 10) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+ }
+ __pyx_v_method = values[0];
+ __pyx_v_path = values[1];
+ __pyx_v_version = values[2];
+ __pyx_v_headers = values[3];
+ __pyx_v_raw_headers = values[4];
+ __pyx_v_should_close = values[5];
+ __pyx_v_compression = values[6];
+ __pyx_v_upgrade = values[7];
+ __pyx_v_chunked = values[8];
+ __pyx_v_url = values[9];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 10, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.RawRequestMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage___init__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self), __pyx_v_method, __pyx_v_path, __pyx_v_version, __pyx_v_headers, __pyx_v_raw_headers, __pyx_v_should_close, __pyx_v_compression, __pyx_v_upgrade, __pyx_v_chunked, __pyx_v_url);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage___init__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_path, PyObject *__pyx_v_version, PyObject *__pyx_v_headers, PyObject *__pyx_v_raw_headers, PyObject *__pyx_v_should_close, PyObject *__pyx_v_compression, PyObject *__pyx_v_upgrade, PyObject *__pyx_v_chunked, PyObject *__pyx_v_url) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "aiohttp/_http_parser.pyx":124
+ * def __init__(self, method, path, version, headers, raw_headers,
+ * should_close, compression, upgrade, chunked, url):
+ * self.method = method # <<<<<<<<<<<<<<
+ * self.path = path
+ * self.version = version
+ */
+ if (!(likely(PyUnicode_CheckExact(__pyx_v_method))||((__pyx_v_method) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_method)->tp_name), 0))) __PYX_ERR(0, 124, __pyx_L1_error)
+ __pyx_t_1 = __pyx_v_method;
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_self->method);
+ __Pyx_DECREF(__pyx_v_self->method);
+ __pyx_v_self->method = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":125
+ * should_close, compression, upgrade, chunked, url):
+ * self.method = method
+ * self.path = path # <<<<<<<<<<<<<<
+ * self.version = version
+ * self.headers = headers
+ */
+ if (!(likely(PyUnicode_CheckExact(__pyx_v_path))||((__pyx_v_path) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_path)->tp_name), 0))) __PYX_ERR(0, 125, __pyx_L1_error)
+ __pyx_t_1 = __pyx_v_path;
+ __Pyx_INCREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_self->path);
+ __Pyx_DECREF(__pyx_v_self->path);
+ __pyx_v_self->path = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":126
+ * self.method = method
+ * self.path = path
+ * self.version = version # <<<<<<<<<<<<<<
+ * self.headers = headers
+ * self.raw_headers = raw_headers
+ */
+ __Pyx_INCREF(__pyx_v_version);
+ __Pyx_GIVEREF(__pyx_v_version);
+ __Pyx_GOTREF(__pyx_v_self->version);
+ __Pyx_DECREF(__pyx_v_self->version);
+ __pyx_v_self->version = __pyx_v_version;
+
+ /* "aiohttp/_http_parser.pyx":127
+ * self.path = path
+ * self.version = version
+ * self.headers = headers # <<<<<<<<<<<<<<
+ * self.raw_headers = raw_headers
+ * self.should_close = should_close
+ */
+ __Pyx_INCREF(__pyx_v_headers);
+ __Pyx_GIVEREF(__pyx_v_headers);
+ __Pyx_GOTREF(__pyx_v_self->headers);
+ __Pyx_DECREF(__pyx_v_self->headers);
+ __pyx_v_self->headers = __pyx_v_headers;
+
+ /* "aiohttp/_http_parser.pyx":128
+ * self.version = version
+ * self.headers = headers
+ * self.raw_headers = raw_headers # <<<<<<<<<<<<<<
+ * self.should_close = should_close
+ * self.compression = compression
+ */
+ __Pyx_INCREF(__pyx_v_raw_headers);
+ __Pyx_GIVEREF(__pyx_v_raw_headers);
+ __Pyx_GOTREF(__pyx_v_self->raw_headers);
+ __Pyx_DECREF(__pyx_v_self->raw_headers);
+ __pyx_v_self->raw_headers = __pyx_v_raw_headers;
+
+ /* "aiohttp/_http_parser.pyx":129
+ * self.headers = headers
+ * self.raw_headers = raw_headers
+ * self.should_close = should_close # <<<<<<<<<<<<<<
+ * self.compression = compression
+ * self.upgrade = upgrade
+ */
+ __Pyx_INCREF(__pyx_v_should_close);
+ __Pyx_GIVEREF(__pyx_v_should_close);
+ __Pyx_GOTREF(__pyx_v_self->should_close);
+ __Pyx_DECREF(__pyx_v_self->should_close);
+ __pyx_v_self->should_close = __pyx_v_should_close;
+
+ /* "aiohttp/_http_parser.pyx":130
+ * self.raw_headers = raw_headers
+ * self.should_close = should_close
+ * self.compression = compression # <<<<<<<<<<<<<<
+ * self.upgrade = upgrade
+ * self.chunked = chunked
+ */
+ __Pyx_INCREF(__pyx_v_compression);
+ __Pyx_GIVEREF(__pyx_v_compression);
+ __Pyx_GOTREF(__pyx_v_self->compression);
+ __Pyx_DECREF(__pyx_v_self->compression);
+ __pyx_v_self->compression = __pyx_v_compression;
+
+ /* "aiohttp/_http_parser.pyx":131
+ * self.should_close = should_close
+ * self.compression = compression
+ * self.upgrade = upgrade # <<<<<<<<<<<<<<
+ * self.chunked = chunked
+ * self.url = url
+ */
+ __Pyx_INCREF(__pyx_v_upgrade);
+ __Pyx_GIVEREF(__pyx_v_upgrade);
+ __Pyx_GOTREF(__pyx_v_self->upgrade);
+ __Pyx_DECREF(__pyx_v_self->upgrade);
+ __pyx_v_self->upgrade = __pyx_v_upgrade;
+
+ /* "aiohttp/_http_parser.pyx":132
+ * self.compression = compression
+ * self.upgrade = upgrade
+ * self.chunked = chunked # <<<<<<<<<<<<<<
+ * self.url = url
+ *
+ */
+ __Pyx_INCREF(__pyx_v_chunked);
+ __Pyx_GIVEREF(__pyx_v_chunked);
+ __Pyx_GOTREF(__pyx_v_self->chunked);
+ __Pyx_DECREF(__pyx_v_self->chunked);
+ __pyx_v_self->chunked = __pyx_v_chunked;
+
+ /* "aiohttp/_http_parser.pyx":133
+ * self.upgrade = upgrade
+ * self.chunked = chunked
+ * self.url = url # <<<<<<<<<<<<<<
+ *
+ * def __repr__(self):
+ */
+ __Pyx_INCREF(__pyx_v_url);
+ __Pyx_GIVEREF(__pyx_v_url);
+ __Pyx_GOTREF(__pyx_v_self->url);
+ __Pyx_DECREF(__pyx_v_self->url);
+ __pyx_v_self->url = __pyx_v_url;
+
+ /* "aiohttp/_http_parser.pyx":122
+ * cdef readonly object url # yarl.URL
+ *
+ * def __init__(self, method, path, version, headers, raw_headers, # <<<<<<<<<<<<<<
+ * should_close, compression, upgrade, chunked, url):
+ * self.method = method
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawRequestMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":135
+ * self.url = url
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * info = []
+ * info.append(("method", self.method))
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_3__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_3__repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_2__repr__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+static PyObject *__pyx_gb_7aiohttp_12_http_parser_17RawRequestMessage_8__repr___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
+
+/* "aiohttp/_http_parser.pyx":147
+ * info.append(("chunked", self.chunked))
+ * info.append(("url", self.url))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info) # <<<<<<<<<<<<<<
+ * return '<RawRequestMessage(' + sinfo + ')>'
+ *
+ */
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_8__repr___genexpr(PyObject *__pyx_self) {
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *__pyx_cur_scope;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("genexpr", 0);
+ __pyx_cur_scope = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *)__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr(__pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr, __pyx_empty_tuple, NULL);
+ if (unlikely(!__pyx_cur_scope)) {
+ __pyx_cur_scope = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *)Py_None);
+ __Pyx_INCREF(Py_None);
+ __PYX_ERR(0, 147, __pyx_L1_error)
+ } else {
+ __Pyx_GOTREF(__pyx_cur_scope);
+ }
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *) __pyx_self;
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
+ {
+ __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7aiohttp_12_http_parser_17RawRequestMessage_8__repr___2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_repr___locals_genexpr, __pyx_n_s_aiohttp__http_parser); if (unlikely(!gen)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_cur_scope);
+ __Pyx_RefNannyFinishContext();
+ return (PyObject *) gen;
+ }
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.RawRequestMessage.__repr__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_gb_7aiohttp_12_http_parser_17RawRequestMessage_8__repr___2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
+{
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *)__pyx_generator->closure);
+ PyObject *__pyx_r = NULL;
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *(*__pyx_t_7)(PyObject *);
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("genexpr", 0);
+ switch (__pyx_generator->resume_label) {
+ case 0: goto __pyx_L3_first_run;
+ default: /* CPython raises the right error here */
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __pyx_L3_first_run:;
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_r);
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_info)) { __Pyx_RaiseClosureNameError("info"); __PYX_ERR(0, 147, __pyx_L1_error) }
+ if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_info == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ __PYX_ERR(0, 147, __pyx_L1_error)
+ }
+ __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_info; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ for (;;) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 147, __pyx_L1_error)
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+ PyObject* sequence = __pyx_t_3;
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(0, 147, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
+ } else {
+ __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
+ }
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ #else
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
+ index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_4);
+ index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
+ __pyx_t_7 = NULL;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ goto __pyx_L7_unpacking_done;
+ __pyx_L6_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_7 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ __PYX_ERR(0, 147, __pyx_L1_error)
+ __pyx_L7_unpacking_done:;
+ }
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_name);
+ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_name, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
+ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_name, __pyx_kp_u_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = PyObject_Repr(__pyx_cur_scope->__pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ #if !CYTHON_USE_EXC_INFO_STACK
+ __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+ #endif
+ __pyx_generator->resume_label = -1;
+ __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":135
+ * self.url = url
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * info = []
+ * info.append(("method", self.method))
+ */
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_2__repr__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *__pyx_cur_scope;
+ PyObject *__pyx_v_sinfo = NULL;
+ PyObject *__pyx_gb_7aiohttp_12_http_parser_17RawRequestMessage_8__repr___2generator = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__repr__", 0);
+ __pyx_cur_scope = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *)__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct____repr__(__pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct____repr__, __pyx_empty_tuple, NULL);
+ if (unlikely(!__pyx_cur_scope)) {
+ __pyx_cur_scope = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *)Py_None);
+ __Pyx_INCREF(Py_None);
+ __PYX_ERR(0, 135, __pyx_L1_error)
+ } else {
+ __Pyx_GOTREF(__pyx_cur_scope);
+ }
+
+ /* "aiohttp/_http_parser.pyx":136
+ *
+ * def __repr__(self):
+ * info = [] # <<<<<<<<<<<<<<
+ * info.append(("method", self.method))
+ * info.append(("path", self.path))
+ */
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_info = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":137
+ * def __repr__(self):
+ * info = []
+ * info.append(("method", self.method)) # <<<<<<<<<<<<<<
+ * info.append(("path", self.path))
+ * info.append(("version", self.version))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_method);
+ __Pyx_GIVEREF(__pyx_n_u_method);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_method);
+ __Pyx_INCREF(__pyx_v_self->method);
+ __Pyx_GIVEREF(__pyx_v_self->method);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->method);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":138
+ * info = []
+ * info.append(("method", self.method))
+ * info.append(("path", self.path)) # <<<<<<<<<<<<<<
+ * info.append(("version", self.version))
+ * info.append(("headers", self.headers))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_path);
+ __Pyx_GIVEREF(__pyx_n_u_path);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_path);
+ __Pyx_INCREF(__pyx_v_self->path);
+ __Pyx_GIVEREF(__pyx_v_self->path);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->path);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 138, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":139
+ * info.append(("method", self.method))
+ * info.append(("path", self.path))
+ * info.append(("version", self.version)) # <<<<<<<<<<<<<<
+ * info.append(("headers", self.headers))
+ * info.append(("raw_headers", self.raw_headers))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_version);
+ __Pyx_GIVEREF(__pyx_n_u_version);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_version);
+ __Pyx_INCREF(__pyx_v_self->version);
+ __Pyx_GIVEREF(__pyx_v_self->version);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->version);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 139, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":140
+ * info.append(("path", self.path))
+ * info.append(("version", self.version))
+ * info.append(("headers", self.headers)) # <<<<<<<<<<<<<<
+ * info.append(("raw_headers", self.raw_headers))
+ * info.append(("should_close", self.should_close))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_headers);
+ __Pyx_GIVEREF(__pyx_n_u_headers);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_headers);
+ __Pyx_INCREF(__pyx_v_self->headers);
+ __Pyx_GIVEREF(__pyx_v_self->headers);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->headers);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 140, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":141
+ * info.append(("version", self.version))
+ * info.append(("headers", self.headers))
+ * info.append(("raw_headers", self.raw_headers)) # <<<<<<<<<<<<<<
+ * info.append(("should_close", self.should_close))
+ * info.append(("compression", self.compression))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_raw_headers);
+ __Pyx_GIVEREF(__pyx_n_u_raw_headers);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_raw_headers);
+ __Pyx_INCREF(__pyx_v_self->raw_headers);
+ __Pyx_GIVEREF(__pyx_v_self->raw_headers);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->raw_headers);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 141, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":142
+ * info.append(("headers", self.headers))
+ * info.append(("raw_headers", self.raw_headers))
+ * info.append(("should_close", self.should_close)) # <<<<<<<<<<<<<<
+ * info.append(("compression", self.compression))
+ * info.append(("upgrade", self.upgrade))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_should_close);
+ __Pyx_GIVEREF(__pyx_n_u_should_close);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_should_close);
+ __Pyx_INCREF(__pyx_v_self->should_close);
+ __Pyx_GIVEREF(__pyx_v_self->should_close);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->should_close);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 142, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":143
+ * info.append(("raw_headers", self.raw_headers))
+ * info.append(("should_close", self.should_close))
+ * info.append(("compression", self.compression)) # <<<<<<<<<<<<<<
+ * info.append(("upgrade", self.upgrade))
+ * info.append(("chunked", self.chunked))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_compression);
+ __Pyx_GIVEREF(__pyx_n_u_compression);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_compression);
+ __Pyx_INCREF(__pyx_v_self->compression);
+ __Pyx_GIVEREF(__pyx_v_self->compression);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->compression);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 143, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":144
+ * info.append(("should_close", self.should_close))
+ * info.append(("compression", self.compression))
+ * info.append(("upgrade", self.upgrade)) # <<<<<<<<<<<<<<
+ * info.append(("chunked", self.chunked))
+ * info.append(("url", self.url))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 144, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_upgrade);
+ __Pyx_GIVEREF(__pyx_n_u_upgrade);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_upgrade);
+ __Pyx_INCREF(__pyx_v_self->upgrade);
+ __Pyx_GIVEREF(__pyx_v_self->upgrade);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->upgrade);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 144, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":145
+ * info.append(("compression", self.compression))
+ * info.append(("upgrade", self.upgrade))
+ * info.append(("chunked", self.chunked)) # <<<<<<<<<<<<<<
+ * info.append(("url", self.url))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info)
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 145, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_chunked);
+ __Pyx_GIVEREF(__pyx_n_u_chunked);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_chunked);
+ __Pyx_INCREF(__pyx_v_self->chunked);
+ __Pyx_GIVEREF(__pyx_v_self->chunked);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->chunked);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":146
+ * info.append(("upgrade", self.upgrade))
+ * info.append(("chunked", self.chunked))
+ * info.append(("url", self.url)) # <<<<<<<<<<<<<<
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info)
+ * return '<RawRequestMessage(' + sinfo + ')>'
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_url);
+ __Pyx_GIVEREF(__pyx_n_u_url);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_url);
+ __Pyx_INCREF(__pyx_v_self->url);
+ __Pyx_GIVEREF(__pyx_v_self->url);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->url);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":147
+ * info.append(("chunked", self.chunked))
+ * info.append(("url", self.url))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info) # <<<<<<<<<<<<<<
+ * return '<RawRequestMessage(' + sinfo + ')>'
+ *
+ */
+ __pyx_t_1 = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_8__repr___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_sinfo = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":148
+ * info.append(("url", self.url))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info)
+ * return '<RawRequestMessage(' + sinfo + ')>' # <<<<<<<<<<<<<<
+ *
+ * def _replace(self, **dct):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyUnicode_ConcatSafe(__pyx_kp_u_RawRequestMessage, __pyx_v_sinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_t_1, __pyx_kp_u__3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":135
+ * self.url = url
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * info = []
+ * info.append(("method", self.method))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawRequestMessage.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_sinfo);
+ __Pyx_XDECREF(__pyx_gb_7aiohttp_12_http_parser_17RawRequestMessage_8__repr___2generator);
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":150
+ * return '<RawRequestMessage(' + sinfo + ')>'
+ *
+ * def _replace(self, **dct): # <<<<<<<<<<<<<<
+ * cdef RawRequestMessage ret
+ * ret = _new_request_message(self.method,
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_5_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_5_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_dct = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_replace (wrapper)", 0);
+ if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+ __Pyx_RaiseArgtupleInvalid("_replace", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
+ if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_replace", 1))) return NULL;
+ __pyx_v_dct = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_dct)) return NULL;
+ __Pyx_GOTREF(__pyx_v_dct);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_4_replace(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self), __pyx_v_dct);
+
+ /* function exit code */
+ __Pyx_XDECREF(__pyx_v_dct);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_4_replace(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self, PyObject *__pyx_v_dct) {
+ struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_ret = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ int __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_replace", 0);
+
+ /* "aiohttp/_http_parser.pyx":152
+ * def _replace(self, **dct):
+ * cdef RawRequestMessage ret
+ * ret = _new_request_message(self.method, # <<<<<<<<<<<<<<
+ * self.path,
+ * self.version,
+ */
+ __pyx_t_1 = __pyx_v_self->method;
+ __Pyx_INCREF(__pyx_t_1);
+
+ /* "aiohttp/_http_parser.pyx":153
+ * cdef RawRequestMessage ret
+ * ret = _new_request_message(self.method,
+ * self.path, # <<<<<<<<<<<<<<
+ * self.version,
+ * self.headers,
+ */
+ __pyx_t_2 = __pyx_v_self->path;
+ __Pyx_INCREF(__pyx_t_2);
+
+ /* "aiohttp/_http_parser.pyx":154
+ * ret = _new_request_message(self.method,
+ * self.path,
+ * self.version, # <<<<<<<<<<<<<<
+ * self.headers,
+ * self.raw_headers,
+ */
+ __pyx_t_3 = __pyx_v_self->version;
+ __Pyx_INCREF(__pyx_t_3);
+
+ /* "aiohttp/_http_parser.pyx":155
+ * self.path,
+ * self.version,
+ * self.headers, # <<<<<<<<<<<<<<
+ * self.raw_headers,
+ * self.should_close,
+ */
+ __pyx_t_4 = __pyx_v_self->headers;
+ __Pyx_INCREF(__pyx_t_4);
+
+ /* "aiohttp/_http_parser.pyx":156
+ * self.version,
+ * self.headers,
+ * self.raw_headers, # <<<<<<<<<<<<<<
+ * self.should_close,
+ * self.compression,
+ */
+ __pyx_t_5 = __pyx_v_self->raw_headers;
+ __Pyx_INCREF(__pyx_t_5);
+
+ /* "aiohttp/_http_parser.pyx":157
+ * self.headers,
+ * self.raw_headers,
+ * self.should_close, # <<<<<<<<<<<<<<
+ * self.compression,
+ * self.upgrade,
+ */
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_self->should_close); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":158
+ * self.raw_headers,
+ * self.should_close,
+ * self.compression, # <<<<<<<<<<<<<<
+ * self.upgrade,
+ * self.chunked,
+ */
+ __pyx_t_7 = __pyx_v_self->compression;
+ __Pyx_INCREF(__pyx_t_7);
+
+ /* "aiohttp/_http_parser.pyx":159
+ * self.should_close,
+ * self.compression,
+ * self.upgrade, # <<<<<<<<<<<<<<
+ * self.chunked,
+ * self.url)
+ */
+ __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_self->upgrade); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":160
+ * self.compression,
+ * self.upgrade,
+ * self.chunked, # <<<<<<<<<<<<<<
+ * self.url)
+ * if "method" in dct:
+ */
+ __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_self->chunked); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":161
+ * self.upgrade,
+ * self.chunked,
+ * self.url) # <<<<<<<<<<<<<<
+ * if "method" in dct:
+ * ret.method = dct["method"]
+ */
+ __pyx_t_10 = __pyx_v_self->url;
+ __Pyx_INCREF(__pyx_t_10);
+
+ /* "aiohttp/_http_parser.pyx":152
+ * def _replace(self, **dct):
+ * cdef RawRequestMessage ret
+ * ret = _new_request_message(self.method, # <<<<<<<<<<<<<<
+ * self.path,
+ * self.version,
+ */
+ __pyx_t_11 = __pyx_f_7aiohttp_12_http_parser__new_request_message(((PyObject*)__pyx_t_1), ((PyObject*)__pyx_t_2), __pyx_t_3, __pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ if (!(likely(((__pyx_t_11) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_11, __pyx_ptype_7aiohttp_12_http_parser_RawRequestMessage))))) __PYX_ERR(0, 152, __pyx_L1_error)
+ __pyx_v_ret = ((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_t_11);
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":162
+ * self.chunked,
+ * self.url)
+ * if "method" in dct: # <<<<<<<<<<<<<<
+ * ret.method = dct["method"]
+ * if "path" in dct:
+ */
+ __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_method, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __pyx_t_8 = (__pyx_t_9 != 0);
+ if (__pyx_t_8) {
+
+ /* "aiohttp/_http_parser.pyx":163
+ * self.url)
+ * if "method" in dct:
+ * ret.method = dct["method"] # <<<<<<<<<<<<<<
+ * if "path" in dct:
+ * ret.path = dct["path"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_method); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 163, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ if (!(likely(PyUnicode_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_11)->tp_name), 0))) __PYX_ERR(0, 163, __pyx_L1_error)
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->method);
+ __Pyx_DECREF(__pyx_v_ret->method);
+ __pyx_v_ret->method = ((PyObject*)__pyx_t_11);
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":162
+ * self.chunked,
+ * self.url)
+ * if "method" in dct: # <<<<<<<<<<<<<<
+ * ret.method = dct["method"]
+ * if "path" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":164
+ * if "method" in dct:
+ * ret.method = dct["method"]
+ * if "path" in dct: # <<<<<<<<<<<<<<
+ * ret.path = dct["path"]
+ * if "version" in dct:
+ */
+ __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_path, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __pyx_t_9 = (__pyx_t_8 != 0);
+ if (__pyx_t_9) {
+
+ /* "aiohttp/_http_parser.pyx":165
+ * ret.method = dct["method"]
+ * if "path" in dct:
+ * ret.path = dct["path"] # <<<<<<<<<<<<<<
+ * if "version" in dct:
+ * ret.version = dct["version"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_path); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ if (!(likely(PyUnicode_CheckExact(__pyx_t_11))||((__pyx_t_11) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_11)->tp_name), 0))) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->path);
+ __Pyx_DECREF(__pyx_v_ret->path);
+ __pyx_v_ret->path = ((PyObject*)__pyx_t_11);
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":164
+ * if "method" in dct:
+ * ret.method = dct["method"]
+ * if "path" in dct: # <<<<<<<<<<<<<<
+ * ret.path = dct["path"]
+ * if "version" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":166
+ * if "path" in dct:
+ * ret.path = dct["path"]
+ * if "version" in dct: # <<<<<<<<<<<<<<
+ * ret.version = dct["version"]
+ * if "headers" in dct:
+ */
+ __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_version, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 166, __pyx_L1_error)
+ __pyx_t_8 = (__pyx_t_9 != 0);
+ if (__pyx_t_8) {
+
+ /* "aiohttp/_http_parser.pyx":167
+ * ret.path = dct["path"]
+ * if "version" in dct:
+ * ret.version = dct["version"] # <<<<<<<<<<<<<<
+ * if "headers" in dct:
+ * ret.headers = dct["headers"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_version); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->version);
+ __Pyx_DECREF(__pyx_v_ret->version);
+ __pyx_v_ret->version = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":166
+ * if "path" in dct:
+ * ret.path = dct["path"]
+ * if "version" in dct: # <<<<<<<<<<<<<<
+ * ret.version = dct["version"]
+ * if "headers" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":168
+ * if "version" in dct:
+ * ret.version = dct["version"]
+ * if "headers" in dct: # <<<<<<<<<<<<<<
+ * ret.headers = dct["headers"]
+ * if "raw_headers" in dct:
+ */
+ __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_headers, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
+ __pyx_t_9 = (__pyx_t_8 != 0);
+ if (__pyx_t_9) {
+
+ /* "aiohttp/_http_parser.pyx":169
+ * ret.version = dct["version"]
+ * if "headers" in dct:
+ * ret.headers = dct["headers"] # <<<<<<<<<<<<<<
+ * if "raw_headers" in dct:
+ * ret.raw_headers = dct["raw_headers"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_headers); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 169, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->headers);
+ __Pyx_DECREF(__pyx_v_ret->headers);
+ __pyx_v_ret->headers = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":168
+ * if "version" in dct:
+ * ret.version = dct["version"]
+ * if "headers" in dct: # <<<<<<<<<<<<<<
+ * ret.headers = dct["headers"]
+ * if "raw_headers" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":170
+ * if "headers" in dct:
+ * ret.headers = dct["headers"]
+ * if "raw_headers" in dct: # <<<<<<<<<<<<<<
+ * ret.raw_headers = dct["raw_headers"]
+ * if "should_close" in dct:
+ */
+ __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_raw_headers, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 170, __pyx_L1_error)
+ __pyx_t_8 = (__pyx_t_9 != 0);
+ if (__pyx_t_8) {
+
+ /* "aiohttp/_http_parser.pyx":171
+ * ret.headers = dct["headers"]
+ * if "raw_headers" in dct:
+ * ret.raw_headers = dct["raw_headers"] # <<<<<<<<<<<<<<
+ * if "should_close" in dct:
+ * ret.should_close = dct["should_close"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_raw_headers); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 171, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->raw_headers);
+ __Pyx_DECREF(__pyx_v_ret->raw_headers);
+ __pyx_v_ret->raw_headers = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":170
+ * if "headers" in dct:
+ * ret.headers = dct["headers"]
+ * if "raw_headers" in dct: # <<<<<<<<<<<<<<
+ * ret.raw_headers = dct["raw_headers"]
+ * if "should_close" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":172
+ * if "raw_headers" in dct:
+ * ret.raw_headers = dct["raw_headers"]
+ * if "should_close" in dct: # <<<<<<<<<<<<<<
+ * ret.should_close = dct["should_close"]
+ * if "compression" in dct:
+ */
+ __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_should_close, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __pyx_t_9 = (__pyx_t_8 != 0);
+ if (__pyx_t_9) {
+
+ /* "aiohttp/_http_parser.pyx":173
+ * ret.raw_headers = dct["raw_headers"]
+ * if "should_close" in dct:
+ * ret.should_close = dct["should_close"] # <<<<<<<<<<<<<<
+ * if "compression" in dct:
+ * ret.compression = dct["compression"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_should_close); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->should_close);
+ __Pyx_DECREF(__pyx_v_ret->should_close);
+ __pyx_v_ret->should_close = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":172
+ * if "raw_headers" in dct:
+ * ret.raw_headers = dct["raw_headers"]
+ * if "should_close" in dct: # <<<<<<<<<<<<<<
+ * ret.should_close = dct["should_close"]
+ * if "compression" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":174
+ * if "should_close" in dct:
+ * ret.should_close = dct["should_close"]
+ * if "compression" in dct: # <<<<<<<<<<<<<<
+ * ret.compression = dct["compression"]
+ * if "upgrade" in dct:
+ */
+ __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_compression, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 174, __pyx_L1_error)
+ __pyx_t_8 = (__pyx_t_9 != 0);
+ if (__pyx_t_8) {
+
+ /* "aiohttp/_http_parser.pyx":175
+ * ret.should_close = dct["should_close"]
+ * if "compression" in dct:
+ * ret.compression = dct["compression"] # <<<<<<<<<<<<<<
+ * if "upgrade" in dct:
+ * ret.upgrade = dct["upgrade"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_compression); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->compression);
+ __Pyx_DECREF(__pyx_v_ret->compression);
+ __pyx_v_ret->compression = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":174
+ * if "should_close" in dct:
+ * ret.should_close = dct["should_close"]
+ * if "compression" in dct: # <<<<<<<<<<<<<<
+ * ret.compression = dct["compression"]
+ * if "upgrade" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":176
+ * if "compression" in dct:
+ * ret.compression = dct["compression"]
+ * if "upgrade" in dct: # <<<<<<<<<<<<<<
+ * ret.upgrade = dct["upgrade"]
+ * if "chunked" in dct:
+ */
+ __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_upgrade, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 176, __pyx_L1_error)
+ __pyx_t_9 = (__pyx_t_8 != 0);
+ if (__pyx_t_9) {
+
+ /* "aiohttp/_http_parser.pyx":177
+ * ret.compression = dct["compression"]
+ * if "upgrade" in dct:
+ * ret.upgrade = dct["upgrade"] # <<<<<<<<<<<<<<
+ * if "chunked" in dct:
+ * ret.chunked = dct["chunked"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_upgrade); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 177, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->upgrade);
+ __Pyx_DECREF(__pyx_v_ret->upgrade);
+ __pyx_v_ret->upgrade = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":176
+ * if "compression" in dct:
+ * ret.compression = dct["compression"]
+ * if "upgrade" in dct: # <<<<<<<<<<<<<<
+ * ret.upgrade = dct["upgrade"]
+ * if "chunked" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":178
+ * if "upgrade" in dct:
+ * ret.upgrade = dct["upgrade"]
+ * if "chunked" in dct: # <<<<<<<<<<<<<<
+ * ret.chunked = dct["chunked"]
+ * if "url" in dct:
+ */
+ __pyx_t_9 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_chunked, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __pyx_t_8 = (__pyx_t_9 != 0);
+ if (__pyx_t_8) {
+
+ /* "aiohttp/_http_parser.pyx":179
+ * ret.upgrade = dct["upgrade"]
+ * if "chunked" in dct:
+ * ret.chunked = dct["chunked"] # <<<<<<<<<<<<<<
+ * if "url" in dct:
+ * ret.url = dct["url"]
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_chunked); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->chunked);
+ __Pyx_DECREF(__pyx_v_ret->chunked);
+ __pyx_v_ret->chunked = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":178
+ * if "upgrade" in dct:
+ * ret.upgrade = dct["upgrade"]
+ * if "chunked" in dct: # <<<<<<<<<<<<<<
+ * ret.chunked = dct["chunked"]
+ * if "url" in dct:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":180
+ * if "chunked" in dct:
+ * ret.chunked = dct["chunked"]
+ * if "url" in dct: # <<<<<<<<<<<<<<
+ * ret.url = dct["url"]
+ * return ret
+ */
+ __pyx_t_8 = (__Pyx_PyDict_ContainsTF(__pyx_n_u_url, __pyx_v_dct, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 180, __pyx_L1_error)
+ __pyx_t_9 = (__pyx_t_8 != 0);
+ if (__pyx_t_9) {
+
+ /* "aiohttp/_http_parser.pyx":181
+ * ret.chunked = dct["chunked"]
+ * if "url" in dct:
+ * ret.url = dct["url"] # <<<<<<<<<<<<<<
+ * return ret
+ *
+ */
+ __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_dct, __pyx_n_u_url); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 181, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_11);
+ __Pyx_GOTREF(__pyx_v_ret->url);
+ __Pyx_DECREF(__pyx_v_ret->url);
+ __pyx_v_ret->url = __pyx_t_11;
+ __pyx_t_11 = 0;
+
+ /* "aiohttp/_http_parser.pyx":180
+ * if "chunked" in dct:
+ * ret.chunked = dct["chunked"]
+ * if "url" in dct: # <<<<<<<<<<<<<<
+ * ret.url = dct["url"]
+ * return ret
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":182
+ * if "url" in dct:
+ * ret.url = dct["url"]
+ * return ret # <<<<<<<<<<<<<<
+ *
+ * cdef _new_request_message(str method,
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_ret));
+ __pyx_r = ((PyObject *)__pyx_v_ret);
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":150
+ * return '<RawRequestMessage(' + sinfo + ')>'
+ *
+ * def _replace(self, **dct): # <<<<<<<<<<<<<<
+ * cdef RawRequestMessage ret
+ * ret = _new_request_message(self.method,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawRequestMessage._replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_ret);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":111
+ * @cython.freelist(DEFAULT_FREELIST_SIZE)
+ * cdef class RawRequestMessage:
+ * cdef readonly str method # <<<<<<<<<<<<<<
+ * cdef readonly str path
+ * cdef readonly object version # HttpVersion
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_6method_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_6method_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_6method___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_6method___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->method);
+ __pyx_r = __pyx_v_self->method;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":112
+ * cdef class RawRequestMessage:
+ * cdef readonly str method
+ * cdef readonly str path # <<<<<<<<<<<<<<
+ * cdef readonly object version # HttpVersion
+ * cdef readonly object headers # CIMultiDict
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_4path_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_4path_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_4path___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_4path___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->path);
+ __pyx_r = __pyx_v_self->path;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":113
+ * cdef readonly str method
+ * cdef readonly str path
+ * cdef readonly object version # HttpVersion # <<<<<<<<<<<<<<
+ * cdef readonly object headers # CIMultiDict
+ * cdef readonly object raw_headers # tuple
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7version_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7version_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7version___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7version___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->version);
+ __pyx_r = __pyx_v_self->version;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":114
+ * cdef readonly str path
+ * cdef readonly object version # HttpVersion
+ * cdef readonly object headers # CIMultiDict # <<<<<<<<<<<<<<
+ * cdef readonly object raw_headers # tuple
+ * cdef readonly object should_close
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7headers_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7headers_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7headers___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7headers___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->headers);
+ __pyx_r = __pyx_v_self->headers;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":115
+ * cdef readonly object version # HttpVersion
+ * cdef readonly object headers # CIMultiDict
+ * cdef readonly object raw_headers # tuple # <<<<<<<<<<<<<<
+ * cdef readonly object should_close
+ * cdef readonly object compression
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_11raw_headers_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_11raw_headers_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_11raw_headers___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_11raw_headers___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->raw_headers);
+ __pyx_r = __pyx_v_self->raw_headers;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":116
+ * cdef readonly object headers # CIMultiDict
+ * cdef readonly object raw_headers # tuple
+ * cdef readonly object should_close # <<<<<<<<<<<<<<
+ * cdef readonly object compression
+ * cdef readonly object upgrade
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_12should_close_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_12should_close_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_12should_close___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_12should_close___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->should_close);
+ __pyx_r = __pyx_v_self->should_close;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":117
+ * cdef readonly object raw_headers # tuple
+ * cdef readonly object should_close
+ * cdef readonly object compression # <<<<<<<<<<<<<<
+ * cdef readonly object upgrade
+ * cdef readonly object chunked
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_11compression_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_11compression_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_11compression___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_11compression___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->compression);
+ __pyx_r = __pyx_v_self->compression;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":118
+ * cdef readonly object should_close
+ * cdef readonly object compression
+ * cdef readonly object upgrade # <<<<<<<<<<<<<<
+ * cdef readonly object chunked
+ * cdef readonly object url # yarl.URL
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7upgrade_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7upgrade_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7upgrade___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7upgrade___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->upgrade);
+ __pyx_r = __pyx_v_self->upgrade;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":119
+ * cdef readonly object compression
+ * cdef readonly object upgrade
+ * cdef readonly object chunked # <<<<<<<<<<<<<<
+ * cdef readonly object url # yarl.URL
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7chunked_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7chunked_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7chunked___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_7chunked___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->chunked);
+ __pyx_r = __pyx_v_self->chunked;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":120
+ * cdef readonly object upgrade
+ * cdef readonly object chunked
+ * cdef readonly object url # yarl.URL # <<<<<<<<<<<<<<
+ *
+ * def __init__(self, method, path, version, headers, raw_headers,
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_3url_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_3url_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_3url___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_3url___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->url);
+ __pyx_r = __pyx_v_self->url;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef tuple state
+ * cdef object _dict
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_6__reduce_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_6__reduce_cython__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self) {
+ PyObject *__pyx_v_state = 0;
+ PyObject *__pyx_v__dict = 0;
+ int __pyx_v_use_setstate;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":5
+ * cdef object _dict
+ * cdef bint use_setstate
+ * state = (self.chunked, self.compression, self.headers, self.method, self.path, self.raw_headers, self.should_close, self.upgrade, self.url, self.version) # <<<<<<<<<<<<<<
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ */
+ __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_self->chunked);
+ __Pyx_GIVEREF(__pyx_v_self->chunked);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->chunked);
+ __Pyx_INCREF(__pyx_v_self->compression);
+ __Pyx_GIVEREF(__pyx_v_self->compression);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->compression);
+ __Pyx_INCREF(__pyx_v_self->headers);
+ __Pyx_GIVEREF(__pyx_v_self->headers);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_self->headers);
+ __Pyx_INCREF(__pyx_v_self->method);
+ __Pyx_GIVEREF(__pyx_v_self->method);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_self->method);
+ __Pyx_INCREF(__pyx_v_self->path);
+ __Pyx_GIVEREF(__pyx_v_self->path);
+ PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_v_self->path);
+ __Pyx_INCREF(__pyx_v_self->raw_headers);
+ __Pyx_GIVEREF(__pyx_v_self->raw_headers);
+ PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_v_self->raw_headers);
+ __Pyx_INCREF(__pyx_v_self->should_close);
+ __Pyx_GIVEREF(__pyx_v_self->should_close);
+ PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_v_self->should_close);
+ __Pyx_INCREF(__pyx_v_self->upgrade);
+ __Pyx_GIVEREF(__pyx_v_self->upgrade);
+ PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_v_self->upgrade);
+ __Pyx_INCREF(__pyx_v_self->url);
+ __Pyx_GIVEREF(__pyx_v_self->url);
+ PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_v_self->url);
+ __Pyx_INCREF(__pyx_v_self->version);
+ __Pyx_GIVEREF(__pyx_v_self->version);
+ PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_v_self->version);
+ __pyx_v_state = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":6
+ * cdef bint use_setstate
+ * state = (self.chunked, self.compression, self.headers, self.method, self.path, self.raw_headers, self.should_close, self.upgrade, self.url, self.version)
+ * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
+ * if _dict is not None:
+ * state += (_dict,)
+ */
+ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v__dict = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":7
+ * state = (self.chunked, self.compression, self.headers, self.method, self.path, self.raw_headers, self.should_close, self.upgrade, self.url, self.version)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ __pyx_t_2 = (__pyx_v__dict != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":8
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ * state += (_dict,) # <<<<<<<<<<<<<<
+ * use_setstate = True
+ * else:
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v__dict);
+ __Pyx_GIVEREF(__pyx_v__dict);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
+ __pyx_t_4 = 0;
+
+ /* "(tree fragment)":9
+ * if _dict is not None:
+ * state += (_dict,)
+ * use_setstate = True # <<<<<<<<<<<<<<
+ * else:
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.method is not None or self.path is not None or self.raw_headers is not None or self.should_close is not None or self.upgrade is not None or self.url is not None or self.version is not None
+ */
+ __pyx_v_use_setstate = 1;
+
+ /* "(tree fragment)":7
+ * state = (self.chunked, self.compression, self.headers, self.method, self.path, self.raw_headers, self.should_close, self.upgrade, self.url, self.version)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ goto __pyx_L3;
+ }
+
+ /* "(tree fragment)":11
+ * use_setstate = True
+ * else:
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.method is not None or self.path is not None or self.raw_headers is not None or self.should_close is not None or self.upgrade is not None or self.url is not None or self.version is not None # <<<<<<<<<<<<<<
+ * if use_setstate:
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, None), state
+ */
+ /*else*/ {
+ __pyx_t_2 = (__pyx_v_self->chunked != Py_None);
+ __pyx_t_5 = (__pyx_t_2 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->compression != Py_None);
+ __pyx_t_2 = (__pyx_t_5 != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = (__pyx_v_self->headers != Py_None);
+ __pyx_t_5 = (__pyx_t_2 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->method != ((PyObject*)Py_None));
+ __pyx_t_2 = (__pyx_t_5 != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = (__pyx_v_self->path != ((PyObject*)Py_None));
+ __pyx_t_5 = (__pyx_t_2 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->raw_headers != Py_None);
+ __pyx_t_2 = (__pyx_t_5 != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = (__pyx_v_self->should_close != Py_None);
+ __pyx_t_5 = (__pyx_t_2 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->upgrade != Py_None);
+ __pyx_t_2 = (__pyx_t_5 != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_3 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = (__pyx_v_self->url != Py_None);
+ __pyx_t_5 = (__pyx_t_2 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->version != Py_None);
+ __pyx_t_2 = (__pyx_t_5 != 0);
+ __pyx_t_3 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ __pyx_v_use_setstate = __pyx_t_3;
+ }
+ __pyx_L3:;
+
+ /* "(tree fragment)":12
+ * else:
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.method is not None or self.path is not None or self.raw_headers is not None or self.should_close is not None or self.upgrade is not None or self.url is not None or self.version is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, None), state
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_use_setstate != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":13
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.method is not None or self.path is not None or self.raw_headers is not None or self.should_close is not None or self.upgrade is not None or self.url is not None or self.version is not None
+ * if use_setstate:
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, None), state # <<<<<<<<<<<<<<
+ * else:
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, state)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_RawRequestMessage); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_21004882);
+ __Pyx_GIVEREF(__pyx_int_21004882);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_21004882);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
+ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":12
+ * else:
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.method is not None or self.path is not None or self.raw_headers is not None or self.should_close is not None or self.upgrade is not None or self.url is not None or self.version is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, None), state
+ * else:
+ */
+ }
+
+ /* "(tree fragment)":15
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, None), state
+ * else:
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, state) # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_RawRequestMessage__set_state(self, __pyx_state)
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_RawRequestMessage); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_21004882);
+ __Pyx_GIVEREF(__pyx_int_21004882);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_21004882);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef tuple state
+ * cdef object _dict
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawRequestMessage.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_state);
+ __Pyx_XDECREF(__pyx_v__dict);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":16
+ * else:
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_RawRequestMessage__set_state(self, __pyx_state)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_8__setstate_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17RawRequestMessage_8__setstate_cython__(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":17
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, state)
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_RawRequestMessage__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
+ */
+ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_7aiohttp_12_http_parser___pyx_unpickle_RawRequestMessage__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":16
+ * else:
+ * return __pyx_unpickle_RawRequestMessage, (type(self), 0x1408252, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_RawRequestMessage__set_state(self, __pyx_state)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawRequestMessage.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":184
+ * return ret
+ *
+ * cdef _new_request_message(str method, # <<<<<<<<<<<<<<
+ * str path,
+ * object version,
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser__new_request_message(PyObject *__pyx_v_method, PyObject *__pyx_v_path, PyObject *__pyx_v_version, PyObject *__pyx_v_headers, PyObject *__pyx_v_raw_headers, int __pyx_v_should_close, PyObject *__pyx_v_compression, int __pyx_v_upgrade, int __pyx_v_chunked, PyObject *__pyx_v_url) {
+ struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v_ret = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_new_request_message", 0);
+
+ /* "aiohttp/_http_parser.pyx":195
+ * object url):
+ * cdef RawRequestMessage ret
+ * ret = RawRequestMessage.__new__(RawRequestMessage) # <<<<<<<<<<<<<<
+ * ret.method = method
+ * ret.path = path
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_7aiohttp_12_http_parser_RawRequestMessage(((PyTypeObject *)__pyx_ptype_7aiohttp_12_http_parser_RawRequestMessage), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __pyx_v_ret = ((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":196
+ * cdef RawRequestMessage ret
+ * ret = RawRequestMessage.__new__(RawRequestMessage)
+ * ret.method = method # <<<<<<<<<<<<<<
+ * ret.path = path
+ * ret.version = version
+ */
+ __Pyx_INCREF(__pyx_v_method);
+ __Pyx_GIVEREF(__pyx_v_method);
+ __Pyx_GOTREF(__pyx_v_ret->method);
+ __Pyx_DECREF(__pyx_v_ret->method);
+ __pyx_v_ret->method = __pyx_v_method;
+
+ /* "aiohttp/_http_parser.pyx":197
+ * ret = RawRequestMessage.__new__(RawRequestMessage)
+ * ret.method = method
+ * ret.path = path # <<<<<<<<<<<<<<
+ * ret.version = version
+ * ret.headers = headers
+ */
+ __Pyx_INCREF(__pyx_v_path);
+ __Pyx_GIVEREF(__pyx_v_path);
+ __Pyx_GOTREF(__pyx_v_ret->path);
+ __Pyx_DECREF(__pyx_v_ret->path);
+ __pyx_v_ret->path = __pyx_v_path;
+
+ /* "aiohttp/_http_parser.pyx":198
+ * ret.method = method
+ * ret.path = path
+ * ret.version = version # <<<<<<<<<<<<<<
+ * ret.headers = headers
+ * ret.raw_headers = raw_headers
+ */
+ __Pyx_INCREF(__pyx_v_version);
+ __Pyx_GIVEREF(__pyx_v_version);
+ __Pyx_GOTREF(__pyx_v_ret->version);
+ __Pyx_DECREF(__pyx_v_ret->version);
+ __pyx_v_ret->version = __pyx_v_version;
+
+ /* "aiohttp/_http_parser.pyx":199
+ * ret.path = path
+ * ret.version = version
+ * ret.headers = headers # <<<<<<<<<<<<<<
+ * ret.raw_headers = raw_headers
+ * ret.should_close = should_close
+ */
+ __Pyx_INCREF(__pyx_v_headers);
+ __Pyx_GIVEREF(__pyx_v_headers);
+ __Pyx_GOTREF(__pyx_v_ret->headers);
+ __Pyx_DECREF(__pyx_v_ret->headers);
+ __pyx_v_ret->headers = __pyx_v_headers;
+
+ /* "aiohttp/_http_parser.pyx":200
+ * ret.version = version
+ * ret.headers = headers
+ * ret.raw_headers = raw_headers # <<<<<<<<<<<<<<
+ * ret.should_close = should_close
+ * ret.compression = compression
+ */
+ __Pyx_INCREF(__pyx_v_raw_headers);
+ __Pyx_GIVEREF(__pyx_v_raw_headers);
+ __Pyx_GOTREF(__pyx_v_ret->raw_headers);
+ __Pyx_DECREF(__pyx_v_ret->raw_headers);
+ __pyx_v_ret->raw_headers = __pyx_v_raw_headers;
+
+ /* "aiohttp/_http_parser.pyx":201
+ * ret.headers = headers
+ * ret.raw_headers = raw_headers
+ * ret.should_close = should_close # <<<<<<<<<<<<<<
+ * ret.compression = compression
+ * ret.upgrade = upgrade
+ */
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_should_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_ret->should_close);
+ __Pyx_DECREF(__pyx_v_ret->should_close);
+ __pyx_v_ret->should_close = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":202
+ * ret.raw_headers = raw_headers
+ * ret.should_close = should_close
+ * ret.compression = compression # <<<<<<<<<<<<<<
+ * ret.upgrade = upgrade
+ * ret.chunked = chunked
+ */
+ __Pyx_INCREF(__pyx_v_compression);
+ __Pyx_GIVEREF(__pyx_v_compression);
+ __Pyx_GOTREF(__pyx_v_ret->compression);
+ __Pyx_DECREF(__pyx_v_ret->compression);
+ __pyx_v_ret->compression = __pyx_v_compression;
+
+ /* "aiohttp/_http_parser.pyx":203
+ * ret.should_close = should_close
+ * ret.compression = compression
+ * ret.upgrade = upgrade # <<<<<<<<<<<<<<
+ * ret.chunked = chunked
+ * ret.url = url
+ */
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_upgrade); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_ret->upgrade);
+ __Pyx_DECREF(__pyx_v_ret->upgrade);
+ __pyx_v_ret->upgrade = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":204
+ * ret.compression = compression
+ * ret.upgrade = upgrade
+ * ret.chunked = chunked # <<<<<<<<<<<<<<
+ * ret.url = url
+ * return ret
+ */
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_chunked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_ret->chunked);
+ __Pyx_DECREF(__pyx_v_ret->chunked);
+ __pyx_v_ret->chunked = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":205
+ * ret.upgrade = upgrade
+ * ret.chunked = chunked
+ * ret.url = url # <<<<<<<<<<<<<<
+ * return ret
+ *
+ */
+ __Pyx_INCREF(__pyx_v_url);
+ __Pyx_GIVEREF(__pyx_v_url);
+ __Pyx_GOTREF(__pyx_v_ret->url);
+ __Pyx_DECREF(__pyx_v_ret->url);
+ __pyx_v_ret->url = __pyx_v_url;
+
+ /* "aiohttp/_http_parser.pyx":206
+ * ret.chunked = chunked
+ * ret.url = url
+ * return ret # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_ret));
+ __pyx_r = ((PyObject *)__pyx_v_ret);
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":184
+ * return ret
+ *
+ * cdef _new_request_message(str method, # <<<<<<<<<<<<<<
+ * str path,
+ * object version,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser._new_request_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_ret);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":221
+ * cdef readonly object chunked
+ *
+ * def __init__(self, version, code, reason, headers, raw_headers, # <<<<<<<<<<<<<<
+ * should_close, compression, upgrade, chunked):
+ * self.version = version
+ */
+
+/* Python wrapper */
+static int __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_version = 0;
+ PyObject *__pyx_v_code = 0;
+ PyObject *__pyx_v_reason = 0;
+ PyObject *__pyx_v_headers = 0;
+ PyObject *__pyx_v_raw_headers = 0;
+ PyObject *__pyx_v_should_close = 0;
+ PyObject *__pyx_v_compression = 0;
+ PyObject *__pyx_v_upgrade = 0;
+ PyObject *__pyx_v_chunked = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_version,&__pyx_n_s_code,&__pyx_n_s_reason,&__pyx_n_s_headers,&__pyx_n_s_raw_headers,&__pyx_n_s_should_close,&__pyx_n_s_compression,&__pyx_n_s_upgrade,&__pyx_n_s_chunked,0};
+ PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ CYTHON_FALLTHROUGH;
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ CYTHON_FALLTHROUGH;
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ CYTHON_FALLTHROUGH;
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_version)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_code)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 1); __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_reason)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 2); __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_headers)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 3); __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_raw_headers)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 4); __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 5:
+ if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_should_close)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 5); __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 6:
+ if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_compression)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 6); __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 7:
+ if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_upgrade)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 7); __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 8:
+ if (likely((values[8] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_chunked)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, 8); __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 221, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ }
+ __pyx_v_version = values[0];
+ __pyx_v_code = values[1];
+ __pyx_v_reason = values[2];
+ __pyx_v_headers = values[3];
+ __pyx_v_raw_headers = values[4];
+ __pyx_v_should_close = values[5];
+ __pyx_v_compression = values[6];
+ __pyx_v_upgrade = values[7];
+ __pyx_v_chunked = values[8];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 221, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.RawResponseMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage___init__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self), __pyx_v_version, __pyx_v_code, __pyx_v_reason, __pyx_v_headers, __pyx_v_raw_headers, __pyx_v_should_close, __pyx_v_compression, __pyx_v_upgrade, __pyx_v_chunked);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage___init__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self, PyObject *__pyx_v_version, PyObject *__pyx_v_code, PyObject *__pyx_v_reason, PyObject *__pyx_v_headers, PyObject *__pyx_v_raw_headers, PyObject *__pyx_v_should_close, PyObject *__pyx_v_compression, PyObject *__pyx_v_upgrade, PyObject *__pyx_v_chunked) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "aiohttp/_http_parser.pyx":223
+ * def __init__(self, version, code, reason, headers, raw_headers,
+ * should_close, compression, upgrade, chunked):
+ * self.version = version # <<<<<<<<<<<<<<
+ * self.code = code
+ * self.reason = reason
+ */
+ __Pyx_INCREF(__pyx_v_version);
+ __Pyx_GIVEREF(__pyx_v_version);
+ __Pyx_GOTREF(__pyx_v_self->version);
+ __Pyx_DECREF(__pyx_v_self->version);
+ __pyx_v_self->version = __pyx_v_version;
+
+ /* "aiohttp/_http_parser.pyx":224
+ * should_close, compression, upgrade, chunked):
+ * self.version = version
+ * self.code = code # <<<<<<<<<<<<<<
+ * self.reason = reason
+ * self.headers = headers
+ */
+ __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_code); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 224, __pyx_L1_error)
+ __pyx_v_self->code = __pyx_t_1;
+
+ /* "aiohttp/_http_parser.pyx":225
+ * self.version = version
+ * self.code = code
+ * self.reason = reason # <<<<<<<<<<<<<<
+ * self.headers = headers
+ * self.raw_headers = raw_headers
+ */
+ if (!(likely(PyUnicode_CheckExact(__pyx_v_reason))||((__pyx_v_reason) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_reason)->tp_name), 0))) __PYX_ERR(0, 225, __pyx_L1_error)
+ __pyx_t_2 = __pyx_v_reason;
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_self->reason);
+ __Pyx_DECREF(__pyx_v_self->reason);
+ __pyx_v_self->reason = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":226
+ * self.code = code
+ * self.reason = reason
+ * self.headers = headers # <<<<<<<<<<<<<<
+ * self.raw_headers = raw_headers
+ * self.should_close = should_close
+ */
+ __Pyx_INCREF(__pyx_v_headers);
+ __Pyx_GIVEREF(__pyx_v_headers);
+ __Pyx_GOTREF(__pyx_v_self->headers);
+ __Pyx_DECREF(__pyx_v_self->headers);
+ __pyx_v_self->headers = __pyx_v_headers;
+
+ /* "aiohttp/_http_parser.pyx":227
+ * self.reason = reason
+ * self.headers = headers
+ * self.raw_headers = raw_headers # <<<<<<<<<<<<<<
+ * self.should_close = should_close
+ * self.compression = compression
+ */
+ __Pyx_INCREF(__pyx_v_raw_headers);
+ __Pyx_GIVEREF(__pyx_v_raw_headers);
+ __Pyx_GOTREF(__pyx_v_self->raw_headers);
+ __Pyx_DECREF(__pyx_v_self->raw_headers);
+ __pyx_v_self->raw_headers = __pyx_v_raw_headers;
+
+ /* "aiohttp/_http_parser.pyx":228
+ * self.headers = headers
+ * self.raw_headers = raw_headers
+ * self.should_close = should_close # <<<<<<<<<<<<<<
+ * self.compression = compression
+ * self.upgrade = upgrade
+ */
+ __Pyx_INCREF(__pyx_v_should_close);
+ __Pyx_GIVEREF(__pyx_v_should_close);
+ __Pyx_GOTREF(__pyx_v_self->should_close);
+ __Pyx_DECREF(__pyx_v_self->should_close);
+ __pyx_v_self->should_close = __pyx_v_should_close;
+
+ /* "aiohttp/_http_parser.pyx":229
+ * self.raw_headers = raw_headers
+ * self.should_close = should_close
+ * self.compression = compression # <<<<<<<<<<<<<<
+ * self.upgrade = upgrade
+ * self.chunked = chunked
+ */
+ __Pyx_INCREF(__pyx_v_compression);
+ __Pyx_GIVEREF(__pyx_v_compression);
+ __Pyx_GOTREF(__pyx_v_self->compression);
+ __Pyx_DECREF(__pyx_v_self->compression);
+ __pyx_v_self->compression = __pyx_v_compression;
+
+ /* "aiohttp/_http_parser.pyx":230
+ * self.should_close = should_close
+ * self.compression = compression
+ * self.upgrade = upgrade # <<<<<<<<<<<<<<
+ * self.chunked = chunked
+ *
+ */
+ __Pyx_INCREF(__pyx_v_upgrade);
+ __Pyx_GIVEREF(__pyx_v_upgrade);
+ __Pyx_GOTREF(__pyx_v_self->upgrade);
+ __Pyx_DECREF(__pyx_v_self->upgrade);
+ __pyx_v_self->upgrade = __pyx_v_upgrade;
+
+ /* "aiohttp/_http_parser.pyx":231
+ * self.compression = compression
+ * self.upgrade = upgrade
+ * self.chunked = chunked # <<<<<<<<<<<<<<
+ *
+ * def __repr__(self):
+ */
+ __Pyx_INCREF(__pyx_v_chunked);
+ __Pyx_GIVEREF(__pyx_v_chunked);
+ __Pyx_GOTREF(__pyx_v_self->chunked);
+ __Pyx_DECREF(__pyx_v_self->chunked);
+ __pyx_v_self->chunked = __pyx_v_chunked;
+
+ /* "aiohttp/_http_parser.pyx":221
+ * cdef readonly object chunked
+ *
+ * def __init__(self, version, code, reason, headers, raw_headers, # <<<<<<<<<<<<<<
+ * should_close, compression, upgrade, chunked):
+ * self.version = version
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawResponseMessage.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":233
+ * self.chunked = chunked
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * info = []
+ * info.append(("version", self.version))
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_3__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_3__repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_2__repr__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+static PyObject *__pyx_gb_7aiohttp_12_http_parser_18RawResponseMessage_8__repr___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
+
+/* "aiohttp/_http_parser.pyx":244
+ * info.append(("upgrade", self.upgrade))
+ * info.append(("chunked", self.chunked))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info) # <<<<<<<<<<<<<<
+ * return '<RawResponseMessage(' + sinfo + ')>'
+ *
+ */
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_8__repr___genexpr(PyObject *__pyx_self) {
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("genexpr", 0);
+ __pyx_cur_scope = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *)__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr(__pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
+ if (unlikely(!__pyx_cur_scope)) {
+ __pyx_cur_scope = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *)Py_None);
+ __Pyx_INCREF(Py_None);
+ __PYX_ERR(0, 244, __pyx_L1_error)
+ } else {
+ __Pyx_GOTREF(__pyx_cur_scope);
+ }
+ __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *) __pyx_self;
+ __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
+ __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
+ {
+ __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7aiohttp_12_http_parser_18RawResponseMessage_8__repr___2generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_repr___locals_genexpr, __pyx_n_s_aiohttp__http_parser); if (unlikely(!gen)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_cur_scope);
+ __Pyx_RefNannyFinishContext();
+ return (PyObject *) gen;
+ }
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.RawResponseMessage.__repr__.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_gb_7aiohttp_12_http_parser_18RawResponseMessage_8__repr___2generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
+{
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
+ PyObject *__pyx_r = NULL;
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *(*__pyx_t_7)(PyObject *);
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("genexpr", 0);
+ switch (__pyx_generator->resume_label) {
+ case 0: goto __pyx_L3_first_run;
+ default: /* CPython raises the right error here */
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ }
+ __pyx_L3_first_run:;
+ if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __pyx_r = PyList_New(0); if (unlikely(!__pyx_r)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_r);
+ if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_info)) { __Pyx_RaiseClosureNameError("info"); __PYX_ERR(0, 244, __pyx_L1_error) }
+ if (unlikely(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_info == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ __PYX_ERR(0, 244, __pyx_L1_error)
+ }
+ __pyx_t_1 = __pyx_cur_scope->__pyx_outer_scope->__pyx_v_info; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ for (;;) {
+ if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 244, __pyx_L1_error)
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
+ PyObject* sequence = __pyx_t_3;
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(0, 244, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ if (likely(PyTuple_CheckExact(sequence))) {
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
+ } else {
+ __pyx_t_4 = PyList_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyList_GET_ITEM(sequence, 1);
+ }
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ #else
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ Py_ssize_t index = -1;
+ __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
+ index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_4);
+ index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
+ __Pyx_GOTREF(__pyx_t_5);
+ if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
+ __pyx_t_7 = NULL;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ goto __pyx_L7_unpacking_done;
+ __pyx_L6_unpacking_failed:;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_7 = NULL;
+ if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
+ __PYX_ERR(0, 244, __pyx_L1_error)
+ __pyx_L7_unpacking_done:;
+ }
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_name);
+ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_name, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_4);
+ __pyx_t_4 = 0;
+ __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
+ __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_3 = PyNumber_Add(__pyx_cur_scope->__pyx_v_name, __pyx_kp_u_); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = PyObject_Repr(__pyx_cur_scope->__pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(__Pyx_ListComp_Append(__pyx_r, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ #if !CYTHON_USE_EXC_INFO_STACK
+ __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
+ #endif
+ __pyx_generator->resume_label = -1;
+ __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":233
+ * self.chunked = chunked
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * info = []
+ * info.append(("version", self.version))
+ */
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_2__repr__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *__pyx_cur_scope;
+ PyObject *__pyx_v_sinfo = NULL;
+ PyObject *__pyx_gb_7aiohttp_12_http_parser_18RawResponseMessage_8__repr___2generator1 = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__repr__", 0);
+ __pyx_cur_scope = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *)__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__(__pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__, __pyx_empty_tuple, NULL);
+ if (unlikely(!__pyx_cur_scope)) {
+ __pyx_cur_scope = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *)Py_None);
+ __Pyx_INCREF(Py_None);
+ __PYX_ERR(0, 233, __pyx_L1_error)
+ } else {
+ __Pyx_GOTREF(__pyx_cur_scope);
+ }
+
+ /* "aiohttp/_http_parser.pyx":234
+ *
+ * def __repr__(self):
+ * info = [] # <<<<<<<<<<<<<<
+ * info.append(("version", self.version))
+ * info.append(("code", self.code))
+ */
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_cur_scope->__pyx_v_info = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":235
+ * def __repr__(self):
+ * info = []
+ * info.append(("version", self.version)) # <<<<<<<<<<<<<<
+ * info.append(("code", self.code))
+ * info.append(("reason", self.reason))
+ */
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_u_version);
+ __Pyx_GIVEREF(__pyx_n_u_version);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_version);
+ __Pyx_INCREF(__pyx_v_self->version);
+ __Pyx_GIVEREF(__pyx_v_self->version);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->version);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_1); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 235, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":236
+ * info = []
+ * info.append(("version", self.version))
+ * info.append(("code", self.code)) # <<<<<<<<<<<<<<
+ * info.append(("reason", self.reason))
+ * info.append(("headers", self.headers))
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 236, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_u_code);
+ __Pyx_GIVEREF(__pyx_n_u_code);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_code);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 236, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":237
+ * info.append(("version", self.version))
+ * info.append(("code", self.code))
+ * info.append(("reason", self.reason)) # <<<<<<<<<<<<<<
+ * info.append(("headers", self.headers))
+ * info.append(("raw_headers", self.raw_headers))
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 237, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_u_reason);
+ __Pyx_GIVEREF(__pyx_n_u_reason);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_reason);
+ __Pyx_INCREF(__pyx_v_self->reason);
+ __Pyx_GIVEREF(__pyx_v_self->reason);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->reason);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 237, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":238
+ * info.append(("code", self.code))
+ * info.append(("reason", self.reason))
+ * info.append(("headers", self.headers)) # <<<<<<<<<<<<<<
+ * info.append(("raw_headers", self.raw_headers))
+ * info.append(("should_close", self.should_close))
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_u_headers);
+ __Pyx_GIVEREF(__pyx_n_u_headers);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_headers);
+ __Pyx_INCREF(__pyx_v_self->headers);
+ __Pyx_GIVEREF(__pyx_v_self->headers);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->headers);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 238, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":239
+ * info.append(("reason", self.reason))
+ * info.append(("headers", self.headers))
+ * info.append(("raw_headers", self.raw_headers)) # <<<<<<<<<<<<<<
+ * info.append(("should_close", self.should_close))
+ * info.append(("compression", self.compression))
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 239, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_u_raw_headers);
+ __Pyx_GIVEREF(__pyx_n_u_raw_headers);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_raw_headers);
+ __Pyx_INCREF(__pyx_v_self->raw_headers);
+ __Pyx_GIVEREF(__pyx_v_self->raw_headers);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->raw_headers);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 239, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":240
+ * info.append(("headers", self.headers))
+ * info.append(("raw_headers", self.raw_headers))
+ * info.append(("should_close", self.should_close)) # <<<<<<<<<<<<<<
+ * info.append(("compression", self.compression))
+ * info.append(("upgrade", self.upgrade))
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_u_should_close);
+ __Pyx_GIVEREF(__pyx_n_u_should_close);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_should_close);
+ __Pyx_INCREF(__pyx_v_self->should_close);
+ __Pyx_GIVEREF(__pyx_v_self->should_close);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->should_close);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 240, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":241
+ * info.append(("raw_headers", self.raw_headers))
+ * info.append(("should_close", self.should_close))
+ * info.append(("compression", self.compression)) # <<<<<<<<<<<<<<
+ * info.append(("upgrade", self.upgrade))
+ * info.append(("chunked", self.chunked))
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_u_compression);
+ __Pyx_GIVEREF(__pyx_n_u_compression);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_compression);
+ __Pyx_INCREF(__pyx_v_self->compression);
+ __Pyx_GIVEREF(__pyx_v_self->compression);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->compression);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 241, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":242
+ * info.append(("should_close", self.should_close))
+ * info.append(("compression", self.compression))
+ * info.append(("upgrade", self.upgrade)) # <<<<<<<<<<<<<<
+ * info.append(("chunked", self.chunked))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info)
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_u_upgrade);
+ __Pyx_GIVEREF(__pyx_n_u_upgrade);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_upgrade);
+ __Pyx_INCREF(__pyx_v_self->upgrade);
+ __Pyx_GIVEREF(__pyx_v_self->upgrade);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->upgrade);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 242, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":243
+ * info.append(("compression", self.compression))
+ * info.append(("upgrade", self.upgrade))
+ * info.append(("chunked", self.chunked)) # <<<<<<<<<<<<<<
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info)
+ * return '<RawResponseMessage(' + sinfo + ')>'
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 243, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_n_u_chunked);
+ __Pyx_GIVEREF(__pyx_n_u_chunked);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_u_chunked);
+ __Pyx_INCREF(__pyx_v_self->chunked);
+ __Pyx_GIVEREF(__pyx_v_self->chunked);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->chunked);
+ __pyx_t_2 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_info, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 243, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":244
+ * info.append(("upgrade", self.upgrade))
+ * info.append(("chunked", self.chunked))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info) # <<<<<<<<<<<<<<
+ * return '<RawResponseMessage(' + sinfo + ')>'
+ *
+ */
+ __pyx_t_3 = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_8__repr___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_Generator_Next(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyUnicode_Join(__pyx_kp_u__2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 244, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_sinfo = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":245
+ * info.append(("chunked", self.chunked))
+ * sinfo = ', '.join(name + '=' + repr(val) for name, val in info)
+ * return '<RawResponseMessage(' + sinfo + ')>' # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_PyUnicode_ConcatSafe(__pyx_kp_u_RawResponseMessage, __pyx_v_sinfo); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_3, __pyx_kp_u__3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":233
+ * self.chunked = chunked
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * info = []
+ * info.append(("version", self.version))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawResponseMessage.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_sinfo);
+ __Pyx_XDECREF(__pyx_gb_7aiohttp_12_http_parser_18RawResponseMessage_8__repr___2generator1);
+ __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":211
+ * @cython.freelist(DEFAULT_FREELIST_SIZE)
+ * cdef class RawResponseMessage:
+ * cdef readonly object version # HttpVersion # <<<<<<<<<<<<<<
+ * cdef readonly int code
+ * cdef readonly str reason
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7version_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7version_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7version___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7version___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->version);
+ __pyx_r = __pyx_v_self->version;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":212
+ * cdef class RawResponseMessage:
+ * cdef readonly object version # HttpVersion
+ * cdef readonly int code # <<<<<<<<<<<<<<
+ * cdef readonly str reason
+ * cdef readonly object headers # CIMultiDict
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_4code_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_4code_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_4code___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_4code___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->code); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 212, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawResponseMessage.code.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":213
+ * cdef readonly object version # HttpVersion
+ * cdef readonly int code
+ * cdef readonly str reason # <<<<<<<<<<<<<<
+ * cdef readonly object headers # CIMultiDict
+ * cdef readonly object raw_headers # tuple
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_6reason_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_6reason_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_6reason___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_6reason___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->reason);
+ __pyx_r = __pyx_v_self->reason;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":214
+ * cdef readonly int code
+ * cdef readonly str reason
+ * cdef readonly object headers # CIMultiDict # <<<<<<<<<<<<<<
+ * cdef readonly object raw_headers # tuple
+ * cdef readonly object should_close
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7headers_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7headers_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7headers___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7headers___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->headers);
+ __pyx_r = __pyx_v_self->headers;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":215
+ * cdef readonly str reason
+ * cdef readonly object headers # CIMultiDict
+ * cdef readonly object raw_headers # tuple # <<<<<<<<<<<<<<
+ * cdef readonly object should_close
+ * cdef readonly object compression
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_11raw_headers_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_11raw_headers_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_11raw_headers___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_11raw_headers___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->raw_headers);
+ __pyx_r = __pyx_v_self->raw_headers;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":216
+ * cdef readonly object headers # CIMultiDict
+ * cdef readonly object raw_headers # tuple
+ * cdef readonly object should_close # <<<<<<<<<<<<<<
+ * cdef readonly object compression
+ * cdef readonly object upgrade
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_12should_close_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_12should_close_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_12should_close___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_12should_close___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->should_close);
+ __pyx_r = __pyx_v_self->should_close;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":217
+ * cdef readonly object raw_headers # tuple
+ * cdef readonly object should_close
+ * cdef readonly object compression # <<<<<<<<<<<<<<
+ * cdef readonly object upgrade
+ * cdef readonly object chunked
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_11compression_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_11compression_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_11compression___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_11compression___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->compression);
+ __pyx_r = __pyx_v_self->compression;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":218
+ * cdef readonly object should_close
+ * cdef readonly object compression
+ * cdef readonly object upgrade # <<<<<<<<<<<<<<
+ * cdef readonly object chunked
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7upgrade_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7upgrade_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7upgrade___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7upgrade___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->upgrade);
+ __pyx_r = __pyx_v_self->upgrade;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":219
+ * cdef readonly object compression
+ * cdef readonly object upgrade
+ * cdef readonly object chunked # <<<<<<<<<<<<<<
+ *
+ * def __init__(self, version, code, reason, headers, raw_headers,
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7chunked_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7chunked_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7chunked___get__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_7chunked___get__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->chunked);
+ __pyx_r = __pyx_v_self->chunked;
+ goto __pyx_L0;
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef tuple state
+ * cdef object _dict
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_4__reduce_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_4__reduce_cython__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self) {
+ PyObject *__pyx_v_state = 0;
+ PyObject *__pyx_v__dict = 0;
+ int __pyx_v_use_setstate;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":5
+ * cdef object _dict
+ * cdef bint use_setstate
+ * state = (self.chunked, self.code, self.compression, self.headers, self.raw_headers, self.reason, self.should_close, self.upgrade, self.version) # <<<<<<<<<<<<<<
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->code); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_self->chunked);
+ __Pyx_GIVEREF(__pyx_v_self->chunked);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->chunked);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_self->compression);
+ __Pyx_GIVEREF(__pyx_v_self->compression);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_self->compression);
+ __Pyx_INCREF(__pyx_v_self->headers);
+ __Pyx_GIVEREF(__pyx_v_self->headers);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_self->headers);
+ __Pyx_INCREF(__pyx_v_self->raw_headers);
+ __Pyx_GIVEREF(__pyx_v_self->raw_headers);
+ PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_self->raw_headers);
+ __Pyx_INCREF(__pyx_v_self->reason);
+ __Pyx_GIVEREF(__pyx_v_self->reason);
+ PyTuple_SET_ITEM(__pyx_t_2, 5, __pyx_v_self->reason);
+ __Pyx_INCREF(__pyx_v_self->should_close);
+ __Pyx_GIVEREF(__pyx_v_self->should_close);
+ PyTuple_SET_ITEM(__pyx_t_2, 6, __pyx_v_self->should_close);
+ __Pyx_INCREF(__pyx_v_self->upgrade);
+ __Pyx_GIVEREF(__pyx_v_self->upgrade);
+ PyTuple_SET_ITEM(__pyx_t_2, 7, __pyx_v_self->upgrade);
+ __Pyx_INCREF(__pyx_v_self->version);
+ __Pyx_GIVEREF(__pyx_v_self->version);
+ PyTuple_SET_ITEM(__pyx_t_2, 8, __pyx_v_self->version);
+ __pyx_t_1 = 0;
+ __pyx_v_state = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "(tree fragment)":6
+ * cdef bint use_setstate
+ * state = (self.chunked, self.code, self.compression, self.headers, self.raw_headers, self.reason, self.should_close, self.upgrade, self.version)
+ * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
+ * if _dict is not None:
+ * state += (_dict,)
+ */
+ __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v__dict = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "(tree fragment)":7
+ * state = (self.chunked, self.code, self.compression, self.headers, self.raw_headers, self.reason, self.should_close, self.upgrade, self.version)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ __pyx_t_3 = (__pyx_v__dict != Py_None);
+ __pyx_t_4 = (__pyx_t_3 != 0);
+ if (__pyx_t_4) {
+
+ /* "(tree fragment)":8
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ * state += (_dict,) # <<<<<<<<<<<<<<
+ * use_setstate = True
+ * else:
+ */
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v__dict);
+ __Pyx_GIVEREF(__pyx_v__dict);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict);
+ __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1));
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":9
+ * if _dict is not None:
+ * state += (_dict,)
+ * use_setstate = True # <<<<<<<<<<<<<<
+ * else:
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.raw_headers is not None or self.reason is not None or self.should_close is not None or self.upgrade is not None or self.version is not None
+ */
+ __pyx_v_use_setstate = 1;
+
+ /* "(tree fragment)":7
+ * state = (self.chunked, self.code, self.compression, self.headers, self.raw_headers, self.reason, self.should_close, self.upgrade, self.version)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ goto __pyx_L3;
+ }
+
+ /* "(tree fragment)":11
+ * use_setstate = True
+ * else:
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.raw_headers is not None or self.reason is not None or self.should_close is not None or self.upgrade is not None or self.version is not None # <<<<<<<<<<<<<<
+ * if use_setstate:
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, None), state
+ */
+ /*else*/ {
+ __pyx_t_3 = (__pyx_v_self->chunked != Py_None);
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_4 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->compression != Py_None);
+ __pyx_t_3 = (__pyx_t_5 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_4 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_self->headers != Py_None);
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_4 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->raw_headers != Py_None);
+ __pyx_t_3 = (__pyx_t_5 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_4 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_self->reason != ((PyObject*)Py_None));
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_4 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->should_close != Py_None);
+ __pyx_t_3 = (__pyx_t_5 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_4 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_self->upgrade != Py_None);
+ __pyx_t_5 = (__pyx_t_3 != 0);
+ if (!__pyx_t_5) {
+ } else {
+ __pyx_t_4 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->version != Py_None);
+ __pyx_t_3 = (__pyx_t_5 != 0);
+ __pyx_t_4 = __pyx_t_3;
+ __pyx_L4_bool_binop_done:;
+ __pyx_v_use_setstate = __pyx_t_4;
+ }
+ __pyx_L3:;
+
+ /* "(tree fragment)":12
+ * else:
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.raw_headers is not None or self.reason is not None or self.should_close is not None or self.upgrade is not None or self.version is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, None), state
+ * else:
+ */
+ __pyx_t_4 = (__pyx_v_use_setstate != 0);
+ if (__pyx_t_4) {
+
+ /* "(tree fragment)":13
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.raw_headers is not None or self.reason is not None or self.should_close is not None or self.upgrade is not None or self.version is not None
+ * if use_setstate:
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, None), state # <<<<<<<<<<<<<<
+ * else:
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, state)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_RawResponseMessag); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_209127132);
+ __Pyx_GIVEREF(__pyx_int_209127132);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_209127132);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None);
+ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_state);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":12
+ * else:
+ * use_setstate = self.chunked is not None or self.compression is not None or self.headers is not None or self.raw_headers is not None or self.reason is not None or self.should_close is not None or self.upgrade is not None or self.version is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, None), state
+ * else:
+ */
+ }
+
+ /* "(tree fragment)":15
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, None), state
+ * else:
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, state) # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_RawResponseMessage__set_state(self, __pyx_state)
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_pyx_unpickle_RawResponseMessag); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_209127132);
+ __Pyx_GIVEREF(__pyx_int_209127132);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_209127132);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
+ __pyx_t_6 = 0;
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef tuple state
+ * cdef object _dict
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawResponseMessage.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_state);
+ __Pyx_XDECREF(__pyx_v__dict);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":16
+ * else:
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_RawResponseMessage__set_state(self, __pyx_state)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_6__setstate_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18RawResponseMessage_6__setstate_cython__(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":17
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, state)
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_RawResponseMessage__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
+ */
+ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
+ __pyx_t_1 = __pyx_f_7aiohttp_12_http_parser___pyx_unpickle_RawResponseMessage__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":16
+ * else:
+ * return __pyx_unpickle_RawResponseMessage, (type(self), 0xc7706dc, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_RawResponseMessage__set_state(self, __pyx_state)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.RawResponseMessage.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":248
+ *
+ *
+ * cdef _new_response_message(object version, # <<<<<<<<<<<<<<
+ * int code,
+ * str reason,
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser__new_response_message(PyObject *__pyx_v_version, int __pyx_v_code, PyObject *__pyx_v_reason, PyObject *__pyx_v_headers, PyObject *__pyx_v_raw_headers, int __pyx_v_should_close, PyObject *__pyx_v_compression, int __pyx_v_upgrade, int __pyx_v_chunked) {
+ struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v_ret = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_new_response_message", 0);
+
+ /* "aiohttp/_http_parser.pyx":258
+ * bint chunked):
+ * cdef RawResponseMessage ret
+ * ret = RawResponseMessage.__new__(RawResponseMessage) # <<<<<<<<<<<<<<
+ * ret.version = version
+ * ret.code = code
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_tp_new_7aiohttp_12_http_parser_RawResponseMessage(((PyTypeObject *)__pyx_ptype_7aiohttp_12_http_parser_RawResponseMessage), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
+ __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+ __pyx_v_ret = ((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":259
+ * cdef RawResponseMessage ret
+ * ret = RawResponseMessage.__new__(RawResponseMessage)
+ * ret.version = version # <<<<<<<<<<<<<<
+ * ret.code = code
+ * ret.reason = reason
+ */
+ __Pyx_INCREF(__pyx_v_version);
+ __Pyx_GIVEREF(__pyx_v_version);
+ __Pyx_GOTREF(__pyx_v_ret->version);
+ __Pyx_DECREF(__pyx_v_ret->version);
+ __pyx_v_ret->version = __pyx_v_version;
+
+ /* "aiohttp/_http_parser.pyx":260
+ * ret = RawResponseMessage.__new__(RawResponseMessage)
+ * ret.version = version
+ * ret.code = code # <<<<<<<<<<<<<<
+ * ret.reason = reason
+ * ret.headers = headers
+ */
+ __pyx_v_ret->code = __pyx_v_code;
+
+ /* "aiohttp/_http_parser.pyx":261
+ * ret.version = version
+ * ret.code = code
+ * ret.reason = reason # <<<<<<<<<<<<<<
+ * ret.headers = headers
+ * ret.raw_headers = raw_headers
+ */
+ __Pyx_INCREF(__pyx_v_reason);
+ __Pyx_GIVEREF(__pyx_v_reason);
+ __Pyx_GOTREF(__pyx_v_ret->reason);
+ __Pyx_DECREF(__pyx_v_ret->reason);
+ __pyx_v_ret->reason = __pyx_v_reason;
+
+ /* "aiohttp/_http_parser.pyx":262
+ * ret.code = code
+ * ret.reason = reason
+ * ret.headers = headers # <<<<<<<<<<<<<<
+ * ret.raw_headers = raw_headers
+ * ret.should_close = should_close
+ */
+ __Pyx_INCREF(__pyx_v_headers);
+ __Pyx_GIVEREF(__pyx_v_headers);
+ __Pyx_GOTREF(__pyx_v_ret->headers);
+ __Pyx_DECREF(__pyx_v_ret->headers);
+ __pyx_v_ret->headers = __pyx_v_headers;
+
+ /* "aiohttp/_http_parser.pyx":263
+ * ret.reason = reason
+ * ret.headers = headers
+ * ret.raw_headers = raw_headers # <<<<<<<<<<<<<<
+ * ret.should_close = should_close
+ * ret.compression = compression
+ */
+ __Pyx_INCREF(__pyx_v_raw_headers);
+ __Pyx_GIVEREF(__pyx_v_raw_headers);
+ __Pyx_GOTREF(__pyx_v_ret->raw_headers);
+ __Pyx_DECREF(__pyx_v_ret->raw_headers);
+ __pyx_v_ret->raw_headers = __pyx_v_raw_headers;
+
+ /* "aiohttp/_http_parser.pyx":264
+ * ret.headers = headers
+ * ret.raw_headers = raw_headers
+ * ret.should_close = should_close # <<<<<<<<<<<<<<
+ * ret.compression = compression
+ * ret.upgrade = upgrade
+ */
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_should_close); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_ret->should_close);
+ __Pyx_DECREF(__pyx_v_ret->should_close);
+ __pyx_v_ret->should_close = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":265
+ * ret.raw_headers = raw_headers
+ * ret.should_close = should_close
+ * ret.compression = compression # <<<<<<<<<<<<<<
+ * ret.upgrade = upgrade
+ * ret.chunked = chunked
+ */
+ __Pyx_INCREF(__pyx_v_compression);
+ __Pyx_GIVEREF(__pyx_v_compression);
+ __Pyx_GOTREF(__pyx_v_ret->compression);
+ __Pyx_DECREF(__pyx_v_ret->compression);
+ __pyx_v_ret->compression = __pyx_v_compression;
+
+ /* "aiohttp/_http_parser.pyx":266
+ * ret.should_close = should_close
+ * ret.compression = compression
+ * ret.upgrade = upgrade # <<<<<<<<<<<<<<
+ * ret.chunked = chunked
+ * return ret
+ */
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_upgrade); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 266, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_ret->upgrade);
+ __Pyx_DECREF(__pyx_v_ret->upgrade);
+ __pyx_v_ret->upgrade = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":267
+ * ret.compression = compression
+ * ret.upgrade = upgrade
+ * ret.chunked = chunked # <<<<<<<<<<<<<<
+ * return ret
+ *
+ */
+ __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_chunked); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 267, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_ret->chunked);
+ __Pyx_DECREF(__pyx_v_ret->chunked);
+ __pyx_v_ret->chunked = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":268
+ * ret.upgrade = upgrade
+ * ret.chunked = chunked
+ * return ret # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_ret));
+ __pyx_r = ((PyObject *)__pyx_v_ret);
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":248
+ *
+ *
+ * cdef _new_response_message(object version, # <<<<<<<<<<<<<<
+ * int code,
+ * str reason,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser._new_response_message", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_ret);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":312
+ * Py_buffer py_buf
+ *
+ * def __cinit__(self): # <<<<<<<<<<<<<<
+ * self._cparser = <cparser.llhttp_t*> \
+ * PyMem_Malloc(sizeof(cparser.llhttp_t))
+ */
+
+/* Python wrapper */
+static int __pyx_pw_7aiohttp_12_http_parser_10HttpParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_7aiohttp_12_http_parser_10HttpParser_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
+ if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_10HttpParser___cinit__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_7aiohttp_12_http_parser_10HttpParser___cinit__(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "aiohttp/_http_parser.pyx":313
+ *
+ * def __cinit__(self):
+ * self._cparser = <cparser.llhttp_t*> \ # <<<<<<<<<<<<<<
+ * PyMem_Malloc(sizeof(cparser.llhttp_t))
+ * if self._cparser is NULL:
+ */
+ __pyx_v_self->_cparser = ((llhttp_t *)PyMem_Malloc((sizeof(llhttp_t))));
+
+ /* "aiohttp/_http_parser.pyx":315
+ * self._cparser = <cparser.llhttp_t*> \
+ * PyMem_Malloc(sizeof(cparser.llhttp_t))
+ * if self._cparser is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError()
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->_cparser == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "aiohttp/_http_parser.pyx":316
+ * PyMem_Malloc(sizeof(cparser.llhttp_t))
+ * if self._cparser is NULL:
+ * raise MemoryError() # <<<<<<<<<<<<<<
+ *
+ * self._csettings = <cparser.llhttp_settings_t*> \
+ */
+ PyErr_NoMemory(); __PYX_ERR(0, 316, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":315
+ * self._cparser = <cparser.llhttp_t*> \
+ * PyMem_Malloc(sizeof(cparser.llhttp_t))
+ * if self._cparser is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError()
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":318
+ * raise MemoryError()
+ *
+ * self._csettings = <cparser.llhttp_settings_t*> \ # <<<<<<<<<<<<<<
+ * PyMem_Malloc(sizeof(cparser.llhttp_settings_t))
+ * if self._csettings is NULL:
+ */
+ __pyx_v_self->_csettings = ((llhttp_settings_t *)PyMem_Malloc((sizeof(llhttp_settings_t))));
+
+ /* "aiohttp/_http_parser.pyx":320
+ * self._csettings = <cparser.llhttp_settings_t*> \
+ * PyMem_Malloc(sizeof(cparser.llhttp_settings_t))
+ * if self._csettings is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError()
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->_csettings == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "aiohttp/_http_parser.pyx":321
+ * PyMem_Malloc(sizeof(cparser.llhttp_settings_t))
+ * if self._csettings is NULL:
+ * raise MemoryError() # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(self):
+ */
+ PyErr_NoMemory(); __PYX_ERR(0, 321, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":320
+ * self._csettings = <cparser.llhttp_settings_t*> \
+ * PyMem_Malloc(sizeof(cparser.llhttp_settings_t))
+ * if self._csettings is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError()
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":312
+ * Py_buffer py_buf
+ *
+ * def __cinit__(self): # <<<<<<<<<<<<<<
+ * self._cparser = <cparser.llhttp_t*> \
+ * PyMem_Malloc(sizeof(cparser.llhttp_t))
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":323
+ * raise MemoryError()
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * PyMem_Free(self._cparser)
+ * PyMem_Free(self._csettings)
+ */
+
+/* Python wrapper */
+static void __pyx_pw_7aiohttp_12_http_parser_10HttpParser_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pw_7aiohttp_12_http_parser_10HttpParser_3__dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_pf_7aiohttp_12_http_parser_10HttpParser_2__dealloc__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_7aiohttp_12_http_parser_10HttpParser_2__dealloc__(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "aiohttp/_http_parser.pyx":324
+ *
+ * def __dealloc__(self):
+ * PyMem_Free(self._cparser) # <<<<<<<<<<<<<<
+ * PyMem_Free(self._csettings)
+ *
+ */
+ PyMem_Free(__pyx_v_self->_cparser);
+
+ /* "aiohttp/_http_parser.pyx":325
+ * def __dealloc__(self):
+ * PyMem_Free(self._cparser)
+ * PyMem_Free(self._csettings) # <<<<<<<<<<<<<<
+ *
+ * cdef _init(
+ */
+ PyMem_Free(__pyx_v_self->_csettings);
+
+ /* "aiohttp/_http_parser.pyx":323
+ * raise MemoryError()
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * PyMem_Free(self._cparser)
+ * PyMem_Free(self._csettings)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "aiohttp/_http_parser.pyx":327
+ * PyMem_Free(self._csettings)
+ *
+ * cdef _init( # <<<<<<<<<<<<<<
+ * self, cparser.llhttp_type mode,
+ * object protocol, object loop, int limit,
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__init(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, enum llhttp_type __pyx_v_mode, PyObject *__pyx_v_protocol, PyObject *__pyx_v_loop, int __pyx_v_limit, struct __pyx_opt_args_7aiohttp_12_http_parser_10HttpParser__init *__pyx_optional_args) {
+
+ /* "aiohttp/_http_parser.pyx":330
+ * self, cparser.llhttp_type mode,
+ * object protocol, object loop, int limit,
+ * object timer=None, # <<<<<<<<<<<<<<
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None,
+ */
+ PyObject *__pyx_v_timer = ((PyObject *)Py_None);
+ size_t __pyx_v_max_line_size = ((size_t)0x1FFE);
+ size_t __pyx_v_max_headers = ((size_t)0x8000);
+ size_t __pyx_v_max_field_size = ((size_t)0x1FFE);
+
+ /* "aiohttp/_http_parser.pyx":332
+ * object timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None, # <<<<<<<<<<<<<<
+ * bint response_with_body=True, bint read_until_eof=False,
+ * bint auto_decompress=True,
+ */
+ PyObject *__pyx_v_payload_exception = ((PyObject *)Py_None);
+
+ /* "aiohttp/_http_parser.pyx":333
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None,
+ * bint response_with_body=True, bint read_until_eof=False, # <<<<<<<<<<<<<<
+ * bint auto_decompress=True,
+ * ):
+ */
+ int __pyx_v_response_with_body = ((int)1);
+ int __pyx_v_read_until_eof = ((int)0);
+
+ /* "aiohttp/_http_parser.pyx":334
+ * size_t max_field_size=8190, payload_exception=None,
+ * bint response_with_body=True, bint read_until_eof=False,
+ * bint auto_decompress=True, # <<<<<<<<<<<<<<
+ * ):
+ * cparser.llhttp_settings_init(self._csettings)
+ */
+ int __pyx_v_auto_decompress = ((int)1);
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_init", 0);
+ if (__pyx_optional_args) {
+ if (__pyx_optional_args->__pyx_n > 0) {
+ __pyx_v_timer = __pyx_optional_args->timer;
+ if (__pyx_optional_args->__pyx_n > 1) {
+ __pyx_v_max_line_size = __pyx_optional_args->max_line_size;
+ if (__pyx_optional_args->__pyx_n > 2) {
+ __pyx_v_max_headers = __pyx_optional_args->max_headers;
+ if (__pyx_optional_args->__pyx_n > 3) {
+ __pyx_v_max_field_size = __pyx_optional_args->max_field_size;
+ if (__pyx_optional_args->__pyx_n > 4) {
+ __pyx_v_payload_exception = __pyx_optional_args->payload_exception;
+ if (__pyx_optional_args->__pyx_n > 5) {
+ __pyx_v_response_with_body = __pyx_optional_args->response_with_body;
+ if (__pyx_optional_args->__pyx_n > 6) {
+ __pyx_v_read_until_eof = __pyx_optional_args->read_until_eof;
+ if (__pyx_optional_args->__pyx_n > 7) {
+ __pyx_v_auto_decompress = __pyx_optional_args->auto_decompress;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* "aiohttp/_http_parser.pyx":336
+ * bint auto_decompress=True,
+ * ):
+ * cparser.llhttp_settings_init(self._csettings) # <<<<<<<<<<<<<<
+ * cparser.llhttp_init(self._cparser, mode, self._csettings)
+ * self._cparser.data = <void*>self
+ */
+ llhttp_settings_init(__pyx_v_self->_csettings);
+
+ /* "aiohttp/_http_parser.pyx":337
+ * ):
+ * cparser.llhttp_settings_init(self._csettings)
+ * cparser.llhttp_init(self._cparser, mode, self._csettings) # <<<<<<<<<<<<<<
+ * self._cparser.data = <void*>self
+ * self._cparser.content_length = 0
+ */
+ llhttp_init(__pyx_v_self->_cparser, __pyx_v_mode, __pyx_v_self->_csettings);
+
+ /* "aiohttp/_http_parser.pyx":338
+ * cparser.llhttp_settings_init(self._csettings)
+ * cparser.llhttp_init(self._cparser, mode, self._csettings)
+ * self._cparser.data = <void*>self # <<<<<<<<<<<<<<
+ * self._cparser.content_length = 0
+ *
+ */
+ __pyx_v_self->_cparser->data = ((void *)__pyx_v_self);
+
+ /* "aiohttp/_http_parser.pyx":339
+ * cparser.llhttp_init(self._cparser, mode, self._csettings)
+ * self._cparser.data = <void*>self
+ * self._cparser.content_length = 0 # <<<<<<<<<<<<<<
+ *
+ * self._protocol = protocol
+ */
+ __pyx_v_self->_cparser->content_length = 0;
+
+ /* "aiohttp/_http_parser.pyx":341
+ * self._cparser.content_length = 0
+ *
+ * self._protocol = protocol # <<<<<<<<<<<<<<
+ * self._loop = loop
+ * self._timer = timer
+ */
+ __Pyx_INCREF(__pyx_v_protocol);
+ __Pyx_GIVEREF(__pyx_v_protocol);
+ __Pyx_GOTREF(__pyx_v_self->_protocol);
+ __Pyx_DECREF(__pyx_v_self->_protocol);
+ __pyx_v_self->_protocol = __pyx_v_protocol;
+
+ /* "aiohttp/_http_parser.pyx":342
+ *
+ * self._protocol = protocol
+ * self._loop = loop # <<<<<<<<<<<<<<
+ * self._timer = timer
+ *
+ */
+ __Pyx_INCREF(__pyx_v_loop);
+ __Pyx_GIVEREF(__pyx_v_loop);
+ __Pyx_GOTREF(__pyx_v_self->_loop);
+ __Pyx_DECREF(__pyx_v_self->_loop);
+ __pyx_v_self->_loop = __pyx_v_loop;
+
+ /* "aiohttp/_http_parser.pyx":343
+ * self._protocol = protocol
+ * self._loop = loop
+ * self._timer = timer # <<<<<<<<<<<<<<
+ *
+ * self._buf = bytearray()
+ */
+ __Pyx_INCREF(__pyx_v_timer);
+ __Pyx_GIVEREF(__pyx_v_timer);
+ __Pyx_GOTREF(__pyx_v_self->_timer);
+ __Pyx_DECREF(__pyx_v_self->_timer);
+ __pyx_v_self->_timer = __pyx_v_timer;
+
+ /* "aiohttp/_http_parser.pyx":345
+ * self._timer = timer
+ *
+ * self._buf = bytearray() # <<<<<<<<<<<<<<
+ * self._payload = None
+ * self._payload_error = 0
+ */
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyByteArray_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_self->_buf);
+ __Pyx_DECREF(__pyx_v_self->_buf);
+ __pyx_v_self->_buf = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":346
+ *
+ * self._buf = bytearray()
+ * self._payload = None # <<<<<<<<<<<<<<
+ * self._payload_error = 0
+ * self._payload_exception = payload_exception
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_payload);
+ __Pyx_DECREF(__pyx_v_self->_payload);
+ __pyx_v_self->_payload = Py_None;
+
+ /* "aiohttp/_http_parser.pyx":347
+ * self._buf = bytearray()
+ * self._payload = None
+ * self._payload_error = 0 # <<<<<<<<<<<<<<
+ * self._payload_exception = payload_exception
+ * self._messages = []
+ */
+ __pyx_v_self->_payload_error = 0;
+
+ /* "aiohttp/_http_parser.pyx":348
+ * self._payload = None
+ * self._payload_error = 0
+ * self._payload_exception = payload_exception # <<<<<<<<<<<<<<
+ * self._messages = []
+ *
+ */
+ __Pyx_INCREF(__pyx_v_payload_exception);
+ __Pyx_GIVEREF(__pyx_v_payload_exception);
+ __Pyx_GOTREF(__pyx_v_self->_payload_exception);
+ __Pyx_DECREF(__pyx_v_self->_payload_exception);
+ __pyx_v_self->_payload_exception = __pyx_v_payload_exception;
+
+ /* "aiohttp/_http_parser.pyx":349
+ * self._payload_error = 0
+ * self._payload_exception = payload_exception
+ * self._messages = [] # <<<<<<<<<<<<<<
+ *
+ * self._raw_name = bytearray()
+ */
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 349, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_self->_messages);
+ __Pyx_DECREF(__pyx_v_self->_messages);
+ __pyx_v_self->_messages = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":351
+ * self._messages = []
+ *
+ * self._raw_name = bytearray() # <<<<<<<<<<<<<<
+ * self._raw_value = bytearray()
+ * self._has_value = False
+ */
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyByteArray_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 351, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_self->_raw_name);
+ __Pyx_DECREF(__pyx_v_self->_raw_name);
+ __pyx_v_self->_raw_name = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":352
+ *
+ * self._raw_name = bytearray()
+ * self._raw_value = bytearray() # <<<<<<<<<<<<<<
+ * self._has_value = False
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_CallNoArg(((PyObject *)(&PyByteArray_Type))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 352, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_self->_raw_value);
+ __Pyx_DECREF(__pyx_v_self->_raw_value);
+ __pyx_v_self->_raw_value = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":353
+ * self._raw_name = bytearray()
+ * self._raw_value = bytearray()
+ * self._has_value = False # <<<<<<<<<<<<<<
+ *
+ * self._max_line_size = max_line_size
+ */
+ __pyx_v_self->_has_value = 0;
+
+ /* "aiohttp/_http_parser.pyx":355
+ * self._has_value = False
+ *
+ * self._max_line_size = max_line_size # <<<<<<<<<<<<<<
+ * self._max_headers = max_headers
+ * self._max_field_size = max_field_size
+ */
+ __pyx_v_self->_max_line_size = __pyx_v_max_line_size;
+
+ /* "aiohttp/_http_parser.pyx":356
+ *
+ * self._max_line_size = max_line_size
+ * self._max_headers = max_headers # <<<<<<<<<<<<<<
+ * self._max_field_size = max_field_size
+ * self._response_with_body = response_with_body
+ */
+ __pyx_v_self->_max_headers = __pyx_v_max_headers;
+
+ /* "aiohttp/_http_parser.pyx":357
+ * self._max_line_size = max_line_size
+ * self._max_headers = max_headers
+ * self._max_field_size = max_field_size # <<<<<<<<<<<<<<
+ * self._response_with_body = response_with_body
+ * self._read_until_eof = read_until_eof
+ */
+ __pyx_v_self->_max_field_size = __pyx_v_max_field_size;
+
+ /* "aiohttp/_http_parser.pyx":358
+ * self._max_headers = max_headers
+ * self._max_field_size = max_field_size
+ * self._response_with_body = response_with_body # <<<<<<<<<<<<<<
+ * self._read_until_eof = read_until_eof
+ * self._upgraded = False
+ */
+ __pyx_v_self->_response_with_body = __pyx_v_response_with_body;
+
+ /* "aiohttp/_http_parser.pyx":359
+ * self._max_field_size = max_field_size
+ * self._response_with_body = response_with_body
+ * self._read_until_eof = read_until_eof # <<<<<<<<<<<<<<
+ * self._upgraded = False
+ * self._auto_decompress = auto_decompress
+ */
+ __pyx_v_self->_read_until_eof = __pyx_v_read_until_eof;
+
+ /* "aiohttp/_http_parser.pyx":360
+ * self._response_with_body = response_with_body
+ * self._read_until_eof = read_until_eof
+ * self._upgraded = False # <<<<<<<<<<<<<<
+ * self._auto_decompress = auto_decompress
+ * self._content_encoding = None
+ */
+ __pyx_v_self->_upgraded = 0;
+
+ /* "aiohttp/_http_parser.pyx":361
+ * self._read_until_eof = read_until_eof
+ * self._upgraded = False
+ * self._auto_decompress = auto_decompress # <<<<<<<<<<<<<<
+ * self._content_encoding = None
+ *
+ */
+ __pyx_v_self->_auto_decompress = __pyx_v_auto_decompress;
+
+ /* "aiohttp/_http_parser.pyx":362
+ * self._upgraded = False
+ * self._auto_decompress = auto_decompress
+ * self._content_encoding = None # <<<<<<<<<<<<<<
+ *
+ * self._csettings.on_url = cb_on_url
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_content_encoding);
+ __Pyx_DECREF(__pyx_v_self->_content_encoding);
+ __pyx_v_self->_content_encoding = ((PyObject*)Py_None);
+
+ /* "aiohttp/_http_parser.pyx":364
+ * self._content_encoding = None
+ *
+ * self._csettings.on_url = cb_on_url # <<<<<<<<<<<<<<
+ * self._csettings.on_status = cb_on_status
+ * self._csettings.on_header_field = cb_on_header_field
+ */
+ __pyx_v_self->_csettings->on_url = __pyx_f_7aiohttp_12_http_parser_cb_on_url;
+
+ /* "aiohttp/_http_parser.pyx":365
+ *
+ * self._csettings.on_url = cb_on_url
+ * self._csettings.on_status = cb_on_status # <<<<<<<<<<<<<<
+ * self._csettings.on_header_field = cb_on_header_field
+ * self._csettings.on_header_value = cb_on_header_value
+ */
+ __pyx_v_self->_csettings->on_status = __pyx_f_7aiohttp_12_http_parser_cb_on_status;
+
+ /* "aiohttp/_http_parser.pyx":366
+ * self._csettings.on_url = cb_on_url
+ * self._csettings.on_status = cb_on_status
+ * self._csettings.on_header_field = cb_on_header_field # <<<<<<<<<<<<<<
+ * self._csettings.on_header_value = cb_on_header_value
+ * self._csettings.on_headers_complete = cb_on_headers_complete
+ */
+ __pyx_v_self->_csettings->on_header_field = __pyx_f_7aiohttp_12_http_parser_cb_on_header_field;
+
+ /* "aiohttp/_http_parser.pyx":367
+ * self._csettings.on_status = cb_on_status
+ * self._csettings.on_header_field = cb_on_header_field
+ * self._csettings.on_header_value = cb_on_header_value # <<<<<<<<<<<<<<
+ * self._csettings.on_headers_complete = cb_on_headers_complete
+ * self._csettings.on_body = cb_on_body
+ */
+ __pyx_v_self->_csettings->on_header_value = __pyx_f_7aiohttp_12_http_parser_cb_on_header_value;
+
+ /* "aiohttp/_http_parser.pyx":368
+ * self._csettings.on_header_field = cb_on_header_field
+ * self._csettings.on_header_value = cb_on_header_value
+ * self._csettings.on_headers_complete = cb_on_headers_complete # <<<<<<<<<<<<<<
+ * self._csettings.on_body = cb_on_body
+ * self._csettings.on_message_begin = cb_on_message_begin
+ */
+ __pyx_v_self->_csettings->on_headers_complete = __pyx_f_7aiohttp_12_http_parser_cb_on_headers_complete;
+
+ /* "aiohttp/_http_parser.pyx":369
+ * self._csettings.on_header_value = cb_on_header_value
+ * self._csettings.on_headers_complete = cb_on_headers_complete
+ * self._csettings.on_body = cb_on_body # <<<<<<<<<<<<<<
+ * self._csettings.on_message_begin = cb_on_message_begin
+ * self._csettings.on_message_complete = cb_on_message_complete
+ */
+ __pyx_v_self->_csettings->on_body = __pyx_f_7aiohttp_12_http_parser_cb_on_body;
+
+ /* "aiohttp/_http_parser.pyx":370
+ * self._csettings.on_headers_complete = cb_on_headers_complete
+ * self._csettings.on_body = cb_on_body
+ * self._csettings.on_message_begin = cb_on_message_begin # <<<<<<<<<<<<<<
+ * self._csettings.on_message_complete = cb_on_message_complete
+ * self._csettings.on_chunk_header = cb_on_chunk_header
+ */
+ __pyx_v_self->_csettings->on_message_begin = __pyx_f_7aiohttp_12_http_parser_cb_on_message_begin;
+
+ /* "aiohttp/_http_parser.pyx":371
+ * self._csettings.on_body = cb_on_body
+ * self._csettings.on_message_begin = cb_on_message_begin
+ * self._csettings.on_message_complete = cb_on_message_complete # <<<<<<<<<<<<<<
+ * self._csettings.on_chunk_header = cb_on_chunk_header
+ * self._csettings.on_chunk_complete = cb_on_chunk_complete
+ */
+ __pyx_v_self->_csettings->on_message_complete = __pyx_f_7aiohttp_12_http_parser_cb_on_message_complete;
+
+ /* "aiohttp/_http_parser.pyx":372
+ * self._csettings.on_message_begin = cb_on_message_begin
+ * self._csettings.on_message_complete = cb_on_message_complete
+ * self._csettings.on_chunk_header = cb_on_chunk_header # <<<<<<<<<<<<<<
+ * self._csettings.on_chunk_complete = cb_on_chunk_complete
+ *
+ */
+ __pyx_v_self->_csettings->on_chunk_header = __pyx_f_7aiohttp_12_http_parser_cb_on_chunk_header;
+
+ /* "aiohttp/_http_parser.pyx":373
+ * self._csettings.on_message_complete = cb_on_message_complete
+ * self._csettings.on_chunk_header = cb_on_chunk_header
+ * self._csettings.on_chunk_complete = cb_on_chunk_complete # <<<<<<<<<<<<<<
+ *
+ * self._last_error = None
+ */
+ __pyx_v_self->_csettings->on_chunk_complete = __pyx_f_7aiohttp_12_http_parser_cb_on_chunk_complete;
+
+ /* "aiohttp/_http_parser.pyx":375
+ * self._csettings.on_chunk_complete = cb_on_chunk_complete
+ *
+ * self._last_error = None # <<<<<<<<<<<<<<
+ * self._limit = limit
+ *
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_last_error);
+ __Pyx_DECREF(__pyx_v_self->_last_error);
+ __pyx_v_self->_last_error = Py_None;
+
+ /* "aiohttp/_http_parser.pyx":376
+ *
+ * self._last_error = None
+ * self._limit = limit # <<<<<<<<<<<<<<
+ *
+ * cdef _process_header(self):
+ */
+ __pyx_v_self->_limit = __pyx_v_limit;
+
+ /* "aiohttp/_http_parser.pyx":327
+ * PyMem_Free(self._csettings)
+ *
+ * cdef _init( # <<<<<<<<<<<<<<
+ * self, cparser.llhttp_type mode,
+ * object protocol, object loop, int limit,
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser._init", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":378
+ * self._limit = limit
+ *
+ * cdef _process_header(self): # <<<<<<<<<<<<<<
+ * if self._raw_name:
+ * raw_name = bytes(self._raw_name)
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__process_header(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ PyObject *__pyx_v_raw_name = NULL;
+ PyObject *__pyx_v_raw_value = NULL;
+ PyObject *__pyx_v_name = NULL;
+ PyObject *__pyx_v_value = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_process_header", 0);
+
+ /* "aiohttp/_http_parser.pyx":379
+ *
+ * cdef _process_header(self):
+ * if self._raw_name: # <<<<<<<<<<<<<<
+ * raw_name = bytes(self._raw_name)
+ * raw_value = bytes(self._raw_value)
+ */
+ __pyx_t_1 = (__pyx_v_self->_raw_name != Py_None)&&(PyByteArray_GET_SIZE(__pyx_v_self->_raw_name) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_parser.pyx":380
+ * cdef _process_header(self):
+ * if self._raw_name:
+ * raw_name = bytes(self._raw_name) # <<<<<<<<<<<<<<
+ * raw_value = bytes(self._raw_value)
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_self->_raw_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 380, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_raw_name = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":381
+ * if self._raw_name:
+ * raw_name = bytes(self._raw_name)
+ * raw_value = bytes(self._raw_value) # <<<<<<<<<<<<<<
+ *
+ * name = find_header(raw_name)
+ */
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_self->_raw_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 381, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_raw_value = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":383
+ * raw_value = bytes(self._raw_value)
+ *
+ * name = find_header(raw_name) # <<<<<<<<<<<<<<
+ * value = raw_value.decode('utf-8', 'surrogateescape')
+ *
+ */
+ __pyx_t_2 = __pyx_f_7aiohttp_12_http_parser_find_header(__pyx_v_raw_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 383, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_name = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":384
+ *
+ * name = find_header(raw_name)
+ * value = raw_value.decode('utf-8', 'surrogateescape') # <<<<<<<<<<<<<<
+ *
+ * self._headers.add(name, value)
+ */
+ __pyx_t_2 = __Pyx_decode_bytes(__pyx_v_raw_value, 0, PY_SSIZE_T_MAX, NULL, ((char const *)"surrogateescape"), PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_value = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":386
+ * value = raw_value.decode('utf-8', 'surrogateescape')
+ *
+ * self._headers.add(name, value) # <<<<<<<<<<<<<<
+ *
+ * if name is CONTENT_ENCODING:
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_headers, __pyx_n_s_add); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ __pyx_t_5 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ __pyx_t_5 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_name, __pyx_v_value};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_4) {
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_name);
+ __Pyx_GIVEREF(__pyx_v_name);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_name);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 386, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":388
+ * self._headers.add(name, value)
+ *
+ * if name is CONTENT_ENCODING: # <<<<<<<<<<<<<<
+ * self._content_encoding = value
+ *
+ */
+ __pyx_t_1 = (__pyx_v_name == __pyx_v_7aiohttp_12_http_parser_CONTENT_ENCODING);
+ __pyx_t_7 = (__pyx_t_1 != 0);
+ if (__pyx_t_7) {
+
+ /* "aiohttp/_http_parser.pyx":389
+ *
+ * if name is CONTENT_ENCODING:
+ * self._content_encoding = value # <<<<<<<<<<<<<<
+ *
+ * PyByteArray_Resize(self._raw_name, 0)
+ */
+ if (!(likely(PyUnicode_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 389, __pyx_L1_error)
+ __pyx_t_2 = __pyx_v_value;
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_self->_content_encoding);
+ __Pyx_DECREF(__pyx_v_self->_content_encoding);
+ __pyx_v_self->_content_encoding = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":388
+ * self._headers.add(name, value)
+ *
+ * if name is CONTENT_ENCODING: # <<<<<<<<<<<<<<
+ * self._content_encoding = value
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":391
+ * self._content_encoding = value
+ *
+ * PyByteArray_Resize(self._raw_name, 0) # <<<<<<<<<<<<<<
+ * PyByteArray_Resize(self._raw_value, 0)
+ * self._has_value = False
+ */
+ __pyx_t_2 = __pyx_v_self->_raw_name;
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_5 = PyByteArray_Resize(__pyx_t_2, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 391, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":392
+ *
+ * PyByteArray_Resize(self._raw_name, 0)
+ * PyByteArray_Resize(self._raw_value, 0) # <<<<<<<<<<<<<<
+ * self._has_value = False
+ * self._raw_headers.append((raw_name, raw_value))
+ */
+ __pyx_t_2 = __pyx_v_self->_raw_value;
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_5 = PyByteArray_Resize(__pyx_t_2, 0); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 392, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":393
+ * PyByteArray_Resize(self._raw_name, 0)
+ * PyByteArray_Resize(self._raw_value, 0)
+ * self._has_value = False # <<<<<<<<<<<<<<
+ * self._raw_headers.append((raw_name, raw_value))
+ *
+ */
+ __pyx_v_self->_has_value = 0;
+
+ /* "aiohttp/_http_parser.pyx":394
+ * PyByteArray_Resize(self._raw_value, 0)
+ * self._has_value = False
+ * self._raw_headers.append((raw_name, raw_value)) # <<<<<<<<<<<<<<
+ *
+ * cdef _on_header_field(self, char* at, size_t length):
+ */
+ if (unlikely(__pyx_v_self->_raw_headers == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+ __PYX_ERR(0, 394, __pyx_L1_error)
+ }
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 394, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_raw_name);
+ __Pyx_GIVEREF(__pyx_v_raw_name);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_raw_name);
+ __Pyx_INCREF(__pyx_v_raw_value);
+ __Pyx_GIVEREF(__pyx_v_raw_value);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_raw_value);
+ __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_raw_headers, __pyx_t_2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 394, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":379
+ *
+ * cdef _process_header(self):
+ * if self._raw_name: # <<<<<<<<<<<<<<
+ * raw_name = bytes(self._raw_name)
+ * raw_value = bytes(self._raw_value)
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":378
+ * self._limit = limit
+ *
+ * cdef _process_header(self): # <<<<<<<<<<<<<<
+ * if self._raw_name:
+ * raw_name = bytes(self._raw_name)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser._process_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_raw_name);
+ __Pyx_XDECREF(__pyx_v_raw_value);
+ __Pyx_XDECREF(__pyx_v_name);
+ __Pyx_XDECREF(__pyx_v_value);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":396
+ * self._raw_headers.append((raw_name, raw_value))
+ *
+ * cdef _on_header_field(self, char* at, size_t length): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t size
+ * cdef char *buf
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_header_field(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, char *__pyx_v_at, size_t __pyx_v_length) {
+ Py_ssize_t __pyx_v_size;
+ char *__pyx_v_buf;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_on_header_field", 0);
+
+ /* "aiohttp/_http_parser.pyx":399
+ * cdef Py_ssize_t size
+ * cdef char *buf
+ * if self._has_value: # <<<<<<<<<<<<<<
+ * self._process_header()
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->_has_value != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_parser.pyx":400
+ * cdef char *buf
+ * if self._has_value:
+ * self._process_header() # <<<<<<<<<<<<<<
+ *
+ * size = PyByteArray_Size(self._raw_name)
+ */
+ __pyx_t_2 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self->__pyx_vtab)->_process_header(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":399
+ * cdef Py_ssize_t size
+ * cdef char *buf
+ * if self._has_value: # <<<<<<<<<<<<<<
+ * self._process_header()
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":402
+ * self._process_header()
+ *
+ * size = PyByteArray_Size(self._raw_name) # <<<<<<<<<<<<<<
+ * PyByteArray_Resize(self._raw_name, size + length)
+ * buf = PyByteArray_AsString(self._raw_name)
+ */
+ __pyx_t_2 = __pyx_v_self->_raw_name;
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_3 = PyByteArray_Size(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 402, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_size = __pyx_t_3;
+
+ /* "aiohttp/_http_parser.pyx":403
+ *
+ * size = PyByteArray_Size(self._raw_name)
+ * PyByteArray_Resize(self._raw_name, size + length) # <<<<<<<<<<<<<<
+ * buf = PyByteArray_AsString(self._raw_name)
+ * memcpy(buf + size, at, length)
+ */
+ __pyx_t_2 = __pyx_v_self->_raw_name;
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_4 = PyByteArray_Resize(__pyx_t_2, (__pyx_v_size + __pyx_v_length)); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 403, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":404
+ * size = PyByteArray_Size(self._raw_name)
+ * PyByteArray_Resize(self._raw_name, size + length)
+ * buf = PyByteArray_AsString(self._raw_name) # <<<<<<<<<<<<<<
+ * memcpy(buf + size, at, length)
+ *
+ */
+ __pyx_t_2 = __pyx_v_self->_raw_name;
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_v_buf = PyByteArray_AsString(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":405
+ * PyByteArray_Resize(self._raw_name, size + length)
+ * buf = PyByteArray_AsString(self._raw_name)
+ * memcpy(buf + size, at, length) # <<<<<<<<<<<<<<
+ *
+ * cdef _on_header_value(self, char* at, size_t length):
+ */
+ (void)(memcpy((__pyx_v_buf + __pyx_v_size), __pyx_v_at, __pyx_v_length));
+
+ /* "aiohttp/_http_parser.pyx":396
+ * self._raw_headers.append((raw_name, raw_value))
+ *
+ * cdef _on_header_field(self, char* at, size_t length): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t size
+ * cdef char *buf
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser._on_header_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":407
+ * memcpy(buf + size, at, length)
+ *
+ * cdef _on_header_value(self, char* at, size_t length): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t size
+ * cdef char *buf
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_header_value(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, char *__pyx_v_at, size_t __pyx_v_length) {
+ Py_ssize_t __pyx_v_size;
+ char *__pyx_v_buf;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_on_header_value", 0);
+
+ /* "aiohttp/_http_parser.pyx":411
+ * cdef char *buf
+ *
+ * size = PyByteArray_Size(self._raw_value) # <<<<<<<<<<<<<<
+ * PyByteArray_Resize(self._raw_value, size + length)
+ * buf = PyByteArray_AsString(self._raw_value)
+ */
+ __pyx_t_1 = __pyx_v_self->_raw_value;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_2 = PyByteArray_Size(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1L))) __PYX_ERR(0, 411, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_size = __pyx_t_2;
+
+ /* "aiohttp/_http_parser.pyx":412
+ *
+ * size = PyByteArray_Size(self._raw_value)
+ * PyByteArray_Resize(self._raw_value, size + length) # <<<<<<<<<<<<<<
+ * buf = PyByteArray_AsString(self._raw_value)
+ * memcpy(buf + size, at, length)
+ */
+ __pyx_t_1 = __pyx_v_self->_raw_value;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_3 = PyByteArray_Resize(__pyx_t_1, (__pyx_v_size + __pyx_v_length)); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 412, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":413
+ * size = PyByteArray_Size(self._raw_value)
+ * PyByteArray_Resize(self._raw_value, size + length)
+ * buf = PyByteArray_AsString(self._raw_value) # <<<<<<<<<<<<<<
+ * memcpy(buf + size, at, length)
+ * self._has_value = True
+ */
+ __pyx_t_1 = __pyx_v_self->_raw_value;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_buf = PyByteArray_AsString(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":414
+ * PyByteArray_Resize(self._raw_value, size + length)
+ * buf = PyByteArray_AsString(self._raw_value)
+ * memcpy(buf + size, at, length) # <<<<<<<<<<<<<<
+ * self._has_value = True
+ *
+ */
+ (void)(memcpy((__pyx_v_buf + __pyx_v_size), __pyx_v_at, __pyx_v_length));
+
+ /* "aiohttp/_http_parser.pyx":415
+ * buf = PyByteArray_AsString(self._raw_value)
+ * memcpy(buf + size, at, length)
+ * self._has_value = True # <<<<<<<<<<<<<<
+ *
+ * cdef _on_headers_complete(self):
+ */
+ __pyx_v_self->_has_value = 1;
+
+ /* "aiohttp/_http_parser.pyx":407
+ * memcpy(buf + size, at, length)
+ *
+ * cdef _on_header_value(self, char* at, size_t length): # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t size
+ * cdef char *buf
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser._on_header_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":417
+ * self._has_value = True
+ *
+ * cdef _on_headers_complete(self): # <<<<<<<<<<<<<<
+ * self._process_header()
+ *
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_headers_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ PyObject *__pyx_v_method = NULL;
+ int __pyx_v_should_close;
+ uint8_t __pyx_v_upgrade;
+ int __pyx_v_chunked;
+ PyObject *__pyx_v_raw_headers = NULL;
+ PyObject *__pyx_v_headers = NULL;
+ PyObject *__pyx_v_encoding = NULL;
+ PyObject *__pyx_v_enc = NULL;
+ PyObject *__pyx_v_msg = NULL;
+ PyObject *__pyx_v_payload = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ uint8_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_on_headers_complete", 0);
+
+ /* "aiohttp/_http_parser.pyx":418
+ *
+ * cdef _on_headers_complete(self):
+ * self._process_header() # <<<<<<<<<<<<<<
+ *
+ * method = http_method_str(self._cparser.method)
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self->__pyx_vtab)->_process_header(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":420
+ * self._process_header()
+ *
+ * method = http_method_str(self._cparser.method) # <<<<<<<<<<<<<<
+ * should_close = not cparser.llhttp_should_keep_alive(self._cparser)
+ * upgrade = self._cparser.upgrade
+ */
+ __pyx_t_1 = __pyx_f_7aiohttp_12_http_parser_http_method_str(__pyx_v_self->_cparser->method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_method = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":421
+ *
+ * method = http_method_str(self._cparser.method)
+ * should_close = not cparser.llhttp_should_keep_alive(self._cparser) # <<<<<<<<<<<<<<
+ * upgrade = self._cparser.upgrade
+ * chunked = self._cparser.flags & cparser.F_CHUNKED
+ */
+ __pyx_v_should_close = (!(llhttp_should_keep_alive(__pyx_v_self->_cparser) != 0));
+
+ /* "aiohttp/_http_parser.pyx":422
+ * method = http_method_str(self._cparser.method)
+ * should_close = not cparser.llhttp_should_keep_alive(self._cparser)
+ * upgrade = self._cparser.upgrade # <<<<<<<<<<<<<<
+ * chunked = self._cparser.flags & cparser.F_CHUNKED
+ *
+ */
+ __pyx_t_2 = __pyx_v_self->_cparser->upgrade;
+ __pyx_v_upgrade = __pyx_t_2;
+
+ /* "aiohttp/_http_parser.pyx":423
+ * should_close = not cparser.llhttp_should_keep_alive(self._cparser)
+ * upgrade = self._cparser.upgrade
+ * chunked = self._cparser.flags & cparser.F_CHUNKED # <<<<<<<<<<<<<<
+ *
+ * raw_headers = tuple(self._raw_headers)
+ */
+ __pyx_v_chunked = (__pyx_v_self->_cparser->flags & F_CHUNKED);
+
+ /* "aiohttp/_http_parser.pyx":425
+ * chunked = self._cparser.flags & cparser.F_CHUNKED
+ *
+ * raw_headers = tuple(self._raw_headers) # <<<<<<<<<<<<<<
+ * headers = CIMultiDictProxy(self._headers)
+ *
+ */
+ if (unlikely(__pyx_v_self->_raw_headers == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ __PYX_ERR(0, 425, __pyx_L1_error)
+ }
+ __pyx_t_1 = PyList_AsTuple(__pyx_v_self->_raw_headers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 425, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_raw_headers = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":426
+ *
+ * raw_headers = tuple(self._raw_headers)
+ * headers = CIMultiDictProxy(self._headers) # <<<<<<<<<<<<<<
+ *
+ * if upgrade or self._cparser.method == cparser.HTTP_CONNECT:
+ */
+ __Pyx_INCREF(__pyx_v_7aiohttp_12_http_parser_CIMultiDictProxy);
+ __pyx_t_3 = __pyx_v_7aiohttp_12_http_parser_CIMultiDictProxy; __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_self->_headers) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->_headers);
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_headers = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":428
+ * headers = CIMultiDictProxy(self._headers)
+ *
+ * if upgrade or self._cparser.method == cparser.HTTP_CONNECT: # <<<<<<<<<<<<<<
+ * self._upgraded = True
+ *
+ */
+ __pyx_t_6 = (__pyx_v_upgrade != 0);
+ if (!__pyx_t_6) {
+ } else {
+ __pyx_t_5 = __pyx_t_6;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_6 = ((__pyx_v_self->_cparser->method == HTTP_CONNECT) != 0);
+ __pyx_t_5 = __pyx_t_6;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_5) {
+
+ /* "aiohttp/_http_parser.pyx":429
+ *
+ * if upgrade or self._cparser.method == cparser.HTTP_CONNECT:
+ * self._upgraded = True # <<<<<<<<<<<<<<
+ *
+ * # do not support old websocket spec
+ */
+ __pyx_v_self->_upgraded = 1;
+
+ /* "aiohttp/_http_parser.pyx":428
+ * headers = CIMultiDictProxy(self._headers)
+ *
+ * if upgrade or self._cparser.method == cparser.HTTP_CONNECT: # <<<<<<<<<<<<<<
+ * self._upgraded = True
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":432
+ *
+ * # do not support old websocket spec
+ * if SEC_WEBSOCKET_KEY1 in headers: # <<<<<<<<<<<<<<
+ * raise InvalidHeader(SEC_WEBSOCKET_KEY1)
+ *
+ */
+ __pyx_t_5 = (__Pyx_PySequence_ContainsTF(__pyx_v_7aiohttp_12_http_parser_SEC_WEBSOCKET_KEY1, __pyx_v_headers, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 432, __pyx_L1_error)
+ __pyx_t_6 = (__pyx_t_5 != 0);
+ if (unlikely(__pyx_t_6)) {
+
+ /* "aiohttp/_http_parser.pyx":433
+ * # do not support old websocket spec
+ * if SEC_WEBSOCKET_KEY1 in headers:
+ * raise InvalidHeader(SEC_WEBSOCKET_KEY1) # <<<<<<<<<<<<<<
+ *
+ * encoding = None
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_InvalidHeader); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_7aiohttp_12_http_parser_SEC_WEBSOCKET_KEY1) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_7aiohttp_12_http_parser_SEC_WEBSOCKET_KEY1);
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 433, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":432
+ *
+ * # do not support old websocket spec
+ * if SEC_WEBSOCKET_KEY1 in headers: # <<<<<<<<<<<<<<
+ * raise InvalidHeader(SEC_WEBSOCKET_KEY1)
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":435
+ * raise InvalidHeader(SEC_WEBSOCKET_KEY1)
+ *
+ * encoding = None # <<<<<<<<<<<<<<
+ * enc = self._content_encoding
+ * if enc is not None:
+ */
+ __Pyx_INCREF(Py_None);
+ __pyx_v_encoding = Py_None;
+
+ /* "aiohttp/_http_parser.pyx":436
+ *
+ * encoding = None
+ * enc = self._content_encoding # <<<<<<<<<<<<<<
+ * if enc is not None:
+ * self._content_encoding = None
+ */
+ __pyx_t_1 = __pyx_v_self->_content_encoding;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_enc = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":437
+ * encoding = None
+ * enc = self._content_encoding
+ * if enc is not None: # <<<<<<<<<<<<<<
+ * self._content_encoding = None
+ * enc = enc.lower()
+ */
+ __pyx_t_6 = (__pyx_v_enc != Py_None);
+ __pyx_t_5 = (__pyx_t_6 != 0);
+ if (__pyx_t_5) {
+
+ /* "aiohttp/_http_parser.pyx":438
+ * enc = self._content_encoding
+ * if enc is not None:
+ * self._content_encoding = None # <<<<<<<<<<<<<<
+ * enc = enc.lower()
+ * if enc in ('gzip', 'deflate', 'br'):
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_content_encoding);
+ __Pyx_DECREF(__pyx_v_self->_content_encoding);
+ __pyx_v_self->_content_encoding = ((PyObject*)Py_None);
+
+ /* "aiohttp/_http_parser.pyx":439
+ * if enc is not None:
+ * self._content_encoding = None
+ * enc = enc.lower() # <<<<<<<<<<<<<<
+ * if enc in ('gzip', 'deflate', 'br'):
+ * encoding = enc
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_enc, __pyx_n_s_lower); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_enc, __pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":440
+ * self._content_encoding = None
+ * enc = enc.lower()
+ * if enc in ('gzip', 'deflate', 'br'): # <<<<<<<<<<<<<<
+ * encoding = enc
+ *
+ */
+ __Pyx_INCREF(__pyx_v_enc);
+ __pyx_t_1 = __pyx_v_enc;
+ __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_gzip, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 440, __pyx_L1_error)
+ if (!__pyx_t_6) {
+ } else {
+ __pyx_t_5 = __pyx_t_6;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_deflate, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 440, __pyx_L1_error)
+ if (!__pyx_t_6) {
+ } else {
+ __pyx_t_5 = __pyx_t_6;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_6 = (__Pyx_PyUnicode_Equals(__pyx_t_1, __pyx_n_u_br, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 440, __pyx_L1_error)
+ __pyx_t_5 = __pyx_t_6;
+ __pyx_L9_bool_binop_done:;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = (__pyx_t_5 != 0);
+ if (__pyx_t_6) {
+
+ /* "aiohttp/_http_parser.pyx":441
+ * enc = enc.lower()
+ * if enc in ('gzip', 'deflate', 'br'):
+ * encoding = enc # <<<<<<<<<<<<<<
+ *
+ * if self._cparser.type == cparser.HTTP_REQUEST:
+ */
+ __Pyx_INCREF(__pyx_v_enc);
+ __Pyx_DECREF_SET(__pyx_v_encoding, __pyx_v_enc);
+
+ /* "aiohttp/_http_parser.pyx":440
+ * self._content_encoding = None
+ * enc = enc.lower()
+ * if enc in ('gzip', 'deflate', 'br'): # <<<<<<<<<<<<<<
+ * encoding = enc
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":437
+ * encoding = None
+ * enc = self._content_encoding
+ * if enc is not None: # <<<<<<<<<<<<<<
+ * self._content_encoding = None
+ * enc = enc.lower()
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":443
+ * encoding = enc
+ *
+ * if self._cparser.type == cparser.HTTP_REQUEST: # <<<<<<<<<<<<<<
+ * msg = _new_request_message(
+ * method, self._path,
+ */
+ __pyx_t_6 = ((__pyx_v_self->_cparser->type == HTTP_REQUEST) != 0);
+ if (__pyx_t_6) {
+
+ /* "aiohttp/_http_parser.pyx":445
+ * if self._cparser.type == cparser.HTTP_REQUEST:
+ * msg = _new_request_message(
+ * method, self._path, # <<<<<<<<<<<<<<
+ * self.http_version(), headers, raw_headers,
+ * should_close, encoding, upgrade, chunked, self._url)
+ */
+ __pyx_t_1 = __pyx_v_self->_path;
+ __Pyx_INCREF(__pyx_t_1);
+
+ /* "aiohttp/_http_parser.pyx":446
+ * msg = _new_request_message(
+ * method, self._path,
+ * self.http_version(), headers, raw_headers, # <<<<<<<<<<<<<<
+ * should_close, encoding, upgrade, chunked, self._url)
+ * else:
+ */
+ __pyx_t_3 = __pyx_f_7aiohttp_12_http_parser_10HttpParser_http_version(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "aiohttp/_http_parser.pyx":447
+ * method, self._path,
+ * self.http_version(), headers, raw_headers,
+ * should_close, encoding, upgrade, chunked, self._url) # <<<<<<<<<<<<<<
+ * else:
+ * msg = _new_response_message(
+ */
+ __pyx_t_4 = __pyx_v_self->_url;
+ __Pyx_INCREF(__pyx_t_4);
+
+ /* "aiohttp/_http_parser.pyx":444
+ *
+ * if self._cparser.type == cparser.HTTP_REQUEST:
+ * msg = _new_request_message( # <<<<<<<<<<<<<<
+ * method, self._path,
+ * self.http_version(), headers, raw_headers,
+ */
+ __pyx_t_7 = __pyx_f_7aiohttp_12_http_parser__new_request_message(__pyx_v_method, ((PyObject*)__pyx_t_1), __pyx_t_3, __pyx_v_headers, __pyx_v_raw_headers, __pyx_v_should_close, __pyx_v_encoding, __pyx_v_upgrade, __pyx_v_chunked, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 444, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_msg = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "aiohttp/_http_parser.pyx":443
+ * encoding = enc
+ *
+ * if self._cparser.type == cparser.HTTP_REQUEST: # <<<<<<<<<<<<<<
+ * msg = _new_request_message(
+ * method, self._path,
+ */
+ goto __pyx_L12;
+ }
+
+ /* "aiohttp/_http_parser.pyx":449
+ * should_close, encoding, upgrade, chunked, self._url)
+ * else:
+ * msg = _new_response_message( # <<<<<<<<<<<<<<
+ * self.http_version(), self._cparser.status_code, self._reason,
+ * headers, raw_headers, should_close, encoding,
+ */
+ /*else*/ {
+
+ /* "aiohttp/_http_parser.pyx":450
+ * else:
+ * msg = _new_response_message(
+ * self.http_version(), self._cparser.status_code, self._reason, # <<<<<<<<<<<<<<
+ * headers, raw_headers, should_close, encoding,
+ * upgrade, chunked)
+ */
+ __pyx_t_7 = __pyx_f_7aiohttp_12_http_parser_10HttpParser_http_version(__pyx_v_self); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_4 = __pyx_v_self->_reason;
+ __Pyx_INCREF(__pyx_t_4);
+
+ /* "aiohttp/_http_parser.pyx":449
+ * should_close, encoding, upgrade, chunked, self._url)
+ * else:
+ * msg = _new_response_message( # <<<<<<<<<<<<<<
+ * self.http_version(), self._cparser.status_code, self._reason,
+ * headers, raw_headers, should_close, encoding,
+ */
+ __pyx_t_3 = __pyx_f_7aiohttp_12_http_parser__new_response_message(__pyx_t_7, __pyx_v_self->_cparser->status_code, ((PyObject*)__pyx_t_4), __pyx_v_headers, __pyx_v_raw_headers, __pyx_v_should_close, __pyx_v_encoding, __pyx_v_upgrade, __pyx_v_chunked); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 449, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_msg = __pyx_t_3;
+ __pyx_t_3 = 0;
+ }
+ __pyx_L12:;
+
+ /* "aiohttp/_http_parser.pyx":455
+ *
+ * if (
+ * ULLONG_MAX > self._cparser.content_length > 0 or chunked or # <<<<<<<<<<<<<<
+ * self._cparser.method == cparser.HTTP_CONNECT or
+ * (self._cparser.status_code >= 199 and
+ */
+ __pyx_t_5 = (ULLONG_MAX > __pyx_v_self->_cparser->content_length);
+ if (__pyx_t_5) {
+ __pyx_t_5 = (__pyx_v_self->_cparser->content_length > 0);
+ }
+ __pyx_t_8 = (__pyx_t_5 != 0);
+ if (!__pyx_t_8) {
+ } else {
+ __pyx_t_6 = __pyx_t_8;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_t_8 = (__pyx_v_chunked != 0);
+ if (!__pyx_t_8) {
+ } else {
+ __pyx_t_6 = __pyx_t_8;
+ goto __pyx_L14_bool_binop_done;
+ }
+
+ /* "aiohttp/_http_parser.pyx":456
+ * if (
+ * ULLONG_MAX > self._cparser.content_length > 0 or chunked or
+ * self._cparser.method == cparser.HTTP_CONNECT or # <<<<<<<<<<<<<<
+ * (self._cparser.status_code >= 199 and
+ * self._cparser.content_length == 0 and
+ */
+ __pyx_t_8 = ((__pyx_v_self->_cparser->method == HTTP_CONNECT) != 0);
+ if (!__pyx_t_8) {
+ } else {
+ __pyx_t_6 = __pyx_t_8;
+ goto __pyx_L14_bool_binop_done;
+ }
+
+ /* "aiohttp/_http_parser.pyx":457
+ * ULLONG_MAX > self._cparser.content_length > 0 or chunked or
+ * self._cparser.method == cparser.HTTP_CONNECT or
+ * (self._cparser.status_code >= 199 and # <<<<<<<<<<<<<<
+ * self._cparser.content_length == 0 and
+ * self._read_until_eof)
+ */
+ __pyx_t_8 = ((__pyx_v_self->_cparser->status_code >= 0xC7) != 0);
+ if (__pyx_t_8) {
+ } else {
+ __pyx_t_6 = __pyx_t_8;
+ goto __pyx_L14_bool_binop_done;
+ }
+
+ /* "aiohttp/_http_parser.pyx":458
+ * self._cparser.method == cparser.HTTP_CONNECT or
+ * (self._cparser.status_code >= 199 and
+ * self._cparser.content_length == 0 and # <<<<<<<<<<<<<<
+ * self._read_until_eof)
+ * ):
+ */
+ __pyx_t_8 = ((__pyx_v_self->_cparser->content_length == 0) != 0);
+ if (__pyx_t_8) {
+ } else {
+ __pyx_t_6 = __pyx_t_8;
+ goto __pyx_L14_bool_binop_done;
+ }
+
+ /* "aiohttp/_http_parser.pyx":459
+ * (self._cparser.status_code >= 199 and
+ * self._cparser.content_length == 0 and
+ * self._read_until_eof) # <<<<<<<<<<<<<<
+ * ):
+ * payload = StreamReader(
+ */
+ __pyx_t_8 = (__pyx_v_self->_read_until_eof != 0);
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_L14_bool_binop_done:;
+
+ /* "aiohttp/_http_parser.pyx":454
+ * upgrade, chunked)
+ *
+ * if ( # <<<<<<<<<<<<<<
+ * ULLONG_MAX > self._cparser.content_length > 0 or chunked or
+ * self._cparser.method == cparser.HTTP_CONNECT or
+ */
+ if (__pyx_t_6) {
+
+ /* "aiohttp/_http_parser.pyx":461
+ * self._read_until_eof)
+ * ):
+ * payload = StreamReader( # <<<<<<<<<<<<<<
+ * self._protocol, timer=self._timer, loop=self._loop,
+ * limit=self._limit)
+ */
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_self->_protocol);
+ __Pyx_GIVEREF(__pyx_v_self->_protocol);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->_protocol);
+
+ /* "aiohttp/_http_parser.pyx":462
+ * ):
+ * payload = StreamReader(
+ * self._protocol, timer=self._timer, loop=self._loop, # <<<<<<<<<<<<<<
+ * limit=self._limit)
+ * else:
+ */
+ __pyx_t_4 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 462, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_timer, __pyx_v_self->_timer) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_loop, __pyx_v_self->_loop) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":463
+ * payload = StreamReader(
+ * self._protocol, timer=self._timer, loop=self._loop,
+ * limit=self._limit) # <<<<<<<<<<<<<<
+ * else:
+ * payload = EMPTY_PAYLOAD
+ */
+ __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_self->_limit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 463, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_limit, __pyx_t_7) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "aiohttp/_http_parser.pyx":461
+ * self._read_until_eof)
+ * ):
+ * payload = StreamReader( # <<<<<<<<<<<<<<
+ * self._protocol, timer=self._timer, loop=self._loop,
+ * limit=self._limit)
+ */
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_v_7aiohttp_12_http_parser_StreamReader, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 461, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_payload = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "aiohttp/_http_parser.pyx":454
+ * upgrade, chunked)
+ *
+ * if ( # <<<<<<<<<<<<<<
+ * ULLONG_MAX > self._cparser.content_length > 0 or chunked or
+ * self._cparser.method == cparser.HTTP_CONNECT or
+ */
+ goto __pyx_L13;
+ }
+
+ /* "aiohttp/_http_parser.pyx":465
+ * limit=self._limit)
+ * else:
+ * payload = EMPTY_PAYLOAD # <<<<<<<<<<<<<<
+ *
+ * self._payload = payload
+ */
+ /*else*/ {
+ __Pyx_INCREF(__pyx_v_7aiohttp_12_http_parser_EMPTY_PAYLOAD);
+ __pyx_v_payload = __pyx_v_7aiohttp_12_http_parser_EMPTY_PAYLOAD;
+ }
+ __pyx_L13:;
+
+ /* "aiohttp/_http_parser.pyx":467
+ * payload = EMPTY_PAYLOAD
+ *
+ * self._payload = payload # <<<<<<<<<<<<<<
+ * if encoding is not None and self._auto_decompress:
+ * self._payload = DeflateBuffer(payload, encoding)
+ */
+ __Pyx_INCREF(__pyx_v_payload);
+ __Pyx_GIVEREF(__pyx_v_payload);
+ __Pyx_GOTREF(__pyx_v_self->_payload);
+ __Pyx_DECREF(__pyx_v_self->_payload);
+ __pyx_v_self->_payload = __pyx_v_payload;
+
+ /* "aiohttp/_http_parser.pyx":468
+ *
+ * self._payload = payload
+ * if encoding is not None and self._auto_decompress: # <<<<<<<<<<<<<<
+ * self._payload = DeflateBuffer(payload, encoding)
+ *
+ */
+ __pyx_t_8 = (__pyx_v_encoding != Py_None);
+ __pyx_t_5 = (__pyx_t_8 != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_6 = __pyx_t_5;
+ goto __pyx_L21_bool_binop_done;
+ }
+ __pyx_t_5 = (__pyx_v_self->_auto_decompress != 0);
+ __pyx_t_6 = __pyx_t_5;
+ __pyx_L21_bool_binop_done:;
+ if (__pyx_t_6) {
+
+ /* "aiohttp/_http_parser.pyx":469
+ * self._payload = payload
+ * if encoding is not None and self._auto_decompress:
+ * self._payload = DeflateBuffer(payload, encoding) # <<<<<<<<<<<<<<
+ *
+ * if not self._response_with_body:
+ */
+ __Pyx_INCREF(__pyx_v_7aiohttp_12_http_parser_DeflateBuffer);
+ __pyx_t_4 = __pyx_v_7aiohttp_12_http_parser_DeflateBuffer; __pyx_t_3 = NULL;
+ __pyx_t_9 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ __pyx_t_9 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_payload, __pyx_v_encoding};
+ __pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 469, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_payload, __pyx_v_encoding};
+ __pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 469, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_7);
+ } else
+ #endif
+ {
+ __pyx_t_1 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_payload);
+ __Pyx_GIVEREF(__pyx_v_payload);
+ PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_9, __pyx_v_payload);
+ __Pyx_INCREF(__pyx_v_encoding);
+ __Pyx_GIVEREF(__pyx_v_encoding);
+ PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_9, __pyx_v_encoding);
+ __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 469, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GIVEREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_v_self->_payload);
+ __Pyx_DECREF(__pyx_v_self->_payload);
+ __pyx_v_self->_payload = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "aiohttp/_http_parser.pyx":468
+ *
+ * self._payload = payload
+ * if encoding is not None and self._auto_decompress: # <<<<<<<<<<<<<<
+ * self._payload = DeflateBuffer(payload, encoding)
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":471
+ * self._payload = DeflateBuffer(payload, encoding)
+ *
+ * if not self._response_with_body: # <<<<<<<<<<<<<<
+ * payload = EMPTY_PAYLOAD
+ *
+ */
+ __pyx_t_6 = ((!(__pyx_v_self->_response_with_body != 0)) != 0);
+ if (__pyx_t_6) {
+
+ /* "aiohttp/_http_parser.pyx":472
+ *
+ * if not self._response_with_body:
+ * payload = EMPTY_PAYLOAD # <<<<<<<<<<<<<<
+ *
+ * self._messages.append((msg, payload))
+ */
+ __Pyx_INCREF(__pyx_v_7aiohttp_12_http_parser_EMPTY_PAYLOAD);
+ __Pyx_DECREF_SET(__pyx_v_payload, __pyx_v_7aiohttp_12_http_parser_EMPTY_PAYLOAD);
+
+ /* "aiohttp/_http_parser.pyx":471
+ * self._payload = DeflateBuffer(payload, encoding)
+ *
+ * if not self._response_with_body: # <<<<<<<<<<<<<<
+ * payload = EMPTY_PAYLOAD
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":474
+ * payload = EMPTY_PAYLOAD
+ *
+ * self._messages.append((msg, payload)) # <<<<<<<<<<<<<<
+ *
+ * cdef _on_message_complete(self):
+ */
+ if (unlikely(__pyx_v_self->_messages == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+ __PYX_ERR(0, 474, __pyx_L1_error)
+ }
+ __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 474, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_v_msg);
+ __Pyx_GIVEREF(__pyx_v_msg);
+ PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_msg);
+ __Pyx_INCREF(__pyx_v_payload);
+ __Pyx_GIVEREF(__pyx_v_payload);
+ PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_payload);
+ __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_self->_messages, __pyx_t_7); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 474, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "aiohttp/_http_parser.pyx":417
+ * self._has_value = True
+ *
+ * cdef _on_headers_complete(self): # <<<<<<<<<<<<<<
+ * self._process_header()
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser._on_headers_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_method);
+ __Pyx_XDECREF(__pyx_v_raw_headers);
+ __Pyx_XDECREF(__pyx_v_headers);
+ __Pyx_XDECREF(__pyx_v_encoding);
+ __Pyx_XDECREF(__pyx_v_enc);
+ __Pyx_XDECREF(__pyx_v_msg);
+ __Pyx_XDECREF(__pyx_v_payload);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":476
+ * self._messages.append((msg, payload))
+ *
+ * cdef _on_message_complete(self): # <<<<<<<<<<<<<<
+ * self._payload.feed_eof()
+ * self._payload = None
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_message_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_on_message_complete", 0);
+
+ /* "aiohttp/_http_parser.pyx":477
+ *
+ * cdef _on_message_complete(self):
+ * self._payload.feed_eof() # <<<<<<<<<<<<<<
+ * self._payload = None
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_payload, __pyx_n_s_feed_eof); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":478
+ * cdef _on_message_complete(self):
+ * self._payload.feed_eof()
+ * self._payload = None # <<<<<<<<<<<<<<
+ *
+ * cdef _on_chunk_header(self):
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_payload);
+ __Pyx_DECREF(__pyx_v_self->_payload);
+ __pyx_v_self->_payload = Py_None;
+
+ /* "aiohttp/_http_parser.pyx":476
+ * self._messages.append((msg, payload))
+ *
+ * cdef _on_message_complete(self): # <<<<<<<<<<<<<<
+ * self._payload.feed_eof()
+ * self._payload = None
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser._on_message_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":480
+ * self._payload = None
+ *
+ * cdef _on_chunk_header(self): # <<<<<<<<<<<<<<
+ * self._payload.begin_http_chunk_receiving()
+ *
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_chunk_header(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_on_chunk_header", 0);
+
+ /* "aiohttp/_http_parser.pyx":481
+ *
+ * cdef _on_chunk_header(self):
+ * self._payload.begin_http_chunk_receiving() # <<<<<<<<<<<<<<
+ *
+ * cdef _on_chunk_complete(self):
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_payload, __pyx_n_s_begin_http_chunk_receiving); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 481, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 481, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":480
+ * self._payload = None
+ *
+ * cdef _on_chunk_header(self): # <<<<<<<<<<<<<<
+ * self._payload.begin_http_chunk_receiving()
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser._on_chunk_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":483
+ * self._payload.begin_http_chunk_receiving()
+ *
+ * cdef _on_chunk_complete(self): # <<<<<<<<<<<<<<
+ * self._payload.end_http_chunk_receiving()
+ *
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_chunk_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_on_chunk_complete", 0);
+
+ /* "aiohttp/_http_parser.pyx":484
+ *
+ * cdef _on_chunk_complete(self):
+ * self._payload.end_http_chunk_receiving() # <<<<<<<<<<<<<<
+ *
+ * cdef object _on_status_complete(self):
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_payload, __pyx_n_s_end_http_chunk_receiving); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":483
+ * self._payload.begin_http_chunk_receiving()
+ *
+ * cdef _on_chunk_complete(self): # <<<<<<<<<<<<<<
+ * self._payload.end_http_chunk_receiving()
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser._on_chunk_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":486
+ * self._payload.end_http_chunk_receiving()
+ *
+ * cdef object _on_status_complete(self): # <<<<<<<<<<<<<<
+ * pass
+ *
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_status_complete(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_on_status_complete", 0);
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":489
+ * pass
+ *
+ * cdef inline http_version(self): # <<<<<<<<<<<<<<
+ * cdef cparser.llhttp_t* parser = self._cparser
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_7aiohttp_12_http_parser_10HttpParser_http_version(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ llhttp_t *__pyx_v_parser;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ llhttp_t *__pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("http_version", 0);
+
+ /* "aiohttp/_http_parser.pyx":490
+ *
+ * cdef inline http_version(self):
+ * cdef cparser.llhttp_t* parser = self._cparser # <<<<<<<<<<<<<<
+ *
+ * if parser.http_major == 1:
+ */
+ __pyx_t_1 = __pyx_v_self->_cparser;
+ __pyx_v_parser = __pyx_t_1;
+
+ /* "aiohttp/_http_parser.pyx":492
+ * cdef cparser.llhttp_t* parser = self._cparser
+ *
+ * if parser.http_major == 1: # <<<<<<<<<<<<<<
+ * if parser.http_minor == 0:
+ * return HttpVersion10
+ */
+ __pyx_t_2 = ((__pyx_v_parser->http_major == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":493
+ *
+ * if parser.http_major == 1:
+ * if parser.http_minor == 0: # <<<<<<<<<<<<<<
+ * return HttpVersion10
+ * elif parser.http_minor == 1:
+ */
+ switch (__pyx_v_parser->http_minor) {
+ case 0:
+
+ /* "aiohttp/_http_parser.pyx":494
+ * if parser.http_major == 1:
+ * if parser.http_minor == 0:
+ * return HttpVersion10 # <<<<<<<<<<<<<<
+ * elif parser.http_minor == 1:
+ * return HttpVersion11
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_7aiohttp_12_http_parser_HttpVersion10);
+ __pyx_r = __pyx_v_7aiohttp_12_http_parser_HttpVersion10;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":493
+ *
+ * if parser.http_major == 1:
+ * if parser.http_minor == 0: # <<<<<<<<<<<<<<
+ * return HttpVersion10
+ * elif parser.http_minor == 1:
+ */
+ break;
+ case 1:
+
+ /* "aiohttp/_http_parser.pyx":496
+ * return HttpVersion10
+ * elif parser.http_minor == 1:
+ * return HttpVersion11 # <<<<<<<<<<<<<<
+ *
+ * return HttpVersion(parser.http_major, parser.http_minor)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_7aiohttp_12_http_parser_HttpVersion11);
+ __pyx_r = __pyx_v_7aiohttp_12_http_parser_HttpVersion11;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":495
+ * if parser.http_minor == 0:
+ * return HttpVersion10
+ * elif parser.http_minor == 1: # <<<<<<<<<<<<<<
+ * return HttpVersion11
+ *
+ */
+ break;
+ default: break;
+ }
+
+ /* "aiohttp/_http_parser.pyx":492
+ * cdef cparser.llhttp_t* parser = self._cparser
+ *
+ * if parser.http_major == 1: # <<<<<<<<<<<<<<
+ * if parser.http_minor == 0:
+ * return HttpVersion10
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":498
+ * return HttpVersion11
+ *
+ * return HttpVersion(parser.http_major, parser.http_minor) # <<<<<<<<<<<<<<
+ *
+ * ### Public API ###
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_PyInt_From_uint8_t(__pyx_v_parser->http_major); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyInt_From_uint8_t(__pyx_v_parser->http_minor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_7aiohttp_12_http_parser_HttpVersion);
+ __pyx_t_6 = __pyx_v_7aiohttp_12_http_parser_HttpVersion; __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_4, __pyx_t_5};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 498, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":489
+ * pass
+ *
+ * cdef inline http_version(self): # <<<<<<<<<<<<<<
+ * cdef cparser.llhttp_t* parser = self._cparser
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser.http_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":502
+ * ### Public API ###
+ *
+ * def feed_eof(self): # <<<<<<<<<<<<<<
+ * cdef bytes desc
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_5feed_eof(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_5feed_eof(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("feed_eof (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_10HttpParser_4feed_eof(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_4feed_eof(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ PyObject *__pyx_v_desc = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("feed_eof", 0);
+
+ /* "aiohttp/_http_parser.pyx":505
+ * cdef bytes desc
+ *
+ * if self._payload is not None: # <<<<<<<<<<<<<<
+ * if self._cparser.flags & cparser.F_CHUNKED:
+ * raise TransferEncodingError(
+ */
+ __pyx_t_1 = (__pyx_v_self->_payload != Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":506
+ *
+ * if self._payload is not None:
+ * if self._cparser.flags & cparser.F_CHUNKED: # <<<<<<<<<<<<<<
+ * raise TransferEncodingError(
+ * "Not enough data for satisfy transfer length header.")
+ */
+ __pyx_t_2 = ((__pyx_v_self->_cparser->flags & F_CHUNKED) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "aiohttp/_http_parser.pyx":507
+ * if self._payload is not None:
+ * if self._cparser.flags & cparser.F_CHUNKED:
+ * raise TransferEncodingError( # <<<<<<<<<<<<<<
+ * "Not enough data for satisfy transfer length header.")
+ * elif self._cparser.flags & cparser.F_CONTENT_LENGTH:
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_TransferEncodingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Not_enough_data_for_satisfy_tran) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Not_enough_data_for_satisfy_tran);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(0, 507, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":506
+ *
+ * if self._payload is not None:
+ * if self._cparser.flags & cparser.F_CHUNKED: # <<<<<<<<<<<<<<
+ * raise TransferEncodingError(
+ * "Not enough data for satisfy transfer length header.")
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":509
+ * raise TransferEncodingError(
+ * "Not enough data for satisfy transfer length header.")
+ * elif self._cparser.flags & cparser.F_CONTENT_LENGTH: # <<<<<<<<<<<<<<
+ * raise ContentLengthError(
+ * "Not enough data for satisfy content length header.")
+ */
+ __pyx_t_2 = ((__pyx_v_self->_cparser->flags & F_CONTENT_LENGTH) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "aiohttp/_http_parser.pyx":510
+ * "Not enough data for satisfy transfer length header.")
+ * elif self._cparser.flags & cparser.F_CONTENT_LENGTH:
+ * raise ContentLengthError( # <<<<<<<<<<<<<<
+ * "Not enough data for satisfy content length header.")
+ * elif cparser.llhttp_get_errno(self._cparser) != cparser.HPE_OK:
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ContentLengthError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 510, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_Not_enough_data_for_satisfy_cont) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_Not_enough_data_for_satisfy_cont);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(0, 510, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":509
+ * raise TransferEncodingError(
+ * "Not enough data for satisfy transfer length header.")
+ * elif self._cparser.flags & cparser.F_CONTENT_LENGTH: # <<<<<<<<<<<<<<
+ * raise ContentLengthError(
+ * "Not enough data for satisfy content length header.")
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":512
+ * raise ContentLengthError(
+ * "Not enough data for satisfy content length header.")
+ * elif cparser.llhttp_get_errno(self._cparser) != cparser.HPE_OK: # <<<<<<<<<<<<<<
+ * desc = cparser.llhttp_get_error_reason(self._cparser)
+ * raise PayloadEncodingError(desc.decode('latin-1'))
+ */
+ __pyx_t_2 = ((llhttp_get_errno(__pyx_v_self->_cparser) != HPE_OK) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "aiohttp/_http_parser.pyx":513
+ * "Not enough data for satisfy content length header.")
+ * elif cparser.llhttp_get_errno(self._cparser) != cparser.HPE_OK:
+ * desc = cparser.llhttp_get_error_reason(self._cparser) # <<<<<<<<<<<<<<
+ * raise PayloadEncodingError(desc.decode('latin-1'))
+ * else:
+ */
+ __pyx_t_3 = __Pyx_PyBytes_FromString(llhttp_get_error_reason(__pyx_v_self->_cparser)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_v_desc = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":514
+ * elif cparser.llhttp_get_errno(self._cparser) != cparser.HPE_OK:
+ * desc = cparser.llhttp_get_error_reason(self._cparser)
+ * raise PayloadEncodingError(desc.decode('latin-1')) # <<<<<<<<<<<<<<
+ * else:
+ * self._payload.feed_eof()
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_PayloadEncodingError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 514, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_decode_bytes(__pyx_v_desc, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeLatin1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 514, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 514, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(0, 514, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":512
+ * raise ContentLengthError(
+ * "Not enough data for satisfy content length header.")
+ * elif cparser.llhttp_get_errno(self._cparser) != cparser.HPE_OK: # <<<<<<<<<<<<<<
+ * desc = cparser.llhttp_get_error_reason(self._cparser)
+ * raise PayloadEncodingError(desc.decode('latin-1'))
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":516
+ * raise PayloadEncodingError(desc.decode('latin-1'))
+ * else:
+ * self._payload.feed_eof() # <<<<<<<<<<<<<<
+ * elif self._started:
+ * self._on_headers_complete()
+ */
+ /*else*/ {
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_payload, __pyx_n_s_feed_eof); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 516, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 516, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":505
+ * cdef bytes desc
+ *
+ * if self._payload is not None: # <<<<<<<<<<<<<<
+ * if self._cparser.flags & cparser.F_CHUNKED:
+ * raise TransferEncodingError(
+ */
+ goto __pyx_L3;
+ }
+
+ /* "aiohttp/_http_parser.pyx":517
+ * else:
+ * self._payload.feed_eof()
+ * elif self._started: # <<<<<<<<<<<<<<
+ * self._on_headers_complete()
+ * if self._messages:
+ */
+ __pyx_t_2 = (__pyx_v_self->_started != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":518
+ * self._payload.feed_eof()
+ * elif self._started:
+ * self._on_headers_complete() # <<<<<<<<<<<<<<
+ * if self._messages:
+ * return self._messages[-1][0]
+ */
+ __pyx_t_3 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self->__pyx_vtab)->_on_headers_complete(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 518, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":519
+ * elif self._started:
+ * self._on_headers_complete()
+ * if self._messages: # <<<<<<<<<<<<<<
+ * return self._messages[-1][0]
+ *
+ */
+ __pyx_t_2 = (__pyx_v_self->_messages != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_messages) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":520
+ * self._on_headers_complete()
+ * if self._messages:
+ * return self._messages[-1][0] # <<<<<<<<<<<<<<
+ *
+ * def feed_data(self, data):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (unlikely(__pyx_v_self->_messages == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 520, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_self->_messages, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 520, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":519
+ * elif self._started:
+ * self._on_headers_complete()
+ * if self._messages: # <<<<<<<<<<<<<<
+ * return self._messages[-1][0]
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":517
+ * else:
+ * self._payload.feed_eof()
+ * elif self._started: # <<<<<<<<<<<<<<
+ * self._on_headers_complete()
+ * if self._messages:
+ */
+ }
+ __pyx_L3:;
+
+ /* "aiohttp/_http_parser.pyx":502
+ * ### Public API ###
+ *
+ * def feed_eof(self): # <<<<<<<<<<<<<<
+ * cdef bytes desc
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser.feed_eof", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_desc);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":522
+ * return self._messages[-1][0]
+ *
+ * def feed_data(self, data): # <<<<<<<<<<<<<<
+ * cdef:
+ * size_t data_len
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_7feed_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_7feed_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("feed_data (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_10HttpParser_6feed_data(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self), ((PyObject *)__pyx_v_data));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_6feed_data(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, PyObject *__pyx_v_data) {
+ size_t __pyx_v_data_len;
+ size_t __pyx_v_nb;
+ llhttp_errno_t __pyx_v_errno;
+ PyObject *__pyx_v_ex = NULL;
+ char const *__pyx_v_after;
+ PyObject *__pyx_v_before = NULL;
+ PyObject *__pyx_v_after_b = NULL;
+ PyObject *__pyx_v_pointer = NULL;
+ PyObject *__pyx_v_messages = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("feed_data", 0);
+ __Pyx_INCREF(__pyx_v_data);
+
+ /* "aiohttp/_http_parser.pyx":528
+ * cdef cparser.llhttp_errno_t errno
+ *
+ * PyObject_GetBuffer(data, &self.py_buf, PyBUF_SIMPLE) # <<<<<<<<<<<<<<
+ * data_len = <size_t>self.py_buf.len
+ *
+ */
+ __pyx_t_1 = PyObject_GetBuffer(__pyx_v_data, (&__pyx_v_self->py_buf), PyBUF_SIMPLE); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 528, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":529
+ *
+ * PyObject_GetBuffer(data, &self.py_buf, PyBUF_SIMPLE)
+ * data_len = <size_t>self.py_buf.len # <<<<<<<<<<<<<<
+ *
+ * errno = cparser.llhttp_execute(
+ */
+ __pyx_v_data_len = ((size_t)__pyx_v_self->py_buf.len);
+
+ /* "aiohttp/_http_parser.pyx":531
+ * data_len = <size_t>self.py_buf.len
+ *
+ * errno = cparser.llhttp_execute( # <<<<<<<<<<<<<<
+ * self._cparser,
+ * <char*>self.py_buf.buf,
+ */
+ __pyx_v_errno = llhttp_execute(__pyx_v_self->_cparser, ((char *)__pyx_v_self->py_buf.buf), __pyx_v_data_len);
+
+ /* "aiohttp/_http_parser.pyx":536
+ * data_len)
+ *
+ * if errno is cparser.HPE_PAUSED_UPGRADE: # <<<<<<<<<<<<<<
+ * cparser.llhttp_resume_after_upgrade(self._cparser)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_errno == HPE_PAUSED_UPGRADE) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":537
+ *
+ * if errno is cparser.HPE_PAUSED_UPGRADE:
+ * cparser.llhttp_resume_after_upgrade(self._cparser) # <<<<<<<<<<<<<<
+ *
+ * nb = cparser.llhttp_get_error_pos(self._cparser) - <char*>self.py_buf.buf
+ */
+ llhttp_resume_after_upgrade(__pyx_v_self->_cparser);
+
+ /* "aiohttp/_http_parser.pyx":539
+ * cparser.llhttp_resume_after_upgrade(self._cparser)
+ *
+ * nb = cparser.llhttp_get_error_pos(self._cparser) - <char*>self.py_buf.buf # <<<<<<<<<<<<<<
+ *
+ * PyBuffer_Release(&self.py_buf)
+ */
+ __pyx_v_nb = (llhttp_get_error_pos(__pyx_v_self->_cparser) - ((char *)__pyx_v_self->py_buf.buf));
+
+ /* "aiohttp/_http_parser.pyx":536
+ * data_len)
+ *
+ * if errno is cparser.HPE_PAUSED_UPGRADE: # <<<<<<<<<<<<<<
+ * cparser.llhttp_resume_after_upgrade(self._cparser)
+ *
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":541
+ * nb = cparser.llhttp_get_error_pos(self._cparser) - <char*>self.py_buf.buf
+ *
+ * PyBuffer_Release(&self.py_buf) # <<<<<<<<<<<<<<
+ *
+ * if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE):
+ */
+ PyBuffer_Release((&__pyx_v_self->py_buf));
+
+ /* "aiohttp/_http_parser.pyx":543
+ * PyBuffer_Release(&self.py_buf)
+ *
+ * if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE): # <<<<<<<<<<<<<<
+ * if self._payload_error == 0:
+ * if self._last_error is not None:
+ */
+ switch (__pyx_v_errno) {
+ case HPE_OK:
+ case HPE_PAUSED_UPGRADE:
+ __pyx_t_2 = 0;
+ break;
+ default:
+ __pyx_t_2 = 1;
+ break;
+ }
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "aiohttp/_http_parser.pyx":544
+ *
+ * if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE):
+ * if self._payload_error == 0: # <<<<<<<<<<<<<<
+ * if self._last_error is not None:
+ * ex = self._last_error
+ */
+ __pyx_t_3 = ((__pyx_v_self->_payload_error == 0) != 0);
+ if (__pyx_t_3) {
+
+ /* "aiohttp/_http_parser.pyx":545
+ * if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE):
+ * if self._payload_error == 0:
+ * if self._last_error is not None: # <<<<<<<<<<<<<<
+ * ex = self._last_error
+ * self._last_error = None
+ */
+ __pyx_t_3 = (__pyx_v_self->_last_error != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":546
+ * if self._payload_error == 0:
+ * if self._last_error is not None:
+ * ex = self._last_error # <<<<<<<<<<<<<<
+ * self._last_error = None
+ * else:
+ */
+ __pyx_t_4 = __pyx_v_self->_last_error;
+ __Pyx_INCREF(__pyx_t_4);
+ __pyx_v_ex = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "aiohttp/_http_parser.pyx":547
+ * if self._last_error is not None:
+ * ex = self._last_error
+ * self._last_error = None # <<<<<<<<<<<<<<
+ * else:
+ * after = cparser.llhttp_get_error_pos(self._cparser)
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_last_error);
+ __Pyx_DECREF(__pyx_v_self->_last_error);
+ __pyx_v_self->_last_error = Py_None;
+
+ /* "aiohttp/_http_parser.pyx":545
+ * if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE):
+ * if self._payload_error == 0:
+ * if self._last_error is not None: # <<<<<<<<<<<<<<
+ * ex = self._last_error
+ * self._last_error = None
+ */
+ goto __pyx_L6;
+ }
+
+ /* "aiohttp/_http_parser.pyx":549
+ * self._last_error = None
+ * else:
+ * after = cparser.llhttp_get_error_pos(self._cparser) # <<<<<<<<<<<<<<
+ * before = data[:after - <char*>self.py_buf.buf]
+ * after_b = after.split(b"\n", 1)[0]
+ */
+ /*else*/ {
+ __pyx_v_after = llhttp_get_error_pos(__pyx_v_self->_cparser);
+
+ /* "aiohttp/_http_parser.pyx":550
+ * else:
+ * after = cparser.llhttp_get_error_pos(self._cparser)
+ * before = data[:after - <char*>self.py_buf.buf] # <<<<<<<<<<<<<<
+ * after_b = after.split(b"\n", 1)[0]
+ * before = before.rsplit(b"\n", 1)[-1]
+ */
+ __pyx_t_4 = __Pyx_PyObject_GetSlice(__pyx_v_data, 0, (__pyx_v_after - ((char *)__pyx_v_self->py_buf.buf)), NULL, NULL, NULL, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_v_before = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "aiohttp/_http_parser.pyx":551
+ * after = cparser.llhttp_get_error_pos(self._cparser)
+ * before = data[:after - <char*>self.py_buf.buf]
+ * after_b = after.split(b"\n", 1)[0] # <<<<<<<<<<<<<<
+ * before = before.rsplit(b"\n", 1)[-1]
+ * data = before + after_b
+ */
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_after); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_after_b = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "aiohttp/_http_parser.pyx":552
+ * before = data[:after - <char*>self.py_buf.buf]
+ * after_b = after.split(b"\n", 1)[0]
+ * before = before.rsplit(b"\n", 1)[-1] # <<<<<<<<<<<<<<
+ * data = before + after_b
+ * pointer = " " * (len(repr(before))-1) + "^"
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_before, __pyx_n_s_rsplit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 552, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(__pyx_v_before, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "aiohttp/_http_parser.pyx":553
+ * after_b = after.split(b"\n", 1)[0]
+ * before = before.rsplit(b"\n", 1)[-1]
+ * data = before + after_b # <<<<<<<<<<<<<<
+ * pointer = " " * (len(repr(before))-1) + "^"
+ * ex = parser_error_from_errno(self._cparser, data, pointer)
+ */
+ __pyx_t_5 = PyNumber_Add(__pyx_v_before, __pyx_v_after_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "aiohttp/_http_parser.pyx":554
+ * before = before.rsplit(b"\n", 1)[-1]
+ * data = before + after_b
+ * pointer = " " * (len(repr(before))-1) + "^" # <<<<<<<<<<<<<<
+ * ex = parser_error_from_errno(self._cparser, data, pointer)
+ * self._payload = None
+ */
+ __pyx_t_5 = PyObject_Repr(__pyx_v_before); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 554, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyInt_FromSsize_t((__pyx_t_6 - 1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = PyNumber_Multiply(__pyx_kp_u__6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u__7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (!(likely(PyUnicode_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(0, 554, __pyx_L1_error)
+ __pyx_v_pointer = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "aiohttp/_http_parser.pyx":555
+ * data = before + after_b
+ * pointer = " " * (len(repr(before))-1) + "^"
+ * ex = parser_error_from_errno(self._cparser, data, pointer) # <<<<<<<<<<<<<<
+ * self._payload = None
+ * raise ex
+ */
+ __pyx_t_5 = __pyx_f_7aiohttp_12_http_parser_parser_error_from_errno(__pyx_v_self->_cparser, __pyx_v_data, __pyx_v_pointer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_v_ex = __pyx_t_5;
+ __pyx_t_5 = 0;
+ }
+ __pyx_L6:;
+
+ /* "aiohttp/_http_parser.pyx":556
+ * pointer = " " * (len(repr(before))-1) + "^"
+ * ex = parser_error_from_errno(self._cparser, data, pointer)
+ * self._payload = None # <<<<<<<<<<<<<<
+ * raise ex
+ *
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_self->_payload);
+ __Pyx_DECREF(__pyx_v_self->_payload);
+ __pyx_v_self->_payload = Py_None;
+
+ /* "aiohttp/_http_parser.pyx":557
+ * ex = parser_error_from_errno(self._cparser, data, pointer)
+ * self._payload = None
+ * raise ex # <<<<<<<<<<<<<<
+ *
+ * if self._messages:
+ */
+ __Pyx_Raise(__pyx_v_ex, 0, 0, 0);
+ __PYX_ERR(0, 557, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":544
+ *
+ * if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE):
+ * if self._payload_error == 0: # <<<<<<<<<<<<<<
+ * if self._last_error is not None:
+ * ex = self._last_error
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":543
+ * PyBuffer_Release(&self.py_buf)
+ *
+ * if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE): # <<<<<<<<<<<<<<
+ * if self._payload_error == 0:
+ * if self._last_error is not None:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":559
+ * raise ex
+ *
+ * if self._messages: # <<<<<<<<<<<<<<
+ * messages = self._messages
+ * self._messages = []
+ */
+ __pyx_t_2 = (__pyx_v_self->_messages != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_messages) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":560
+ *
+ * if self._messages:
+ * messages = self._messages # <<<<<<<<<<<<<<
+ * self._messages = []
+ * else:
+ */
+ __pyx_t_5 = __pyx_v_self->_messages;
+ __Pyx_INCREF(__pyx_t_5);
+ __pyx_v_messages = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "aiohttp/_http_parser.pyx":561
+ * if self._messages:
+ * messages = self._messages
+ * self._messages = [] # <<<<<<<<<<<<<<
+ * else:
+ * messages = ()
+ */
+ __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_v_self->_messages);
+ __Pyx_DECREF(__pyx_v_self->_messages);
+ __pyx_v_self->_messages = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "aiohttp/_http_parser.pyx":559
+ * raise ex
+ *
+ * if self._messages: # <<<<<<<<<<<<<<
+ * messages = self._messages
+ * self._messages = []
+ */
+ goto __pyx_L7;
+ }
+
+ /* "aiohttp/_http_parser.pyx":563
+ * self._messages = []
+ * else:
+ * messages = () # <<<<<<<<<<<<<<
+ *
+ * if self._upgraded:
+ */
+ /*else*/ {
+ __Pyx_INCREF(__pyx_empty_tuple);
+ __pyx_v_messages = __pyx_empty_tuple;
+ }
+ __pyx_L7:;
+
+ /* "aiohttp/_http_parser.pyx":565
+ * messages = ()
+ *
+ * if self._upgraded: # <<<<<<<<<<<<<<
+ * return messages, True, data[nb:]
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_self->_upgraded != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":566
+ *
+ * if self._upgraded:
+ * return messages, True, data[nb:] # <<<<<<<<<<<<<<
+ * else:
+ * return messages, False, b''
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_v_data, __pyx_v_nb, 0, NULL, NULL, NULL, 1, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 566, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_messages);
+ __Pyx_GIVEREF(__pyx_v_messages);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_messages);
+ __Pyx_INCREF(Py_True);
+ __Pyx_GIVEREF(Py_True);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, Py_True);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":565
+ * messages = ()
+ *
+ * if self._upgraded: # <<<<<<<<<<<<<<
+ * return messages, True, data[nb:]
+ * else:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":568
+ * return messages, True, data[nb:]
+ * else:
+ * return messages, False, b'' # <<<<<<<<<<<<<<
+ *
+ * def set_upgraded(self, val):
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 568, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_messages);
+ __Pyx_GIVEREF(__pyx_v_messages);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_messages);
+ __Pyx_INCREF(Py_False);
+ __Pyx_GIVEREF(Py_False);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, Py_False);
+ __Pyx_INCREF(__pyx_kp_b__8);
+ __Pyx_GIVEREF(__pyx_kp_b__8);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_kp_b__8);
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":522
+ * return self._messages[-1][0]
+ *
+ * def feed_data(self, data): # <<<<<<<<<<<<<<
+ * cdef:
+ * size_t data_len
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser.feed_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_ex);
+ __Pyx_XDECREF(__pyx_v_before);
+ __Pyx_XDECREF(__pyx_v_after_b);
+ __Pyx_XDECREF(__pyx_v_pointer);
+ __Pyx_XDECREF(__pyx_v_messages);
+ __Pyx_XDECREF(__pyx_v_data);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":570
+ * return messages, False, b''
+ *
+ * def set_upgraded(self, val): # <<<<<<<<<<<<<<
+ * self._upgraded = val
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_9set_upgraded(PyObject *__pyx_v_self, PyObject *__pyx_v_val); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_9set_upgraded(PyObject *__pyx_v_self, PyObject *__pyx_v_val) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("set_upgraded (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_10HttpParser_8set_upgraded(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self), ((PyObject *)__pyx_v_val));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_8set_upgraded(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, PyObject *__pyx_v_val) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("set_upgraded", 0);
+
+ /* "aiohttp/_http_parser.pyx":571
+ *
+ * def set_upgraded(self, val):
+ * self._upgraded = val # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_val); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 571, __pyx_L1_error)
+ __pyx_v_self->_upgraded = __pyx_t_1;
+
+ /* "aiohttp/_http_parser.pyx":570
+ * return messages, False, b''
+ *
+ * def set_upgraded(self, val): # <<<<<<<<<<<<<<
+ * self._upgraded = val
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser.set_upgraded", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_10HttpParser_10__reduce_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(1, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_10HttpParser_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_10HttpParser_12__setstate_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_10HttpParser_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(1, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpParser.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":576
+ * cdef class HttpRequestParser(HttpParser):
+ *
+ * def __init__( # <<<<<<<<<<<<<<
+ * self, protocol, loop, int limit, timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ */
+
+/* Python wrapper */
+static int __pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_protocol = 0;
+ PyObject *__pyx_v_loop = 0;
+ int __pyx_v_limit;
+ PyObject *__pyx_v_timer = 0;
+ size_t __pyx_v_max_line_size;
+ size_t __pyx_v_max_headers;
+ size_t __pyx_v_max_field_size;
+ PyObject *__pyx_v_payload_exception = 0;
+ int __pyx_v_response_with_body;
+ int __pyx_v_read_until_eof;
+ int __pyx_v_auto_decompress;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_protocol,&__pyx_n_s_loop,&__pyx_n_s_limit,&__pyx_n_s_timer,&__pyx_n_s_max_line_size,&__pyx_n_s_max_headers,&__pyx_n_s_max_field_size,&__pyx_n_s_payload_exception,&__pyx_n_s_response_with_body,&__pyx_n_s_read_until_eof,&__pyx_n_s_auto_decompress,0};
+ PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
+
+ /* "aiohttp/_http_parser.pyx":577
+ *
+ * def __init__(
+ * self, protocol, loop, int limit, timer=None, # <<<<<<<<<<<<<<
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None,
+ */
+ values[3] = ((PyObject *)Py_None);
+
+ /* "aiohttp/_http_parser.pyx":579
+ * self, protocol, loop, int limit, timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None, # <<<<<<<<<<<<<<
+ * bint response_with_body=True, bint read_until_eof=False,
+ * bint auto_decompress=True,
+ */
+ values[7] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
+ CYTHON_FALLTHROUGH;
+ case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+ CYTHON_FALLTHROUGH;
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ CYTHON_FALLTHROUGH;
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ CYTHON_FALLTHROUGH;
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ CYTHON_FALLTHROUGH;
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_protocol)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 11, 1); __PYX_ERR(0, 576, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_limit)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 11, 2); __PYX_ERR(0, 576, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timer);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_line_size);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 5:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_headers);
+ if (value) { values[5] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 6:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_field_size);
+ if (value) { values[6] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 7:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_payload_exception);
+ if (value) { values[7] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 8:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_response_with_body);
+ if (value) { values[8] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 9:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read_until_eof);
+ if (value) { values[9] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 10:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_auto_decompress);
+ if (value) { values[10] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 576, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
+ CYTHON_FALLTHROUGH;
+ case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+ CYTHON_FALLTHROUGH;
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ CYTHON_FALLTHROUGH;
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ CYTHON_FALLTHROUGH;
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ CYTHON_FALLTHROUGH;
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_protocol = values[0];
+ __pyx_v_loop = values[1];
+ __pyx_v_limit = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L3_error)
+ __pyx_v_timer = values[3];
+ if (values[4]) {
+ __pyx_v_max_line_size = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_max_line_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error)
+ } else {
+ __pyx_v_max_line_size = ((size_t)0x1FFE);
+ }
+ if (values[5]) {
+ __pyx_v_max_headers = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_max_headers == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L3_error)
+ } else {
+ __pyx_v_max_headers = ((size_t)0x8000);
+ }
+ if (values[6]) {
+ __pyx_v_max_field_size = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_max_field_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L3_error)
+ } else {
+ __pyx_v_max_field_size = ((size_t)0x1FFE);
+ }
+ __pyx_v_payload_exception = values[7];
+ if (values[8]) {
+ __pyx_v_response_with_body = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_response_with_body == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
+ } else {
+
+ /* "aiohttp/_http_parser.pyx":580
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None,
+ * bint response_with_body=True, bint read_until_eof=False, # <<<<<<<<<<<<<<
+ * bint auto_decompress=True,
+ * ):
+ */
+ __pyx_v_response_with_body = ((int)1);
+ }
+ if (values[9]) {
+ __pyx_v_read_until_eof = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_read_until_eof == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L3_error)
+ } else {
+ __pyx_v_read_until_eof = ((int)0);
+ }
+ if (values[10]) {
+ __pyx_v_auto_decompress = __Pyx_PyObject_IsTrue(values[10]); if (unlikely((__pyx_v_auto_decompress == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 581, __pyx_L3_error)
+ } else {
+
+ /* "aiohttp/_http_parser.pyx":581
+ * size_t max_field_size=8190, payload_exception=None,
+ * bint response_with_body=True, bint read_until_eof=False,
+ * bint auto_decompress=True, # <<<<<<<<<<<<<<
+ * ):
+ * self._init(cparser.HTTP_REQUEST, protocol, loop, limit, timer,
+ */
+ __pyx_v_auto_decompress = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 576, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpRequestParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser___init__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *)__pyx_v_self), __pyx_v_protocol, __pyx_v_loop, __pyx_v_limit, __pyx_v_timer, __pyx_v_max_line_size, __pyx_v_max_headers, __pyx_v_max_field_size, __pyx_v_payload_exception, __pyx_v_response_with_body, __pyx_v_read_until_eof, __pyx_v_auto_decompress);
+
+ /* "aiohttp/_http_parser.pyx":576
+ * cdef class HttpRequestParser(HttpParser):
+ *
+ * def __init__( # <<<<<<<<<<<<<<
+ * self, protocol, loop, int limit, timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser___init__(struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *__pyx_v_self, PyObject *__pyx_v_protocol, PyObject *__pyx_v_loop, int __pyx_v_limit, PyObject *__pyx_v_timer, size_t __pyx_v_max_line_size, size_t __pyx_v_max_headers, size_t __pyx_v_max_field_size, PyObject *__pyx_v_payload_exception, int __pyx_v_response_with_body, int __pyx_v_read_until_eof, int __pyx_v_auto_decompress) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ struct __pyx_opt_args_7aiohttp_12_http_parser_10HttpParser__init __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "aiohttp/_http_parser.pyx":583
+ * bint auto_decompress=True,
+ * ):
+ * self._init(cparser.HTTP_REQUEST, protocol, loop, limit, timer, # <<<<<<<<<<<<<<
+ * max_line_size, max_headers, max_field_size,
+ * payload_exception, response_with_body, read_until_eof,
+ */
+ __pyx_t_2.__pyx_n = 8;
+ __pyx_t_2.timer = __pyx_v_timer;
+ __pyx_t_2.max_line_size = __pyx_v_max_line_size;
+ __pyx_t_2.max_headers = __pyx_v_max_headers;
+ __pyx_t_2.max_field_size = __pyx_v_max_field_size;
+ __pyx_t_2.payload_exception = __pyx_v_payload_exception;
+ __pyx_t_2.response_with_body = __pyx_v_response_with_body;
+ __pyx_t_2.read_until_eof = __pyx_v_read_until_eof;
+ __pyx_t_2.auto_decompress = __pyx_v_auto_decompress;
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpRequestParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._init(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self), HTTP_REQUEST, __pyx_v_protocol, __pyx_v_loop, __pyx_v_limit, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":576
+ * cdef class HttpRequestParser(HttpParser):
+ *
+ * def __init__( # <<<<<<<<<<<<<<
+ * self, protocol, loop, int limit, timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpRequestParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":588
+ * auto_decompress)
+ *
+ * cdef object _on_status_complete(self): # <<<<<<<<<<<<<<
+ * cdef int idx1, idx2
+ * if not self._buf:
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_17HttpRequestParser__on_status_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *__pyx_v_self) {
+ int __pyx_v_idx1;
+ int __pyx_v_idx2;
+ Py_ssize_t __pyx_v_idx3;
+ PyObject *__pyx_v_query = NULL;
+ PyObject *__pyx_v_path = NULL;
+ PyObject *__pyx_v_fragment = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ Py_UCS4 __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ char const *__pyx_t_11;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ PyObject *__pyx_t_17 = NULL;
+ int __pyx_t_18;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_on_status_complete", 0);
+
+ /* "aiohttp/_http_parser.pyx":590
+ * cdef object _on_status_complete(self):
+ * cdef int idx1, idx2
+ * if not self._buf: # <<<<<<<<<<<<<<
+ * return
+ * self._path = self._buf.decode('utf-8', 'surrogateescape')
+ */
+ __pyx_t_1 = (__pyx_v_self->__pyx_base._buf != Py_None)&&(PyByteArray_GET_SIZE(__pyx_v_self->__pyx_base._buf) != 0);
+ __pyx_t_2 = ((!__pyx_t_1) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":591
+ * cdef int idx1, idx2
+ * if not self._buf:
+ * return # <<<<<<<<<<<<<<
+ * self._path = self._buf.decode('utf-8', 'surrogateescape')
+ * try:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":590
+ * cdef object _on_status_complete(self):
+ * cdef int idx1, idx2
+ * if not self._buf: # <<<<<<<<<<<<<<
+ * return
+ * self._path = self._buf.decode('utf-8', 'surrogateescape')
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":592
+ * if not self._buf:
+ * return
+ * self._path = self._buf.decode('utf-8', 'surrogateescape') # <<<<<<<<<<<<<<
+ * try:
+ * idx3 = len(self._path)
+ */
+ if (unlikely(__pyx_v_self->__pyx_base._buf == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
+ __PYX_ERR(0, 592, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_decode_bytearray(__pyx_v_self->__pyx_base._buf, 0, PY_SSIZE_T_MAX, NULL, ((char const *)"surrogateescape"), PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_v_self->__pyx_base._path);
+ __Pyx_DECREF(__pyx_v_self->__pyx_base._path);
+ __pyx_v_self->__pyx_base._path = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":593
+ * return
+ * self._path = self._buf.decode('utf-8', 'surrogateescape')
+ * try: # <<<<<<<<<<<<<<
+ * idx3 = len(self._path)
+ * if self._cparser.method == cparser.HTTP_CONNECT:
+ */
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":594
+ * self._path = self._buf.decode('utf-8', 'surrogateescape')
+ * try:
+ * idx3 = len(self._path) # <<<<<<<<<<<<<<
+ * if self._cparser.method == cparser.HTTP_CONNECT:
+ * # authority-form,
+ */
+ __pyx_t_3 = __pyx_v_self->__pyx_base._path;
+ __Pyx_INCREF(__pyx_t_3);
+ if (unlikely(__pyx_t_3 == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(0, 594, __pyx_L5_error)
+ }
+ __pyx_t_4 = __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 594, __pyx_L5_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_idx3 = __pyx_t_4;
+
+ /* "aiohttp/_http_parser.pyx":595
+ * try:
+ * idx3 = len(self._path)
+ * if self._cparser.method == cparser.HTTP_CONNECT: # <<<<<<<<<<<<<<
+ * # authority-form,
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3
+ */
+ __pyx_t_2 = ((__pyx_v_self->__pyx_base._cparser->method == HTTP_CONNECT) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":598
+ * # authority-form,
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3
+ * self._url = URL.build(authority=self._path, encoded=True) # <<<<<<<<<<<<<<
+ * elif idx3 > 1 and self._path[0] == '/':
+ * # origin-form,
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_7aiohttp_12_http_parser_URL, __pyx_n_s_build); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 598, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_authority, __pyx_v_self->__pyx_base._path) < 0) __PYX_ERR(0, 598, __pyx_L5_error)
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoded, Py_True) < 0) __PYX_ERR(0, 598, __pyx_L5_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 598, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GIVEREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_v_self->__pyx_base._url);
+ __Pyx_DECREF(__pyx_v_self->__pyx_base._url);
+ __pyx_v_self->__pyx_base._url = __pyx_t_6;
+ __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":595
+ * try:
+ * idx3 = len(self._path)
+ * if self._cparser.method == cparser.HTTP_CONNECT: # <<<<<<<<<<<<<<
+ * # authority-form,
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3
+ */
+ goto __pyx_L7;
+ }
+
+ /* "aiohttp/_http_parser.pyx":599
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3
+ * self._url = URL.build(authority=self._path, encoded=True)
+ * elif idx3 > 1 and self._path[0] == '/': # <<<<<<<<<<<<<<
+ * # origin-form,
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1
+ */
+ __pyx_t_1 = ((__pyx_v_idx3 > 1) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L8_bool_binop_done;
+ }
+ __pyx_t_7 = __Pyx_GetItemInt_Unicode(__pyx_v_self->__pyx_base._path, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_7 == (Py_UCS4)-1)) __PYX_ERR(0, 599, __pyx_L5_error)
+ __pyx_t_1 = ((__pyx_t_7 == 47) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L8_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":602
+ * # origin-form,
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1
+ * idx1 = self._path.find("?") # <<<<<<<<<<<<<<
+ * if idx1 == -1:
+ * query = ""
+ */
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find");
+ __PYX_ERR(0, 602, __pyx_L5_error)
+ }
+ __pyx_t_4 = PyUnicode_Find(__pyx_v_self->__pyx_base._path, __pyx_kp_u__11, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-2))) __PYX_ERR(0, 602, __pyx_L5_error)
+ __pyx_v_idx1 = __pyx_t_4;
+
+ /* "aiohttp/_http_parser.pyx":603
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1
+ * idx1 = self._path.find("?")
+ * if idx1 == -1: # <<<<<<<<<<<<<<
+ * query = ""
+ * idx2 = self._path.find("#")
+ */
+ __pyx_t_2 = ((__pyx_v_idx1 == -1L) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":604
+ * idx1 = self._path.find("?")
+ * if idx1 == -1:
+ * query = "" # <<<<<<<<<<<<<<
+ * idx2 = self._path.find("#")
+ * if idx2 == -1:
+ */
+ __Pyx_INCREF(__pyx_kp_u__8);
+ __pyx_v_query = __pyx_kp_u__8;
+
+ /* "aiohttp/_http_parser.pyx":605
+ * if idx1 == -1:
+ * query = ""
+ * idx2 = self._path.find("#") # <<<<<<<<<<<<<<
+ * if idx2 == -1:
+ * path = self._path
+ */
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find");
+ __PYX_ERR(0, 605, __pyx_L5_error)
+ }
+ __pyx_t_4 = PyUnicode_Find(__pyx_v_self->__pyx_base._path, __pyx_kp_u__12, 0, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-2))) __PYX_ERR(0, 605, __pyx_L5_error)
+ __pyx_v_idx2 = __pyx_t_4;
+
+ /* "aiohttp/_http_parser.pyx":606
+ * query = ""
+ * idx2 = self._path.find("#")
+ * if idx2 == -1: # <<<<<<<<<<<<<<
+ * path = self._path
+ * fragment = ""
+ */
+ __pyx_t_2 = ((__pyx_v_idx2 == -1L) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":607
+ * idx2 = self._path.find("#")
+ * if idx2 == -1:
+ * path = self._path # <<<<<<<<<<<<<<
+ * fragment = ""
+ * else:
+ */
+ __pyx_t_6 = __pyx_v_self->__pyx_base._path;
+ __Pyx_INCREF(__pyx_t_6);
+ __pyx_v_path = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":608
+ * if idx2 == -1:
+ * path = self._path
+ * fragment = "" # <<<<<<<<<<<<<<
+ * else:
+ * path = self._path[0: idx2]
+ */
+ __Pyx_INCREF(__pyx_kp_u__8);
+ __pyx_v_fragment = __pyx_kp_u__8;
+
+ /* "aiohttp/_http_parser.pyx":606
+ * query = ""
+ * idx2 = self._path.find("#")
+ * if idx2 == -1: # <<<<<<<<<<<<<<
+ * path = self._path
+ * fragment = ""
+ */
+ goto __pyx_L11;
+ }
+
+ /* "aiohttp/_http_parser.pyx":610
+ * fragment = ""
+ * else:
+ * path = self._path[0: idx2] # <<<<<<<<<<<<<<
+ * fragment = self._path[idx2+1:]
+ *
+ */
+ /*else*/ {
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 610, __pyx_L5_error)
+ }
+ __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_self->__pyx_base._path, 0, __pyx_v_idx2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 610, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_path = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":611
+ * else:
+ * path = self._path[0: idx2]
+ * fragment = self._path[idx2+1:] # <<<<<<<<<<<<<<
+ *
+ * else:
+ */
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 611, __pyx_L5_error)
+ }
+ __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_self->__pyx_base._path, (__pyx_v_idx2 + 1), PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 611, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_fragment = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+ }
+ __pyx_L11:;
+
+ /* "aiohttp/_http_parser.pyx":603
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1
+ * idx1 = self._path.find("?")
+ * if idx1 == -1: # <<<<<<<<<<<<<<
+ * query = ""
+ * idx2 = self._path.find("#")
+ */
+ goto __pyx_L10;
+ }
+
+ /* "aiohttp/_http_parser.pyx":614
+ *
+ * else:
+ * path = self._path[0:idx1] # <<<<<<<<<<<<<<
+ * idx1 += 1
+ * idx2 = self._path.find("#", idx1+1)
+ */
+ /*else*/ {
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 614, __pyx_L5_error)
+ }
+ __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_self->__pyx_base._path, 0, __pyx_v_idx1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 614, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_path = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":615
+ * else:
+ * path = self._path[0:idx1]
+ * idx1 += 1 # <<<<<<<<<<<<<<
+ * idx2 = self._path.find("#", idx1+1)
+ * if idx2 == -1:
+ */
+ __pyx_v_idx1 = (__pyx_v_idx1 + 1);
+
+ /* "aiohttp/_http_parser.pyx":616
+ * path = self._path[0:idx1]
+ * idx1 += 1
+ * idx2 = self._path.find("#", idx1+1) # <<<<<<<<<<<<<<
+ * if idx2 == -1:
+ * query = self._path[idx1:]
+ */
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "find");
+ __PYX_ERR(0, 616, __pyx_L5_error)
+ }
+ __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_idx1 + 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 616, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_6); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 616, __pyx_L5_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_8 = PyUnicode_Find(__pyx_v_self->__pyx_base._path, __pyx_kp_u__12, __pyx_t_4, PY_SSIZE_T_MAX, 1); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-2))) __PYX_ERR(0, 616, __pyx_L5_error)
+ __pyx_v_idx2 = __pyx_t_8;
+
+ /* "aiohttp/_http_parser.pyx":617
+ * idx1 += 1
+ * idx2 = self._path.find("#", idx1+1)
+ * if idx2 == -1: # <<<<<<<<<<<<<<
+ * query = self._path[idx1:]
+ * fragment = ""
+ */
+ __pyx_t_2 = ((__pyx_v_idx2 == -1L) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_parser.pyx":618
+ * idx2 = self._path.find("#", idx1+1)
+ * if idx2 == -1:
+ * query = self._path[idx1:] # <<<<<<<<<<<<<<
+ * fragment = ""
+ * else:
+ */
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 618, __pyx_L5_error)
+ }
+ __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_self->__pyx_base._path, __pyx_v_idx1, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 618, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_query = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":619
+ * if idx2 == -1:
+ * query = self._path[idx1:]
+ * fragment = "" # <<<<<<<<<<<<<<
+ * else:
+ * query = self._path[idx1: idx2]
+ */
+ __Pyx_INCREF(__pyx_kp_u__8);
+ __pyx_v_fragment = __pyx_kp_u__8;
+
+ /* "aiohttp/_http_parser.pyx":617
+ * idx1 += 1
+ * idx2 = self._path.find("#", idx1+1)
+ * if idx2 == -1: # <<<<<<<<<<<<<<
+ * query = self._path[idx1:]
+ * fragment = ""
+ */
+ goto __pyx_L12;
+ }
+
+ /* "aiohttp/_http_parser.pyx":621
+ * fragment = ""
+ * else:
+ * query = self._path[idx1: idx2] # <<<<<<<<<<<<<<
+ * fragment = self._path[idx2+1:]
+ *
+ */
+ /*else*/ {
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 621, __pyx_L5_error)
+ }
+ __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_self->__pyx_base._path, __pyx_v_idx1, __pyx_v_idx2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 621, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_query = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":622
+ * else:
+ * query = self._path[idx1: idx2]
+ * fragment = self._path[idx2+1:] # <<<<<<<<<<<<<<
+ *
+ * self._url = URL.build(
+ */
+ if (unlikely(__pyx_v_self->__pyx_base._path == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(0, 622, __pyx_L5_error)
+ }
+ __pyx_t_6 = __Pyx_PyUnicode_Substring(__pyx_v_self->__pyx_base._path, (__pyx_v_idx2 + 1), PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 622, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_v_fragment = ((PyObject*)__pyx_t_6);
+ __pyx_t_6 = 0;
+ }
+ __pyx_L12:;
+ }
+ __pyx_L10:;
+
+ /* "aiohttp/_http_parser.pyx":624
+ * fragment = self._path[idx2+1:]
+ *
+ * self._url = URL.build( # <<<<<<<<<<<<<<
+ * path=path,
+ * query_string=query,
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_7aiohttp_12_http_parser_URL, __pyx_n_s_build); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 624, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "aiohttp/_http_parser.pyx":625
+ *
+ * self._url = URL.build(
+ * path=path, # <<<<<<<<<<<<<<
+ * query_string=query,
+ * fragment=fragment,
+ */
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 625, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_path, __pyx_v_path) < 0) __PYX_ERR(0, 625, __pyx_L5_error)
+
+ /* "aiohttp/_http_parser.pyx":626
+ * self._url = URL.build(
+ * path=path,
+ * query_string=query, # <<<<<<<<<<<<<<
+ * fragment=fragment,
+ * encoded=True,
+ */
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_query_string, __pyx_v_query) < 0) __PYX_ERR(0, 625, __pyx_L5_error)
+
+ /* "aiohttp/_http_parser.pyx":627
+ * path=path,
+ * query_string=query,
+ * fragment=fragment, # <<<<<<<<<<<<<<
+ * encoded=True,
+ * )
+ */
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_fragment, __pyx_v_fragment) < 0) __PYX_ERR(0, 625, __pyx_L5_error)
+
+ /* "aiohttp/_http_parser.pyx":628
+ * query_string=query,
+ * fragment=fragment,
+ * encoded=True, # <<<<<<<<<<<<<<
+ * )
+ * else:
+ */
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoded, Py_True) < 0) __PYX_ERR(0, 625, __pyx_L5_error)
+
+ /* "aiohttp/_http_parser.pyx":624
+ * fragment = self._path[idx2+1:]
+ *
+ * self._url = URL.build( # <<<<<<<<<<<<<<
+ * path=path,
+ * query_string=query,
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 624, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GIVEREF(__pyx_t_3);
+ __Pyx_GOTREF(__pyx_v_self->__pyx_base._url);
+ __Pyx_DECREF(__pyx_v_self->__pyx_base._url);
+ __pyx_v_self->__pyx_base._url = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "aiohttp/_http_parser.pyx":599
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3
+ * self._url = URL.build(authority=self._path, encoded=True)
+ * elif idx3 > 1 and self._path[0] == '/': # <<<<<<<<<<<<<<
+ * # origin-form,
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1
+ */
+ goto __pyx_L7;
+ }
+
+ /* "aiohttp/_http_parser.pyx":633
+ * # absolute-form for proxy maybe,
+ * # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.2
+ * self._url = URL(self._path, encoded=True) # <<<<<<<<<<<<<<
+ * finally:
+ * PyByteArray_Resize(self._buf, 0)
+ */
+ /*else*/ {
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 633, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_self->__pyx_base._path);
+ __Pyx_GIVEREF(__pyx_v_self->__pyx_base._path);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->__pyx_base._path);
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 633, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_encoded, Py_True) < 0) __PYX_ERR(0, 633, __pyx_L5_error)
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_v_7aiohttp_12_http_parser_URL, __pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 633, __pyx_L5_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GIVEREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_v_self->__pyx_base._url);
+ __Pyx_DECREF(__pyx_v_self->__pyx_base._url);
+ __pyx_v_self->__pyx_base._url = __pyx_t_6;
+ __pyx_t_6 = 0;
+ }
+ __pyx_L7:;
+ }
+
+ /* "aiohttp/_http_parser.pyx":635
+ * self._url = URL(self._path, encoded=True)
+ * finally:
+ * PyByteArray_Resize(self._buf, 0) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ __pyx_t_6 = __pyx_v_self->__pyx_base._buf;
+ __Pyx_INCREF(__pyx_t_6);
+ __pyx_t_9 = PyByteArray_Resize(__pyx_t_6, 0); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 635, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ goto __pyx_L6;
+ }
+ __pyx_L5_error:;
+ /*exception exit:*/{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
+ if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
+ __Pyx_XGOTREF(__pyx_t_12);
+ __Pyx_XGOTREF(__pyx_t_13);
+ __Pyx_XGOTREF(__pyx_t_14);
+ __Pyx_XGOTREF(__pyx_t_15);
+ __Pyx_XGOTREF(__pyx_t_16);
+ __Pyx_XGOTREF(__pyx_t_17);
+ __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
+ {
+ __pyx_t_6 = __pyx_v_self->__pyx_base._buf;
+ __Pyx_INCREF(__pyx_t_6);
+ __pyx_t_18 = PyByteArray_Resize(__pyx_t_6, 0); if (unlikely(__pyx_t_18 == ((int)-1))) __PYX_ERR(0, 635, __pyx_L14_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_15);
+ __Pyx_XGIVEREF(__pyx_t_16);
+ __Pyx_XGIVEREF(__pyx_t_17);
+ __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+ }
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __Pyx_XGIVEREF(__pyx_t_13);
+ __Pyx_XGIVEREF(__pyx_t_14);
+ __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
+ __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+ __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
+ goto __pyx_L1_error;
+ __pyx_L14_error:;
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_15);
+ __Pyx_XGIVEREF(__pyx_t_16);
+ __Pyx_XGIVEREF(__pyx_t_17);
+ __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
+ }
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
+ goto __pyx_L1_error;
+ }
+ __pyx_L6:;
+ }
+
+ /* "aiohttp/_http_parser.pyx":588
+ * auto_decompress)
+ *
+ * cdef object _on_status_complete(self): # <<<<<<<<<<<<<<
+ * cdef int idx1, idx2
+ * if not self._buf:
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpRequestParser._on_status_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_query);
+ __Pyx_XDECREF(__pyx_v_path);
+ __Pyx_XDECREF(__pyx_v_fragment);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser_2__reduce_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(1, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpRequestParser.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser_4__setstate_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_17HttpRequestParser_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(1, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpRequestParser.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":640
+ * cdef class HttpResponseParser(HttpParser):
+ *
+ * def __init__( # <<<<<<<<<<<<<<
+ * self, protocol, loop, int limit, timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ */
+
+/* Python wrapper */
+static int __pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_protocol = 0;
+ PyObject *__pyx_v_loop = 0;
+ int __pyx_v_limit;
+ PyObject *__pyx_v_timer = 0;
+ size_t __pyx_v_max_line_size;
+ size_t __pyx_v_max_headers;
+ size_t __pyx_v_max_field_size;
+ PyObject *__pyx_v_payload_exception = 0;
+ int __pyx_v_response_with_body;
+ int __pyx_v_read_until_eof;
+ int __pyx_v_auto_decompress;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_protocol,&__pyx_n_s_loop,&__pyx_n_s_limit,&__pyx_n_s_timer,&__pyx_n_s_max_line_size,&__pyx_n_s_max_headers,&__pyx_n_s_max_field_size,&__pyx_n_s_payload_exception,&__pyx_n_s_response_with_body,&__pyx_n_s_read_until_eof,&__pyx_n_s_auto_decompress,0};
+ PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
+
+ /* "aiohttp/_http_parser.pyx":641
+ *
+ * def __init__(
+ * self, protocol, loop, int limit, timer=None, # <<<<<<<<<<<<<<
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None,
+ */
+ values[3] = ((PyObject *)Py_None);
+
+ /* "aiohttp/_http_parser.pyx":643
+ * self, protocol, loop, int limit, timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None, # <<<<<<<<<<<<<<
+ * bint response_with_body=True, bint read_until_eof=False,
+ * bint auto_decompress=True
+ */
+ values[7] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
+ CYTHON_FALLTHROUGH;
+ case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+ CYTHON_FALLTHROUGH;
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ CYTHON_FALLTHROUGH;
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ CYTHON_FALLTHROUGH;
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ CYTHON_FALLTHROUGH;
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_protocol)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 11, 1); __PYX_ERR(0, 640, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_limit)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 11, 2); __PYX_ERR(0, 640, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_timer);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_line_size);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 5:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_headers);
+ if (value) { values[5] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 6:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_max_field_size);
+ if (value) { values[6] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 7:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_payload_exception);
+ if (value) { values[7] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 8:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_response_with_body);
+ if (value) { values[8] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 9:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_read_until_eof);
+ if (value) { values[9] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 10:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_auto_decompress);
+ if (value) { values[10] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 640, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
+ CYTHON_FALLTHROUGH;
+ case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
+ CYTHON_FALLTHROUGH;
+ case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
+ CYTHON_FALLTHROUGH;
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ CYTHON_FALLTHROUGH;
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ CYTHON_FALLTHROUGH;
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_protocol = values[0];
+ __pyx_v_loop = values[1];
+ __pyx_v_limit = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_limit == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 641, __pyx_L3_error)
+ __pyx_v_timer = values[3];
+ if (values[4]) {
+ __pyx_v_max_line_size = __Pyx_PyInt_As_size_t(values[4]); if (unlikely((__pyx_v_max_line_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error)
+ } else {
+ __pyx_v_max_line_size = ((size_t)0x1FFE);
+ }
+ if (values[5]) {
+ __pyx_v_max_headers = __Pyx_PyInt_As_size_t(values[5]); if (unlikely((__pyx_v_max_headers == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 642, __pyx_L3_error)
+ } else {
+ __pyx_v_max_headers = ((size_t)0x8000);
+ }
+ if (values[6]) {
+ __pyx_v_max_field_size = __Pyx_PyInt_As_size_t(values[6]); if (unlikely((__pyx_v_max_field_size == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L3_error)
+ } else {
+ __pyx_v_max_field_size = ((size_t)0x1FFE);
+ }
+ __pyx_v_payload_exception = values[7];
+ if (values[8]) {
+ __pyx_v_response_with_body = __Pyx_PyObject_IsTrue(values[8]); if (unlikely((__pyx_v_response_with_body == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L3_error)
+ } else {
+
+ /* "aiohttp/_http_parser.pyx":644
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ * size_t max_field_size=8190, payload_exception=None,
+ * bint response_with_body=True, bint read_until_eof=False, # <<<<<<<<<<<<<<
+ * bint auto_decompress=True
+ * ):
+ */
+ __pyx_v_response_with_body = ((int)1);
+ }
+ if (values[9]) {
+ __pyx_v_read_until_eof = __Pyx_PyObject_IsTrue(values[9]); if (unlikely((__pyx_v_read_until_eof == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 644, __pyx_L3_error)
+ } else {
+ __pyx_v_read_until_eof = ((int)0);
+ }
+ if (values[10]) {
+ __pyx_v_auto_decompress = __Pyx_PyObject_IsTrue(values[10]); if (unlikely((__pyx_v_auto_decompress == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 645, __pyx_L3_error)
+ } else {
+
+ /* "aiohttp/_http_parser.pyx":645
+ * size_t max_field_size=8190, payload_exception=None,
+ * bint response_with_body=True, bint read_until_eof=False,
+ * bint auto_decompress=True # <<<<<<<<<<<<<<
+ * ):
+ * self._init(cparser.HTTP_RESPONSE, protocol, loop, limit, timer,
+ */
+ __pyx_v_auto_decompress = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 640, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpResponseParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser___init__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *)__pyx_v_self), __pyx_v_protocol, __pyx_v_loop, __pyx_v_limit, __pyx_v_timer, __pyx_v_max_line_size, __pyx_v_max_headers, __pyx_v_max_field_size, __pyx_v_payload_exception, __pyx_v_response_with_body, __pyx_v_read_until_eof, __pyx_v_auto_decompress);
+
+ /* "aiohttp/_http_parser.pyx":640
+ * cdef class HttpResponseParser(HttpParser):
+ *
+ * def __init__( # <<<<<<<<<<<<<<
+ * self, protocol, loop, int limit, timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser___init__(struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *__pyx_v_self, PyObject *__pyx_v_protocol, PyObject *__pyx_v_loop, int __pyx_v_limit, PyObject *__pyx_v_timer, size_t __pyx_v_max_line_size, size_t __pyx_v_max_headers, size_t __pyx_v_max_field_size, PyObject *__pyx_v_payload_exception, int __pyx_v_response_with_body, int __pyx_v_read_until_eof, int __pyx_v_auto_decompress) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ struct __pyx_opt_args_7aiohttp_12_http_parser_10HttpParser__init __pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "aiohttp/_http_parser.pyx":647
+ * bint auto_decompress=True
+ * ):
+ * self._init(cparser.HTTP_RESPONSE, protocol, loop, limit, timer, # <<<<<<<<<<<<<<
+ * max_line_size, max_headers, max_field_size,
+ * payload_exception, response_with_body, read_until_eof,
+ */
+ __pyx_t_2.__pyx_n = 8;
+ __pyx_t_2.timer = __pyx_v_timer;
+ __pyx_t_2.max_line_size = __pyx_v_max_line_size;
+ __pyx_t_2.max_headers = __pyx_v_max_headers;
+ __pyx_t_2.max_field_size = __pyx_v_max_field_size;
+ __pyx_t_2.payload_exception = __pyx_v_payload_exception;
+ __pyx_t_2.response_with_body = __pyx_v_response_with_body;
+ __pyx_t_2.read_until_eof = __pyx_v_read_until_eof;
+ __pyx_t_2.auto_decompress = __pyx_v_auto_decompress;
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpResponseParser *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._init(((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_v_self), HTTP_RESPONSE, __pyx_v_protocol, __pyx_v_loop, __pyx_v_limit, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 647, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":640
+ * cdef class HttpResponseParser(HttpParser):
+ *
+ * def __init__( # <<<<<<<<<<<<<<
+ * self, protocol, loop, int limit, timer=None,
+ * size_t max_line_size=8190, size_t max_headers=32768,
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpResponseParser.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":652
+ * auto_decompress)
+ *
+ * cdef object _on_status_complete(self): # <<<<<<<<<<<<<<
+ * if self._buf:
+ * self._reason = self._buf.decode('utf-8', 'surrogateescape')
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_18HttpResponseParser__on_status_complete(struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_on_status_complete", 0);
+
+ /* "aiohttp/_http_parser.pyx":653
+ *
+ * cdef object _on_status_complete(self):
+ * if self._buf: # <<<<<<<<<<<<<<
+ * self._reason = self._buf.decode('utf-8', 'surrogateescape')
+ * PyByteArray_Resize(self._buf, 0)
+ */
+ __pyx_t_1 = (__pyx_v_self->__pyx_base._buf != Py_None)&&(PyByteArray_GET_SIZE(__pyx_v_self->__pyx_base._buf) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_parser.pyx":654
+ * cdef object _on_status_complete(self):
+ * if self._buf:
+ * self._reason = self._buf.decode('utf-8', 'surrogateescape') # <<<<<<<<<<<<<<
+ * PyByteArray_Resize(self._buf, 0)
+ * else:
+ */
+ if (unlikely(__pyx_v_self->__pyx_base._buf == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "decode");
+ __PYX_ERR(0, 654, __pyx_L1_error)
+ }
+ __pyx_t_2 = __Pyx_decode_bytearray(__pyx_v_self->__pyx_base._buf, 0, PY_SSIZE_T_MAX, NULL, ((char const *)"surrogateescape"), PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 654, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_self->__pyx_base._reason);
+ __Pyx_DECREF(__pyx_v_self->__pyx_base._reason);
+ __pyx_v_self->__pyx_base._reason = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":655
+ * if self._buf:
+ * self._reason = self._buf.decode('utf-8', 'surrogateescape')
+ * PyByteArray_Resize(self._buf, 0) # <<<<<<<<<<<<<<
+ * else:
+ * self._reason = self._reason or ''
+ */
+ __pyx_t_2 = __pyx_v_self->__pyx_base._buf;
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_t_3 = PyByteArray_Resize(__pyx_t_2, 0); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 655, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":653
+ *
+ * cdef object _on_status_complete(self):
+ * if self._buf: # <<<<<<<<<<<<<<
+ * self._reason = self._buf.decode('utf-8', 'surrogateescape')
+ * PyByteArray_Resize(self._buf, 0)
+ */
+ goto __pyx_L3;
+ }
+
+ /* "aiohttp/_http_parser.pyx":657
+ * PyByteArray_Resize(self._buf, 0)
+ * else:
+ * self._reason = self._reason or '' # <<<<<<<<<<<<<<
+ *
+ * cdef int cb_on_message_begin(cparser.llhttp_t* parser) except -1:
+ */
+ /*else*/ {
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->__pyx_base._reason); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 657, __pyx_L1_error)
+ if (!__pyx_t_1) {
+ } else {
+ __Pyx_INCREF(__pyx_v_self->__pyx_base._reason);
+ __pyx_t_2 = __pyx_v_self->__pyx_base._reason;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __Pyx_INCREF(__pyx_kp_u__8);
+ __pyx_t_2 = __pyx_kp_u__8;
+ __pyx_L4_bool_binop_done:;
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_self->__pyx_base._reason);
+ __Pyx_DECREF(__pyx_v_self->__pyx_base._reason);
+ __pyx_v_self->__pyx_base._reason = ((PyObject*)__pyx_t_2);
+ __pyx_t_2 = 0;
+ }
+ __pyx_L3:;
+
+ /* "aiohttp/_http_parser.pyx":652
+ * auto_decompress)
+ *
+ * cdef object _on_status_complete(self): # <<<<<<<<<<<<<<
+ * if self._buf:
+ * self._reason = self._buf.decode('utf-8', 'surrogateescape')
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpResponseParser._on_status_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser_2__reduce_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(1, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpResponseParser.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser_4__setstate_cython__(((struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_18HttpResponseParser_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(1, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("aiohttp._http_parser.HttpResponseParser.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":659
+ * self._reason = self._reason or ''
+ *
+ * cdef int cb_on_message_begin(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ *
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_message_begin(llhttp_t *__pyx_v_parser) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_message_begin", 0);
+
+ /* "aiohttp/_http_parser.pyx":660
+ *
+ * cdef int cb_on_message_begin(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ *
+ * pyparser._started = True
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":662
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ *
+ * pyparser._started = True # <<<<<<<<<<<<<<
+ * pyparser._headers = CIMultiDict()
+ * pyparser._raw_headers = []
+ */
+ __pyx_v_pyparser->_started = 1;
+
+ /* "aiohttp/_http_parser.pyx":663
+ *
+ * pyparser._started = True
+ * pyparser._headers = CIMultiDict() # <<<<<<<<<<<<<<
+ * pyparser._raw_headers = []
+ * PyByteArray_Resize(pyparser._buf, 0)
+ */
+ __Pyx_INCREF(__pyx_v_7aiohttp_12_http_parser_CIMultiDict);
+ __pyx_t_2 = __pyx_v_7aiohttp_12_http_parser_CIMultiDict; __pyx_t_3 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_pyparser->_headers);
+ __Pyx_DECREF(__pyx_v_pyparser->_headers);
+ __pyx_v_pyparser->_headers = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":664
+ * pyparser._started = True
+ * pyparser._headers = CIMultiDict()
+ * pyparser._raw_headers = [] # <<<<<<<<<<<<<<
+ * PyByteArray_Resize(pyparser._buf, 0)
+ * pyparser._path = None
+ */
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 664, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v_pyparser->_raw_headers);
+ __Pyx_DECREF(__pyx_v_pyparser->_raw_headers);
+ __pyx_v_pyparser->_raw_headers = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":665
+ * pyparser._headers = CIMultiDict()
+ * pyparser._raw_headers = []
+ * PyByteArray_Resize(pyparser._buf, 0) # <<<<<<<<<<<<<<
+ * pyparser._path = None
+ * pyparser._reason = None
+ */
+ __pyx_t_1 = __pyx_v_pyparser->_buf;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_4 = PyByteArray_Resize(__pyx_t_1, 0); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 665, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":666
+ * pyparser._raw_headers = []
+ * PyByteArray_Resize(pyparser._buf, 0)
+ * pyparser._path = None # <<<<<<<<<<<<<<
+ * pyparser._reason = None
+ * return 0
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_pyparser->_path);
+ __Pyx_DECREF(__pyx_v_pyparser->_path);
+ __pyx_v_pyparser->_path = ((PyObject*)Py_None);
+
+ /* "aiohttp/_http_parser.pyx":667
+ * PyByteArray_Resize(pyparser._buf, 0)
+ * pyparser._path = None
+ * pyparser._reason = None # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ __Pyx_GOTREF(__pyx_v_pyparser->_reason);
+ __Pyx_DECREF(__pyx_v_pyparser->_reason);
+ __pyx_v_pyparser->_reason = ((PyObject*)Py_None);
+
+ /* "aiohttp/_http_parser.pyx":668
+ * pyparser._path = None
+ * pyparser._reason = None
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":659
+ * self._reason = self._reason or ''
+ *
+ * cdef int cb_on_message_begin(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_message_begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":671
+ *
+ *
+ * cdef int cb_on_url(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_url(llhttp_t *__pyx_v_parser, char const *__pyx_v_at, size_t __pyx_v_length) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ PyObject *__pyx_v_ex = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_url", 0);
+
+ /* "aiohttp/_http_parser.pyx":673
+ * cdef int cb_on_url(cparser.llhttp_t* parser,
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * try:
+ * if length > pyparser._max_line_size:
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":674
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong(
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":675
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ * if length > pyparser._max_line_size: # <<<<<<<<<<<<<<
+ * raise LineTooLong(
+ * 'Status line is too long', pyparser._max_line_size, length)
+ */
+ __pyx_t_5 = ((__pyx_v_length > __pyx_v_pyparser->_max_line_size) != 0);
+ if (unlikely(__pyx_t_5)) {
+
+ /* "aiohttp/_http_parser.pyx":676
+ * try:
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong( # <<<<<<<<<<<<<<
+ * 'Status line is too long', pyparser._max_line_size, length)
+ * extend(pyparser._buf, at, length)
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_LineTooLong); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 676, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "aiohttp/_http_parser.pyx":677
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong(
+ * 'Status line is too long', pyparser._max_line_size, length) # <<<<<<<<<<<<<<
+ * extend(pyparser._buf, at, length)
+ * except BaseException as ex:
+ */
+ __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_pyparser->_max_line_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 677, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = NULL;
+ __pyx_t_10 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_9)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_9);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_10 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_u_Status_line_is_too_long, __pyx_t_7, __pyx_t_8};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_u_Status_line_is_too_long, __pyx_t_7, __pyx_t_8};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 676, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ if (__pyx_t_9) {
+ __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_u_Status_line_is_too_long);
+ __Pyx_GIVEREF(__pyx_kp_u_Status_line_is_too_long);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_kp_u_Status_line_is_too_long);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_8);
+ __pyx_t_7 = 0;
+ __pyx_t_8 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 676, __pyx_L3_error)
+
+ /* "aiohttp/_http_parser.pyx":675
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ * if length > pyparser._max_line_size: # <<<<<<<<<<<<<<
+ * raise LineTooLong(
+ * 'Status line is too long', pyparser._max_line_size, length)
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":678
+ * raise LineTooLong(
+ * 'Status line is too long', pyparser._max_line_size, length)
+ * extend(pyparser._buf, at, length) # <<<<<<<<<<<<<<
+ * except BaseException as ex:
+ * pyparser._last_error = ex
+ */
+ __pyx_t_1 = __pyx_v_pyparser->_buf;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_6 = __pyx_f_7aiohttp_12_http_parser_extend(__pyx_t_1, __pyx_v_at, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 678, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":674
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong(
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":683
+ * return -1
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else:*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "aiohttp/_http_parser.pyx":679
+ * 'Status line is too long', pyparser._max_line_size, length)
+ * extend(pyparser._buf, at, length)
+ * except BaseException as ex: # <<<<<<<<<<<<<<
+ * pyparser._last_error = ex
+ * return -1
+ */
+ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_10) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_11) < 0) __PYX_ERR(0, 679, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_ex = __pyx_t_1;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":680
+ * extend(pyparser._buf, at, length)
+ * except BaseException as ex:
+ * pyparser._last_error = ex # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_ex);
+ __Pyx_GIVEREF(__pyx_v_ex);
+ __Pyx_GOTREF(__pyx_v_pyparser->_last_error);
+ __Pyx_DECREF(__pyx_v_pyparser->_last_error);
+ __pyx_v_pyparser->_last_error = __pyx_v_ex;
+
+ /* "aiohttp/_http_parser.pyx":681
+ * except BaseException as ex:
+ * pyparser._last_error = ex
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ goto __pyx_L14_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":679
+ * 'Status line is too long', pyparser._max_line_size, length)
+ * extend(pyparser._buf, at, length)
+ * except BaseException as ex: # <<<<<<<<<<<<<<
+ * pyparser._last_error = ex
+ * return -1
+ */
+ /*finally:*/ {
+ __pyx_L14_return: {
+ __pyx_t_10 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_ex);
+ __pyx_v_ex = NULL;
+ __pyx_r = __pyx_t_10;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":674
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong(
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":671
+ *
+ *
+ * cdef int cb_on_url(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_url", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_ex);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":686
+ *
+ *
+ * cdef int cb_on_status(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_status(llhttp_t *__pyx_v_parser, char const *__pyx_v_at, size_t __pyx_v_length) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ PyObject *__pyx_v_ex = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_status", 0);
+
+ /* "aiohttp/_http_parser.pyx":688
+ * cdef int cb_on_status(cparser.llhttp_t* parser,
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * cdef str reason
+ * try:
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":690
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef str reason
+ * try: # <<<<<<<<<<<<<<
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong(
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":691
+ * cdef str reason
+ * try:
+ * if length > pyparser._max_line_size: # <<<<<<<<<<<<<<
+ * raise LineTooLong(
+ * 'Status line is too long', pyparser._max_line_size, length)
+ */
+ __pyx_t_5 = ((__pyx_v_length > __pyx_v_pyparser->_max_line_size) != 0);
+ if (unlikely(__pyx_t_5)) {
+
+ /* "aiohttp/_http_parser.pyx":692
+ * try:
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong( # <<<<<<<<<<<<<<
+ * 'Status line is too long', pyparser._max_line_size, length)
+ * extend(pyparser._buf, at, length)
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_LineTooLong); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "aiohttp/_http_parser.pyx":693
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong(
+ * 'Status line is too long', pyparser._max_line_size, length) # <<<<<<<<<<<<<<
+ * extend(pyparser._buf, at, length)
+ * except BaseException as ex:
+ */
+ __pyx_t_7 = __Pyx_PyInt_FromSize_t(__pyx_v_pyparser->_max_line_size); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 693, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 693, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = NULL;
+ __pyx_t_10 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_9)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_9);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_10 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_u_Status_line_is_too_long, __pyx_t_7, __pyx_t_8};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_kp_u_Status_line_is_too_long, __pyx_t_7, __pyx_t_8};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 692, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ if (__pyx_t_9) {
+ __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_u_Status_line_is_too_long);
+ __Pyx_GIVEREF(__pyx_kp_u_Status_line_is_too_long);
+ PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_kp_u_Status_line_is_too_long);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_t_8);
+ __pyx_t_7 = 0;
+ __pyx_t_8 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 692, __pyx_L3_error)
+
+ /* "aiohttp/_http_parser.pyx":691
+ * cdef str reason
+ * try:
+ * if length > pyparser._max_line_size: # <<<<<<<<<<<<<<
+ * raise LineTooLong(
+ * 'Status line is too long', pyparser._max_line_size, length)
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":694
+ * raise LineTooLong(
+ * 'Status line is too long', pyparser._max_line_size, length)
+ * extend(pyparser._buf, at, length) # <<<<<<<<<<<<<<
+ * except BaseException as ex:
+ * pyparser._last_error = ex
+ */
+ __pyx_t_1 = __pyx_v_pyparser->_buf;
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_t_6 = __pyx_f_7aiohttp_12_http_parser_extend(__pyx_t_1, __pyx_v_at, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 694, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":690
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef str reason
+ * try: # <<<<<<<<<<<<<<
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong(
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":699
+ * return -1
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else:*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "aiohttp/_http_parser.pyx":695
+ * 'Status line is too long', pyparser._max_line_size, length)
+ * extend(pyparser._buf, at, length)
+ * except BaseException as ex: # <<<<<<<<<<<<<<
+ * pyparser._last_error = ex
+ * return -1
+ */
+ __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_10) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_11) < 0) __PYX_ERR(0, 695, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_ex = __pyx_t_1;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":696
+ * extend(pyparser._buf, at, length)
+ * except BaseException as ex:
+ * pyparser._last_error = ex # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_ex);
+ __Pyx_GIVEREF(__pyx_v_ex);
+ __Pyx_GOTREF(__pyx_v_pyparser->_last_error);
+ __Pyx_DECREF(__pyx_v_pyparser->_last_error);
+ __pyx_v_pyparser->_last_error = __pyx_v_ex;
+
+ /* "aiohttp/_http_parser.pyx":697
+ * except BaseException as ex:
+ * pyparser._last_error = ex
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ goto __pyx_L14_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":695
+ * 'Status line is too long', pyparser._max_line_size, length)
+ * extend(pyparser._buf, at, length)
+ * except BaseException as ex: # <<<<<<<<<<<<<<
+ * pyparser._last_error = ex
+ * return -1
+ */
+ /*finally:*/ {
+ __pyx_L14_return: {
+ __pyx_t_10 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_ex);
+ __pyx_v_ex = NULL;
+ __pyx_r = __pyx_t_10;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":690
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef str reason
+ * try: # <<<<<<<<<<<<<<
+ * if length > pyparser._max_line_size:
+ * raise LineTooLong(
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":686
+ *
+ *
+ * cdef int cb_on_status(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_ex);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":702
+ *
+ *
+ * cdef int cb_on_header_field(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_header_field(llhttp_t *__pyx_v_parser, char const *__pyx_v_at, size_t __pyx_v_length) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ Py_ssize_t __pyx_v_size;
+ PyObject *__pyx_v_ex = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ int __pyx_t_11;
+ PyObject *__pyx_t_12 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_header_field", 0);
+
+ /* "aiohttp/_http_parser.pyx":704
+ * cdef int cb_on_header_field(cparser.llhttp_t* parser,
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t size
+ * try:
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":706
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef Py_ssize_t size
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_status_complete()
+ * size = len(pyparser._raw_name) + length
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":707
+ * cdef Py_ssize_t size
+ * try:
+ * pyparser._on_status_complete() # <<<<<<<<<<<<<<
+ * size = len(pyparser._raw_name) + length
+ * if size > pyparser._max_field_size:
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_status_complete(__pyx_v_pyparser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":708
+ * try:
+ * pyparser._on_status_complete()
+ * size = len(pyparser._raw_name) + length # <<<<<<<<<<<<<<
+ * if size > pyparser._max_field_size:
+ * raise LineTooLong(
+ */
+ __pyx_t_1 = __pyx_v_pyparser->_raw_name;
+ __Pyx_INCREF(__pyx_t_1);
+ if (unlikely(__pyx_t_1 == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(0, 708, __pyx_L3_error)
+ }
+ __pyx_t_5 = PyByteArray_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 708, __pyx_L3_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_size = (__pyx_t_5 + __pyx_v_length);
+
+ /* "aiohttp/_http_parser.pyx":709
+ * pyparser._on_status_complete()
+ * size = len(pyparser._raw_name) + length
+ * if size > pyparser._max_field_size: # <<<<<<<<<<<<<<
+ * raise LineTooLong(
+ * 'Header name is too long', pyparser._max_field_size, size)
+ */
+ __pyx_t_6 = ((__pyx_v_size > __pyx_v_pyparser->_max_field_size) != 0);
+ if (unlikely(__pyx_t_6)) {
+
+ /* "aiohttp/_http_parser.pyx":710
+ * size = len(pyparser._raw_name) + length
+ * if size > pyparser._max_field_size:
+ * raise LineTooLong( # <<<<<<<<<<<<<<
+ * 'Header name is too long', pyparser._max_field_size, size)
+ * pyparser._on_header_field(at, length)
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_LineTooLong); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 710, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "aiohttp/_http_parser.pyx":711
+ * if size > pyparser._max_field_size:
+ * raise LineTooLong(
+ * 'Header name is too long', pyparser._max_field_size, size) # <<<<<<<<<<<<<<
+ * pyparser._on_header_field(at, length)
+ * except BaseException as ex:
+ */
+ __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_pyparser->_max_field_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 711, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 711, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = NULL;
+ __pyx_t_11 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_10)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_10);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ __pyx_t_11 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_kp_u_Header_name_is_too_long, __pyx_t_8, __pyx_t_9};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_kp_u_Header_name_is_too_long, __pyx_t_8, __pyx_t_9};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_12 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 710, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ if (__pyx_t_10) {
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_u_Header_name_is_too_long);
+ __Pyx_GIVEREF(__pyx_kp_u_Header_name_is_too_long);
+ PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_kp_u_Header_name_is_too_long);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_9);
+ __pyx_t_8 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 710, __pyx_L3_error)
+
+ /* "aiohttp/_http_parser.pyx":709
+ * pyparser._on_status_complete()
+ * size = len(pyparser._raw_name) + length
+ * if size > pyparser._max_field_size: # <<<<<<<<<<<<<<
+ * raise LineTooLong(
+ * 'Header name is too long', pyparser._max_field_size, size)
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":712
+ * raise LineTooLong(
+ * 'Header name is too long', pyparser._max_field_size, size)
+ * pyparser._on_header_field(at, length) # <<<<<<<<<<<<<<
+ * except BaseException as ex:
+ * pyparser._last_error = ex
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_header_field(__pyx_v_pyparser, __pyx_v_at, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 712, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":706
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef Py_ssize_t size
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_status_complete()
+ * size = len(pyparser._raw_name) + length
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":717
+ * return -1
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else:*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "aiohttp/_http_parser.pyx":713
+ * 'Header name is too long', pyparser._max_field_size, size)
+ * pyparser._on_header_field(at, length)
+ * except BaseException as ex: # <<<<<<<<<<<<<<
+ * pyparser._last_error = ex
+ * return -1
+ */
+ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_11) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_header_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_12) < 0) __PYX_ERR(0, 713, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_7);
+ __pyx_v_ex = __pyx_t_7;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":714
+ * pyparser._on_header_field(at, length)
+ * except BaseException as ex:
+ * pyparser._last_error = ex # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_ex);
+ __Pyx_GIVEREF(__pyx_v_ex);
+ __Pyx_GOTREF(__pyx_v_pyparser->_last_error);
+ __Pyx_DECREF(__pyx_v_pyparser->_last_error);
+ __pyx_v_pyparser->_last_error = __pyx_v_ex;
+
+ /* "aiohttp/_http_parser.pyx":715
+ * except BaseException as ex:
+ * pyparser._last_error = ex
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ goto __pyx_L14_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":713
+ * 'Header name is too long', pyparser._max_field_size, size)
+ * pyparser._on_header_field(at, length)
+ * except BaseException as ex: # <<<<<<<<<<<<<<
+ * pyparser._last_error = ex
+ * return -1
+ */
+ /*finally:*/ {
+ __pyx_L14_return: {
+ __pyx_t_11 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_ex);
+ __pyx_v_ex = NULL;
+ __pyx_r = __pyx_t_11;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":706
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef Py_ssize_t size
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_status_complete()
+ * size = len(pyparser._raw_name) + length
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":702
+ *
+ *
+ * cdef int cb_on_header_field(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_header_field", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_ex);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":720
+ *
+ *
+ * cdef int cb_on_header_value(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_header_value(llhttp_t *__pyx_v_parser, char const *__pyx_v_at, size_t __pyx_v_length) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ Py_ssize_t __pyx_v_size;
+ PyObject *__pyx_v_ex = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ int __pyx_t_11;
+ PyObject *__pyx_t_12 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_header_value", 0);
+
+ /* "aiohttp/_http_parser.pyx":722
+ * cdef int cb_on_header_value(cparser.llhttp_t* parser,
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t size
+ * try:
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":724
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef Py_ssize_t size
+ * try: # <<<<<<<<<<<<<<
+ * size = len(pyparser._raw_value) + length
+ * if size > pyparser._max_field_size:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":725
+ * cdef Py_ssize_t size
+ * try:
+ * size = len(pyparser._raw_value) + length # <<<<<<<<<<<<<<
+ * if size > pyparser._max_field_size:
+ * raise LineTooLong(
+ */
+ __pyx_t_1 = __pyx_v_pyparser->_raw_value;
+ __Pyx_INCREF(__pyx_t_1);
+ if (unlikely(__pyx_t_1 == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(0, 725, __pyx_L3_error)
+ }
+ __pyx_t_5 = PyByteArray_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 725, __pyx_L3_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_size = (__pyx_t_5 + __pyx_v_length);
+
+ /* "aiohttp/_http_parser.pyx":726
+ * try:
+ * size = len(pyparser._raw_value) + length
+ * if size > pyparser._max_field_size: # <<<<<<<<<<<<<<
+ * raise LineTooLong(
+ * 'Header value is too long', pyparser._max_field_size, size)
+ */
+ __pyx_t_6 = ((__pyx_v_size > __pyx_v_pyparser->_max_field_size) != 0);
+ if (unlikely(__pyx_t_6)) {
+
+ /* "aiohttp/_http_parser.pyx":727
+ * size = len(pyparser._raw_value) + length
+ * if size > pyparser._max_field_size:
+ * raise LineTooLong( # <<<<<<<<<<<<<<
+ * 'Header value is too long', pyparser._max_field_size, size)
+ * pyparser._on_header_value(at, length)
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_LineTooLong); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 727, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "aiohttp/_http_parser.pyx":728
+ * if size > pyparser._max_field_size:
+ * raise LineTooLong(
+ * 'Header value is too long', pyparser._max_field_size, size) # <<<<<<<<<<<<<<
+ * pyparser._on_header_value(at, length)
+ * except BaseException as ex:
+ */
+ __pyx_t_8 = __Pyx_PyInt_FromSize_t(__pyx_v_pyparser->_max_field_size); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 728, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_size); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 728, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = NULL;
+ __pyx_t_11 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_10)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_10);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ __pyx_t_11 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_kp_u_Header_value_is_too_long, __pyx_t_8, __pyx_t_9};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_kp_u_Header_value_is_too_long, __pyx_t_8, __pyx_t_9};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_12 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 727, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ if (__pyx_t_10) {
+ __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
+ }
+ __Pyx_INCREF(__pyx_kp_u_Header_value_is_too_long);
+ __Pyx_GIVEREF(__pyx_kp_u_Header_value_is_too_long);
+ PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_kp_u_Header_value_is_too_long);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_9);
+ __pyx_t_8 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 727, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(0, 727, __pyx_L3_error)
+
+ /* "aiohttp/_http_parser.pyx":726
+ * try:
+ * size = len(pyparser._raw_value) + length
+ * if size > pyparser._max_field_size: # <<<<<<<<<<<<<<
+ * raise LineTooLong(
+ * 'Header value is too long', pyparser._max_field_size, size)
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":729
+ * raise LineTooLong(
+ * 'Header value is too long', pyparser._max_field_size, size)
+ * pyparser._on_header_value(at, length) # <<<<<<<<<<<<<<
+ * except BaseException as ex:
+ * pyparser._last_error = ex
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_header_value(__pyx_v_pyparser, __pyx_v_at, __pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 729, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":724
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef Py_ssize_t size
+ * try: # <<<<<<<<<<<<<<
+ * size = len(pyparser._raw_value) + length
+ * if size > pyparser._max_field_size:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":734
+ * return -1
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else:*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "aiohttp/_http_parser.pyx":730
+ * 'Header value is too long', pyparser._max_field_size, size)
+ * pyparser._on_header_value(at, length)
+ * except BaseException as ex: # <<<<<<<<<<<<<<
+ * pyparser._last_error = ex
+ * return -1
+ */
+ __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_11) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_header_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_12) < 0) __PYX_ERR(0, 730, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_INCREF(__pyx_t_7);
+ __pyx_v_ex = __pyx_t_7;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":731
+ * pyparser._on_header_value(at, length)
+ * except BaseException as ex:
+ * pyparser._last_error = ex # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_ex);
+ __Pyx_GIVEREF(__pyx_v_ex);
+ __Pyx_GOTREF(__pyx_v_pyparser->_last_error);
+ __Pyx_DECREF(__pyx_v_pyparser->_last_error);
+ __pyx_v_pyparser->_last_error = __pyx_v_ex;
+
+ /* "aiohttp/_http_parser.pyx":732
+ * except BaseException as ex:
+ * pyparser._last_error = ex
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ goto __pyx_L14_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":730
+ * 'Header value is too long', pyparser._max_field_size, size)
+ * pyparser._on_header_value(at, length)
+ * except BaseException as ex: # <<<<<<<<<<<<<<
+ * pyparser._last_error = ex
+ * return -1
+ */
+ /*finally:*/ {
+ __pyx_L14_return: {
+ __pyx_t_11 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_ex);
+ __pyx_v_ex = NULL;
+ __pyx_r = __pyx_t_11;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":724
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef Py_ssize_t size
+ * try: # <<<<<<<<<<<<<<
+ * size = len(pyparser._raw_value) + length
+ * if size > pyparser._max_field_size:
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":720
+ *
+ *
+ * cdef int cb_on_header_value(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_header_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_ex);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":737
+ *
+ *
+ * cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_headers_complete(llhttp_t *__pyx_v_parser) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ PyObject *__pyx_v_exc = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_headers_complete", 0);
+
+ /* "aiohttp/_http_parser.pyx":738
+ *
+ * cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * try:
+ * pyparser._on_status_complete()
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":739
+ * cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_status_complete()
+ * pyparser._on_headers_complete()
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":740
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ * pyparser._on_status_complete() # <<<<<<<<<<<<<<
+ * pyparser._on_headers_complete()
+ * except BaseException as exc:
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_status_complete(__pyx_v_pyparser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 740, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":741
+ * try:
+ * pyparser._on_status_complete()
+ * pyparser._on_headers_complete() # <<<<<<<<<<<<<<
+ * except BaseException as exc:
+ * pyparser._last_error = exc
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_headers_complete(__pyx_v_pyparser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 741, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":739
+ * cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_status_complete()
+ * pyparser._on_headers_complete()
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":746
+ * return -1
+ * else:
+ * if ( # <<<<<<<<<<<<<<
+ * pyparser._cparser.upgrade or
+ * pyparser._cparser.method == cparser.HTTP_CONNECT
+ */
+ /*else:*/ {
+
+ /* "aiohttp/_http_parser.pyx":747
+ * else:
+ * if (
+ * pyparser._cparser.upgrade or # <<<<<<<<<<<<<<
+ * pyparser._cparser.method == cparser.HTTP_CONNECT
+ * ):
+ */
+ __pyx_t_6 = (__pyx_v_pyparser->_cparser->upgrade != 0);
+ if (!__pyx_t_6) {
+ } else {
+ __pyx_t_5 = __pyx_t_6;
+ goto __pyx_L10_bool_binop_done;
+ }
+
+ /* "aiohttp/_http_parser.pyx":748
+ * if (
+ * pyparser._cparser.upgrade or
+ * pyparser._cparser.method == cparser.HTTP_CONNECT # <<<<<<<<<<<<<<
+ * ):
+ * return 2
+ */
+ __pyx_t_6 = ((__pyx_v_pyparser->_cparser->method == HTTP_CONNECT) != 0);
+ __pyx_t_5 = __pyx_t_6;
+ __pyx_L10_bool_binop_done:;
+
+ /* "aiohttp/_http_parser.pyx":746
+ * return -1
+ * else:
+ * if ( # <<<<<<<<<<<<<<
+ * pyparser._cparser.upgrade or
+ * pyparser._cparser.method == cparser.HTTP_CONNECT
+ */
+ if (__pyx_t_5) {
+
+ /* "aiohttp/_http_parser.pyx":750
+ * pyparser._cparser.method == cparser.HTTP_CONNECT
+ * ):
+ * return 2 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = 2;
+ goto __pyx_L6_except_return;
+
+ /* "aiohttp/_http_parser.pyx":746
+ * return -1
+ * else:
+ * if ( # <<<<<<<<<<<<<<
+ * pyparser._cparser.upgrade or
+ * pyparser._cparser.method == cparser.HTTP_CONNECT
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":752
+ * return 2
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":742
+ * pyparser._on_status_complete()
+ * pyparser._on_headers_complete()
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * pyparser._last_error = exc
+ * return -1
+ */
+ __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_7) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_headers_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 742, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_8);
+ __pyx_v_exc = __pyx_t_8;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":743
+ * pyparser._on_headers_complete()
+ * except BaseException as exc:
+ * pyparser._last_error = exc # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_exc);
+ __Pyx_GIVEREF(__pyx_v_exc);
+ __Pyx_GOTREF(__pyx_v_pyparser->_last_error);
+ __Pyx_DECREF(__pyx_v_pyparser->_last_error);
+ __pyx_v_pyparser->_last_error = __pyx_v_exc;
+
+ /* "aiohttp/_http_parser.pyx":744
+ * except BaseException as exc:
+ * pyparser._last_error = exc
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * if (
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L16_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":742
+ * pyparser._on_status_complete()
+ * pyparser._on_headers_complete()
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * pyparser._last_error = exc
+ * return -1
+ */
+ /*finally:*/ {
+ __pyx_L16_return: {
+ __pyx_t_7 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_exc);
+ __pyx_v_exc = NULL;
+ __pyx_r = __pyx_t_7;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":739
+ * cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_status_complete()
+ * pyparser._on_headers_complete()
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":737
+ *
+ *
+ * cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_headers_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_exc);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":755
+ *
+ *
+ * cdef int cb_on_body(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_body(llhttp_t *__pyx_v_parser, char const *__pyx_v_at, size_t __pyx_v_length) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ PyObject *__pyx_v_body = 0;
+ PyObject *__pyx_v_exc = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_t_10;
+ int __pyx_t_11;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ int __pyx_t_16;
+ char const *__pyx_t_17;
+ PyObject *__pyx_t_18 = NULL;
+ PyObject *__pyx_t_19 = NULL;
+ PyObject *__pyx_t_20 = NULL;
+ PyObject *__pyx_t_21 = NULL;
+ PyObject *__pyx_t_22 = NULL;
+ PyObject *__pyx_t_23 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_body", 0);
+
+ /* "aiohttp/_http_parser.pyx":757
+ * cdef int cb_on_body(cparser.llhttp_t* parser,
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * cdef bytes body = at[:length]
+ * try:
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":758
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef bytes body = at[:length] # <<<<<<<<<<<<<<
+ * try:
+ * pyparser._payload.feed_data(body, length)
+ */
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_at + 0, __pyx_v_length - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 758, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_body = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":759
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef bytes body = at[:length]
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._payload.feed_data(body, length)
+ * except BaseException as exc:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":760
+ * cdef bytes body = at[:length]
+ * try:
+ * pyparser._payload.feed_data(body, length) # <<<<<<<<<<<<<<
+ * except BaseException as exc:
+ * if pyparser._payload_exception is not None:
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_pyparser->_payload, __pyx_n_s_feed_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyInt_FromSize_t(__pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 760, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_body, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_body, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_body);
+ __Pyx_GIVEREF(__pyx_v_body);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_body);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 760, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":759
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef bytes body = at[:length]
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._payload.feed_data(body, length)
+ * except BaseException as exc:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":769
+ * return -1
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else:*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+
+ /* "aiohttp/_http_parser.pyx":761
+ * try:
+ * pyparser._payload.feed_data(body, length)
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * if pyparser._payload_exception is not None:
+ * pyparser._payload.set_exception(pyparser._payload_exception(str(exc)))
+ */
+ __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_8) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_body", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9) < 0) __PYX_ERR(0, 761, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_INCREF(__pyx_t_5);
+ __pyx_v_exc = __pyx_t_5;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":762
+ * pyparser._payload.feed_data(body, length)
+ * except BaseException as exc:
+ * if pyparser._payload_exception is not None: # <<<<<<<<<<<<<<
+ * pyparser._payload.set_exception(pyparser._payload_exception(str(exc)))
+ * else:
+ */
+ __pyx_t_10 = (__pyx_v_pyparser->_payload_exception != Py_None);
+ __pyx_t_11 = (__pyx_t_10 != 0);
+ if (__pyx_t_11) {
+
+ /* "aiohttp/_http_parser.pyx":763
+ * except BaseException as exc:
+ * if pyparser._payload_exception is not None:
+ * pyparser._payload.set_exception(pyparser._payload_exception(str(exc))) # <<<<<<<<<<<<<<
+ * else:
+ * pyparser._payload.set_exception(exc)
+ */
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pyparser->_payload, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 763, __pyx_L14_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_13 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_exc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 763, __pyx_L14_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_INCREF(__pyx_v_pyparser->_payload_exception);
+ __pyx_t_14 = __pyx_v_pyparser->_payload_exception; __pyx_t_15 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_14))) {
+ __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_14);
+ if (likely(__pyx_t_15)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
+ __Pyx_INCREF(__pyx_t_15);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_14, function);
+ }
+ }
+ __pyx_t_12 = (__pyx_t_15) ? __Pyx_PyObject_Call2Args(__pyx_t_14, __pyx_t_15, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_13);
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
+ if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 763, __pyx_L14_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __pyx_t_14 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_14)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_14);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ __pyx_t_6 = (__pyx_t_14) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_14, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 763, __pyx_L14_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_parser.pyx":762
+ * pyparser._payload.feed_data(body, length)
+ * except BaseException as exc:
+ * if pyparser._payload_exception is not None: # <<<<<<<<<<<<<<
+ * pyparser._payload.set_exception(pyparser._payload_exception(str(exc)))
+ * else:
+ */
+ goto __pyx_L16;
+ }
+
+ /* "aiohttp/_http_parser.pyx":765
+ * pyparser._payload.set_exception(pyparser._payload_exception(str(exc)))
+ * else:
+ * pyparser._payload.set_exception(exc) # <<<<<<<<<<<<<<
+ * pyparser._payload_error = 1
+ * return -1
+ */
+ /*else*/ {
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_pyparser->_payload, __pyx_n_s_set_exception); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 765, __pyx_L14_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_12 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_12)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_12);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ __pyx_t_6 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_v_exc) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_exc);
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 765, __pyx_L14_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __pyx_L16:;
+
+ /* "aiohttp/_http_parser.pyx":766
+ * else:
+ * pyparser._payload.set_exception(exc)
+ * pyparser._payload_error = 1 # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __pyx_v_pyparser->_payload_error = 1;
+
+ /* "aiohttp/_http_parser.pyx":767
+ * pyparser._payload.set_exception(exc)
+ * pyparser._payload_error = 1
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L13_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":761
+ * try:
+ * pyparser._payload.feed_data(body, length)
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * if pyparser._payload_exception is not None:
+ * pyparser._payload.set_exception(pyparser._payload_exception(str(exc)))
+ */
+ /*finally:*/ {
+ __pyx_L14_error:;
+ /*exception exit:*/{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
+ __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
+ __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
+ __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
+ __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
+ if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_18, &__pyx_t_19, &__pyx_t_20);
+ __Pyx_XGOTREF(__pyx_t_18);
+ __Pyx_XGOTREF(__pyx_t_19);
+ __Pyx_XGOTREF(__pyx_t_20);
+ __Pyx_XGOTREF(__pyx_t_21);
+ __Pyx_XGOTREF(__pyx_t_22);
+ __Pyx_XGOTREF(__pyx_t_23);
+ __pyx_t_8 = __pyx_lineno; __pyx_t_16 = __pyx_clineno; __pyx_t_17 = __pyx_filename;
+ {
+ __Pyx_DECREF(__pyx_v_exc);
+ __pyx_v_exc = NULL;
+ }
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_21);
+ __Pyx_XGIVEREF(__pyx_t_22);
+ __Pyx_XGIVEREF(__pyx_t_23);
+ __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
+ }
+ __Pyx_XGIVEREF(__pyx_t_18);
+ __Pyx_XGIVEREF(__pyx_t_19);
+ __Pyx_XGIVEREF(__pyx_t_20);
+ __Pyx_ErrRestore(__pyx_t_18, __pyx_t_19, __pyx_t_20);
+ __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
+ __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_16; __pyx_filename = __pyx_t_17;
+ goto __pyx_L5_except_error;
+ }
+ __pyx_L13_return: {
+ __pyx_t_16 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_exc);
+ __pyx_v_exc = NULL;
+ __pyx_r = __pyx_t_16;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":759
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * cdef bytes body = at[:length]
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._payload.feed_data(body, length)
+ * except BaseException as exc:
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":755
+ *
+ *
+ * cdef int cb_on_body(cparser.llhttp_t* parser, # <<<<<<<<<<<<<<
+ * const char *at, size_t length) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_body", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_body);
+ __Pyx_XDECREF(__pyx_v_exc);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":772
+ *
+ *
+ * cdef int cb_on_message_complete(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_message_complete(llhttp_t *__pyx_v_parser) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ PyObject *__pyx_v_exc = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_message_complete", 0);
+
+ /* "aiohttp/_http_parser.pyx":773
+ *
+ * cdef int cb_on_message_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * try:
+ * pyparser._started = False
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":774
+ * cdef int cb_on_message_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._started = False
+ * pyparser._on_message_complete()
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":775
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ * pyparser._started = False # <<<<<<<<<<<<<<
+ * pyparser._on_message_complete()
+ * except BaseException as exc:
+ */
+ __pyx_v_pyparser->_started = 0;
+
+ /* "aiohttp/_http_parser.pyx":776
+ * try:
+ * pyparser._started = False
+ * pyparser._on_message_complete() # <<<<<<<<<<<<<<
+ * except BaseException as exc:
+ * pyparser._last_error = exc
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_message_complete(__pyx_v_pyparser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":774
+ * cdef int cb_on_message_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._started = False
+ * pyparser._on_message_complete()
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":781
+ * return -1
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else:*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":777
+ * pyparser._started = False
+ * pyparser._on_message_complete()
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * pyparser._last_error = exc
+ * return -1
+ */
+ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_5) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_message_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 777, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_6);
+ __pyx_v_exc = __pyx_t_6;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":778
+ * pyparser._on_message_complete()
+ * except BaseException as exc:
+ * pyparser._last_error = exc # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_exc);
+ __Pyx_GIVEREF(__pyx_v_exc);
+ __Pyx_GOTREF(__pyx_v_pyparser->_last_error);
+ __Pyx_DECREF(__pyx_v_pyparser->_last_error);
+ __pyx_v_pyparser->_last_error = __pyx_v_exc;
+
+ /* "aiohttp/_http_parser.pyx":779
+ * except BaseException as exc:
+ * pyparser._last_error = exc
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ goto __pyx_L13_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":777
+ * pyparser._started = False
+ * pyparser._on_message_complete()
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * pyparser._last_error = exc
+ * return -1
+ */
+ /*finally:*/ {
+ __pyx_L13_return: {
+ __pyx_t_5 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_exc);
+ __pyx_v_exc = NULL;
+ __pyx_r = __pyx_t_5;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":774
+ * cdef int cb_on_message_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._started = False
+ * pyparser._on_message_complete()
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":772
+ *
+ *
+ * cdef int cb_on_message_complete(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_message_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_exc);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":784
+ *
+ *
+ * cdef int cb_on_chunk_header(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_chunk_header(llhttp_t *__pyx_v_parser) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ PyObject *__pyx_v_exc = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_chunk_header", 0);
+
+ /* "aiohttp/_http_parser.pyx":785
+ *
+ * cdef int cb_on_chunk_header(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * try:
+ * pyparser._on_chunk_header()
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":786
+ * cdef int cb_on_chunk_header(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_chunk_header()
+ * except BaseException as exc:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":787
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ * pyparser._on_chunk_header() # <<<<<<<<<<<<<<
+ * except BaseException as exc:
+ * pyparser._last_error = exc
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_chunk_header(__pyx_v_pyparser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":786
+ * cdef int cb_on_chunk_header(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_chunk_header()
+ * except BaseException as exc:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":792
+ * return -1
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else:*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":788
+ * try:
+ * pyparser._on_chunk_header()
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * pyparser._last_error = exc
+ * return -1
+ */
+ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_5) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_chunk_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 788, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_6);
+ __pyx_v_exc = __pyx_t_6;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":789
+ * pyparser._on_chunk_header()
+ * except BaseException as exc:
+ * pyparser._last_error = exc # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_exc);
+ __Pyx_GIVEREF(__pyx_v_exc);
+ __Pyx_GOTREF(__pyx_v_pyparser->_last_error);
+ __Pyx_DECREF(__pyx_v_pyparser->_last_error);
+ __pyx_v_pyparser->_last_error = __pyx_v_exc;
+
+ /* "aiohttp/_http_parser.pyx":790
+ * except BaseException as exc:
+ * pyparser._last_error = exc
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ goto __pyx_L13_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":788
+ * try:
+ * pyparser._on_chunk_header()
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * pyparser._last_error = exc
+ * return -1
+ */
+ /*finally:*/ {
+ __pyx_L13_return: {
+ __pyx_t_5 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_exc);
+ __pyx_v_exc = NULL;
+ __pyx_r = __pyx_t_5;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":786
+ * cdef int cb_on_chunk_header(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_chunk_header()
+ * except BaseException as exc:
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":784
+ *
+ *
+ * cdef int cb_on_chunk_header(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_chunk_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_exc);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":795
+ *
+ *
+ * cdef int cb_on_chunk_complete(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ */
+
+static int __pyx_f_7aiohttp_12_http_parser_cb_on_chunk_complete(llhttp_t *__pyx_v_parser) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *__pyx_v_pyparser = 0;
+ PyObject *__pyx_v_exc = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("cb_on_chunk_complete", 0);
+
+ /* "aiohttp/_http_parser.pyx":796
+ *
+ * cdef int cb_on_chunk_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data # <<<<<<<<<<<<<<
+ * try:
+ * pyparser._on_chunk_complete()
+ */
+ __pyx_t_1 = ((PyObject *)__pyx_v_parser->data);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v_pyparser = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":797
+ * cdef int cb_on_chunk_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_chunk_complete()
+ * except BaseException as exc:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":798
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ * pyparser._on_chunk_complete() # <<<<<<<<<<<<<<
+ * except BaseException as exc:
+ * pyparser._last_error = exc
+ */
+ __pyx_t_1 = ((struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser *)__pyx_v_pyparser->__pyx_vtab)->_on_chunk_complete(__pyx_v_pyparser); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 798, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":797
+ * cdef int cb_on_chunk_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_chunk_complete()
+ * except BaseException as exc:
+ */
+ }
+
+ /* "aiohttp/_http_parser.pyx":803
+ * return -1
+ * else:
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else:*/ {
+ __pyx_r = 0;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":799
+ * try:
+ * pyparser._on_chunk_complete()
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * pyparser._last_error = exc
+ * return -1
+ */
+ __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_BaseException);
+ if (__pyx_t_5) {
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_chunk_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 799, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_6);
+ __pyx_v_exc = __pyx_t_6;
+ /*try:*/ {
+
+ /* "aiohttp/_http_parser.pyx":800
+ * pyparser._on_chunk_complete()
+ * except BaseException as exc:
+ * pyparser._last_error = exc # <<<<<<<<<<<<<<
+ * return -1
+ * else:
+ */
+ __Pyx_INCREF(__pyx_v_exc);
+ __Pyx_GIVEREF(__pyx_v_exc);
+ __Pyx_GOTREF(__pyx_v_pyparser->_last_error);
+ __Pyx_DECREF(__pyx_v_pyparser->_last_error);
+ __pyx_v_pyparser->_last_error = __pyx_v_exc;
+
+ /* "aiohttp/_http_parser.pyx":801
+ * except BaseException as exc:
+ * pyparser._last_error = exc
+ * return -1 # <<<<<<<<<<<<<<
+ * else:
+ * return 0
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ goto __pyx_L13_return;
+ }
+
+ /* "aiohttp/_http_parser.pyx":799
+ * try:
+ * pyparser._on_chunk_complete()
+ * except BaseException as exc: # <<<<<<<<<<<<<<
+ * pyparser._last_error = exc
+ * return -1
+ */
+ /*finally:*/ {
+ __pyx_L13_return: {
+ __pyx_t_5 = __pyx_r;
+ __Pyx_DECREF(__pyx_v_exc);
+ __pyx_v_exc = NULL;
+ __pyx_r = __pyx_t_5;
+ goto __pyx_L6_except_return;
+ }
+ }
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "aiohttp/_http_parser.pyx":797
+ * cdef int cb_on_chunk_complete(cparser.llhttp_t* parser) except -1:
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try: # <<<<<<<<<<<<<<
+ * pyparser._on_chunk_complete()
+ * except BaseException as exc:
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_parser.pyx":795
+ *
+ *
+ * cdef int cb_on_chunk_complete(cparser.llhttp_t* parser) except -1: # <<<<<<<<<<<<<<
+ * cdef HttpParser pyparser = <HttpParser>parser.data
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("aiohttp._http_parser.cb_on_chunk_complete", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_pyparser);
+ __Pyx_XDECREF(__pyx_v_exc);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_parser.pyx":806
+ *
+ *
+ * cdef parser_error_from_errno(cparser.llhttp_t* parser, data, pointer): # <<<<<<<<<<<<<<
+ * cdef cparser.llhttp_errno_t errno = cparser.llhttp_get_errno(parser)
+ * cdef bytes desc = cparser.llhttp_get_error_reason(parser)
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser_parser_error_from_errno(llhttp_t *__pyx_v_parser, PyObject *__pyx_v_data, PyObject *__pyx_v_pointer) {
+ llhttp_errno_t __pyx_v_errno;
+ PyObject *__pyx_v_desc = 0;
+ PyObject *__pyx_v_cls = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("parser_error_from_errno", 0);
+
+ /* "aiohttp/_http_parser.pyx":807
+ *
+ * cdef parser_error_from_errno(cparser.llhttp_t* parser, data, pointer):
+ * cdef cparser.llhttp_errno_t errno = cparser.llhttp_get_errno(parser) # <<<<<<<<<<<<<<
+ * cdef bytes desc = cparser.llhttp_get_error_reason(parser)
+ *
+ */
+ __pyx_v_errno = llhttp_get_errno(__pyx_v_parser);
+
+ /* "aiohttp/_http_parser.pyx":808
+ * cdef parser_error_from_errno(cparser.llhttp_t* parser, data, pointer):
+ * cdef cparser.llhttp_errno_t errno = cparser.llhttp_get_errno(parser)
+ * cdef bytes desc = cparser.llhttp_get_error_reason(parser) # <<<<<<<<<<<<<<
+ *
+ * if errno in (cparser.HPE_CB_MESSAGE_BEGIN,
+ */
+ __pyx_t_1 = __Pyx_PyBytes_FromString(llhttp_get_error_reason(__pyx_v_parser)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 808, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_desc = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":810
+ * cdef bytes desc = cparser.llhttp_get_error_reason(parser)
+ *
+ * if errno in (cparser.HPE_CB_MESSAGE_BEGIN, # <<<<<<<<<<<<<<
+ * cparser.HPE_CB_HEADERS_COMPLETE,
+ * cparser.HPE_CB_MESSAGE_COMPLETE,
+ */
+ switch (__pyx_v_errno) {
+ case HPE_CB_MESSAGE_BEGIN:
+ case HPE_CB_HEADERS_COMPLETE:
+
+ /* "aiohttp/_http_parser.pyx":811
+ *
+ * if errno in (cparser.HPE_CB_MESSAGE_BEGIN,
+ * cparser.HPE_CB_HEADERS_COMPLETE, # <<<<<<<<<<<<<<
+ * cparser.HPE_CB_MESSAGE_COMPLETE,
+ * cparser.HPE_CB_CHUNK_HEADER,
+ */
+ case HPE_CB_MESSAGE_COMPLETE:
+
+ /* "aiohttp/_http_parser.pyx":812
+ * if errno in (cparser.HPE_CB_MESSAGE_BEGIN,
+ * cparser.HPE_CB_HEADERS_COMPLETE,
+ * cparser.HPE_CB_MESSAGE_COMPLETE, # <<<<<<<<<<<<<<
+ * cparser.HPE_CB_CHUNK_HEADER,
+ * cparser.HPE_CB_CHUNK_COMPLETE,
+ */
+ case HPE_CB_CHUNK_HEADER:
+
+ /* "aiohttp/_http_parser.pyx":813
+ * cparser.HPE_CB_HEADERS_COMPLETE,
+ * cparser.HPE_CB_MESSAGE_COMPLETE,
+ * cparser.HPE_CB_CHUNK_HEADER, # <<<<<<<<<<<<<<
+ * cparser.HPE_CB_CHUNK_COMPLETE,
+ * cparser.HPE_INVALID_CONSTANT,
+ */
+ case HPE_CB_CHUNK_COMPLETE:
+
+ /* "aiohttp/_http_parser.pyx":814
+ * cparser.HPE_CB_MESSAGE_COMPLETE,
+ * cparser.HPE_CB_CHUNK_HEADER,
+ * cparser.HPE_CB_CHUNK_COMPLETE, # <<<<<<<<<<<<<<
+ * cparser.HPE_INVALID_CONSTANT,
+ * cparser.HPE_INVALID_HEADER_TOKEN,
+ */
+ case HPE_INVALID_CONSTANT:
+
+ /* "aiohttp/_http_parser.pyx":815
+ * cparser.HPE_CB_CHUNK_HEADER,
+ * cparser.HPE_CB_CHUNK_COMPLETE,
+ * cparser.HPE_INVALID_CONSTANT, # <<<<<<<<<<<<<<
+ * cparser.HPE_INVALID_HEADER_TOKEN,
+ * cparser.HPE_INVALID_CONTENT_LENGTH,
+ */
+ case HPE_INVALID_HEADER_TOKEN:
+
+ /* "aiohttp/_http_parser.pyx":816
+ * cparser.HPE_CB_CHUNK_COMPLETE,
+ * cparser.HPE_INVALID_CONSTANT,
+ * cparser.HPE_INVALID_HEADER_TOKEN, # <<<<<<<<<<<<<<
+ * cparser.HPE_INVALID_CONTENT_LENGTH,
+ * cparser.HPE_INVALID_CHUNK_SIZE,
+ */
+ case HPE_INVALID_CONTENT_LENGTH:
+
+ /* "aiohttp/_http_parser.pyx":817
+ * cparser.HPE_INVALID_CONSTANT,
+ * cparser.HPE_INVALID_HEADER_TOKEN,
+ * cparser.HPE_INVALID_CONTENT_LENGTH, # <<<<<<<<<<<<<<
+ * cparser.HPE_INVALID_CHUNK_SIZE,
+ * cparser.HPE_INVALID_EOF_STATE,
+ */
+ case HPE_INVALID_CHUNK_SIZE:
+
+ /* "aiohttp/_http_parser.pyx":818
+ * cparser.HPE_INVALID_HEADER_TOKEN,
+ * cparser.HPE_INVALID_CONTENT_LENGTH,
+ * cparser.HPE_INVALID_CHUNK_SIZE, # <<<<<<<<<<<<<<
+ * cparser.HPE_INVALID_EOF_STATE,
+ * cparser.HPE_INVALID_TRANSFER_ENCODING):
+ */
+ case HPE_INVALID_EOF_STATE:
+
+ /* "aiohttp/_http_parser.pyx":819
+ * cparser.HPE_INVALID_CONTENT_LENGTH,
+ * cparser.HPE_INVALID_CHUNK_SIZE,
+ * cparser.HPE_INVALID_EOF_STATE, # <<<<<<<<<<<<<<
+ * cparser.HPE_INVALID_TRANSFER_ENCODING):
+ * cls = BadHttpMessage
+ */
+ case HPE_INVALID_TRANSFER_ENCODING:
+
+ /* "aiohttp/_http_parser.pyx":821
+ * cparser.HPE_INVALID_EOF_STATE,
+ * cparser.HPE_INVALID_TRANSFER_ENCODING):
+ * cls = BadHttpMessage # <<<<<<<<<<<<<<
+ *
+ * elif errno == cparser.HPE_INVALID_STATUS:
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BadHttpMessage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 821, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_cls = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":810
+ * cdef bytes desc = cparser.llhttp_get_error_reason(parser)
+ *
+ * if errno in (cparser.HPE_CB_MESSAGE_BEGIN, # <<<<<<<<<<<<<<
+ * cparser.HPE_CB_HEADERS_COMPLETE,
+ * cparser.HPE_CB_MESSAGE_COMPLETE,
+ */
+ break;
+ case HPE_INVALID_STATUS:
+
+ /* "aiohttp/_http_parser.pyx":824
+ *
+ * elif errno == cparser.HPE_INVALID_STATUS:
+ * cls = BadStatusLine # <<<<<<<<<<<<<<
+ *
+ * elif errno == cparser.HPE_INVALID_METHOD:
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BadStatusLine); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_cls = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":823
+ * cls = BadHttpMessage
+ *
+ * elif errno == cparser.HPE_INVALID_STATUS: # <<<<<<<<<<<<<<
+ * cls = BadStatusLine
+ *
+ */
+ break;
+ case HPE_INVALID_METHOD:
+
+ /* "aiohttp/_http_parser.pyx":827
+ *
+ * elif errno == cparser.HPE_INVALID_METHOD:
+ * cls = BadStatusLine # <<<<<<<<<<<<<<
+ *
+ * elif errno == cparser.HPE_INVALID_VERSION:
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BadStatusLine); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 827, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_cls = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":826
+ * cls = BadStatusLine
+ *
+ * elif errno == cparser.HPE_INVALID_METHOD: # <<<<<<<<<<<<<<
+ * cls = BadStatusLine
+ *
+ */
+ break;
+ case HPE_INVALID_VERSION:
+
+ /* "aiohttp/_http_parser.pyx":830
+ *
+ * elif errno == cparser.HPE_INVALID_VERSION:
+ * cls = BadStatusLine # <<<<<<<<<<<<<<
+ *
+ * elif errno == cparser.HPE_INVALID_URL:
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BadStatusLine); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_cls = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":829
+ * cls = BadStatusLine
+ *
+ * elif errno == cparser.HPE_INVALID_VERSION: # <<<<<<<<<<<<<<
+ * cls = BadStatusLine
+ *
+ */
+ break;
+ case HPE_INVALID_URL:
+
+ /* "aiohttp/_http_parser.pyx":833
+ *
+ * elif errno == cparser.HPE_INVALID_URL:
+ * cls = InvalidURLError # <<<<<<<<<<<<<<
+ *
+ * else:
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_InvalidURLError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 833, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_cls = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":832
+ * cls = BadStatusLine
+ *
+ * elif errno == cparser.HPE_INVALID_URL: # <<<<<<<<<<<<<<
+ * cls = InvalidURLError
+ *
+ */
+ break;
+ default:
+
+ /* "aiohttp/_http_parser.pyx":836
+ *
+ * else:
+ * cls = BadHttpMessage # <<<<<<<<<<<<<<
+ *
+ * return cls("{}:\n\n {!r}\n {}".format(desc.decode("latin-1"), data, pointer))
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_BadHttpMessage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_cls = __pyx_t_1;
+ __pyx_t_1 = 0;
+ break;
+ }
+
+ /* "aiohttp/_http_parser.pyx":838
+ * cls = BadHttpMessage
+ *
+ * return cls("{}:\n\n {!r}\n {}".format(desc.decode("latin-1"), data, pointer)) # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_r, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_decode_bytes(__pyx_v_desc, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeLatin1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ __pyx_t_6 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ __pyx_t_6 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_v_data, __pyx_v_pointer};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_5, __pyx_t_4, __pyx_v_data, __pyx_v_pointer};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 838, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_data);
+ __Pyx_INCREF(__pyx_v_pointer);
+ __Pyx_GIVEREF(__pyx_v_pointer);
+ PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_pointer);
+ __pyx_t_4 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 838, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_INCREF(__pyx_v_cls);
+ __pyx_t_3 = __pyx_v_cls; __pyx_t_7 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 838, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_parser.pyx":806
+ *
+ *
+ * cdef parser_error_from_errno(cparser.llhttp_t* parser, data, pointer): # <<<<<<<<<<<<<<
+ * cdef cparser.llhttp_errno_t errno = cparser.llhttp_get_errno(parser)
+ * cdef bytes desc = cparser.llhttp_get_error_reason(parser)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("aiohttp._http_parser.parser_error_from_errno", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_desc);
+ __Pyx_XDECREF(__pyx_v_cls);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __pyx_unpickle_RawRequestMessage(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_1__pyx_unpickle_RawRequestMessage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_7aiohttp_12_http_parser_1__pyx_unpickle_RawRequestMessage = {"__pyx_unpickle_RawRequestMessage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7aiohttp_12_http_parser_1__pyx_unpickle_RawRequestMessage, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_1__pyx_unpickle_RawRequestMessage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v___pyx_type = 0;
+ long __pyx_v___pyx_checksum;
+ PyObject *__pyx_v___pyx_state = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_unpickle_RawRequestMessage (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RawRequestMessage", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RawRequestMessage", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_RawRequestMessage") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v___pyx_type = values[0];
+ __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
+ __pyx_v___pyx_state = values[2];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RawRequestMessage", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.__pyx_unpickle_RawRequestMessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser___pyx_unpickle_RawRequestMessage(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser___pyx_unpickle_RawRequestMessage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_v___pyx_PickleError = 0;
+ PyObject *__pyx_v___pyx_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_RawRequestMessage", 0);
+
+ /* "(tree fragment)":4
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0x1408252, 0xf602a9f, 0x03e51e3): # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x1408252, 0xf602a9f, 0x03e51e3) = (chunked, compression, headers, method, path, raw_headers, should_close, upgrade, url, version))" % __pyx_checksum)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__17, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":5
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0x1408252, 0xf602a9f, 0x03e51e3):
+ * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x1408252, 0xf602a9f, 0x03e51e3) = (chunked, compression, headers, method, path, raw_headers, should_close, upgrade, url, version))" % __pyx_checksum)
+ * __pyx_result = RawRequestMessage.__new__(__pyx_type)
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_PickleError);
+ __Pyx_GIVEREF(__pyx_n_s_PickleError);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v___pyx_PickleError = __pyx_t_1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "(tree fragment)":6
+ * if __pyx_checksum not in (0x1408252, 0xf602a9f, 0x03e51e3):
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x1408252, 0xf602a9f, 0x03e51e3) = (chunked, compression, headers, method, path, raw_headers, should_close, upgrade, url, version))" % __pyx_checksum) # <<<<<<<<<<<<<<
+ * __pyx_result = RawRequestMessage.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_INCREF(__pyx_v___pyx_PickleError);
+ __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(1, 6, __pyx_L1_error)
+
+ /* "(tree fragment)":4
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0x1408252, 0xf602a9f, 0x03e51e3): # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x1408252, 0xf602a9f, 0x03e51e3) = (chunked, compression, headers, method, path, raw_headers, should_close, upgrade, url, version))" % __pyx_checksum)
+ */
+ }
+
+ /* "(tree fragment)":7
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x1408252, 0xf602a9f, 0x03e51e3) = (chunked, compression, headers, method, path, raw_headers, should_close, upgrade, url, version))" % __pyx_checksum)
+ * __pyx_result = RawRequestMessage.__new__(__pyx_type) # <<<<<<<<<<<<<<
+ * if __pyx_state is not None:
+ * __pyx_unpickle_RawRequestMessage__set_state(<RawRequestMessage> __pyx_result, __pyx_state)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7aiohttp_12_http_parser_RawRequestMessage), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v___pyx_result = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "(tree fragment)":8
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x1408252, 0xf602a9f, 0x03e51e3) = (chunked, compression, headers, method, path, raw_headers, should_close, upgrade, url, version))" % __pyx_checksum)
+ * __pyx_result = RawRequestMessage.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_RawRequestMessage__set_state(<RawRequestMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+
+ /* "(tree fragment)":9
+ * __pyx_result = RawRequestMessage.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ * __pyx_unpickle_RawRequestMessage__set_state(<RawRequestMessage> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawRequestMessage__set_state(RawRequestMessage __pyx_result, tuple __pyx_state):
+ */
+ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_7aiohttp_12_http_parser___pyx_unpickle_RawRequestMessage__set_state(((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "(tree fragment)":8
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0x1408252, 0xf602a9f, 0x03e51e3) = (chunked, compression, headers, method, path, raw_headers, should_close, upgrade, url, version))" % __pyx_checksum)
+ * __pyx_result = RawRequestMessage.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_RawRequestMessage__set_state(<RawRequestMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ }
+
+ /* "(tree fragment)":10
+ * if __pyx_state is not None:
+ * __pyx_unpickle_RawRequestMessage__set_state(<RawRequestMessage> __pyx_result, __pyx_state)
+ * return __pyx_result # <<<<<<<<<<<<<<
+ * cdef __pyx_unpickle_RawRequestMessage__set_state(RawRequestMessage __pyx_result, tuple __pyx_state):
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.compression = __pyx_state[1]; __pyx_result.headers = __pyx_state[2]; __pyx_result.method = __pyx_state[3]; __pyx_result.path = __pyx_state[4]; __pyx_result.raw_headers = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.url = __pyx_state[8]; __pyx_result.version = __pyx_state[9]
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v___pyx_result);
+ __pyx_r = __pyx_v___pyx_result;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_RawRequestMessage(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._http_parser.__pyx_unpickle_RawRequestMessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v___pyx_PickleError);
+ __Pyx_XDECREF(__pyx_v___pyx_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":11
+ * __pyx_unpickle_RawRequestMessage__set_state(<RawRequestMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawRequestMessage__set_state(RawRequestMessage __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.compression = __pyx_state[1]; __pyx_result.headers = __pyx_state[2]; __pyx_result.method = __pyx_state[3]; __pyx_result.path = __pyx_state[4]; __pyx_result.raw_headers = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.url = __pyx_state[8]; __pyx_result.version = __pyx_state[9]
+ * if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser___pyx_unpickle_RawRequestMessage__set_state(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_RawRequestMessage__set_state", 0);
+
+ /* "(tree fragment)":12
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawRequestMessage__set_state(RawRequestMessage __pyx_result, tuple __pyx_state):
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.compression = __pyx_state[1]; __pyx_result.headers = __pyx_state[2]; __pyx_result.method = __pyx_state[3]; __pyx_result.path = __pyx_state[4]; __pyx_result.raw_headers = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.url = __pyx_state[8]; __pyx_result.version = __pyx_state[9] # <<<<<<<<<<<<<<
+ * if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[10])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->chunked);
+ __Pyx_DECREF(__pyx_v___pyx_result->chunked);
+ __pyx_v___pyx_result->chunked = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->compression);
+ __Pyx_DECREF(__pyx_v___pyx_result->compression);
+ __pyx_v___pyx_result->compression = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->headers);
+ __Pyx_DECREF(__pyx_v___pyx_result->headers);
+ __pyx_v___pyx_result->headers = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->method);
+ __Pyx_DECREF(__pyx_v___pyx_result->method);
+ __pyx_v___pyx_result->method = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->path);
+ __Pyx_DECREF(__pyx_v___pyx_result->path);
+ __pyx_v___pyx_result->path = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->raw_headers);
+ __Pyx_DECREF(__pyx_v___pyx_result->raw_headers);
+ __pyx_v___pyx_result->raw_headers = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->should_close);
+ __Pyx_DECREF(__pyx_v___pyx_result->should_close);
+ __pyx_v___pyx_result->should_close = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->upgrade);
+ __Pyx_DECREF(__pyx_v___pyx_result->upgrade);
+ __pyx_v___pyx_result->upgrade = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->url);
+ __Pyx_DECREF(__pyx_v___pyx_result->url);
+ __pyx_v___pyx_result->url = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->version);
+ __Pyx_DECREF(__pyx_v___pyx_result->version);
+ __pyx_v___pyx_result->version = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":13
+ * cdef __pyx_unpickle_RawRequestMessage__set_state(RawRequestMessage __pyx_result, tuple __pyx_state):
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.compression = __pyx_state[1]; __pyx_result.headers = __pyx_state[2]; __pyx_result.method = __pyx_state[3]; __pyx_result.path = __pyx_state[4]; __pyx_result.raw_headers = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.url = __pyx_state[8]; __pyx_result.version = __pyx_state[9]
+ * if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[10])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(1, 13, __pyx_L1_error)
+ }
+ __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
+ __pyx_t_4 = ((__pyx_t_3 > 10) != 0);
+ if (__pyx_t_4) {
+ } else {
+ __pyx_t_2 = __pyx_t_4;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_4 != 0);
+ __pyx_t_2 = __pyx_t_5;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "(tree fragment)":14
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.compression = __pyx_state[1]; __pyx_result.headers = __pyx_state[2]; __pyx_result.method = __pyx_state[3]; __pyx_result.path = __pyx_state[4]; __pyx_result.raw_headers = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.url = __pyx_state[8]; __pyx_result.version = __pyx_state[9]
+ * if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[10]) # <<<<<<<<<<<<<<
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 14, __pyx_L1_error)
+ }
+ __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_8)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":13
+ * cdef __pyx_unpickle_RawRequestMessage__set_state(RawRequestMessage __pyx_result, tuple __pyx_state):
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.compression = __pyx_state[1]; __pyx_result.headers = __pyx_state[2]; __pyx_result.method = __pyx_state[3]; __pyx_result.path = __pyx_state[4]; __pyx_result.raw_headers = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.url = __pyx_state[8]; __pyx_result.version = __pyx_state[9]
+ * if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[10])
+ */
+ }
+
+ /* "(tree fragment)":11
+ * __pyx_unpickle_RawRequestMessage__set_state(<RawRequestMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawRequestMessage__set_state(RawRequestMessage __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.compression = __pyx_state[1]; __pyx_result.headers = __pyx_state[2]; __pyx_result.method = __pyx_state[3]; __pyx_result.path = __pyx_state[4]; __pyx_result.raw_headers = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.url = __pyx_state[8]; __pyx_result.version = __pyx_state[9]
+ * if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("aiohttp._http_parser.__pyx_unpickle_RawRequestMessage__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __pyx_unpickle_RawResponseMessage(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_3__pyx_unpickle_RawResponseMessage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_7aiohttp_12_http_parser_3__pyx_unpickle_RawResponseMessage = {"__pyx_unpickle_RawResponseMessage", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7aiohttp_12_http_parser_3__pyx_unpickle_RawResponseMessage, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_7aiohttp_12_http_parser_3__pyx_unpickle_RawResponseMessage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v___pyx_type = 0;
+ long __pyx_v___pyx_checksum;
+ PyObject *__pyx_v___pyx_state = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_unpickle_RawResponseMessage (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RawResponseMessage", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RawResponseMessage", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_RawResponseMessage") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v___pyx_type = values[0];
+ __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
+ __pyx_v___pyx_state = values[2];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_RawResponseMessage", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._http_parser.__pyx_unpickle_RawResponseMessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_12_http_parser_2__pyx_unpickle_RawResponseMessage(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_parser_2__pyx_unpickle_RawResponseMessage(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_v___pyx_PickleError = 0;
+ PyObject *__pyx_v___pyx_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_RawResponseMessage", 0);
+
+ /* "(tree fragment)":4
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0xc7706dc, 0xcb2b2ba, 0x4febc0e): # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xc7706dc, 0xcb2b2ba, 0x4febc0e) = (chunked, code, compression, headers, raw_headers, reason, should_close, upgrade, version))" % __pyx_checksum)
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_t_1, __pyx_tuple__18, Py_NE)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":5
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0xc7706dc, 0xcb2b2ba, 0x4febc0e):
+ * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xc7706dc, 0xcb2b2ba, 0x4febc0e) = (chunked, code, compression, headers, raw_headers, reason, should_close, upgrade, version))" % __pyx_checksum)
+ * __pyx_result = RawResponseMessage.__new__(__pyx_type)
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_PickleError);
+ __Pyx_GIVEREF(__pyx_n_s_PickleError);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_PickleError);
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_1);
+ __pyx_v___pyx_PickleError = __pyx_t_1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "(tree fragment)":6
+ * if __pyx_checksum not in (0xc7706dc, 0xcb2b2ba, 0x4febc0e):
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xc7706dc, 0xcb2b2ba, 0x4febc0e) = (chunked, code, compression, headers, raw_headers, reason, should_close, upgrade, version))" % __pyx_checksum) # <<<<<<<<<<<<<<
+ * __pyx_result = RawResponseMessage.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_INCREF(__pyx_v___pyx_PickleError);
+ __pyx_t_1 = __pyx_v___pyx_PickleError; __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(1, 6, __pyx_L1_error)
+
+ /* "(tree fragment)":4
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ * if __pyx_checksum not in (0xc7706dc, 0xcb2b2ba, 0x4febc0e): # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xc7706dc, 0xcb2b2ba, 0x4febc0e) = (chunked, code, compression, headers, raw_headers, reason, should_close, upgrade, version))" % __pyx_checksum)
+ */
+ }
+
+ /* "(tree fragment)":7
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xc7706dc, 0xcb2b2ba, 0x4febc0e) = (chunked, code, compression, headers, raw_headers, reason, should_close, upgrade, version))" % __pyx_checksum)
+ * __pyx_result = RawResponseMessage.__new__(__pyx_type) # <<<<<<<<<<<<<<
+ * if __pyx_state is not None:
+ * __pyx_unpickle_RawResponseMessage__set_state(<RawResponseMessage> __pyx_result, __pyx_state)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7aiohttp_12_http_parser_RawResponseMessage), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_5, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v___pyx_type);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v___pyx_result = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "(tree fragment)":8
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xc7706dc, 0xcb2b2ba, 0x4febc0e) = (chunked, code, compression, headers, raw_headers, reason, should_close, upgrade, version))" % __pyx_checksum)
+ * __pyx_result = RawResponseMessage.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_RawResponseMessage__set_state(<RawResponseMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ __pyx_t_3 = (__pyx_v___pyx_state != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+
+ /* "(tree fragment)":9
+ * __pyx_result = RawResponseMessage.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ * __pyx_unpickle_RawResponseMessage__set_state(<RawResponseMessage> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawResponseMessage__set_state(RawResponseMessage __pyx_result, tuple __pyx_state):
+ */
+ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
+ __pyx_t_4 = __pyx_f_7aiohttp_12_http_parser___pyx_unpickle_RawResponseMessage__set_state(((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 9, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "(tree fragment)":8
+ * raise __pyx_PickleError("Incompatible checksums (0x%x vs (0xc7706dc, 0xcb2b2ba, 0x4febc0e) = (chunked, code, compression, headers, raw_headers, reason, should_close, upgrade, version))" % __pyx_checksum)
+ * __pyx_result = RawResponseMessage.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_RawResponseMessage__set_state(<RawResponseMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ }
+
+ /* "(tree fragment)":10
+ * if __pyx_state is not None:
+ * __pyx_unpickle_RawResponseMessage__set_state(<RawResponseMessage> __pyx_result, __pyx_state)
+ * return __pyx_result # <<<<<<<<<<<<<<
+ * cdef __pyx_unpickle_RawResponseMessage__set_state(RawResponseMessage __pyx_result, tuple __pyx_state):
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.code = __pyx_state[1]; __pyx_result.compression = __pyx_state[2]; __pyx_result.headers = __pyx_state[3]; __pyx_result.raw_headers = __pyx_state[4]; __pyx_result.reason = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.version = __pyx_state[8]
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v___pyx_result);
+ __pyx_r = __pyx_v___pyx_result;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_RawResponseMessage(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._http_parser.__pyx_unpickle_RawResponseMessage", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v___pyx_PickleError);
+ __Pyx_XDECREF(__pyx_v___pyx_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":11
+ * __pyx_unpickle_RawResponseMessage__set_state(<RawResponseMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawResponseMessage__set_state(RawResponseMessage __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.code = __pyx_state[1]; __pyx_result.compression = __pyx_state[2]; __pyx_result.headers = __pyx_state[3]; __pyx_result.raw_headers = __pyx_state[4]; __pyx_result.reason = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.version = __pyx_state[8]
+ * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_parser___pyx_unpickle_RawResponseMessage__set_state(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_RawResponseMessage__set_state", 0);
+
+ /* "(tree fragment)":12
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawResponseMessage__set_state(RawResponseMessage __pyx_result, tuple __pyx_state):
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.code = __pyx_state[1]; __pyx_result.compression = __pyx_state[2]; __pyx_result.headers = __pyx_state[3]; __pyx_result.raw_headers = __pyx_state[4]; __pyx_result.reason = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.version = __pyx_state[8] # <<<<<<<<<<<<<<
+ * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[9])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->chunked);
+ __Pyx_DECREF(__pyx_v___pyx_result->chunked);
+ __pyx_v___pyx_result->chunked = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v___pyx_result->code = __pyx_t_2;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->compression);
+ __Pyx_DECREF(__pyx_v___pyx_result->compression);
+ __pyx_v___pyx_result->compression = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->headers);
+ __Pyx_DECREF(__pyx_v___pyx_result->headers);
+ __pyx_v___pyx_result->headers = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->raw_headers);
+ __Pyx_DECREF(__pyx_v___pyx_result->raw_headers);
+ __pyx_v___pyx_result->raw_headers = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(PyUnicode_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->reason);
+ __Pyx_DECREF(__pyx_v___pyx_result->reason);
+ __pyx_v___pyx_result->reason = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->should_close);
+ __Pyx_DECREF(__pyx_v___pyx_result->should_close);
+ __pyx_v___pyx_result->should_close = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->upgrade);
+ __Pyx_DECREF(__pyx_v___pyx_result->upgrade);
+ __pyx_v___pyx_result->upgrade = __pyx_t_1;
+ __pyx_t_1 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 12, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->version);
+ __Pyx_DECREF(__pyx_v___pyx_result->version);
+ __pyx_v___pyx_result->version = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":13
+ * cdef __pyx_unpickle_RawResponseMessage__set_state(RawResponseMessage __pyx_result, tuple __pyx_state):
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.code = __pyx_state[1]; __pyx_result.compression = __pyx_state[2]; __pyx_result.headers = __pyx_state[3]; __pyx_result.raw_headers = __pyx_state[4]; __pyx_result.reason = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.version = __pyx_state[8]
+ * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[9])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(1, 13, __pyx_L1_error)
+ }
+ __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
+ __pyx_t_5 = ((__pyx_t_4 > 9) != 0);
+ if (__pyx_t_5) {
+ } else {
+ __pyx_t_3 = __pyx_t_5;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
+ __pyx_t_6 = (__pyx_t_5 != 0);
+ __pyx_t_3 = __pyx_t_6;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":14
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.code = __pyx_state[1]; __pyx_result.compression = __pyx_state[2]; __pyx_result.headers = __pyx_state[3]; __pyx_result.raw_headers = __pyx_state[4]; __pyx_result.reason = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.version = __pyx_state[8]
+ * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[9]) # <<<<<<<<<<<<<<
+ */
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 14, __pyx_L1_error)
+ }
+ __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_9 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
+ __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
+ if (likely(__pyx_t_9)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
+ __Pyx_INCREF(__pyx_t_9);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_8, function);
+ }
+ }
+ __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":13
+ * cdef __pyx_unpickle_RawResponseMessage__set_state(RawResponseMessage __pyx_result, tuple __pyx_state):
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.code = __pyx_state[1]; __pyx_result.compression = __pyx_state[2]; __pyx_result.headers = __pyx_state[3]; __pyx_result.raw_headers = __pyx_state[4]; __pyx_result.reason = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.version = __pyx_state[8]
+ * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[9])
+ */
+ }
+
+ /* "(tree fragment)":11
+ * __pyx_unpickle_RawResponseMessage__set_state(<RawResponseMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawResponseMessage__set_state(RawResponseMessage __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.code = __pyx_state[1]; __pyx_result.compression = __pyx_state[2]; __pyx_result.headers = __pyx_state[3]; __pyx_result.raw_headers = __pyx_state[4]; __pyx_result.reason = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.version = __pyx_state[8]
+ * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'):
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("aiohttp._http_parser.__pyx_unpickle_RawResponseMessage__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *__pyx_freelist_7aiohttp_12_http_parser_RawRequestMessage[250];
+static int __pyx_freecount_7aiohttp_12_http_parser_RawRequestMessage = 0;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_RawRequestMessage(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *p;
+ PyObject *o;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7aiohttp_12_http_parser_RawRequestMessage > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage)) & ((t->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0))) {
+ o = (PyObject*)__pyx_freelist_7aiohttp_12_http_parser_RawRequestMessage[--__pyx_freecount_7aiohttp_12_http_parser_RawRequestMessage];
+ memset(o, 0, sizeof(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage));
+ (void) PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ }
+ p = ((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)o);
+ p->method = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->path = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->version = Py_None; Py_INCREF(Py_None);
+ p->headers = Py_None; Py_INCREF(Py_None);
+ p->raw_headers = Py_None; Py_INCREF(Py_None);
+ p->should_close = Py_None; Py_INCREF(Py_None);
+ p->compression = Py_None; Py_INCREF(Py_None);
+ p->upgrade = Py_None; Py_INCREF(Py_None);
+ p->chunked = Py_None; Py_INCREF(Py_None);
+ p->url = Py_None; Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_7aiohttp_12_http_parser_RawRequestMessage(PyObject *o) {
+ struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *p = (struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->method);
+ Py_CLEAR(p->path);
+ Py_CLEAR(p->version);
+ Py_CLEAR(p->headers);
+ Py_CLEAR(p->raw_headers);
+ Py_CLEAR(p->should_close);
+ Py_CLEAR(p->compression);
+ Py_CLEAR(p->upgrade);
+ Py_CLEAR(p->chunked);
+ Py_CLEAR(p->url);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7aiohttp_12_http_parser_RawRequestMessage < 250) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage)) & ((Py_TYPE(o)->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0))) {
+ __pyx_freelist_7aiohttp_12_http_parser_RawRequestMessage[__pyx_freecount_7aiohttp_12_http_parser_RawRequestMessage++] = ((struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_7aiohttp_12_http_parser_RawRequestMessage(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *p = (struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)o;
+ if (p->version) {
+ e = (*v)(p->version, a); if (e) return e;
+ }
+ if (p->headers) {
+ e = (*v)(p->headers, a); if (e) return e;
+ }
+ if (p->raw_headers) {
+ e = (*v)(p->raw_headers, a); if (e) return e;
+ }
+ if (p->should_close) {
+ e = (*v)(p->should_close, a); if (e) return e;
+ }
+ if (p->compression) {
+ e = (*v)(p->compression, a); if (e) return e;
+ }
+ if (p->upgrade) {
+ e = (*v)(p->upgrade, a); if (e) return e;
+ }
+ if (p->chunked) {
+ e = (*v)(p->chunked, a); if (e) return e;
+ }
+ if (p->url) {
+ e = (*v)(p->url, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_7aiohttp_12_http_parser_RawRequestMessage(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *p = (struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage *)o;
+ tmp = ((PyObject*)p->version);
+ p->version = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->headers);
+ p->headers = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->raw_headers);
+ p->raw_headers = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->should_close);
+ p->should_close = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->compression);
+ p->compression = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->upgrade);
+ p->upgrade = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->chunked);
+ p->chunked = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->url);
+ p->url = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_method(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_6method_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_path(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_4path_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_version(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7version_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_headers(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7headers_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_raw_headers(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_11raw_headers_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_should_close(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_12should_close_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_compression(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_11compression_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_upgrade(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7upgrade_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_chunked(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7chunked_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_url(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_3url_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_7aiohttp_12_http_parser_RawRequestMessage[] = {
+ {"_replace", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_5_replace, METH_VARARGS|METH_KEYWORDS, 0},
+ {"__reduce_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_7__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_9__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_7aiohttp_12_http_parser_RawRequestMessage[] = {
+ {(char *)"method", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_method, 0, (char *)0, 0},
+ {(char *)"path", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_path, 0, (char *)0, 0},
+ {(char *)"version", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_version, 0, (char *)0, 0},
+ {(char *)"headers", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_headers, 0, (char *)0, 0},
+ {(char *)"raw_headers", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_raw_headers, 0, (char *)0, 0},
+ {(char *)"should_close", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_should_close, 0, (char *)0, 0},
+ {(char *)"compression", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_compression, 0, (char *)0, 0},
+ {(char *)"upgrade", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_upgrade, 0, (char *)0, 0},
+ {(char *)"chunked", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_chunked, 0, (char *)0, 0},
+ {(char *)"url", __pyx_getprop_7aiohttp_12_http_parser_17RawRequestMessage_url, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser_RawRequestMessage = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.RawRequestMessage", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser_RawRequestMessage), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser_RawRequestMessage, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_3__repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser_RawRequestMessage, /*tp_traverse*/
+ __pyx_tp_clear_7aiohttp_12_http_parser_RawRequestMessage, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_7aiohttp_12_http_parser_RawRequestMessage, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_7aiohttp_12_http_parser_RawRequestMessage, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_pw_7aiohttp_12_http_parser_17RawRequestMessage_1__init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser_RawRequestMessage, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+
+static struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *__pyx_freelist_7aiohttp_12_http_parser_RawResponseMessage[250];
+static int __pyx_freecount_7aiohttp_12_http_parser_RawResponseMessage = 0;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_RawResponseMessage(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *p;
+ PyObject *o;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7aiohttp_12_http_parser_RawResponseMessage > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage)) & ((t->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0))) {
+ o = (PyObject*)__pyx_freelist_7aiohttp_12_http_parser_RawResponseMessage[--__pyx_freecount_7aiohttp_12_http_parser_RawResponseMessage];
+ memset(o, 0, sizeof(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage));
+ (void) PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ }
+ p = ((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)o);
+ p->version = Py_None; Py_INCREF(Py_None);
+ p->reason = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->headers = Py_None; Py_INCREF(Py_None);
+ p->raw_headers = Py_None; Py_INCREF(Py_None);
+ p->should_close = Py_None; Py_INCREF(Py_None);
+ p->compression = Py_None; Py_INCREF(Py_None);
+ p->upgrade = Py_None; Py_INCREF(Py_None);
+ p->chunked = Py_None; Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_7aiohttp_12_http_parser_RawResponseMessage(PyObject *o) {
+ struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *p = (struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->version);
+ Py_CLEAR(p->reason);
+ Py_CLEAR(p->headers);
+ Py_CLEAR(p->raw_headers);
+ Py_CLEAR(p->should_close);
+ Py_CLEAR(p->compression);
+ Py_CLEAR(p->upgrade);
+ Py_CLEAR(p->chunked);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7aiohttp_12_http_parser_RawResponseMessage < 250) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage)) & ((Py_TYPE(o)->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)) == 0))) {
+ __pyx_freelist_7aiohttp_12_http_parser_RawResponseMessage[__pyx_freecount_7aiohttp_12_http_parser_RawResponseMessage++] = ((struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_7aiohttp_12_http_parser_RawResponseMessage(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *p = (struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)o;
+ if (p->version) {
+ e = (*v)(p->version, a); if (e) return e;
+ }
+ if (p->headers) {
+ e = (*v)(p->headers, a); if (e) return e;
+ }
+ if (p->raw_headers) {
+ e = (*v)(p->raw_headers, a); if (e) return e;
+ }
+ if (p->should_close) {
+ e = (*v)(p->should_close, a); if (e) return e;
+ }
+ if (p->compression) {
+ e = (*v)(p->compression, a); if (e) return e;
+ }
+ if (p->upgrade) {
+ e = (*v)(p->upgrade, a); if (e) return e;
+ }
+ if (p->chunked) {
+ e = (*v)(p->chunked, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_7aiohttp_12_http_parser_RawResponseMessage(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *p = (struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage *)o;
+ tmp = ((PyObject*)p->version);
+ p->version = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->headers);
+ p->headers = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->raw_headers);
+ p->raw_headers = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->should_close);
+ p->should_close = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->compression);
+ p->compression = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->upgrade);
+ p->upgrade = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->chunked);
+ p->chunked = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_version(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7version_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_code(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_4code_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_reason(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_6reason_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_headers(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7headers_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_raw_headers(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_11raw_headers_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_should_close(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_12should_close_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_compression(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_11compression_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_upgrade(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7upgrade_1__get__(o);
+}
+
+static PyObject *__pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_chunked(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7chunked_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_7aiohttp_12_http_parser_RawResponseMessage[] = {
+ {"__reduce_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_5__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_7__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_7aiohttp_12_http_parser_RawResponseMessage[] = {
+ {(char *)"version", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_version, 0, (char *)0, 0},
+ {(char *)"code", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_code, 0, (char *)0, 0},
+ {(char *)"reason", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_reason, 0, (char *)0, 0},
+ {(char *)"headers", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_headers, 0, (char *)0, 0},
+ {(char *)"raw_headers", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_raw_headers, 0, (char *)0, 0},
+ {(char *)"should_close", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_should_close, 0, (char *)0, 0},
+ {(char *)"compression", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_compression, 0, (char *)0, 0},
+ {(char *)"upgrade", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_upgrade, 0, (char *)0, 0},
+ {(char *)"chunked", __pyx_getprop_7aiohttp_12_http_parser_18RawResponseMessage_chunked, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser_RawResponseMessage = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.RawResponseMessage", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser_RawResponseMessage), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser_RawResponseMessage, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_3__repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser_RawResponseMessage, /*tp_traverse*/
+ __pyx_tp_clear_7aiohttp_12_http_parser_RawResponseMessage, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_7aiohttp_12_http_parser_RawResponseMessage, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_7aiohttp_12_http_parser_RawResponseMessage, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_pw_7aiohttp_12_http_parser_18RawResponseMessage_1__init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser_RawResponseMessage, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+static struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser __pyx_vtable_7aiohttp_12_http_parser_HttpParser;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_HttpParser(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)o);
+ p->__pyx_vtab = __pyx_vtabptr_7aiohttp_12_http_parser_HttpParser;
+ p->_raw_name = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_raw_value = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_protocol = Py_None; Py_INCREF(Py_None);
+ p->_loop = Py_None; Py_INCREF(Py_None);
+ p->_timer = Py_None; Py_INCREF(Py_None);
+ p->_url = Py_None; Py_INCREF(Py_None);
+ p->_buf = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_path = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_reason = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_headers = Py_None; Py_INCREF(Py_None);
+ p->_raw_headers = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_messages = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_payload = Py_None; Py_INCREF(Py_None);
+ p->_payload_exception = Py_None; Py_INCREF(Py_None);
+ p->_last_error = Py_None; Py_INCREF(Py_None);
+ p->_content_encoding = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->py_buf.obj = NULL;
+ if (unlikely(__pyx_pw_7aiohttp_12_http_parser_10HttpParser_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
+ return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
+}
+
+static void __pyx_tp_dealloc_7aiohttp_12_http_parser_HttpParser(PyObject *o) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *p = (struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
+ __pyx_pw_7aiohttp_12_http_parser_10HttpParser_3__dealloc__(o);
+ __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->_raw_name);
+ Py_CLEAR(p->_raw_value);
+ Py_CLEAR(p->_protocol);
+ Py_CLEAR(p->_loop);
+ Py_CLEAR(p->_timer);
+ Py_CLEAR(p->_url);
+ Py_CLEAR(p->_buf);
+ Py_CLEAR(p->_path);
+ Py_CLEAR(p->_reason);
+ Py_CLEAR(p->_headers);
+ Py_CLEAR(p->_raw_headers);
+ Py_CLEAR(p->_messages);
+ Py_CLEAR(p->_payload);
+ Py_CLEAR(p->_payload_exception);
+ Py_CLEAR(p->_last_error);
+ Py_CLEAR(p->_content_encoding);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_7aiohttp_12_http_parser_HttpParser(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *p = (struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)o;
+ if (p->_protocol) {
+ e = (*v)(p->_protocol, a); if (e) return e;
+ }
+ if (p->_loop) {
+ e = (*v)(p->_loop, a); if (e) return e;
+ }
+ if (p->_timer) {
+ e = (*v)(p->_timer, a); if (e) return e;
+ }
+ if (p->_url) {
+ e = (*v)(p->_url, a); if (e) return e;
+ }
+ if (p->_headers) {
+ e = (*v)(p->_headers, a); if (e) return e;
+ }
+ if (p->_raw_headers) {
+ e = (*v)(p->_raw_headers, a); if (e) return e;
+ }
+ if (p->_messages) {
+ e = (*v)(p->_messages, a); if (e) return e;
+ }
+ if (p->_payload) {
+ e = (*v)(p->_payload, a); if (e) return e;
+ }
+ if (p->_payload_exception) {
+ e = (*v)(p->_payload_exception, a); if (e) return e;
+ }
+ if (p->_last_error) {
+ e = (*v)(p->_last_error, a); if (e) return e;
+ }
+ if (p->py_buf.obj) {
+ e = (*v)(p->py_buf.obj, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_7aiohttp_12_http_parser_HttpParser(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *p = (struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *)o;
+ tmp = ((PyObject*)p->_protocol);
+ p->_protocol = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_loop);
+ p->_loop = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_timer);
+ p->_timer = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_url);
+ p->_url = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_headers);
+ p->_headers = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_raw_headers);
+ p->_raw_headers = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_messages);
+ p->_messages = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_payload);
+ p->_payload = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_payload_exception);
+ p->_payload_exception = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_last_error);
+ p->_last_error = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ Py_CLEAR(p->py_buf.obj);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_7aiohttp_12_http_parser_HttpParser[] = {
+ {"feed_eof", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_10HttpParser_5feed_eof, METH_NOARGS, 0},
+ {"feed_data", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_10HttpParser_7feed_data, METH_O, 0},
+ {"set_upgraded", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_10HttpParser_9set_upgraded, METH_O, 0},
+ {"__reduce_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_10HttpParser_11__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_10HttpParser_13__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser_HttpParser = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.HttpParser", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser_HttpParser, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser_HttpParser, /*tp_traverse*/
+ __pyx_tp_clear_7aiohttp_12_http_parser_HttpParser, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_7aiohttp_12_http_parser_HttpParser, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser_HttpParser, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+static struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpRequestParser __pyx_vtable_7aiohttp_12_http_parser_HttpRequestParser;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_HttpRequestParser(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *p;
+ PyObject *o = __pyx_tp_new_7aiohttp_12_http_parser_HttpParser(t, a, k);
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser *)o);
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser*)__pyx_vtabptr_7aiohttp_12_http_parser_HttpRequestParser;
+ return o;
+}
+
+static PyMethodDef __pyx_methods_7aiohttp_12_http_parser_HttpRequestParser[] = {
+ {"__reduce_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_3__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_5__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser_HttpRequestParser = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.HttpRequestParser", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser_HttpRequestParser), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser_HttpParser, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser_HttpParser, /*tp_traverse*/
+ __pyx_tp_clear_7aiohttp_12_http_parser_HttpParser, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_7aiohttp_12_http_parser_HttpRequestParser, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_pw_7aiohttp_12_http_parser_17HttpRequestParser_1__init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser_HttpRequestParser, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+static struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpResponseParser __pyx_vtable_7aiohttp_12_http_parser_HttpResponseParser;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser_HttpResponseParser(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *p;
+ PyObject *o = __pyx_tp_new_7aiohttp_12_http_parser_HttpParser(t, a, k);
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser *)o);
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7aiohttp_12_http_parser_HttpParser*)__pyx_vtabptr_7aiohttp_12_http_parser_HttpResponseParser;
+ return o;
+}
+
+static PyMethodDef __pyx_methods_7aiohttp_12_http_parser_HttpResponseParser[] = {
+ {"__reduce_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_3__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_5__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser_HttpResponseParser = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.HttpResponseParser", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser_HttpResponseParser), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser_HttpParser, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser_HttpParser, /*tp_traverse*/
+ __pyx_tp_clear_7aiohttp_12_http_parser_HttpParser, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_7aiohttp_12_http_parser_HttpResponseParser, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_pw_7aiohttp_12_http_parser_18HttpResponseParser_1__init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser_HttpResponseParser, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+
+static struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *__pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct____repr__[8];
+static int __pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct____repr__ = 0;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct____repr__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ PyObject *o;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct____repr__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__)))) {
+ o = (PyObject*)__pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct____repr__[--__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct____repr__];
+ memset(o, 0, sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__));
+ (void) PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_7aiohttp_12_http_parser___pyx_scope_struct____repr__(PyObject *o) {
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_info);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct____repr__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__)))) {
+ __pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct____repr__[__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct____repr__++] = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_7aiohttp_12_http_parser___pyx_scope_struct____repr__(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *)o;
+ if (p->__pyx_v_info) {
+ e = (*v)(p->__pyx_v_info, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_7aiohttp_12_http_parser___pyx_scope_struct____repr__(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__ *)o;
+ tmp = ((PyObject*)p->__pyx_v_info);
+ p->__pyx_v_info = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct____repr__ = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.__pyx_scope_struct____repr__", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct____repr__), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser___pyx_scope_struct____repr__, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser___pyx_scope_struct____repr__, /*tp_traverse*/
+ __pyx_tp_clear_7aiohttp_12_http_parser___pyx_scope_struct____repr__, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ 0, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct____repr__, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+
+static struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *__pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr[8];
+static int __pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr = 0;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ PyObject *o;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr[--__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr));
+ (void) PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr(PyObject *o) {
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_outer_scope);
+ Py_CLEAR(p->__pyx_v_name);
+ Py_CLEAR(p->__pyx_v_val);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr)))) {
+ __pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr[__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr++] = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr *)o;
+ if (p->__pyx_outer_scope) {
+ e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
+ }
+ if (p->__pyx_v_name) {
+ e = (*v)(p->__pyx_v_name, a); if (e) return e;
+ }
+ if (p->__pyx_v_val) {
+ e = (*v)(p->__pyx_v_val, a); if (e) return e;
+ }
+ return 0;
+}
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.__pyx_scope_struct_1_genexpr", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ 0, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+
+static struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *__pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__[8];
+static int __pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ = 0;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ PyObject *o;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__)))) {
+ o = (PyObject*)__pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__[--__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__];
+ memset(o, 0, sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__));
+ (void) PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__(PyObject *o) {
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_v_info);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__)))) {
+ __pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__[__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__++] = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *)o;
+ if (p->__pyx_v_info) {
+ e = (*v)(p->__pyx_v_info, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ *)o;
+ tmp = ((PyObject*)p->__pyx_v_info);
+ p->__pyx_v_info = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.__pyx_scope_struct_2___repr__", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__, /*tp_traverse*/
+ __pyx_tp_clear_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ 0, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+
+static struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *__pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr[8];
+static int __pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr = 0;
+
+static PyObject *__pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ PyObject *o;
+ if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr)))) {
+ o = (PyObject*)__pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr[--__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr];
+ memset(o, 0, sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr));
+ (void) PyObject_INIT(o, t);
+ PyObject_GC_Track(o);
+ } else {
+ o = (*t->tp_alloc)(t, 0);
+ if (unlikely(!o)) return 0;
+ }
+ return o;
+}
+
+static void __pyx_tp_dealloc_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr(PyObject *o) {
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *)o;
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->__pyx_outer_scope);
+ Py_CLEAR(p->__pyx_v_name);
+ Py_CLEAR(p->__pyx_v_val);
+ if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr)))) {
+ __pyx_freelist_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr[__pyx_freecount_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *)o);
+ } else {
+ (*Py_TYPE(o)->tp_free)(o);
+ }
+}
+
+static int __pyx_tp_traverse_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr *)o;
+ if (p->__pyx_outer_scope) {
+ e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
+ }
+ if (p->__pyx_v_name) {
+ e = (*v)(p->__pyx_v_name, a); if (e) return e;
+ }
+ if (p->__pyx_v_val) {
+ e = (*v)(p->__pyx_v_val, a); if (e) return e;
+ }
+ return 0;
+}
+
+static PyTypeObject __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "aiohttp._http_parser.__pyx_scope_struct_3_genexpr", /*tp_name*/
+ sizeof(struct __pyx_obj_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
+ #if PY_VERSION_HEX < 0x030800b4
+ 0, /*tp_print*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4
+ 0, /*tp_vectorcall_offset*/
+ #endif
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ 0, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0, /*tp_vectorcall*/
+ #endif
+ #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0, /*tp_print*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0, /*tp_pypy_flags*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec__http_parser(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+ {Py_mod_create, (void*)__pyx_pymod_create},
+ {Py_mod_exec, (void*)__pyx_pymod_exec__http_parser},
+ {0, NULL}
+};
+#endif
+
+static struct PyModuleDef __pyx_moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "_http_parser",
+ 0, /* m_doc */
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ 0, /* m_size */
+ #else
+ -1, /* m_size */
+ #endif
+ __pyx_methods /* m_methods */,
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_moduledef_slots, /* m_slots */
+ #else
+ NULL, /* m_reload */
+ #endif
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+#ifndef CYTHON_SMALL_CODE
+#if defined(__clang__)
+ #define CYTHON_SMALL_CODE
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+ #define CYTHON_SMALL_CODE __attribute__((cold))
+#else
+ #define CYTHON_SMALL_CODE
+#endif
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
+ {&__pyx_n_s_ACCEPT, __pyx_k_ACCEPT, sizeof(__pyx_k_ACCEPT), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCEPT_CHARSET, __pyx_k_ACCEPT_CHARSET, sizeof(__pyx_k_ACCEPT_CHARSET), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCEPT_ENCODING, __pyx_k_ACCEPT_ENCODING, sizeof(__pyx_k_ACCEPT_ENCODING), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCEPT_LANGUAGE, __pyx_k_ACCEPT_LANGUAGE, sizeof(__pyx_k_ACCEPT_LANGUAGE), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCEPT_RANGES, __pyx_k_ACCEPT_RANGES, sizeof(__pyx_k_ACCEPT_RANGES), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCESS_CONTROL_ALLOW_CREDENTIALS, __pyx_k_ACCESS_CONTROL_ALLOW_CREDENTIALS, sizeof(__pyx_k_ACCESS_CONTROL_ALLOW_CREDENTIALS), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCESS_CONTROL_ALLOW_HEADERS, __pyx_k_ACCESS_CONTROL_ALLOW_HEADERS, sizeof(__pyx_k_ACCESS_CONTROL_ALLOW_HEADERS), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCESS_CONTROL_ALLOW_METHODS, __pyx_k_ACCESS_CONTROL_ALLOW_METHODS, sizeof(__pyx_k_ACCESS_CONTROL_ALLOW_METHODS), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCESS_CONTROL_ALLOW_ORIGIN, __pyx_k_ACCESS_CONTROL_ALLOW_ORIGIN, sizeof(__pyx_k_ACCESS_CONTROL_ALLOW_ORIGIN), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCESS_CONTROL_EXPOSE_HEADERS, __pyx_k_ACCESS_CONTROL_EXPOSE_HEADERS, sizeof(__pyx_k_ACCESS_CONTROL_EXPOSE_HEADERS), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCESS_CONTROL_MAX_AGE, __pyx_k_ACCESS_CONTROL_MAX_AGE, sizeof(__pyx_k_ACCESS_CONTROL_MAX_AGE), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCESS_CONTROL_REQUEST_HEADERS, __pyx_k_ACCESS_CONTROL_REQUEST_HEADERS, sizeof(__pyx_k_ACCESS_CONTROL_REQUEST_HEADERS), 0, 0, 1, 1},
+ {&__pyx_n_s_ACCESS_CONTROL_REQUEST_METHOD, __pyx_k_ACCESS_CONTROL_REQUEST_METHOD, sizeof(__pyx_k_ACCESS_CONTROL_REQUEST_METHOD), 0, 0, 1, 1},
+ {&__pyx_n_s_AGE, __pyx_k_AGE, sizeof(__pyx_k_AGE), 0, 0, 1, 1},
+ {&__pyx_n_s_ALLOW, __pyx_k_ALLOW, sizeof(__pyx_k_ALLOW), 0, 0, 1, 1},
+ {&__pyx_n_s_AUTHORIZATION, __pyx_k_AUTHORIZATION, sizeof(__pyx_k_AUTHORIZATION), 0, 0, 1, 1},
+ {&__pyx_n_s_BadHttpMessage, __pyx_k_BadHttpMessage, sizeof(__pyx_k_BadHttpMessage), 0, 0, 1, 1},
+ {&__pyx_n_s_BadStatusLine, __pyx_k_BadStatusLine, sizeof(__pyx_k_BadStatusLine), 0, 0, 1, 1},
+ {&__pyx_n_s_BaseException, __pyx_k_BaseException, sizeof(__pyx_k_BaseException), 0, 0, 1, 1},
+ {&__pyx_n_s_CACHE_CONTROL, __pyx_k_CACHE_CONTROL, sizeof(__pyx_k_CACHE_CONTROL), 0, 0, 1, 1},
+ {&__pyx_n_s_CIMultiDict, __pyx_k_CIMultiDict, sizeof(__pyx_k_CIMultiDict), 0, 0, 1, 1},
+ {&__pyx_n_s_CIMultiDictProxy, __pyx_k_CIMultiDictProxy, sizeof(__pyx_k_CIMultiDictProxy), 0, 0, 1, 1},
+ {&__pyx_n_s_CIMultiDictProxy_2, __pyx_k_CIMultiDictProxy_2, sizeof(__pyx_k_CIMultiDictProxy_2), 0, 0, 1, 1},
+ {&__pyx_n_s_CIMultiDict_2, __pyx_k_CIMultiDict_2, sizeof(__pyx_k_CIMultiDict_2), 0, 0, 1, 1},
+ {&__pyx_n_s_CONNECTION, __pyx_k_CONNECTION, sizeof(__pyx_k_CONNECTION), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_DISPOSITION, __pyx_k_CONTENT_DISPOSITION, sizeof(__pyx_k_CONTENT_DISPOSITION), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_ENCODING, __pyx_k_CONTENT_ENCODING, sizeof(__pyx_k_CONTENT_ENCODING), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_LANGUAGE, __pyx_k_CONTENT_LANGUAGE, sizeof(__pyx_k_CONTENT_LANGUAGE), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_LENGTH, __pyx_k_CONTENT_LENGTH, sizeof(__pyx_k_CONTENT_LENGTH), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_LOCATION, __pyx_k_CONTENT_LOCATION, sizeof(__pyx_k_CONTENT_LOCATION), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_MD5, __pyx_k_CONTENT_MD5, sizeof(__pyx_k_CONTENT_MD5), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_RANGE, __pyx_k_CONTENT_RANGE, sizeof(__pyx_k_CONTENT_RANGE), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_TRANSFER_ENCODING, __pyx_k_CONTENT_TRANSFER_ENCODING, sizeof(__pyx_k_CONTENT_TRANSFER_ENCODING), 0, 0, 1, 1},
+ {&__pyx_n_s_CONTENT_TYPE, __pyx_k_CONTENT_TYPE, sizeof(__pyx_k_CONTENT_TYPE), 0, 0, 1, 1},
+ {&__pyx_n_s_COOKIE, __pyx_k_COOKIE, sizeof(__pyx_k_COOKIE), 0, 0, 1, 1},
+ {&__pyx_n_s_ContentLengthError, __pyx_k_ContentLengthError, sizeof(__pyx_k_ContentLengthError), 0, 0, 1, 1},
+ {&__pyx_n_s_DATE, __pyx_k_DATE, sizeof(__pyx_k_DATE), 0, 0, 1, 1},
+ {&__pyx_n_s_DESTINATION, __pyx_k_DESTINATION, sizeof(__pyx_k_DESTINATION), 0, 0, 1, 1},
+ {&__pyx_n_s_DIGEST, __pyx_k_DIGEST, sizeof(__pyx_k_DIGEST), 0, 0, 1, 1},
+ {&__pyx_n_s_DeflateBuffer, __pyx_k_DeflateBuffer, sizeof(__pyx_k_DeflateBuffer), 0, 0, 1, 1},
+ {&__pyx_n_s_DeflateBuffer_2, __pyx_k_DeflateBuffer_2, sizeof(__pyx_k_DeflateBuffer_2), 0, 0, 1, 1},
+ {&__pyx_n_s_EMPTY_PAYLOAD, __pyx_k_EMPTY_PAYLOAD, sizeof(__pyx_k_EMPTY_PAYLOAD), 0, 0, 1, 1},
+ {&__pyx_n_s_EMPTY_PAYLOAD_2, __pyx_k_EMPTY_PAYLOAD_2, sizeof(__pyx_k_EMPTY_PAYLOAD_2), 0, 0, 1, 1},
+ {&__pyx_n_s_ETAG, __pyx_k_ETAG, sizeof(__pyx_k_ETAG), 0, 0, 1, 1},
+ {&__pyx_n_s_EXPECT, __pyx_k_EXPECT, sizeof(__pyx_k_EXPECT), 0, 0, 1, 1},
+ {&__pyx_n_s_EXPIRES, __pyx_k_EXPIRES, sizeof(__pyx_k_EXPIRES), 0, 0, 1, 1},
+ {&__pyx_n_s_FORWARDED, __pyx_k_FORWARDED, sizeof(__pyx_k_FORWARDED), 0, 0, 1, 1},
+ {&__pyx_n_s_FROM, __pyx_k_FROM, sizeof(__pyx_k_FROM), 0, 0, 1, 1},
+ {&__pyx_n_s_HOST, __pyx_k_HOST, sizeof(__pyx_k_HOST), 0, 0, 1, 1},
+ {&__pyx_kp_u_Header_name_is_too_long, __pyx_k_Header_name_is_too_long, sizeof(__pyx_k_Header_name_is_too_long), 0, 1, 0, 0},
+ {&__pyx_kp_u_Header_value_is_too_long, __pyx_k_Header_value_is_too_long, sizeof(__pyx_k_Header_value_is_too_long), 0, 1, 0, 0},
+ {&__pyx_n_s_HttpRequestParser, __pyx_k_HttpRequestParser, sizeof(__pyx_k_HttpRequestParser), 0, 0, 1, 1},
+ {&__pyx_n_u_HttpRequestParser, __pyx_k_HttpRequestParser, sizeof(__pyx_k_HttpRequestParser), 0, 1, 0, 1},
+ {&__pyx_n_s_HttpResponseParser, __pyx_k_HttpResponseParser, sizeof(__pyx_k_HttpResponseParser), 0, 0, 1, 1},
+ {&__pyx_n_u_HttpResponseParser, __pyx_k_HttpResponseParser, sizeof(__pyx_k_HttpResponseParser), 0, 1, 0, 1},
+ {&__pyx_n_s_HttpVersion, __pyx_k_HttpVersion, sizeof(__pyx_k_HttpVersion), 0, 0, 1, 1},
+ {&__pyx_n_s_HttpVersion10, __pyx_k_HttpVersion10, sizeof(__pyx_k_HttpVersion10), 0, 0, 1, 1},
+ {&__pyx_n_s_HttpVersion10_2, __pyx_k_HttpVersion10_2, sizeof(__pyx_k_HttpVersion10_2), 0, 0, 1, 1},
+ {&__pyx_n_s_HttpVersion11, __pyx_k_HttpVersion11, sizeof(__pyx_k_HttpVersion11), 0, 0, 1, 1},
+ {&__pyx_n_s_HttpVersion11_2, __pyx_k_HttpVersion11_2, sizeof(__pyx_k_HttpVersion11_2), 0, 0, 1, 1},
+ {&__pyx_n_s_HttpVersion_2, __pyx_k_HttpVersion_2, sizeof(__pyx_k_HttpVersion_2), 0, 0, 1, 1},
+ {&__pyx_n_s_IF_MATCH, __pyx_k_IF_MATCH, sizeof(__pyx_k_IF_MATCH), 0, 0, 1, 1},
+ {&__pyx_n_s_IF_MODIFIED_SINCE, __pyx_k_IF_MODIFIED_SINCE, sizeof(__pyx_k_IF_MODIFIED_SINCE), 0, 0, 1, 1},
+ {&__pyx_n_s_IF_NONE_MATCH, __pyx_k_IF_NONE_MATCH, sizeof(__pyx_k_IF_NONE_MATCH), 0, 0, 1, 1},
+ {&__pyx_n_s_IF_RANGE, __pyx_k_IF_RANGE, sizeof(__pyx_k_IF_RANGE), 0, 0, 1, 1},
+ {&__pyx_n_s_IF_UNMODIFIED_SINCE, __pyx_k_IF_UNMODIFIED_SINCE, sizeof(__pyx_k_IF_UNMODIFIED_SINCE), 0, 0, 1, 1},
+ {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0, __pyx_k_Incompatible_checksums_0x_x_vs_0, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0), 0, 0, 1, 0},
+ {&__pyx_kp_s_Incompatible_checksums_0x_x_vs_0_2, __pyx_k_Incompatible_checksums_0x_x_vs_0_2, sizeof(__pyx_k_Incompatible_checksums_0x_x_vs_0_2), 0, 0, 1, 0},
+ {&__pyx_n_s_InvalidHeader, __pyx_k_InvalidHeader, sizeof(__pyx_k_InvalidHeader), 0, 0, 1, 1},
+ {&__pyx_n_s_InvalidURLError, __pyx_k_InvalidURLError, sizeof(__pyx_k_InvalidURLError), 0, 0, 1, 1},
+ {&__pyx_n_s_KEEP_ALIVE, __pyx_k_KEEP_ALIVE, sizeof(__pyx_k_KEEP_ALIVE), 0, 0, 1, 1},
+ {&__pyx_n_s_LAST_EVENT_ID, __pyx_k_LAST_EVENT_ID, sizeof(__pyx_k_LAST_EVENT_ID), 0, 0, 1, 1},
+ {&__pyx_n_s_LAST_MODIFIED, __pyx_k_LAST_MODIFIED, sizeof(__pyx_k_LAST_MODIFIED), 0, 0, 1, 1},
+ {&__pyx_n_s_LINK, __pyx_k_LINK, sizeof(__pyx_k_LINK), 0, 0, 1, 1},
+ {&__pyx_n_s_LOCATION, __pyx_k_LOCATION, sizeof(__pyx_k_LOCATION), 0, 0, 1, 1},
+ {&__pyx_n_s_LineTooLong, __pyx_k_LineTooLong, sizeof(__pyx_k_LineTooLong), 0, 0, 1, 1},
+ {&__pyx_n_s_MAX_FORWARDS, __pyx_k_MAX_FORWARDS, sizeof(__pyx_k_MAX_FORWARDS), 0, 0, 1, 1},
+ {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
+ {&__pyx_kp_u_Not_enough_data_for_satisfy_cont, __pyx_k_Not_enough_data_for_satisfy_cont, sizeof(__pyx_k_Not_enough_data_for_satisfy_cont), 0, 1, 0, 0},
+ {&__pyx_kp_u_Not_enough_data_for_satisfy_tran, __pyx_k_Not_enough_data_for_satisfy_tran, sizeof(__pyx_k_Not_enough_data_for_satisfy_tran), 0, 1, 0, 0},
+ {&__pyx_n_s_ORIGIN, __pyx_k_ORIGIN, sizeof(__pyx_k_ORIGIN), 0, 0, 1, 1},
+ {&__pyx_n_s_PRAGMA, __pyx_k_PRAGMA, sizeof(__pyx_k_PRAGMA), 0, 0, 1, 1},
+ {&__pyx_n_s_PROXY_AUTHENTICATE, __pyx_k_PROXY_AUTHENTICATE, sizeof(__pyx_k_PROXY_AUTHENTICATE), 0, 0, 1, 1},
+ {&__pyx_n_s_PROXY_AUTHORIZATION, __pyx_k_PROXY_AUTHORIZATION, sizeof(__pyx_k_PROXY_AUTHORIZATION), 0, 0, 1, 1},
+ {&__pyx_n_s_PayloadEncodingError, __pyx_k_PayloadEncodingError, sizeof(__pyx_k_PayloadEncodingError), 0, 0, 1, 1},
+ {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
+ {&__pyx_n_s_RANGE, __pyx_k_RANGE, sizeof(__pyx_k_RANGE), 0, 0, 1, 1},
+ {&__pyx_n_s_REFERER, __pyx_k_REFERER, sizeof(__pyx_k_REFERER), 0, 0, 1, 1},
+ {&__pyx_n_s_RETRY_AFTER, __pyx_k_RETRY_AFTER, sizeof(__pyx_k_RETRY_AFTER), 0, 0, 1, 1},
+ {&__pyx_kp_u_RawRequestMessage, __pyx_k_RawRequestMessage, sizeof(__pyx_k_RawRequestMessage), 0, 1, 0, 0},
+ {&__pyx_n_s_RawRequestMessage_2, __pyx_k_RawRequestMessage_2, sizeof(__pyx_k_RawRequestMessage_2), 0, 0, 1, 1},
+ {&__pyx_n_u_RawRequestMessage_2, __pyx_k_RawRequestMessage_2, sizeof(__pyx_k_RawRequestMessage_2), 0, 1, 0, 1},
+ {&__pyx_kp_u_RawResponseMessage, __pyx_k_RawResponseMessage, sizeof(__pyx_k_RawResponseMessage), 0, 1, 0, 0},
+ {&__pyx_n_s_RawResponseMessage_2, __pyx_k_RawResponseMessage_2, sizeof(__pyx_k_RawResponseMessage_2), 0, 0, 1, 1},
+ {&__pyx_n_u_RawResponseMessage_2, __pyx_k_RawResponseMessage_2, sizeof(__pyx_k_RawResponseMessage_2), 0, 1, 0, 1},
+ {&__pyx_n_s_SEC_WEBSOCKET_ACCEPT, __pyx_k_SEC_WEBSOCKET_ACCEPT, sizeof(__pyx_k_SEC_WEBSOCKET_ACCEPT), 0, 0, 1, 1},
+ {&__pyx_n_s_SEC_WEBSOCKET_EXTENSIONS, __pyx_k_SEC_WEBSOCKET_EXTENSIONS, sizeof(__pyx_k_SEC_WEBSOCKET_EXTENSIONS), 0, 0, 1, 1},
+ {&__pyx_n_s_SEC_WEBSOCKET_KEY, __pyx_k_SEC_WEBSOCKET_KEY, sizeof(__pyx_k_SEC_WEBSOCKET_KEY), 0, 0, 1, 1},
+ {&__pyx_n_s_SEC_WEBSOCKET_KEY1, __pyx_k_SEC_WEBSOCKET_KEY1, sizeof(__pyx_k_SEC_WEBSOCKET_KEY1), 0, 0, 1, 1},
+ {&__pyx_n_s_SEC_WEBSOCKET_PROTOCOL, __pyx_k_SEC_WEBSOCKET_PROTOCOL, sizeof(__pyx_k_SEC_WEBSOCKET_PROTOCOL), 0, 0, 1, 1},
+ {&__pyx_n_s_SEC_WEBSOCKET_VERSION, __pyx_k_SEC_WEBSOCKET_VERSION, sizeof(__pyx_k_SEC_WEBSOCKET_VERSION), 0, 0, 1, 1},
+ {&__pyx_n_s_SERVER, __pyx_k_SERVER, sizeof(__pyx_k_SERVER), 0, 0, 1, 1},
+ {&__pyx_n_s_SET_COOKIE, __pyx_k_SET_COOKIE, sizeof(__pyx_k_SET_COOKIE), 0, 0, 1, 1},
+ {&__pyx_kp_u_Status_line_is_too_long, __pyx_k_Status_line_is_too_long, sizeof(__pyx_k_Status_line_is_too_long), 0, 1, 0, 0},
+ {&__pyx_n_s_StreamReader, __pyx_k_StreamReader, sizeof(__pyx_k_StreamReader), 0, 0, 1, 1},
+ {&__pyx_n_s_StreamReader_2, __pyx_k_StreamReader_2, sizeof(__pyx_k_StreamReader_2), 0, 0, 1, 1},
+ {&__pyx_n_s_TE, __pyx_k_TE, sizeof(__pyx_k_TE), 0, 0, 1, 1},
+ {&__pyx_n_s_TRAILER, __pyx_k_TRAILER, sizeof(__pyx_k_TRAILER), 0, 0, 1, 1},
+ {&__pyx_n_s_TRANSFER_ENCODING, __pyx_k_TRANSFER_ENCODING, sizeof(__pyx_k_TRANSFER_ENCODING), 0, 0, 1, 1},
+ {&__pyx_n_s_TransferEncodingError, __pyx_k_TransferEncodingError, sizeof(__pyx_k_TransferEncodingError), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_n_s_UPGRADE, __pyx_k_UPGRADE, sizeof(__pyx_k_UPGRADE), 0, 0, 1, 1},
+ {&__pyx_n_s_URI, __pyx_k_URI, sizeof(__pyx_k_URI), 0, 0, 1, 1},
+ {&__pyx_n_s_URL, __pyx_k_URL, sizeof(__pyx_k_URL), 0, 0, 1, 1},
+ {&__pyx_n_s_URL_2, __pyx_k_URL_2, sizeof(__pyx_k_URL_2), 0, 0, 1, 1},
+ {&__pyx_n_s_USER_AGENT, __pyx_k_USER_AGENT, sizeof(__pyx_k_USER_AGENT), 0, 0, 1, 1},
+ {&__pyx_n_s_VARY, __pyx_k_VARY, sizeof(__pyx_k_VARY), 0, 0, 1, 1},
+ {&__pyx_n_s_VIA, __pyx_k_VIA, sizeof(__pyx_k_VIA), 0, 0, 1, 1},
+ {&__pyx_n_s_WANT_DIGEST, __pyx_k_WANT_DIGEST, sizeof(__pyx_k_WANT_DIGEST), 0, 0, 1, 1},
+ {&__pyx_n_s_WARNING, __pyx_k_WARNING, sizeof(__pyx_k_WARNING), 0, 0, 1, 1},
+ {&__pyx_n_s_WWW_AUTHENTICATE, __pyx_k_WWW_AUTHENTICATE, sizeof(__pyx_k_WWW_AUTHENTICATE), 0, 0, 1, 1},
+ {&__pyx_n_s_X_FORWARDED_FOR, __pyx_k_X_FORWARDED_FOR, sizeof(__pyx_k_X_FORWARDED_FOR), 0, 0, 1, 1},
+ {&__pyx_n_s_X_FORWARDED_HOST, __pyx_k_X_FORWARDED_HOST, sizeof(__pyx_k_X_FORWARDED_HOST), 0, 0, 1, 1},
+ {&__pyx_n_s_X_FORWARDED_PROTO, __pyx_k_X_FORWARDED_PROTO, sizeof(__pyx_k_X_FORWARDED_PROTO), 0, 0, 1, 1},
+ {&__pyx_kp_u__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 1, 0, 0},
+ {&__pyx_kp_u__12, __pyx_k__12, sizeof(__pyx_k__12), 0, 1, 0, 0},
+ {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
+ {&__pyx_kp_u__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0, 0},
+ {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0},
+ {&__pyx_kp_u__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0, 0},
+ {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
+ {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1},
+ {&__pyx_kp_b__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 0, 0},
+ {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
+ {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
+ {&__pyx_n_s_aiohttp, __pyx_k_aiohttp, sizeof(__pyx_k_aiohttp), 0, 0, 1, 1},
+ {&__pyx_n_s_aiohttp__http_parser, __pyx_k_aiohttp__http_parser, sizeof(__pyx_k_aiohttp__http_parser), 0, 0, 1, 1},
+ {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
+ {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
+ {&__pyx_n_s_authority, __pyx_k_authority, sizeof(__pyx_k_authority), 0, 0, 1, 1},
+ {&__pyx_n_s_auto_decompress, __pyx_k_auto_decompress, sizeof(__pyx_k_auto_decompress), 0, 0, 1, 1},
+ {&__pyx_n_s_begin_http_chunk_receiving, __pyx_k_begin_http_chunk_receiving, sizeof(__pyx_k_begin_http_chunk_receiving), 0, 0, 1, 1},
+ {&__pyx_n_u_br, __pyx_k_br, sizeof(__pyx_k_br), 0, 1, 0, 1},
+ {&__pyx_n_s_build, __pyx_k_build, sizeof(__pyx_k_build), 0, 0, 1, 1},
+ {&__pyx_n_s_chunked, __pyx_k_chunked, sizeof(__pyx_k_chunked), 0, 0, 1, 1},
+ {&__pyx_n_u_chunked, __pyx_k_chunked, sizeof(__pyx_k_chunked), 0, 1, 0, 1},
+ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
+ {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
+ {&__pyx_n_s_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 0, 1, 1},
+ {&__pyx_n_u_code, __pyx_k_code, sizeof(__pyx_k_code), 0, 1, 0, 1},
+ {&__pyx_n_s_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 0, 1, 1},
+ {&__pyx_n_u_compression, __pyx_k_compression, sizeof(__pyx_k_compression), 0, 1, 0, 1},
+ {&__pyx_n_u_deflate, __pyx_k_deflate, sizeof(__pyx_k_deflate), 0, 1, 0, 1},
+ {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
+ {&__pyx_n_s_encoded, __pyx_k_encoded, sizeof(__pyx_k_encoded), 0, 0, 1, 1},
+ {&__pyx_n_s_end_http_chunk_receiving, __pyx_k_end_http_chunk_receiving, sizeof(__pyx_k_end_http_chunk_receiving), 0, 0, 1, 1},
+ {&__pyx_n_s_feed_data, __pyx_k_feed_data, sizeof(__pyx_k_feed_data), 0, 0, 1, 1},
+ {&__pyx_n_s_feed_eof, __pyx_k_feed_eof, sizeof(__pyx_k_feed_eof), 0, 0, 1, 1},
+ {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_fragment, __pyx_k_fragment, sizeof(__pyx_k_fragment), 0, 0, 1, 1},
+ {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
+ {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
+ {&__pyx_n_u_gzip, __pyx_k_gzip, sizeof(__pyx_k_gzip), 0, 1, 0, 1},
+ {&__pyx_n_s_hdrs, __pyx_k_hdrs, sizeof(__pyx_k_hdrs), 0, 0, 1, 1},
+ {&__pyx_n_s_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 0, 1, 1},
+ {&__pyx_n_u_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 1, 0, 1},
+ {&__pyx_n_s_http_exceptions, __pyx_k_http_exceptions, sizeof(__pyx_k_http_exceptions), 0, 0, 1, 1},
+ {&__pyx_n_s_http_parser, __pyx_k_http_parser, sizeof(__pyx_k_http_parser), 0, 0, 1, 1},
+ {&__pyx_n_s_http_writer, __pyx_k_http_writer, sizeof(__pyx_k_http_writer), 0, 0, 1, 1},
+ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1},
+ {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1},
+ {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_max_field_size, __pyx_k_max_field_size, sizeof(__pyx_k_max_field_size), 0, 0, 1, 1},
+ {&__pyx_n_s_max_headers, __pyx_k_max_headers, sizeof(__pyx_k_max_headers), 0, 0, 1, 1},
+ {&__pyx_n_s_max_line_size, __pyx_k_max_line_size, sizeof(__pyx_k_max_line_size), 0, 0, 1, 1},
+ {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
+ {&__pyx_n_u_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 1, 0, 1},
+ {&__pyx_n_s_multidict, __pyx_k_multidict, sizeof(__pyx_k_multidict), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
+ {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
+ {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
+ {&__pyx_n_u_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 1, 0, 1},
+ {&__pyx_n_s_payload_exception, __pyx_k_payload_exception, sizeof(__pyx_k_payload_exception), 0, 0, 1, 1},
+ {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
+ {&__pyx_n_s_protocol, __pyx_k_protocol, sizeof(__pyx_k_protocol), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_unpickle_RawRequestMessage, __pyx_k_pyx_unpickle_RawRequestMessage, sizeof(__pyx_k_pyx_unpickle_RawRequestMessage), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_unpickle_RawResponseMessag, __pyx_k_pyx_unpickle_RawResponseMessag, sizeof(__pyx_k_pyx_unpickle_RawResponseMessag), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_query_string, __pyx_k_query_string, sizeof(__pyx_k_query_string), 0, 0, 1, 1},
+ {&__pyx_kp_u_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 1, 0, 0},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_raw_headers, __pyx_k_raw_headers, sizeof(__pyx_k_raw_headers), 0, 0, 1, 1},
+ {&__pyx_n_u_raw_headers, __pyx_k_raw_headers, sizeof(__pyx_k_raw_headers), 0, 1, 0, 1},
+ {&__pyx_n_s_read_until_eof, __pyx_k_read_until_eof, sizeof(__pyx_k_read_until_eof), 0, 0, 1, 1},
+ {&__pyx_n_s_reason, __pyx_k_reason, sizeof(__pyx_k_reason), 0, 0, 1, 1},
+ {&__pyx_n_u_reason, __pyx_k_reason, sizeof(__pyx_k_reason), 0, 1, 0, 1},
+ {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
+ {&__pyx_n_s_repr___locals_genexpr, __pyx_k_repr___locals_genexpr, sizeof(__pyx_k_repr___locals_genexpr), 0, 0, 1, 1},
+ {&__pyx_n_s_response_with_body, __pyx_k_response_with_body, sizeof(__pyx_k_response_with_body), 0, 0, 1, 1},
+ {&__pyx_n_s_rsplit, __pyx_k_rsplit, sizeof(__pyx_k_rsplit), 0, 0, 1, 1},
+ {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
+ {&__pyx_n_s_set_exception, __pyx_k_set_exception, sizeof(__pyx_k_set_exception), 0, 0, 1, 1},
+ {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
+ {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
+ {&__pyx_n_s_should_close, __pyx_k_should_close, sizeof(__pyx_k_should_close), 0, 0, 1, 1},
+ {&__pyx_n_u_should_close, __pyx_k_should_close, sizeof(__pyx_k_should_close), 0, 1, 0, 1},
+ {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
+ {&__pyx_n_s_streams, __pyx_k_streams, sizeof(__pyx_k_streams), 0, 0, 1, 1},
+ {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
+ {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1},
+ {&__pyx_kp_u_unknown, __pyx_k_unknown, sizeof(__pyx_k_unknown), 0, 1, 0, 0},
+ {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
+ {&__pyx_n_s_upgrade, __pyx_k_upgrade, sizeof(__pyx_k_upgrade), 0, 0, 1, 1},
+ {&__pyx_n_u_upgrade, __pyx_k_upgrade, sizeof(__pyx_k_upgrade), 0, 1, 0, 1},
+ {&__pyx_n_s_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 0, 1, 1},
+ {&__pyx_n_u_url, __pyx_k_url, sizeof(__pyx_k_url), 0, 1, 0, 1},
+ {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
+ {&__pyx_n_u_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 1, 0, 1},
+ {&__pyx_n_s_yarl, __pyx_k_yarl, sizeof(__pyx_k_yarl), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 87, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 316, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
+ __pyx_builtin_BaseException = __Pyx_GetBuiltinName(__pyx_n_s_BaseException); if (!__pyx_builtin_BaseException) __PYX_ERR(0, 679, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "aiohttp/_http_parser.pyx":551
+ * after = cparser.llhttp_get_error_pos(self._cparser)
+ * before = data[:after - <char*>self.py_buf.buf]
+ * after_b = after.split(b"\n", 1)[0] # <<<<<<<<<<<<<<
+ * before = before.rsplit(b"\n", 1)[-1]
+ * data = before + after_b
+ */
+ __pyx_tuple__5 = PyTuple_Pack(2, __pyx_kp_b__4, __pyx_int_1); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 551, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
+ __pyx_tuple__17 = PyTuple_Pack(3, __pyx_int_21004882, __pyx_int_257960607, __pyx_int_4084195); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
+ __pyx_tuple__18 = PyTuple_Pack(3, __pyx_int_209127132, __pyx_int_213037754, __pyx_int_83803150); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
+
+ /* "aiohttp/_http_parser.pyx":57
+ * char* PyByteArray_AsString(object)
+ *
+ * __all__ = ('HttpRequestParser', 'HttpResponseParser', # <<<<<<<<<<<<<<
+ * 'RawRequestMessage', 'RawResponseMessage')
+ *
+ */
+ __pyx_tuple__19 = PyTuple_Pack(4, __pyx_n_u_HttpRequestParser, __pyx_n_u_HttpResponseParser, __pyx_n_u_RawRequestMessage_2, __pyx_n_u_RawResponseMessage_2); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 57, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_RawRequestMessage(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+ __pyx_tuple__20 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+ __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_RawRequestMessage, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __pyx_tuple__22 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+ __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_RawResponseMessag, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_4084195 = PyInt_FromLong(4084195L); if (unlikely(!__pyx_int_4084195)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_21004882 = PyInt_FromLong(21004882L); if (unlikely(!__pyx_int_21004882)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_83803150 = PyInt_FromLong(83803150L); if (unlikely(!__pyx_int_83803150)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_209127132 = PyInt_FromLong(209127132L); if (unlikely(!__pyx_int_209127132)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_213037754 = PyInt_FromLong(213037754L); if (unlikely(!__pyx_int_213037754)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_257960607 = PyInt_FromLong(257960607L); if (unlikely(!__pyx_int_257960607)) __PYX_ERR(0, 1, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
+
+static int __Pyx_modinit_global_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
+ /*--- Global init code ---*/
+ __pyx_v_7aiohttp_12_http_parser_headers = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_URL = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_URL_build = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_CIMultiDict = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_CIMultiDictProxy = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_HttpVersion = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_HttpVersion10 = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_HttpVersion11 = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_SEC_WEBSOCKET_KEY1 = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_CONTENT_ENCODING = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_EMPTY_PAYLOAD = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_StreamReader = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser_DeflateBuffer = Py_None; Py_INCREF(Py_None);
+ __pyx_v_7aiohttp_12_http_parser__http_method = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_variable_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
+ /*--- Variable export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
+ /*--- Function export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_type_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
+ /*--- Type init code ---*/
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser_RawRequestMessage) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser_RawRequestMessage.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser_RawRequestMessage.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser_RawRequestMessage.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser_RawRequestMessage.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RawRequestMessage_2, (PyObject *)&__pyx_type_7aiohttp_12_http_parser_RawRequestMessage) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7aiohttp_12_http_parser_RawRequestMessage) < 0) __PYX_ERR(0, 110, __pyx_L1_error)
+ __pyx_ptype_7aiohttp_12_http_parser_RawRequestMessage = &__pyx_type_7aiohttp_12_http_parser_RawRequestMessage;
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser_RawResponseMessage) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser_RawResponseMessage.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser_RawResponseMessage.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser_RawResponseMessage.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser_RawResponseMessage.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_RawResponseMessage_2, (PyObject *)&__pyx_type_7aiohttp_12_http_parser_RawResponseMessage) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7aiohttp_12_http_parser_RawResponseMessage) < 0) __PYX_ERR(0, 210, __pyx_L1_error)
+ __pyx_ptype_7aiohttp_12_http_parser_RawResponseMessage = &__pyx_type_7aiohttp_12_http_parser_RawResponseMessage;
+ __pyx_vtabptr_7aiohttp_12_http_parser_HttpParser = &__pyx_vtable_7aiohttp_12_http_parser_HttpParser;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._init = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *, enum llhttp_type, PyObject *, PyObject *, int, struct __pyx_opt_args_7aiohttp_12_http_parser_10HttpParser__init *__pyx_optional_args))__pyx_f_7aiohttp_12_http_parser_10HttpParser__init;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._process_header = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_10HttpParser__process_header;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._on_header_field = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *, char *, size_t))__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_header_field;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._on_header_value = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *, char *, size_t))__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_header_value;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._on_headers_complete = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_headers_complete;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._on_message_complete = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_message_complete;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._on_chunk_header = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_chunk_header;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._on_chunk_complete = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_chunk_complete;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser._on_status_complete = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_10HttpParser__on_status_complete;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpParser.http_version = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_10HttpParser_http_version;
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser_HttpParser) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser_HttpParser.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser_HttpParser.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser_HttpParser.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser_HttpParser.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_SetVtable(__pyx_type_7aiohttp_12_http_parser_HttpParser.tp_dict, __pyx_vtabptr_7aiohttp_12_http_parser_HttpParser) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7aiohttp_12_http_parser_HttpParser) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
+ __pyx_ptype_7aiohttp_12_http_parser_HttpParser = &__pyx_type_7aiohttp_12_http_parser_HttpParser;
+ __pyx_vtabptr_7aiohttp_12_http_parser_HttpRequestParser = &__pyx_vtable_7aiohttp_12_http_parser_HttpRequestParser;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpRequestParser.__pyx_base = *__pyx_vtabptr_7aiohttp_12_http_parser_HttpParser;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpRequestParser.__pyx_base._on_status_complete = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_17HttpRequestParser__on_status_complete;
+ __pyx_type_7aiohttp_12_http_parser_HttpRequestParser.tp_base = __pyx_ptype_7aiohttp_12_http_parser_HttpParser;
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser_HttpRequestParser) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser_HttpRequestParser.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser_HttpRequestParser.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser_HttpRequestParser.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser_HttpRequestParser.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_SetVtable(__pyx_type_7aiohttp_12_http_parser_HttpRequestParser.tp_dict, __pyx_vtabptr_7aiohttp_12_http_parser_HttpRequestParser) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HttpRequestParser, (PyObject *)&__pyx_type_7aiohttp_12_http_parser_HttpRequestParser) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7aiohttp_12_http_parser_HttpRequestParser) < 0) __PYX_ERR(0, 574, __pyx_L1_error)
+ __pyx_ptype_7aiohttp_12_http_parser_HttpRequestParser = &__pyx_type_7aiohttp_12_http_parser_HttpRequestParser;
+ __pyx_vtabptr_7aiohttp_12_http_parser_HttpResponseParser = &__pyx_vtable_7aiohttp_12_http_parser_HttpResponseParser;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpResponseParser.__pyx_base = *__pyx_vtabptr_7aiohttp_12_http_parser_HttpParser;
+ __pyx_vtable_7aiohttp_12_http_parser_HttpResponseParser.__pyx_base._on_status_complete = (PyObject *(*)(struct __pyx_obj_7aiohttp_12_http_parser_HttpParser *))__pyx_f_7aiohttp_12_http_parser_18HttpResponseParser__on_status_complete;
+ __pyx_type_7aiohttp_12_http_parser_HttpResponseParser.tp_base = __pyx_ptype_7aiohttp_12_http_parser_HttpParser;
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser_HttpResponseParser) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser_HttpResponseParser.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser_HttpResponseParser.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser_HttpResponseParser.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser_HttpResponseParser.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_SetVtable(__pyx_type_7aiohttp_12_http_parser_HttpResponseParser.tp_dict, __pyx_vtabptr_7aiohttp_12_http_parser_HttpResponseParser) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HttpResponseParser, (PyObject *)&__pyx_type_7aiohttp_12_http_parser_HttpResponseParser) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type_7aiohttp_12_http_parser_HttpResponseParser) < 0) __PYX_ERR(0, 638, __pyx_L1_error)
+ __pyx_ptype_7aiohttp_12_http_parser_HttpResponseParser = &__pyx_type_7aiohttp_12_http_parser_HttpResponseParser;
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct____repr__) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct____repr__.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct____repr__.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct____repr__.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct____repr__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
+ }
+ __pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct____repr__ = &__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct____repr__;
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
+ }
+ __pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr = &__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_1_genexpr;
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__) < 0) __PYX_ERR(0, 233, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
+ }
+ __pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__ = &__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_2___repr__;
+ if (PyType_Ready(&__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 244, __pyx_L1_error)
+ #if PY_VERSION_HEX < 0x030800B1
+ __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr.tp_print = 0;
+ #endif
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
+ }
+ __pyx_ptype_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr = &__pyx_type_7aiohttp_12_http_parser___pyx_scope_struct_3_genexpr;
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_type_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
+ /*--- Type import code ---*/
+ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 9, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
+ #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ __Pyx_ImportType_CheckSize_Warn);
+ if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(2, 9, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
+ if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(3, 8, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
+ if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(4, 15, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_variable_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
+ /*--- Variable import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
+ /*--- Function import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+
+#ifndef CYTHON_NO_PYINIT_EXPORT
+#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#elif PY_MAJOR_VERSION < 3
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" void
+#else
+#define __Pyx_PyMODINIT_FUNC void
+#endif
+#else
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
+#else
+#define __Pyx_PyMODINIT_FUNC PyObject *
+#endif
+#endif
+
+
+#if PY_MAJOR_VERSION < 3
+__Pyx_PyMODINIT_FUNC init_http_parser(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC init_http_parser(void)
+#else
+__Pyx_PyMODINIT_FUNC PyInit__http_parser(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC PyInit__http_parser(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+ return PyModuleDef_Init(&__pyx_moduledef);
+}
+static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
+ #if PY_VERSION_HEX >= 0x030700A1
+ static PY_INT64_T main_interpreter_id = -1;
+ PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
+ if (main_interpreter_id == -1) {
+ main_interpreter_id = current_id;
+ return (unlikely(current_id == -1)) ? -1 : 0;
+ } else if (unlikely(main_interpreter_id != current_id))
+ #else
+ static PyInterpreterState *main_interpreter = NULL;
+ PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
+ if (!main_interpreter) {
+ main_interpreter = current_interpreter;
+ } else if (unlikely(main_interpreter != current_interpreter))
+ #endif
+ {
+ PyErr_SetString(
+ PyExc_ImportError,
+ "Interpreter change detected - this module can only be loaded into one interpreter per process.");
+ return -1;
+ }
+ return 0;
+}
+static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
+ PyObject *value = PyObject_GetAttrString(spec, from_name);
+ int result = 0;
+ if (likely(value)) {
+ if (allow_none || value != Py_None) {
+ result = PyDict_SetItemString(moddict, to_name, value);
+ }
+ Py_DECREF(value);
+ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ } else {
+ result = -1;
+ }
+ return result;
+}
+static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+ PyObject *module = NULL, *moddict, *modname;
+ if (__Pyx_check_single_interpreter())
+ return NULL;
+ if (__pyx_m)
+ return __Pyx_NewRef(__pyx_m);
+ modname = PyObject_GetAttrString(spec, "name");
+ if (unlikely(!modname)) goto bad;
+ module = PyModule_NewObject(modname);
+ Py_DECREF(modname);
+ if (unlikely(!module)) goto bad;
+ moddict = PyModule_GetDict(module);
+ if (unlikely(!moddict)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
+ return module;
+bad:
+ Py_XDECREF(module);
+ return NULL;
+}
+
+
+static CYTHON_SMALL_CODE int __pyx_pymod_exec__http_parser(PyObject *__pyx_pyinit_module)
+#endif
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ PyObject *__pyx_t_16 = NULL;
+ PyObject *__pyx_t_17 = NULL;
+ PyObject *__pyx_t_18 = NULL;
+ PyObject *__pyx_t_19 = NULL;
+ PyObject *__pyx_t_20 = NULL;
+ PyObject *__pyx_t_21 = NULL;
+ PyObject *__pyx_t_22 = NULL;
+ PyObject *__pyx_t_23 = NULL;
+ PyObject *__pyx_t_24 = NULL;
+ PyObject *__pyx_t_25 = NULL;
+ PyObject *__pyx_t_26 = NULL;
+ PyObject *__pyx_t_27 = NULL;
+ PyObject *__pyx_t_28 = NULL;
+ PyObject *__pyx_t_29 = NULL;
+ PyObject *__pyx_t_30 = NULL;
+ PyObject *__pyx_t_31 = NULL;
+ PyObject *__pyx_t_32 = NULL;
+ PyObject *__pyx_t_33 = NULL;
+ PyObject *__pyx_t_34 = NULL;
+ PyObject *__pyx_t_35 = NULL;
+ PyObject *__pyx_t_36 = NULL;
+ PyObject *__pyx_t_37 = NULL;
+ PyObject *__pyx_t_38 = NULL;
+ PyObject *__pyx_t_39 = NULL;
+ PyObject *__pyx_t_40 = NULL;
+ PyObject *__pyx_t_41 = NULL;
+ PyObject *__pyx_t_42 = NULL;
+ PyObject *__pyx_t_43 = NULL;
+ PyObject *__pyx_t_44 = NULL;
+ PyObject *__pyx_t_45 = NULL;
+ PyObject *__pyx_t_46 = NULL;
+ PyObject *__pyx_t_47 = NULL;
+ PyObject *__pyx_t_48 = NULL;
+ PyObject *__pyx_t_49 = NULL;
+ PyObject *__pyx_t_50 = NULL;
+ PyObject *__pyx_t_51 = NULL;
+ PyObject *__pyx_t_52 = NULL;
+ PyObject *__pyx_t_53 = NULL;
+ PyObject *__pyx_t_54 = NULL;
+ PyObject *__pyx_t_55 = NULL;
+ PyObject *__pyx_t_56 = NULL;
+ PyObject *__pyx_t_57 = NULL;
+ PyObject *__pyx_t_58 = NULL;
+ PyObject *__pyx_t_59 = NULL;
+ PyObject *__pyx_t_60 = NULL;
+ PyObject *__pyx_t_61 = NULL;
+ PyObject *__pyx_t_62 = NULL;
+ PyObject *__pyx_t_63 = NULL;
+ PyObject *__pyx_t_64 = NULL;
+ PyObject *__pyx_t_65 = NULL;
+ PyObject *__pyx_t_66 = NULL;
+ PyObject *__pyx_t_67 = NULL;
+ PyObject *__pyx_t_68 = NULL;
+ PyObject *__pyx_t_69 = NULL;
+ PyObject *__pyx_t_70 = NULL;
+ PyObject *__pyx_t_71 = NULL;
+ PyObject *__pyx_t_72 = NULL;
+ PyObject *__pyx_t_73 = NULL;
+ PyObject *__pyx_t_74 = NULL;
+ PyObject *__pyx_t_75 = NULL;
+ PyObject *__pyx_t_76 = NULL;
+ PyObject *__pyx_t_77 = NULL;
+ PyObject *__pyx_t_78 = NULL;
+ long __pyx_t_79;
+ llhttp_method_t __pyx_t_80;
+ char const *__pyx_t_81;
+ int __pyx_t_82;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ if (__pyx_m) {
+ if (__pyx_m == __pyx_pyinit_module) return 0;
+ PyErr_SetString(PyExc_RuntimeError, "Module '_http_parser' has already been imported. Re-initialisation is not supported.");
+ return -1;
+ }
+ #elif PY_MAJOR_VERSION >= 3
+ if (__pyx_m) return __Pyx_NewRef(__pyx_m);
+ #endif
+ #if CYTHON_REFNANNY
+__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+}
+#endif
+ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__http_parser(void)", 0);
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pxy_PyFrame_Initialize_Offsets
+ __Pxy_PyFrame_Initialize_Offsets();
+ #endif
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pyx_CyFunction_USED
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ PyEval_InitThreads();
+ #endif
+ /*--- Module creation code ---*/
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_m = __pyx_pyinit_module;
+ Py_INCREF(__pyx_m);
+ #else
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_http_parser", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_b);
+ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_cython_runtime);
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ /*--- Initialize various global constants etc. ---*/
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ if (__pyx_module_is_main_aiohttp___http_parser) {
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "aiohttp._http_parser")) {
+ if (unlikely(PyDict_SetItemString(modules, "aiohttp._http_parser", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Constants init code ---*/
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Global type/function init code ---*/
+ (void)__Pyx_modinit_global_init_code();
+ (void)__Pyx_modinit_variable_export_code();
+ (void)__Pyx_modinit_function_export_code();
+ if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ (void)__Pyx_modinit_variable_import_code();
+ (void)__Pyx_modinit_function_import_code();
+ /*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+
+ /* "aiohttp/_http_parser.pyx":19
+ * from libc.string cimport memcpy
+ *
+ * from multidict import CIMultiDict as _CIMultiDict, CIMultiDictProxy as _CIMultiDictProxy # <<<<<<<<<<<<<<
+ * from yarl import URL as _URL
+ *
+ */
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_CIMultiDict);
+ __Pyx_GIVEREF(__pyx_n_s_CIMultiDict);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_CIMultiDict);
+ __Pyx_INCREF(__pyx_n_s_CIMultiDictProxy);
+ __Pyx_GIVEREF(__pyx_n_s_CIMultiDictProxy);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CIMultiDictProxy);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_multidict, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CIMultiDict); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CIMultiDict_2, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_CIMultiDictProxy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_CIMultiDictProxy_2, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":20
+ *
+ * from multidict import CIMultiDict as _CIMultiDict, CIMultiDictProxy as _CIMultiDictProxy
+ * from yarl import URL as _URL # <<<<<<<<<<<<<<
+ *
+ * from aiohttp import hdrs
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_URL);
+ __Pyx_GIVEREF(__pyx_n_s_URL);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_URL);
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_yarl, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_URL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_URL_2, __pyx_t_2) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":22
+ * from yarl import URL as _URL
+ *
+ * from aiohttp import hdrs # <<<<<<<<<<<<<<
+ *
+ * from .http_exceptions import (
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_hdrs);
+ __Pyx_GIVEREF(__pyx_n_s_hdrs);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_hdrs);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_aiohttp, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_hdrs, __pyx_t_1) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":25
+ *
+ * from .http_exceptions import (
+ * BadHttpMessage, # <<<<<<<<<<<<<<
+ * BadStatusLine,
+ * ContentLengthError,
+ */
+ __pyx_t_2 = PyList_New(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_BadHttpMessage);
+ __Pyx_GIVEREF(__pyx_n_s_BadHttpMessage);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BadHttpMessage);
+ __Pyx_INCREF(__pyx_n_s_BadStatusLine);
+ __Pyx_GIVEREF(__pyx_n_s_BadStatusLine);
+ PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_BadStatusLine);
+ __Pyx_INCREF(__pyx_n_s_ContentLengthError);
+ __Pyx_GIVEREF(__pyx_n_s_ContentLengthError);
+ PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_ContentLengthError);
+ __Pyx_INCREF(__pyx_n_s_InvalidHeader);
+ __Pyx_GIVEREF(__pyx_n_s_InvalidHeader);
+ PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_InvalidHeader);
+ __Pyx_INCREF(__pyx_n_s_InvalidURLError);
+ __Pyx_GIVEREF(__pyx_n_s_InvalidURLError);
+ PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_InvalidURLError);
+ __Pyx_INCREF(__pyx_n_s_LineTooLong);
+ __Pyx_GIVEREF(__pyx_n_s_LineTooLong);
+ PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_LineTooLong);
+ __Pyx_INCREF(__pyx_n_s_PayloadEncodingError);
+ __Pyx_GIVEREF(__pyx_n_s_PayloadEncodingError);
+ PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_PayloadEncodingError);
+ __Pyx_INCREF(__pyx_n_s_TransferEncodingError);
+ __Pyx_GIVEREF(__pyx_n_s_TransferEncodingError);
+ PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_TransferEncodingError);
+
+ /* "aiohttp/_http_parser.pyx":24
+ * from aiohttp import hdrs
+ *
+ * from .http_exceptions import ( # <<<<<<<<<<<<<<
+ * BadHttpMessage,
+ * BadStatusLine,
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_http_exceptions, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BadHttpMessage); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BadHttpMessage, __pyx_t_2) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_BadStatusLine); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_BadStatusLine, __pyx_t_2) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ContentLengthError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_ContentLengthError, __pyx_t_2) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidHeader); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidHeader, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidURLError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_InvalidURLError, __pyx_t_2) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_LineTooLong); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_LineTooLong, __pyx_t_2) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_PayloadEncodingError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_PayloadEncodingError, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_TransferEncodingError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_TransferEncodingError, __pyx_t_2) < 0) __PYX_ERR(0, 32, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":34
+ * TransferEncodingError,
+ * )
+ * from .http_parser import DeflateBuffer as _DeflateBuffer # <<<<<<<<<<<<<<
+ * from .http_writer import (
+ * HttpVersion as _HttpVersion,
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_DeflateBuffer);
+ __Pyx_GIVEREF(__pyx_n_s_DeflateBuffer);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_DeflateBuffer);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_http_parser, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_DeflateBuffer); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_DeflateBuffer_2, __pyx_t_1) < 0) __PYX_ERR(0, 34, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_parser.pyx":36
+ * from .http_parser import DeflateBuffer as _DeflateBuffer
+ * from .http_writer import (
+ * HttpVersion as _HttpVersion, # <<<<<<<<<<<<<<
+ * HttpVersion10 as _HttpVersion10,
+ * HttpVersion11 as _HttpVersion11,
+ */
+ __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_HttpVersion);
+ __Pyx_GIVEREF(__pyx_n_s_HttpVersion);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_HttpVersion);
+ __Pyx_INCREF(__pyx_n_s_HttpVersion10);
+ __Pyx_GIVEREF(__pyx_n_s_HttpVersion10);
+ PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_HttpVersion10);
+ __Pyx_INCREF(__pyx_n_s_HttpVersion11);
+ __Pyx_GIVEREF(__pyx_n_s_HttpVersion11);
+ PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_HttpVersion11);
+
+ /* "aiohttp/_http_parser.pyx":35
+ * )
+ * from .http_parser import DeflateBuffer as _DeflateBuffer
+ * from .http_writer import ( # <<<<<<<<<<<<<<
+ * HttpVersion as _HttpVersion,
+ * HttpVersion10 as _HttpVersion10,
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_http_writer, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_HttpVersion); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HttpVersion_2, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_HttpVersion10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HttpVersion10_2, __pyx_t_2) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_HttpVersion11); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_HttpVersion11_2, __pyx_t_2) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":40
+ * HttpVersion11 as _HttpVersion11,
+ * )
+ * from .streams import EMPTY_PAYLOAD as _EMPTY_PAYLOAD, StreamReader as _StreamReader # <<<<<<<<<<<<<<
+ *
+ * cimport cython
+ */
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_EMPTY_PAYLOAD);
+ __Pyx_GIVEREF(__pyx_n_s_EMPTY_PAYLOAD);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_EMPTY_PAYLOAD);
+ __Pyx_INCREF(__pyx_n_s_StreamReader);
+ __Pyx_GIVEREF(__pyx_n_s_StreamReader);
+ PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_StreamReader);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_streams, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 40, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_EMPTY_PAYLOAD); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMPTY_PAYLOAD_2, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_StreamReader); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 40, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_StreamReader_2, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_headers.pxi":4
+ * # Run ./tools/gen.py to update it after the origin changing.
+ *
+ * from . import hdrs # <<<<<<<<<<<<<<
+ * cdef tuple headers = (
+ * hdrs.ACCEPT,
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_hdrs);
+ __Pyx_GIVEREF(__pyx_n_s_hdrs);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_hdrs);
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s__8, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_hdrs, __pyx_t_2) < 0) __PYX_ERR(5, 4, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":6
+ * from . import hdrs
+ * cdef tuple headers = (
+ * hdrs.ACCEPT, # <<<<<<<<<<<<<<
+ * hdrs.ACCEPT_CHARSET,
+ * hdrs.ACCEPT_ENCODING,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCEPT); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":7
+ * cdef tuple headers = (
+ * hdrs.ACCEPT,
+ * hdrs.ACCEPT_CHARSET, # <<<<<<<<<<<<<<
+ * hdrs.ACCEPT_ENCODING,
+ * hdrs.ACCEPT_LANGUAGE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCEPT_CHARSET); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":8
+ * hdrs.ACCEPT,
+ * hdrs.ACCEPT_CHARSET,
+ * hdrs.ACCEPT_ENCODING, # <<<<<<<<<<<<<<
+ * hdrs.ACCEPT_LANGUAGE,
+ * hdrs.ACCEPT_RANGES,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCEPT_ENCODING); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":9
+ * hdrs.ACCEPT_CHARSET,
+ * hdrs.ACCEPT_ENCODING,
+ * hdrs.ACCEPT_LANGUAGE, # <<<<<<<<<<<<<<
+ * hdrs.ACCEPT_RANGES,
+ * hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 9, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCEPT_LANGUAGE); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 9, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":10
+ * hdrs.ACCEPT_ENCODING,
+ * hdrs.ACCEPT_LANGUAGE,
+ * hdrs.ACCEPT_RANGES, # <<<<<<<<<<<<<<
+ * hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS,
+ * hdrs.ACCESS_CONTROL_ALLOW_HEADERS,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 10, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCEPT_RANGES); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 10, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":11
+ * hdrs.ACCEPT_LANGUAGE,
+ * hdrs.ACCEPT_RANGES,
+ * hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS, # <<<<<<<<<<<<<<
+ * hdrs.ACCESS_CONTROL_ALLOW_HEADERS,
+ * hdrs.ACCESS_CONTROL_ALLOW_METHODS,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCESS_CONTROL_ALLOW_CREDENTIALS); if (unlikely(!__pyx_t_7)) __PYX_ERR(5, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":12
+ * hdrs.ACCEPT_RANGES,
+ * hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS,
+ * hdrs.ACCESS_CONTROL_ALLOW_HEADERS, # <<<<<<<<<<<<<<
+ * hdrs.ACCESS_CONTROL_ALLOW_METHODS,
+ * hdrs.ACCESS_CONTROL_ALLOW_ORIGIN,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCESS_CONTROL_ALLOW_HEADERS); if (unlikely(!__pyx_t_8)) __PYX_ERR(5, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":13
+ * hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS,
+ * hdrs.ACCESS_CONTROL_ALLOW_HEADERS,
+ * hdrs.ACCESS_CONTROL_ALLOW_METHODS, # <<<<<<<<<<<<<<
+ * hdrs.ACCESS_CONTROL_ALLOW_ORIGIN,
+ * hdrs.ACCESS_CONTROL_EXPOSE_HEADERS,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCESS_CONTROL_ALLOW_METHODS); if (unlikely(!__pyx_t_9)) __PYX_ERR(5, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":14
+ * hdrs.ACCESS_CONTROL_ALLOW_HEADERS,
+ * hdrs.ACCESS_CONTROL_ALLOW_METHODS,
+ * hdrs.ACCESS_CONTROL_ALLOW_ORIGIN, # <<<<<<<<<<<<<<
+ * hdrs.ACCESS_CONTROL_EXPOSE_HEADERS,
+ * hdrs.ACCESS_CONTROL_MAX_AGE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCESS_CONTROL_ALLOW_ORIGIN); if (unlikely(!__pyx_t_10)) __PYX_ERR(5, 14, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":15
+ * hdrs.ACCESS_CONTROL_ALLOW_METHODS,
+ * hdrs.ACCESS_CONTROL_ALLOW_ORIGIN,
+ * hdrs.ACCESS_CONTROL_EXPOSE_HEADERS, # <<<<<<<<<<<<<<
+ * hdrs.ACCESS_CONTROL_MAX_AGE,
+ * hdrs.ACCESS_CONTROL_REQUEST_HEADERS,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCESS_CONTROL_EXPOSE_HEADERS); if (unlikely(!__pyx_t_11)) __PYX_ERR(5, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":16
+ * hdrs.ACCESS_CONTROL_ALLOW_ORIGIN,
+ * hdrs.ACCESS_CONTROL_EXPOSE_HEADERS,
+ * hdrs.ACCESS_CONTROL_MAX_AGE, # <<<<<<<<<<<<<<
+ * hdrs.ACCESS_CONTROL_REQUEST_HEADERS,
+ * hdrs.ACCESS_CONTROL_REQUEST_METHOD,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 16, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCESS_CONTROL_MAX_AGE); if (unlikely(!__pyx_t_12)) __PYX_ERR(5, 16, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_12);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":17
+ * hdrs.ACCESS_CONTROL_EXPOSE_HEADERS,
+ * hdrs.ACCESS_CONTROL_MAX_AGE,
+ * hdrs.ACCESS_CONTROL_REQUEST_HEADERS, # <<<<<<<<<<<<<<
+ * hdrs.ACCESS_CONTROL_REQUEST_METHOD,
+ * hdrs.AGE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 17, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCESS_CONTROL_REQUEST_HEADERS); if (unlikely(!__pyx_t_13)) __PYX_ERR(5, 17, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_13);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":18
+ * hdrs.ACCESS_CONTROL_MAX_AGE,
+ * hdrs.ACCESS_CONTROL_REQUEST_HEADERS,
+ * hdrs.ACCESS_CONTROL_REQUEST_METHOD, # <<<<<<<<<<<<<<
+ * hdrs.AGE,
+ * hdrs.ALLOW,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 18, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ACCESS_CONTROL_REQUEST_METHOD); if (unlikely(!__pyx_t_14)) __PYX_ERR(5, 18, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_14);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":19
+ * hdrs.ACCESS_CONTROL_REQUEST_HEADERS,
+ * hdrs.ACCESS_CONTROL_REQUEST_METHOD,
+ * hdrs.AGE, # <<<<<<<<<<<<<<
+ * hdrs.ALLOW,
+ * hdrs.AUTHORIZATION,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 19, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_15 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AGE); if (unlikely(!__pyx_t_15)) __PYX_ERR(5, 19, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_15);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":20
+ * hdrs.ACCESS_CONTROL_REQUEST_METHOD,
+ * hdrs.AGE,
+ * hdrs.ALLOW, # <<<<<<<<<<<<<<
+ * hdrs.AUTHORIZATION,
+ * hdrs.CACHE_CONTROL,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 20, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ALLOW); if (unlikely(!__pyx_t_16)) __PYX_ERR(5, 20, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_16);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":21
+ * hdrs.AGE,
+ * hdrs.ALLOW,
+ * hdrs.AUTHORIZATION, # <<<<<<<<<<<<<<
+ * hdrs.CACHE_CONTROL,
+ * hdrs.CONNECTION,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 21, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_AUTHORIZATION); if (unlikely(!__pyx_t_17)) __PYX_ERR(5, 21, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_17);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":22
+ * hdrs.ALLOW,
+ * hdrs.AUTHORIZATION,
+ * hdrs.CACHE_CONTROL, # <<<<<<<<<<<<<<
+ * hdrs.CONNECTION,
+ * hdrs.CONTENT_DISPOSITION,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 22, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CACHE_CONTROL); if (unlikely(!__pyx_t_18)) __PYX_ERR(5, 22, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_18);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":23
+ * hdrs.AUTHORIZATION,
+ * hdrs.CACHE_CONTROL,
+ * hdrs.CONNECTION, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_DISPOSITION,
+ * hdrs.CONTENT_ENCODING,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 23, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_19 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONNECTION); if (unlikely(!__pyx_t_19)) __PYX_ERR(5, 23, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_19);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":24
+ * hdrs.CACHE_CONTROL,
+ * hdrs.CONNECTION,
+ * hdrs.CONTENT_DISPOSITION, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_ENCODING,
+ * hdrs.CONTENT_LANGUAGE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_DISPOSITION); if (unlikely(!__pyx_t_20)) __PYX_ERR(5, 24, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_20);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":25
+ * hdrs.CONNECTION,
+ * hdrs.CONTENT_DISPOSITION,
+ * hdrs.CONTENT_ENCODING, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_LANGUAGE,
+ * hdrs.CONTENT_LENGTH,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 25, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_21 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_ENCODING); if (unlikely(!__pyx_t_21)) __PYX_ERR(5, 25, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_21);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":26
+ * hdrs.CONTENT_DISPOSITION,
+ * hdrs.CONTENT_ENCODING,
+ * hdrs.CONTENT_LANGUAGE, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_LENGTH,
+ * hdrs.CONTENT_LOCATION,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 26, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_LANGUAGE); if (unlikely(!__pyx_t_22)) __PYX_ERR(5, 26, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_22);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":27
+ * hdrs.CONTENT_ENCODING,
+ * hdrs.CONTENT_LANGUAGE,
+ * hdrs.CONTENT_LENGTH, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_LOCATION,
+ * hdrs.CONTENT_MD5,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 27, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_LENGTH); if (unlikely(!__pyx_t_23)) __PYX_ERR(5, 27, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_23);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":28
+ * hdrs.CONTENT_LANGUAGE,
+ * hdrs.CONTENT_LENGTH,
+ * hdrs.CONTENT_LOCATION, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_MD5,
+ * hdrs.CONTENT_RANGE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 28, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_LOCATION); if (unlikely(!__pyx_t_24)) __PYX_ERR(5, 28, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_24);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":29
+ * hdrs.CONTENT_LENGTH,
+ * hdrs.CONTENT_LOCATION,
+ * hdrs.CONTENT_MD5, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_RANGE,
+ * hdrs.CONTENT_TRANSFER_ENCODING,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 29, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_25 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_MD5); if (unlikely(!__pyx_t_25)) __PYX_ERR(5, 29, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_25);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":30
+ * hdrs.CONTENT_LOCATION,
+ * hdrs.CONTENT_MD5,
+ * hdrs.CONTENT_RANGE, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_TRANSFER_ENCODING,
+ * hdrs.CONTENT_TYPE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 30, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_RANGE); if (unlikely(!__pyx_t_26)) __PYX_ERR(5, 30, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_26);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":31
+ * hdrs.CONTENT_MD5,
+ * hdrs.CONTENT_RANGE,
+ * hdrs.CONTENT_TRANSFER_ENCODING, # <<<<<<<<<<<<<<
+ * hdrs.CONTENT_TYPE,
+ * hdrs.COOKIE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 31, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_27 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_TRANSFER_ENCODING); if (unlikely(!__pyx_t_27)) __PYX_ERR(5, 31, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_27);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":32
+ * hdrs.CONTENT_RANGE,
+ * hdrs.CONTENT_TRANSFER_ENCODING,
+ * hdrs.CONTENT_TYPE, # <<<<<<<<<<<<<<
+ * hdrs.COOKIE,
+ * hdrs.DATE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 32, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_28 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_CONTENT_TYPE); if (unlikely(!__pyx_t_28)) __PYX_ERR(5, 32, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_28);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":33
+ * hdrs.CONTENT_TRANSFER_ENCODING,
+ * hdrs.CONTENT_TYPE,
+ * hdrs.COOKIE, # <<<<<<<<<<<<<<
+ * hdrs.DATE,
+ * hdrs.DESTINATION,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 33, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_29 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_COOKIE); if (unlikely(!__pyx_t_29)) __PYX_ERR(5, 33, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_29);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":34
+ * hdrs.CONTENT_TYPE,
+ * hdrs.COOKIE,
+ * hdrs.DATE, # <<<<<<<<<<<<<<
+ * hdrs.DESTINATION,
+ * hdrs.DIGEST,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 34, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_30 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DATE); if (unlikely(!__pyx_t_30)) __PYX_ERR(5, 34, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":35
+ * hdrs.COOKIE,
+ * hdrs.DATE,
+ * hdrs.DESTINATION, # <<<<<<<<<<<<<<
+ * hdrs.DIGEST,
+ * hdrs.ETAG,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_31 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DESTINATION); if (unlikely(!__pyx_t_31)) __PYX_ERR(5, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_31);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":36
+ * hdrs.DATE,
+ * hdrs.DESTINATION,
+ * hdrs.DIGEST, # <<<<<<<<<<<<<<
+ * hdrs.ETAG,
+ * hdrs.EXPECT,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 36, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_32 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_DIGEST); if (unlikely(!__pyx_t_32)) __PYX_ERR(5, 36, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_32);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":37
+ * hdrs.DESTINATION,
+ * hdrs.DIGEST,
+ * hdrs.ETAG, # <<<<<<<<<<<<<<
+ * hdrs.EXPECT,
+ * hdrs.EXPIRES,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_33 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ETAG); if (unlikely(!__pyx_t_33)) __PYX_ERR(5, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_33);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":38
+ * hdrs.DIGEST,
+ * hdrs.ETAG,
+ * hdrs.EXPECT, # <<<<<<<<<<<<<<
+ * hdrs.EXPIRES,
+ * hdrs.FORWARDED,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 38, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_34 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_EXPECT); if (unlikely(!__pyx_t_34)) __PYX_ERR(5, 38, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_34);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":39
+ * hdrs.ETAG,
+ * hdrs.EXPECT,
+ * hdrs.EXPIRES, # <<<<<<<<<<<<<<
+ * hdrs.FORWARDED,
+ * hdrs.FROM,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 39, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_35 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_EXPIRES); if (unlikely(!__pyx_t_35)) __PYX_ERR(5, 39, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_35);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":40
+ * hdrs.EXPECT,
+ * hdrs.EXPIRES,
+ * hdrs.FORWARDED, # <<<<<<<<<<<<<<
+ * hdrs.FROM,
+ * hdrs.HOST,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 40, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_36 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_FORWARDED); if (unlikely(!__pyx_t_36)) __PYX_ERR(5, 40, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_36);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":41
+ * hdrs.EXPIRES,
+ * hdrs.FORWARDED,
+ * hdrs.FROM, # <<<<<<<<<<<<<<
+ * hdrs.HOST,
+ * hdrs.IF_MATCH,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 41, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_37 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_FROM); if (unlikely(!__pyx_t_37)) __PYX_ERR(5, 41, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_37);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":42
+ * hdrs.FORWARDED,
+ * hdrs.FROM,
+ * hdrs.HOST, # <<<<<<<<<<<<<<
+ * hdrs.IF_MATCH,
+ * hdrs.IF_MODIFIED_SINCE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_38 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_HOST); if (unlikely(!__pyx_t_38)) __PYX_ERR(5, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_38);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":43
+ * hdrs.FROM,
+ * hdrs.HOST,
+ * hdrs.IF_MATCH, # <<<<<<<<<<<<<<
+ * hdrs.IF_MODIFIED_SINCE,
+ * hdrs.IF_NONE_MATCH,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 43, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_39 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IF_MATCH); if (unlikely(!__pyx_t_39)) __PYX_ERR(5, 43, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_39);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":44
+ * hdrs.HOST,
+ * hdrs.IF_MATCH,
+ * hdrs.IF_MODIFIED_SINCE, # <<<<<<<<<<<<<<
+ * hdrs.IF_NONE_MATCH,
+ * hdrs.IF_RANGE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 44, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_40 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IF_MODIFIED_SINCE); if (unlikely(!__pyx_t_40)) __PYX_ERR(5, 44, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_40);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":45
+ * hdrs.IF_MATCH,
+ * hdrs.IF_MODIFIED_SINCE,
+ * hdrs.IF_NONE_MATCH, # <<<<<<<<<<<<<<
+ * hdrs.IF_RANGE,
+ * hdrs.IF_UNMODIFIED_SINCE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 45, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_41 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IF_NONE_MATCH); if (unlikely(!__pyx_t_41)) __PYX_ERR(5, 45, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_41);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":46
+ * hdrs.IF_MODIFIED_SINCE,
+ * hdrs.IF_NONE_MATCH,
+ * hdrs.IF_RANGE, # <<<<<<<<<<<<<<
+ * hdrs.IF_UNMODIFIED_SINCE,
+ * hdrs.KEEP_ALIVE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 46, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_42 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IF_RANGE); if (unlikely(!__pyx_t_42)) __PYX_ERR(5, 46, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_42);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":47
+ * hdrs.IF_NONE_MATCH,
+ * hdrs.IF_RANGE,
+ * hdrs.IF_UNMODIFIED_SINCE, # <<<<<<<<<<<<<<
+ * hdrs.KEEP_ALIVE,
+ * hdrs.LAST_EVENT_ID,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 47, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_43 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_IF_UNMODIFIED_SINCE); if (unlikely(!__pyx_t_43)) __PYX_ERR(5, 47, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_43);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":48
+ * hdrs.IF_RANGE,
+ * hdrs.IF_UNMODIFIED_SINCE,
+ * hdrs.KEEP_ALIVE, # <<<<<<<<<<<<<<
+ * hdrs.LAST_EVENT_ID,
+ * hdrs.LAST_MODIFIED,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 48, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_44 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_KEEP_ALIVE); if (unlikely(!__pyx_t_44)) __PYX_ERR(5, 48, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_44);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":49
+ * hdrs.IF_UNMODIFIED_SINCE,
+ * hdrs.KEEP_ALIVE,
+ * hdrs.LAST_EVENT_ID, # <<<<<<<<<<<<<<
+ * hdrs.LAST_MODIFIED,
+ * hdrs.LINK,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 49, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_45 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LAST_EVENT_ID); if (unlikely(!__pyx_t_45)) __PYX_ERR(5, 49, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_45);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":50
+ * hdrs.KEEP_ALIVE,
+ * hdrs.LAST_EVENT_ID,
+ * hdrs.LAST_MODIFIED, # <<<<<<<<<<<<<<
+ * hdrs.LINK,
+ * hdrs.LOCATION,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 50, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_46 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LAST_MODIFIED); if (unlikely(!__pyx_t_46)) __PYX_ERR(5, 50, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_46);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":51
+ * hdrs.LAST_EVENT_ID,
+ * hdrs.LAST_MODIFIED,
+ * hdrs.LINK, # <<<<<<<<<<<<<<
+ * hdrs.LOCATION,
+ * hdrs.MAX_FORWARDS,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 51, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_47 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LINK); if (unlikely(!__pyx_t_47)) __PYX_ERR(5, 51, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_47);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":52
+ * hdrs.LAST_MODIFIED,
+ * hdrs.LINK,
+ * hdrs.LOCATION, # <<<<<<<<<<<<<<
+ * hdrs.MAX_FORWARDS,
+ * hdrs.ORIGIN,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_48 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LOCATION); if (unlikely(!__pyx_t_48)) __PYX_ERR(5, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_48);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":53
+ * hdrs.LINK,
+ * hdrs.LOCATION,
+ * hdrs.MAX_FORWARDS, # <<<<<<<<<<<<<<
+ * hdrs.ORIGIN,
+ * hdrs.PRAGMA,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 53, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_49 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_MAX_FORWARDS); if (unlikely(!__pyx_t_49)) __PYX_ERR(5, 53, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_49);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":54
+ * hdrs.LOCATION,
+ * hdrs.MAX_FORWARDS,
+ * hdrs.ORIGIN, # <<<<<<<<<<<<<<
+ * hdrs.PRAGMA,
+ * hdrs.PROXY_AUTHENTICATE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 54, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_50 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ORIGIN); if (unlikely(!__pyx_t_50)) __PYX_ERR(5, 54, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_50);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":55
+ * hdrs.MAX_FORWARDS,
+ * hdrs.ORIGIN,
+ * hdrs.PRAGMA, # <<<<<<<<<<<<<<
+ * hdrs.PROXY_AUTHENTICATE,
+ * hdrs.PROXY_AUTHORIZATION,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_51 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PRAGMA); if (unlikely(!__pyx_t_51)) __PYX_ERR(5, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_51);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":56
+ * hdrs.ORIGIN,
+ * hdrs.PRAGMA,
+ * hdrs.PROXY_AUTHENTICATE, # <<<<<<<<<<<<<<
+ * hdrs.PROXY_AUTHORIZATION,
+ * hdrs.RANGE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 56, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_52 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PROXY_AUTHENTICATE); if (unlikely(!__pyx_t_52)) __PYX_ERR(5, 56, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_52);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":57
+ * hdrs.PRAGMA,
+ * hdrs.PROXY_AUTHENTICATE,
+ * hdrs.PROXY_AUTHORIZATION, # <<<<<<<<<<<<<<
+ * hdrs.RANGE,
+ * hdrs.REFERER,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 57, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_53 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PROXY_AUTHORIZATION); if (unlikely(!__pyx_t_53)) __PYX_ERR(5, 57, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_53);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":58
+ * hdrs.PROXY_AUTHENTICATE,
+ * hdrs.PROXY_AUTHORIZATION,
+ * hdrs.RANGE, # <<<<<<<<<<<<<<
+ * hdrs.REFERER,
+ * hdrs.RETRY_AFTER,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 58, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_54 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_RANGE); if (unlikely(!__pyx_t_54)) __PYX_ERR(5, 58, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_54);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":59
+ * hdrs.PROXY_AUTHORIZATION,
+ * hdrs.RANGE,
+ * hdrs.REFERER, # <<<<<<<<<<<<<<
+ * hdrs.RETRY_AFTER,
+ * hdrs.SEC_WEBSOCKET_ACCEPT,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 59, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_55 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_REFERER); if (unlikely(!__pyx_t_55)) __PYX_ERR(5, 59, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_55);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":60
+ * hdrs.RANGE,
+ * hdrs.REFERER,
+ * hdrs.RETRY_AFTER, # <<<<<<<<<<<<<<
+ * hdrs.SEC_WEBSOCKET_ACCEPT,
+ * hdrs.SEC_WEBSOCKET_EXTENSIONS,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 60, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_56 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_RETRY_AFTER); if (unlikely(!__pyx_t_56)) __PYX_ERR(5, 60, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_56);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":61
+ * hdrs.REFERER,
+ * hdrs.RETRY_AFTER,
+ * hdrs.SEC_WEBSOCKET_ACCEPT, # <<<<<<<<<<<<<<
+ * hdrs.SEC_WEBSOCKET_EXTENSIONS,
+ * hdrs.SEC_WEBSOCKET_KEY,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_57 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEC_WEBSOCKET_ACCEPT); if (unlikely(!__pyx_t_57)) __PYX_ERR(5, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_57);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":62
+ * hdrs.RETRY_AFTER,
+ * hdrs.SEC_WEBSOCKET_ACCEPT,
+ * hdrs.SEC_WEBSOCKET_EXTENSIONS, # <<<<<<<<<<<<<<
+ * hdrs.SEC_WEBSOCKET_KEY,
+ * hdrs.SEC_WEBSOCKET_KEY1,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 62, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_58 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEC_WEBSOCKET_EXTENSIONS); if (unlikely(!__pyx_t_58)) __PYX_ERR(5, 62, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_58);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":63
+ * hdrs.SEC_WEBSOCKET_ACCEPT,
+ * hdrs.SEC_WEBSOCKET_EXTENSIONS,
+ * hdrs.SEC_WEBSOCKET_KEY, # <<<<<<<<<<<<<<
+ * hdrs.SEC_WEBSOCKET_KEY1,
+ * hdrs.SEC_WEBSOCKET_PROTOCOL,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 63, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_59 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEC_WEBSOCKET_KEY); if (unlikely(!__pyx_t_59)) __PYX_ERR(5, 63, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_59);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":64
+ * hdrs.SEC_WEBSOCKET_EXTENSIONS,
+ * hdrs.SEC_WEBSOCKET_KEY,
+ * hdrs.SEC_WEBSOCKET_KEY1, # <<<<<<<<<<<<<<
+ * hdrs.SEC_WEBSOCKET_PROTOCOL,
+ * hdrs.SEC_WEBSOCKET_VERSION,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_60 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEC_WEBSOCKET_KEY1); if (unlikely(!__pyx_t_60)) __PYX_ERR(5, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_60);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":65
+ * hdrs.SEC_WEBSOCKET_KEY,
+ * hdrs.SEC_WEBSOCKET_KEY1,
+ * hdrs.SEC_WEBSOCKET_PROTOCOL, # <<<<<<<<<<<<<<
+ * hdrs.SEC_WEBSOCKET_VERSION,
+ * hdrs.SERVER,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 65, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_61 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEC_WEBSOCKET_PROTOCOL); if (unlikely(!__pyx_t_61)) __PYX_ERR(5, 65, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_61);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":66
+ * hdrs.SEC_WEBSOCKET_KEY1,
+ * hdrs.SEC_WEBSOCKET_PROTOCOL,
+ * hdrs.SEC_WEBSOCKET_VERSION, # <<<<<<<<<<<<<<
+ * hdrs.SERVER,
+ * hdrs.SET_COOKIE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_62 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEC_WEBSOCKET_VERSION); if (unlikely(!__pyx_t_62)) __PYX_ERR(5, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_62);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":67
+ * hdrs.SEC_WEBSOCKET_PROTOCOL,
+ * hdrs.SEC_WEBSOCKET_VERSION,
+ * hdrs.SERVER, # <<<<<<<<<<<<<<
+ * hdrs.SET_COOKIE,
+ * hdrs.TE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_63 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SERVER); if (unlikely(!__pyx_t_63)) __PYX_ERR(5, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_63);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":68
+ * hdrs.SEC_WEBSOCKET_VERSION,
+ * hdrs.SERVER,
+ * hdrs.SET_COOKIE, # <<<<<<<<<<<<<<
+ * hdrs.TE,
+ * hdrs.TRAILER,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_64 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SET_COOKIE); if (unlikely(!__pyx_t_64)) __PYX_ERR(5, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_64);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":69
+ * hdrs.SERVER,
+ * hdrs.SET_COOKIE,
+ * hdrs.TE, # <<<<<<<<<<<<<<
+ * hdrs.TRAILER,
+ * hdrs.TRANSFER_ENCODING,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_65 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TE); if (unlikely(!__pyx_t_65)) __PYX_ERR(5, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_65);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":70
+ * hdrs.SET_COOKIE,
+ * hdrs.TE,
+ * hdrs.TRAILER, # <<<<<<<<<<<<<<
+ * hdrs.TRANSFER_ENCODING,
+ * hdrs.URI,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_66 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TRAILER); if (unlikely(!__pyx_t_66)) __PYX_ERR(5, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_66);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":71
+ * hdrs.TE,
+ * hdrs.TRAILER,
+ * hdrs.TRANSFER_ENCODING, # <<<<<<<<<<<<<<
+ * hdrs.URI,
+ * hdrs.UPGRADE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_67 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_TRANSFER_ENCODING); if (unlikely(!__pyx_t_67)) __PYX_ERR(5, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_67);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":72
+ * hdrs.TRAILER,
+ * hdrs.TRANSFER_ENCODING,
+ * hdrs.URI, # <<<<<<<<<<<<<<
+ * hdrs.UPGRADE,
+ * hdrs.USER_AGENT,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_68 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_URI); if (unlikely(!__pyx_t_68)) __PYX_ERR(5, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_68);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":73
+ * hdrs.TRANSFER_ENCODING,
+ * hdrs.URI,
+ * hdrs.UPGRADE, # <<<<<<<<<<<<<<
+ * hdrs.USER_AGENT,
+ * hdrs.VARY,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_69 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_UPGRADE); if (unlikely(!__pyx_t_69)) __PYX_ERR(5, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_69);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":74
+ * hdrs.URI,
+ * hdrs.UPGRADE,
+ * hdrs.USER_AGENT, # <<<<<<<<<<<<<<
+ * hdrs.VARY,
+ * hdrs.VIA,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_70 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_USER_AGENT); if (unlikely(!__pyx_t_70)) __PYX_ERR(5, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_70);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":75
+ * hdrs.UPGRADE,
+ * hdrs.USER_AGENT,
+ * hdrs.VARY, # <<<<<<<<<<<<<<
+ * hdrs.VIA,
+ * hdrs.WWW_AUTHENTICATE,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 75, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_71 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VARY); if (unlikely(!__pyx_t_71)) __PYX_ERR(5, 75, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_71);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":76
+ * hdrs.USER_AGENT,
+ * hdrs.VARY,
+ * hdrs.VIA, # <<<<<<<<<<<<<<
+ * hdrs.WWW_AUTHENTICATE,
+ * hdrs.WANT_DIGEST,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 76, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_72 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_VIA); if (unlikely(!__pyx_t_72)) __PYX_ERR(5, 76, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_72);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":77
+ * hdrs.VARY,
+ * hdrs.VIA,
+ * hdrs.WWW_AUTHENTICATE, # <<<<<<<<<<<<<<
+ * hdrs.WANT_DIGEST,
+ * hdrs.WARNING,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 77, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_73 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_WWW_AUTHENTICATE); if (unlikely(!__pyx_t_73)) __PYX_ERR(5, 77, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_73);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":78
+ * hdrs.VIA,
+ * hdrs.WWW_AUTHENTICATE,
+ * hdrs.WANT_DIGEST, # <<<<<<<<<<<<<<
+ * hdrs.WARNING,
+ * hdrs.X_FORWARDED_FOR,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_74 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_WANT_DIGEST); if (unlikely(!__pyx_t_74)) __PYX_ERR(5, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_74);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":79
+ * hdrs.WWW_AUTHENTICATE,
+ * hdrs.WANT_DIGEST,
+ * hdrs.WARNING, # <<<<<<<<<<<<<<
+ * hdrs.X_FORWARDED_FOR,
+ * hdrs.X_FORWARDED_HOST,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 79, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_75 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_WARNING); if (unlikely(!__pyx_t_75)) __PYX_ERR(5, 79, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_75);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":80
+ * hdrs.WANT_DIGEST,
+ * hdrs.WARNING,
+ * hdrs.X_FORWARDED_FOR, # <<<<<<<<<<<<<<
+ * hdrs.X_FORWARDED_HOST,
+ * hdrs.X_FORWARDED_PROTO,
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_76 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_X_FORWARDED_FOR); if (unlikely(!__pyx_t_76)) __PYX_ERR(5, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_76);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":81
+ * hdrs.WARNING,
+ * hdrs.X_FORWARDED_FOR,
+ * hdrs.X_FORWARDED_HOST, # <<<<<<<<<<<<<<
+ * hdrs.X_FORWARDED_PROTO,
+ * )
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 81, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_77 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_X_FORWARDED_HOST); if (unlikely(!__pyx_t_77)) __PYX_ERR(5, 81, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_77);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":82
+ * hdrs.X_FORWARDED_FOR,
+ * hdrs.X_FORWARDED_HOST,
+ * hdrs.X_FORWARDED_PROTO, # <<<<<<<<<<<<<<
+ * )
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_78 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_X_FORWARDED_PROTO); if (unlikely(!__pyx_t_78)) __PYX_ERR(5, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_78);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_headers.pxi":6
+ * from . import hdrs
+ * cdef tuple headers = (
+ * hdrs.ACCEPT, # <<<<<<<<<<<<<<
+ * hdrs.ACCEPT_CHARSET,
+ * hdrs.ACCEPT_ENCODING,
+ */
+ __pyx_t_1 = PyTuple_New(77); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_1, 5, __pyx_t_7);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_1, 6, __pyx_t_8);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_1, 7, __pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_10);
+ PyTuple_SET_ITEM(__pyx_t_1, 8, __pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_11);
+ PyTuple_SET_ITEM(__pyx_t_1, 9, __pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_12);
+ PyTuple_SET_ITEM(__pyx_t_1, 10, __pyx_t_12);
+ __Pyx_GIVEREF(__pyx_t_13);
+ PyTuple_SET_ITEM(__pyx_t_1, 11, __pyx_t_13);
+ __Pyx_GIVEREF(__pyx_t_14);
+ PyTuple_SET_ITEM(__pyx_t_1, 12, __pyx_t_14);
+ __Pyx_GIVEREF(__pyx_t_15);
+ PyTuple_SET_ITEM(__pyx_t_1, 13, __pyx_t_15);
+ __Pyx_GIVEREF(__pyx_t_16);
+ PyTuple_SET_ITEM(__pyx_t_1, 14, __pyx_t_16);
+ __Pyx_GIVEREF(__pyx_t_17);
+ PyTuple_SET_ITEM(__pyx_t_1, 15, __pyx_t_17);
+ __Pyx_GIVEREF(__pyx_t_18);
+ PyTuple_SET_ITEM(__pyx_t_1, 16, __pyx_t_18);
+ __Pyx_GIVEREF(__pyx_t_19);
+ PyTuple_SET_ITEM(__pyx_t_1, 17, __pyx_t_19);
+ __Pyx_GIVEREF(__pyx_t_20);
+ PyTuple_SET_ITEM(__pyx_t_1, 18, __pyx_t_20);
+ __Pyx_GIVEREF(__pyx_t_21);
+ PyTuple_SET_ITEM(__pyx_t_1, 19, __pyx_t_21);
+ __Pyx_GIVEREF(__pyx_t_22);
+ PyTuple_SET_ITEM(__pyx_t_1, 20, __pyx_t_22);
+ __Pyx_GIVEREF(__pyx_t_23);
+ PyTuple_SET_ITEM(__pyx_t_1, 21, __pyx_t_23);
+ __Pyx_GIVEREF(__pyx_t_24);
+ PyTuple_SET_ITEM(__pyx_t_1, 22, __pyx_t_24);
+ __Pyx_GIVEREF(__pyx_t_25);
+ PyTuple_SET_ITEM(__pyx_t_1, 23, __pyx_t_25);
+ __Pyx_GIVEREF(__pyx_t_26);
+ PyTuple_SET_ITEM(__pyx_t_1, 24, __pyx_t_26);
+ __Pyx_GIVEREF(__pyx_t_27);
+ PyTuple_SET_ITEM(__pyx_t_1, 25, __pyx_t_27);
+ __Pyx_GIVEREF(__pyx_t_28);
+ PyTuple_SET_ITEM(__pyx_t_1, 26, __pyx_t_28);
+ __Pyx_GIVEREF(__pyx_t_29);
+ PyTuple_SET_ITEM(__pyx_t_1, 27, __pyx_t_29);
+ __Pyx_GIVEREF(__pyx_t_30);
+ PyTuple_SET_ITEM(__pyx_t_1, 28, __pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_31);
+ PyTuple_SET_ITEM(__pyx_t_1, 29, __pyx_t_31);
+ __Pyx_GIVEREF(__pyx_t_32);
+ PyTuple_SET_ITEM(__pyx_t_1, 30, __pyx_t_32);
+ __Pyx_GIVEREF(__pyx_t_33);
+ PyTuple_SET_ITEM(__pyx_t_1, 31, __pyx_t_33);
+ __Pyx_GIVEREF(__pyx_t_34);
+ PyTuple_SET_ITEM(__pyx_t_1, 32, __pyx_t_34);
+ __Pyx_GIVEREF(__pyx_t_35);
+ PyTuple_SET_ITEM(__pyx_t_1, 33, __pyx_t_35);
+ __Pyx_GIVEREF(__pyx_t_36);
+ PyTuple_SET_ITEM(__pyx_t_1, 34, __pyx_t_36);
+ __Pyx_GIVEREF(__pyx_t_37);
+ PyTuple_SET_ITEM(__pyx_t_1, 35, __pyx_t_37);
+ __Pyx_GIVEREF(__pyx_t_38);
+ PyTuple_SET_ITEM(__pyx_t_1, 36, __pyx_t_38);
+ __Pyx_GIVEREF(__pyx_t_39);
+ PyTuple_SET_ITEM(__pyx_t_1, 37, __pyx_t_39);
+ __Pyx_GIVEREF(__pyx_t_40);
+ PyTuple_SET_ITEM(__pyx_t_1, 38, __pyx_t_40);
+ __Pyx_GIVEREF(__pyx_t_41);
+ PyTuple_SET_ITEM(__pyx_t_1, 39, __pyx_t_41);
+ __Pyx_GIVEREF(__pyx_t_42);
+ PyTuple_SET_ITEM(__pyx_t_1, 40, __pyx_t_42);
+ __Pyx_GIVEREF(__pyx_t_43);
+ PyTuple_SET_ITEM(__pyx_t_1, 41, __pyx_t_43);
+ __Pyx_GIVEREF(__pyx_t_44);
+ PyTuple_SET_ITEM(__pyx_t_1, 42, __pyx_t_44);
+ __Pyx_GIVEREF(__pyx_t_45);
+ PyTuple_SET_ITEM(__pyx_t_1, 43, __pyx_t_45);
+ __Pyx_GIVEREF(__pyx_t_46);
+ PyTuple_SET_ITEM(__pyx_t_1, 44, __pyx_t_46);
+ __Pyx_GIVEREF(__pyx_t_47);
+ PyTuple_SET_ITEM(__pyx_t_1, 45, __pyx_t_47);
+ __Pyx_GIVEREF(__pyx_t_48);
+ PyTuple_SET_ITEM(__pyx_t_1, 46, __pyx_t_48);
+ __Pyx_GIVEREF(__pyx_t_49);
+ PyTuple_SET_ITEM(__pyx_t_1, 47, __pyx_t_49);
+ __Pyx_GIVEREF(__pyx_t_50);
+ PyTuple_SET_ITEM(__pyx_t_1, 48, __pyx_t_50);
+ __Pyx_GIVEREF(__pyx_t_51);
+ PyTuple_SET_ITEM(__pyx_t_1, 49, __pyx_t_51);
+ __Pyx_GIVEREF(__pyx_t_52);
+ PyTuple_SET_ITEM(__pyx_t_1, 50, __pyx_t_52);
+ __Pyx_GIVEREF(__pyx_t_53);
+ PyTuple_SET_ITEM(__pyx_t_1, 51, __pyx_t_53);
+ __Pyx_GIVEREF(__pyx_t_54);
+ PyTuple_SET_ITEM(__pyx_t_1, 52, __pyx_t_54);
+ __Pyx_GIVEREF(__pyx_t_55);
+ PyTuple_SET_ITEM(__pyx_t_1, 53, __pyx_t_55);
+ __Pyx_GIVEREF(__pyx_t_56);
+ PyTuple_SET_ITEM(__pyx_t_1, 54, __pyx_t_56);
+ __Pyx_GIVEREF(__pyx_t_57);
+ PyTuple_SET_ITEM(__pyx_t_1, 55, __pyx_t_57);
+ __Pyx_GIVEREF(__pyx_t_58);
+ PyTuple_SET_ITEM(__pyx_t_1, 56, __pyx_t_58);
+ __Pyx_GIVEREF(__pyx_t_59);
+ PyTuple_SET_ITEM(__pyx_t_1, 57, __pyx_t_59);
+ __Pyx_GIVEREF(__pyx_t_60);
+ PyTuple_SET_ITEM(__pyx_t_1, 58, __pyx_t_60);
+ __Pyx_GIVEREF(__pyx_t_61);
+ PyTuple_SET_ITEM(__pyx_t_1, 59, __pyx_t_61);
+ __Pyx_GIVEREF(__pyx_t_62);
+ PyTuple_SET_ITEM(__pyx_t_1, 60, __pyx_t_62);
+ __Pyx_GIVEREF(__pyx_t_63);
+ PyTuple_SET_ITEM(__pyx_t_1, 61, __pyx_t_63);
+ __Pyx_GIVEREF(__pyx_t_64);
+ PyTuple_SET_ITEM(__pyx_t_1, 62, __pyx_t_64);
+ __Pyx_GIVEREF(__pyx_t_65);
+ PyTuple_SET_ITEM(__pyx_t_1, 63, __pyx_t_65);
+ __Pyx_GIVEREF(__pyx_t_66);
+ PyTuple_SET_ITEM(__pyx_t_1, 64, __pyx_t_66);
+ __Pyx_GIVEREF(__pyx_t_67);
+ PyTuple_SET_ITEM(__pyx_t_1, 65, __pyx_t_67);
+ __Pyx_GIVEREF(__pyx_t_68);
+ PyTuple_SET_ITEM(__pyx_t_1, 66, __pyx_t_68);
+ __Pyx_GIVEREF(__pyx_t_69);
+ PyTuple_SET_ITEM(__pyx_t_1, 67, __pyx_t_69);
+ __Pyx_GIVEREF(__pyx_t_70);
+ PyTuple_SET_ITEM(__pyx_t_1, 68, __pyx_t_70);
+ __Pyx_GIVEREF(__pyx_t_71);
+ PyTuple_SET_ITEM(__pyx_t_1, 69, __pyx_t_71);
+ __Pyx_GIVEREF(__pyx_t_72);
+ PyTuple_SET_ITEM(__pyx_t_1, 70, __pyx_t_72);
+ __Pyx_GIVEREF(__pyx_t_73);
+ PyTuple_SET_ITEM(__pyx_t_1, 71, __pyx_t_73);
+ __Pyx_GIVEREF(__pyx_t_74);
+ PyTuple_SET_ITEM(__pyx_t_1, 72, __pyx_t_74);
+ __Pyx_GIVEREF(__pyx_t_75);
+ PyTuple_SET_ITEM(__pyx_t_1, 73, __pyx_t_75);
+ __Pyx_GIVEREF(__pyx_t_76);
+ PyTuple_SET_ITEM(__pyx_t_1, 74, __pyx_t_76);
+ __Pyx_GIVEREF(__pyx_t_77);
+ PyTuple_SET_ITEM(__pyx_t_1, 75, __pyx_t_77);
+ __Pyx_GIVEREF(__pyx_t_78);
+ PyTuple_SET_ITEM(__pyx_t_1, 76, __pyx_t_78);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_8 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_10 = 0;
+ __pyx_t_11 = 0;
+ __pyx_t_12 = 0;
+ __pyx_t_13 = 0;
+ __pyx_t_14 = 0;
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+ __pyx_t_17 = 0;
+ __pyx_t_18 = 0;
+ __pyx_t_19 = 0;
+ __pyx_t_20 = 0;
+ __pyx_t_21 = 0;
+ __pyx_t_22 = 0;
+ __pyx_t_23 = 0;
+ __pyx_t_24 = 0;
+ __pyx_t_25 = 0;
+ __pyx_t_26 = 0;
+ __pyx_t_27 = 0;
+ __pyx_t_28 = 0;
+ __pyx_t_29 = 0;
+ __pyx_t_30 = 0;
+ __pyx_t_31 = 0;
+ __pyx_t_32 = 0;
+ __pyx_t_33 = 0;
+ __pyx_t_34 = 0;
+ __pyx_t_35 = 0;
+ __pyx_t_36 = 0;
+ __pyx_t_37 = 0;
+ __pyx_t_38 = 0;
+ __pyx_t_39 = 0;
+ __pyx_t_40 = 0;
+ __pyx_t_41 = 0;
+ __pyx_t_42 = 0;
+ __pyx_t_43 = 0;
+ __pyx_t_44 = 0;
+ __pyx_t_45 = 0;
+ __pyx_t_46 = 0;
+ __pyx_t_47 = 0;
+ __pyx_t_48 = 0;
+ __pyx_t_49 = 0;
+ __pyx_t_50 = 0;
+ __pyx_t_51 = 0;
+ __pyx_t_52 = 0;
+ __pyx_t_53 = 0;
+ __pyx_t_54 = 0;
+ __pyx_t_55 = 0;
+ __pyx_t_56 = 0;
+ __pyx_t_57 = 0;
+ __pyx_t_58 = 0;
+ __pyx_t_59 = 0;
+ __pyx_t_60 = 0;
+ __pyx_t_61 = 0;
+ __pyx_t_62 = 0;
+ __pyx_t_63 = 0;
+ __pyx_t_64 = 0;
+ __pyx_t_65 = 0;
+ __pyx_t_66 = 0;
+ __pyx_t_67 = 0;
+ __pyx_t_68 = 0;
+ __pyx_t_69 = 0;
+ __pyx_t_70 = 0;
+ __pyx_t_71 = 0;
+ __pyx_t_72 = 0;
+ __pyx_t_73 = 0;
+ __pyx_t_74 = 0;
+ __pyx_t_75 = 0;
+ __pyx_t_76 = 0;
+ __pyx_t_77 = 0;
+ __pyx_t_78 = 0;
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_headers);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_headers, ((PyObject*)__pyx_t_1));
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":57
+ * char* PyByteArray_AsString(object)
+ *
+ * __all__ = ('HttpRequestParser', 'HttpResponseParser', # <<<<<<<<<<<<<<
+ * 'RawRequestMessage', 'RawResponseMessage')
+ *
+ */
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_tuple__19) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
+
+ /* "aiohttp/_http_parser.pyx":60
+ * 'RawRequestMessage', 'RawResponseMessage')
+ *
+ * cdef object URL = _URL # <<<<<<<<<<<<<<
+ * cdef object URL_build = URL.build
+ * cdef object CIMultiDict = _CIMultiDict
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_URL_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 60, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_URL);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_URL, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":61
+ *
+ * cdef object URL = _URL
+ * cdef object URL_build = URL.build # <<<<<<<<<<<<<<
+ * cdef object CIMultiDict = _CIMultiDict
+ * cdef object CIMultiDictProxy = _CIMultiDictProxy
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_7aiohttp_12_http_parser_URL, __pyx_n_s_build); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_URL_build);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_URL_build, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":62
+ * cdef object URL = _URL
+ * cdef object URL_build = URL.build
+ * cdef object CIMultiDict = _CIMultiDict # <<<<<<<<<<<<<<
+ * cdef object CIMultiDictProxy = _CIMultiDictProxy
+ * cdef object HttpVersion = _HttpVersion
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CIMultiDict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_CIMultiDict);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_CIMultiDict, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":63
+ * cdef object URL_build = URL.build
+ * cdef object CIMultiDict = _CIMultiDict
+ * cdef object CIMultiDictProxy = _CIMultiDictProxy # <<<<<<<<<<<<<<
+ * cdef object HttpVersion = _HttpVersion
+ * cdef object HttpVersion10 = _HttpVersion10
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_CIMultiDictProxy_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 63, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_CIMultiDictProxy);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_CIMultiDictProxy, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":64
+ * cdef object CIMultiDict = _CIMultiDict
+ * cdef object CIMultiDictProxy = _CIMultiDictProxy
+ * cdef object HttpVersion = _HttpVersion # <<<<<<<<<<<<<<
+ * cdef object HttpVersion10 = _HttpVersion10
+ * cdef object HttpVersion11 = _HttpVersion11
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_HttpVersion_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_HttpVersion);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_HttpVersion, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":65
+ * cdef object CIMultiDictProxy = _CIMultiDictProxy
+ * cdef object HttpVersion = _HttpVersion
+ * cdef object HttpVersion10 = _HttpVersion10 # <<<<<<<<<<<<<<
+ * cdef object HttpVersion11 = _HttpVersion11
+ * cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_HttpVersion10_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_HttpVersion10);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_HttpVersion10, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":66
+ * cdef object HttpVersion = _HttpVersion
+ * cdef object HttpVersion10 = _HttpVersion10
+ * cdef object HttpVersion11 = _HttpVersion11 # <<<<<<<<<<<<<<
+ * cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1
+ * cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_HttpVersion11_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_HttpVersion11);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_HttpVersion11, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":67
+ * cdef object HttpVersion10 = _HttpVersion10
+ * cdef object HttpVersion11 = _HttpVersion11
+ * cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1 # <<<<<<<<<<<<<<
+ * cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING
+ * cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_78 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_SEC_WEBSOCKET_KEY1); if (unlikely(!__pyx_t_78)) __PYX_ERR(0, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_78);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_SEC_WEBSOCKET_KEY1);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_SEC_WEBSOCKET_KEY1, __pyx_t_78);
+ __Pyx_GIVEREF(__pyx_t_78);
+ __pyx_t_78 = 0;
+
+ /* "aiohttp/_http_parser.pyx":68
+ * cdef object HttpVersion11 = _HttpVersion11
+ * cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1
+ * cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING # <<<<<<<<<<<<<<
+ * cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD
+ * cdef object StreamReader = _StreamReader
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_78, __pyx_n_s_hdrs); if (unlikely(!__pyx_t_78)) __PYX_ERR(0, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_78);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_78, __pyx_n_s_CONTENT_ENCODING); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_78); __pyx_t_78 = 0;
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_CONTENT_ENCODING);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_CONTENT_ENCODING, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":69
+ * cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1
+ * cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING
+ * cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD # <<<<<<<<<<<<<<
+ * cdef object StreamReader = _StreamReader
+ * cdef object DeflateBuffer = _DeflateBuffer
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_EMPTY_PAYLOAD_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_EMPTY_PAYLOAD);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_EMPTY_PAYLOAD, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":70
+ * cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING
+ * cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD
+ * cdef object StreamReader = _StreamReader # <<<<<<<<<<<<<<
+ * cdef object DeflateBuffer = _DeflateBuffer
+ *
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_StreamReader_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_StreamReader);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_StreamReader, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":71
+ * cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD
+ * cdef object StreamReader = _StreamReader
+ * cdef object DeflateBuffer = _DeflateBuffer # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_DeflateBuffer_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser_DeflateBuffer);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser_DeflateBuffer, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":85
+ * DEF METHODS_COUNT = 46;
+ *
+ * cdef list _http_method = [] # <<<<<<<<<<<<<<
+ *
+ * for i in range(METHODS_COUNT):
+ */
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_parser__http_method);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_parser__http_method, ((PyObject*)__pyx_t_1));
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":87
+ * cdef list _http_method = []
+ *
+ * for i in range(METHODS_COUNT): # <<<<<<<<<<<<<<
+ * _http_method.append(
+ * cparser.llhttp_method_name(<cparser.llhttp_method_t> i).decode('ascii'))
+ */
+ for (__pyx_t_79 = 0; __pyx_t_79 < 46; __pyx_t_79+=1) {
+ __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_79); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_i, __pyx_t_1) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":88
+ *
+ * for i in range(METHODS_COUNT):
+ * _http_method.append( # <<<<<<<<<<<<<<
+ * cparser.llhttp_method_name(<cparser.llhttp_method_t> i).decode('ascii'))
+ *
+ */
+ if (unlikely(__pyx_v_7aiohttp_12_http_parser__http_method == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
+ __PYX_ERR(0, 88, __pyx_L1_error)
+ }
+
+ /* "aiohttp/_http_parser.pyx":89
+ * for i in range(METHODS_COUNT):
+ * _http_method.append(
+ * cparser.llhttp_method_name(<cparser.llhttp_method_t> i).decode('ascii')) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_80 = ((enum llhttp_method)__Pyx_PyInt_As_enum__llhttp_method(__pyx_t_1)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 89, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_81 = llhttp_method_name(((llhttp_method_t)__pyx_t_80));
+ __pyx_t_1 = __Pyx_decode_c_string(__pyx_t_81, 0, strlen(__pyx_t_81), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+
+ /* "aiohttp/_http_parser.pyx":88
+ *
+ * for i in range(METHODS_COUNT):
+ * _http_method.append( # <<<<<<<<<<<<<<
+ * cparser.llhttp_method_name(<cparser.llhttp_method_t> i).decode('ascii'))
+ *
+ */
+ __pyx_t_82 = __Pyx_PyList_Append(__pyx_v_7aiohttp_12_http_parser__http_method, __pyx_t_1); if (unlikely(__pyx_t_82 == ((int)-1))) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_RawRequestMessage(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * cdef object __pyx_PickleError
+ * cdef object __pyx_result
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7aiohttp_12_http_parser_1__pyx_unpickle_RawRequestMessage, NULL, __pyx_n_s_aiohttp__http_parser); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_RawRequestMessage, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":11
+ * __pyx_unpickle_RawRequestMessage__set_state(<RawRequestMessage> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_RawRequestMessage__set_state(RawRequestMessage __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.chunked = __pyx_state[0]; __pyx_result.compression = __pyx_state[1]; __pyx_result.headers = __pyx_state[2]; __pyx_result.method = __pyx_state[3]; __pyx_result.path = __pyx_state[4]; __pyx_result.raw_headers = __pyx_state[5]; __pyx_result.should_close = __pyx_state[6]; __pyx_result.upgrade = __pyx_state[7]; __pyx_result.url = __pyx_state[8]; __pyx_result.version = __pyx_state[9]
+ * if len(__pyx_state) > 10 and hasattr(__pyx_result, '__dict__'):
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7aiohttp_12_http_parser_3__pyx_unpickle_RawResponseMessage, NULL, __pyx_n_s_aiohttp__http_parser); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_RawResponseMessag, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_parser.pyx":1
+ * #cython: language_level=3 # <<<<<<<<<<<<<<
+ * #
+ * # Based on https://github.com/MagicStack/httptools
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_XDECREF(__pyx_t_12);
+ __Pyx_XDECREF(__pyx_t_13);
+ __Pyx_XDECREF(__pyx_t_14);
+ __Pyx_XDECREF(__pyx_t_15);
+ __Pyx_XDECREF(__pyx_t_16);
+ __Pyx_XDECREF(__pyx_t_17);
+ __Pyx_XDECREF(__pyx_t_18);
+ __Pyx_XDECREF(__pyx_t_19);
+ __Pyx_XDECREF(__pyx_t_20);
+ __Pyx_XDECREF(__pyx_t_21);
+ __Pyx_XDECREF(__pyx_t_22);
+ __Pyx_XDECREF(__pyx_t_23);
+ __Pyx_XDECREF(__pyx_t_24);
+ __Pyx_XDECREF(__pyx_t_25);
+ __Pyx_XDECREF(__pyx_t_26);
+ __Pyx_XDECREF(__pyx_t_27);
+ __Pyx_XDECREF(__pyx_t_28);
+ __Pyx_XDECREF(__pyx_t_29);
+ __Pyx_XDECREF(__pyx_t_30);
+ __Pyx_XDECREF(__pyx_t_31);
+ __Pyx_XDECREF(__pyx_t_32);
+ __Pyx_XDECREF(__pyx_t_33);
+ __Pyx_XDECREF(__pyx_t_34);
+ __Pyx_XDECREF(__pyx_t_35);
+ __Pyx_XDECREF(__pyx_t_36);
+ __Pyx_XDECREF(__pyx_t_37);
+ __Pyx_XDECREF(__pyx_t_38);
+ __Pyx_XDECREF(__pyx_t_39);
+ __Pyx_XDECREF(__pyx_t_40);
+ __Pyx_XDECREF(__pyx_t_41);
+ __Pyx_XDECREF(__pyx_t_42);
+ __Pyx_XDECREF(__pyx_t_43);
+ __Pyx_XDECREF(__pyx_t_44);
+ __Pyx_XDECREF(__pyx_t_45);
+ __Pyx_XDECREF(__pyx_t_46);
+ __Pyx_XDECREF(__pyx_t_47);
+ __Pyx_XDECREF(__pyx_t_48);
+ __Pyx_XDECREF(__pyx_t_49);
+ __Pyx_XDECREF(__pyx_t_50);
+ __Pyx_XDECREF(__pyx_t_51);
+ __Pyx_XDECREF(__pyx_t_52);
+ __Pyx_XDECREF(__pyx_t_53);
+ __Pyx_XDECREF(__pyx_t_54);
+ __Pyx_XDECREF(__pyx_t_55);
+ __Pyx_XDECREF(__pyx_t_56);
+ __Pyx_XDECREF(__pyx_t_57);
+ __Pyx_XDECREF(__pyx_t_58);
+ __Pyx_XDECREF(__pyx_t_59);
+ __Pyx_XDECREF(__pyx_t_60);
+ __Pyx_XDECREF(__pyx_t_61);
+ __Pyx_XDECREF(__pyx_t_62);
+ __Pyx_XDECREF(__pyx_t_63);
+ __Pyx_XDECREF(__pyx_t_64);
+ __Pyx_XDECREF(__pyx_t_65);
+ __Pyx_XDECREF(__pyx_t_66);
+ __Pyx_XDECREF(__pyx_t_67);
+ __Pyx_XDECREF(__pyx_t_68);
+ __Pyx_XDECREF(__pyx_t_69);
+ __Pyx_XDECREF(__pyx_t_70);
+ __Pyx_XDECREF(__pyx_t_71);
+ __Pyx_XDECREF(__pyx_t_72);
+ __Pyx_XDECREF(__pyx_t_73);
+ __Pyx_XDECREF(__pyx_t_74);
+ __Pyx_XDECREF(__pyx_t_75);
+ __Pyx_XDECREF(__pyx_t_76);
+ __Pyx_XDECREF(__pyx_t_77);
+ __Pyx_XDECREF(__pyx_t_78);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init aiohttp._http_parser", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_CLEAR(__pyx_m);
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init aiohttp._http_parser");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ return (__pyx_m != NULL) ? 0 : -1;
+ #elif PY_MAJOR_VERSION >= 3
+ return __pyx_m;
+ #else
+ return;
+ #endif
+}
+
+/* --- Runtime support code --- */
+/* Refnanny */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule(modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, "RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+/* PyObjectGetAttrStr */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#endif
+
+/* GetBuiltinName */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+/* GetItemInt */
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+ PyObject *r;
+ if (!j) return NULL;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ return r;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ Py_ssize_t wrapped_i = i;
+ if (wraparound & unlikely(i < 0)) {
+ wrapped_i += PyList_GET_SIZE(o);
+ }
+ if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
+ PyObject *r = PyList_GET_ITEM(o, wrapped_i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ Py_ssize_t wrapped_i = i;
+ if (wraparound & unlikely(i < 0)) {
+ wrapped_i += PyTuple_GET_SIZE(o);
+ }
+ if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
+ if (is_list || PyList_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
+ if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
+ PyObject *r = PyList_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ else if (PyTuple_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ } else {
+ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+ if (likely(m && m->sq_item)) {
+ if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+ Py_ssize_t l = m->sq_length(o);
+ if (likely(l >= 0)) {
+ i += l;
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ return NULL;
+ PyErr_Clear();
+ }
+ }
+ return m->sq_item(o, i);
+ }
+ }
+#else
+ if (is_list || PySequence_Check(o)) {
+ return PySequence_GetItem(o, i);
+ }
+#endif
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+/* decode_c_bytes */
+static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
+ const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ if (unlikely((start < 0) | (stop < 0))) {
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ if (stop > length)
+ stop = length;
+ if (unlikely(stop <= start))
+ return __Pyx_NewRef(__pyx_empty_unicode);
+ length = stop - start;
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+/* RaiseArgTupleInvalid */
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+/* RaiseDoubleKeywords */
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+/* ParseKeywords */
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+/* None */
+static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
+ PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
+}
+
+/* RaiseTooManyValuesToUnpack */
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+ PyErr_Format(PyExc_ValueError,
+ "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
+}
+
+/* RaiseNeedMoreValuesToUnpack */
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+ PyErr_Format(PyExc_ValueError,
+ "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
+ index, (index == 1) ? "" : "s");
+}
+
+/* IterFinish */
+static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_FAST_THREAD_STATE
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject* exc_type = tstate->curexc_type;
+ if (unlikely(exc_type)) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
+ PyObject *exc_value, *exc_tb;
+ exc_value = tstate->curexc_value;
+ exc_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+ Py_DECREF(exc_type);
+ Py_XDECREF(exc_value);
+ Py_XDECREF(exc_tb);
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#else
+ if (unlikely(PyErr_Occurred())) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#endif
+}
+
+/* UnpackItemEndCheck */
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+ if (unlikely(retval)) {
+ Py_DECREF(retval);
+ __Pyx_RaiseTooManyValuesError(expected);
+ return -1;
+ } else {
+ return __Pyx_IterFinish();
+ }
+ return 0;
+}
+
+/* KeywordStringCheck */
+static int __Pyx_CheckKeywordStrings(
+ PyObject *kwdict,
+ const char* function_name,
+ int kw_allowed)
+{
+ PyObject* key = 0;
+ Py_ssize_t pos = 0;
+#if CYTHON_COMPILING_IN_PYPY
+ if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
+ goto invalid_keyword;
+ return 1;
+#else
+ while (PyDict_Next(kwdict, &pos, &key, 0)) {
+ #if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyString_Check(key)))
+ #endif
+ if (unlikely(!PyUnicode_Check(key)))
+ goto invalid_keyword_type;
+ }
+ if ((!kw_allowed) && unlikely(key))
+ goto invalid_keyword;
+ return 1;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ return 0;
+#endif
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+ return 0;
+}
+
+/* ExtTypeTest */
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (likely(__Pyx_TypeCheck(obj, type)))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+ Py_TYPE(obj)->tp_name, type->tp_name);
+ return 0;
+}
+
+/* DictGetItem */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
+ PyObject *value;
+ value = PyDict_GetItemWithError(d, key);
+ if (unlikely(!value)) {
+ if (!PyErr_Occurred()) {
+ if (unlikely(PyTuple_Check(key))) {
+ PyObject* args = PyTuple_Pack(1, key);
+ if (likely(args)) {
+ PyErr_SetObject(PyExc_KeyError, args);
+ Py_DECREF(args);
+ }
+ } else {
+ PyErr_SetObject(PyExc_KeyError, key);
+ }
+ }
+ return NULL;
+ }
+ Py_INCREF(value);
+ return value;
+}
+#endif
+
+/* PyErrExceptionMatches */
+#if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ if (unlikely(PyTuple_Check(err)))
+ return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+ return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
+}
+#endif
+
+/* PyErrFetchRestore */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+}
+#endif
+
+/* GetAttr */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_USE_TYPE_SLOTS
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+/* GetAttr3 */
+static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+ return NULL;
+ __Pyx_PyErr_Clear();
+ Py_INCREF(d);
+ return d;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
+ PyObject *r = __Pyx_GetAttr(o, n);
+ return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
+}
+
+/* PyDictVersioning */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
+ PyObject **dictptr = NULL;
+ Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
+ if (offset) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
+#else
+ dictptr = _PyObject_GetDictPtr(obj);
+#endif
+ }
+ return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
+}
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
+ return 0;
+ return obj_dict_version == __Pyx_get_object_dict_version(obj);
+}
+#endif
+
+/* GetModuleGlobalName */
+#if CYTHON_USE_DICT_VERSIONS
+static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
+#else
+static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
+#endif
+{
+ PyObject *result;
+#if !CYTHON_AVOID_BORROWED_REFS
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
+ result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ } else if (unlikely(PyErr_Occurred())) {
+ return NULL;
+ }
+#else
+ result = PyDict_GetItem(__pyx_d, name);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ }
+#endif
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ }
+ PyErr_Clear();
+#endif
+ return __Pyx_GetBuiltinName(name);
+}
+
+/* PyFunctionFastCall */
+#if CYTHON_FAST_PYCALL
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, (int)nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, (int)nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif
+#endif
+
+/* PyObjectCall */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = Py_TYPE(func)->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallMethO */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallNoArg */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, NULL, 0);
+ }
+#endif
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
+#else
+ if (likely(PyCFunction_Check(func)))
+#endif
+ {
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+/* PyCFunctionFastCall */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ int flags = PyCFunction_GET_FLAGS(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
+ return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
+ } else {
+ return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
+ }
+}
+#endif
+
+/* PyObjectCallOneArg */
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
+ if (likely(PyCFunction_Check(func))) {
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (__Pyx_PyFastCFunction_Check(func)) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+#endif
+
+/* PyObjectCall2Args */
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
+ PyObject *args, *result = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(function)) {
+ PyObject *args[2] = {arg1, arg2};
+ return __Pyx_PyFunction_FastCall(function, args, 2);
+ }
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(function)) {
+ PyObject *args[2] = {arg1, arg2};
+ return __Pyx_PyCFunction_FastCall(function, args, 2);
+ }
+ #endif
+ args = PyTuple_New(2);
+ if (unlikely(!args)) goto done;
+ Py_INCREF(arg1);
+ PyTuple_SET_ITEM(args, 0, arg1);
+ Py_INCREF(arg2);
+ PyTuple_SET_ITEM(args, 1, arg2);
+ Py_INCREF(function);
+ result = __Pyx_PyObject_Call(function, args, NULL);
+ Py_DECREF(args);
+ Py_DECREF(function);
+done:
+ return result;
+}
+
+/* RaiseException */
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
+ instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+ if (cause) {
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+/* BytesEquals */
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+ if (s1 == s2) {
+ return (equals == Py_EQ);
+ } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
+ const char *ps1, *ps2;
+ Py_ssize_t length = PyBytes_GET_SIZE(s1);
+ if (length != PyBytes_GET_SIZE(s2))
+ return (equals == Py_NE);
+ ps1 = PyBytes_AS_STRING(s1);
+ ps2 = PyBytes_AS_STRING(s2);
+ if (ps1[0] != ps2[0]) {
+ return (equals == Py_NE);
+ } else if (length == 1) {
+ return (equals == Py_EQ);
+ } else {
+ int result;
+#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
+ Py_hash_t hash1, hash2;
+ hash1 = ((PyBytesObject*)s1)->ob_shash;
+ hash2 = ((PyBytesObject*)s2)->ob_shash;
+ if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
+ return (equals == Py_NE);
+ }
+#endif
+ result = memcmp(ps1, ps2, (size_t)length);
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
+ return (equals == Py_NE);
+ } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
+ return (equals == Py_NE);
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+#endif
+}
+
+/* UnicodeEquals */
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+#if PY_MAJOR_VERSION < 3
+ PyObject* owned_ref = NULL;
+#endif
+ int s1_is_unicode, s2_is_unicode;
+ if (s1 == s2) {
+ goto return_eq;
+ }
+ s1_is_unicode = PyUnicode_CheckExact(s1);
+ s2_is_unicode = PyUnicode_CheckExact(s2);
+#if PY_MAJOR_VERSION < 3
+ if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
+ owned_ref = PyUnicode_FromObject(s2);
+ if (unlikely(!owned_ref))
+ return -1;
+ s2 = owned_ref;
+ s2_is_unicode = 1;
+ } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
+ owned_ref = PyUnicode_FromObject(s1);
+ if (unlikely(!owned_ref))
+ return -1;
+ s1 = owned_ref;
+ s1_is_unicode = 1;
+ } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
+ return __Pyx_PyBytes_Equals(s1, s2, equals);
+ }
+#endif
+ if (s1_is_unicode & s2_is_unicode) {
+ Py_ssize_t length;
+ int kind;
+ void *data1, *data2;
+ if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
+ return -1;
+ length = __Pyx_PyUnicode_GET_LENGTH(s1);
+ if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
+ goto return_ne;
+ }
+#if CYTHON_USE_UNICODE_INTERNALS
+ {
+ Py_hash_t hash1, hash2;
+ #if CYTHON_PEP393_ENABLED
+ hash1 = ((PyASCIIObject*)s1)->hash;
+ hash2 = ((PyASCIIObject*)s2)->hash;
+ #else
+ hash1 = ((PyUnicodeObject*)s1)->hash;
+ hash2 = ((PyUnicodeObject*)s2)->hash;
+ #endif
+ if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
+ goto return_ne;
+ }
+ }
+#endif
+ kind = __Pyx_PyUnicode_KIND(s1);
+ if (kind != __Pyx_PyUnicode_KIND(s2)) {
+ goto return_ne;
+ }
+ data1 = __Pyx_PyUnicode_DATA(s1);
+ data2 = __Pyx_PyUnicode_DATA(s2);
+ if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
+ goto return_ne;
+ } else if (length == 1) {
+ goto return_eq;
+ } else {
+ int result = memcmp(data1, data2, (size_t)(length * kind));
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & s2_is_unicode) {
+ goto return_ne;
+ } else if ((s2 == Py_None) & s1_is_unicode) {
+ goto return_ne;
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+return_eq:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ);
+return_ne:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_NE);
+#endif
+}
+
+/* SliceObject */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
+ Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
+ int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
+#if CYTHON_USE_TYPE_SLOTS
+ PyMappingMethods* mp;
+#if PY_MAJOR_VERSION < 3
+ PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
+ if (likely(ms && ms->sq_slice)) {
+ if (!has_cstart) {
+ if (_py_start && (*_py_start != Py_None)) {
+ cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
+ if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstart = 0;
+ }
+ if (!has_cstop) {
+ if (_py_stop && (*_py_stop != Py_None)) {
+ cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
+ if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstop = PY_SSIZE_T_MAX;
+ }
+ if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
+ Py_ssize_t l = ms->sq_length(obj);
+ if (likely(l >= 0)) {
+ if (cstop < 0) {
+ cstop += l;
+ if (cstop < 0) cstop = 0;
+ }
+ if (cstart < 0) {
+ cstart += l;
+ if (cstart < 0) cstart = 0;
+ }
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ return ms->sq_slice(obj, cstart, cstop);
+ }
+#endif
+ mp = Py_TYPE(obj)->tp_as_mapping;
+ if (likely(mp && mp->mp_subscript))
+#endif
+ {
+ PyObject* result;
+ PyObject *py_slice, *py_start, *py_stop;
+ if (_py_slice) {
+ py_slice = *_py_slice;
+ } else {
+ PyObject* owned_start = NULL;
+ PyObject* owned_stop = NULL;
+ if (_py_start) {
+ py_start = *_py_start;
+ } else {
+ if (has_cstart) {
+ owned_start = py_start = PyInt_FromSsize_t(cstart);
+ if (unlikely(!py_start)) goto bad;
+ } else
+ py_start = Py_None;
+ }
+ if (_py_stop) {
+ py_stop = *_py_stop;
+ } else {
+ if (has_cstop) {
+ owned_stop = py_stop = PyInt_FromSsize_t(cstop);
+ if (unlikely(!py_stop)) {
+ Py_XDECREF(owned_start);
+ goto bad;
+ }
+ } else
+ py_stop = Py_None;
+ }
+ py_slice = PySlice_New(py_start, py_stop, Py_None);
+ Py_XDECREF(owned_start);
+ Py_XDECREF(owned_stop);
+ if (unlikely(!py_slice)) goto bad;
+ }
+#if CYTHON_USE_TYPE_SLOTS
+ result = mp->mp_subscript(obj, py_slice);
+#else
+ result = PyObject_GetItem(obj, py_slice);
+#endif
+ if (!_py_slice) {
+ Py_DECREF(py_slice);
+ }
+ return result;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
+bad:
+ return NULL;
+}
+
+/* GetItemIntUnicode */
+static CYTHON_INLINE Py_UCS4 __Pyx_GetItemInt_Unicode_Fast(PyObject* ustring, Py_ssize_t i,
+ int wraparound, int boundscheck) {
+ Py_ssize_t length;
+ if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return (Py_UCS4)-1;
+ if (wraparound | boundscheck) {
+ length = __Pyx_PyUnicode_GET_LENGTH(ustring);
+ if (wraparound & unlikely(i < 0)) i += length;
+ if ((!boundscheck) || likely(__Pyx_is_valid_index(i, length))) {
+ return __Pyx_PyUnicode_READ_CHAR(ustring, i);
+ } else {
+ PyErr_SetString(PyExc_IndexError, "string index out of range");
+ return (Py_UCS4)-1;
+ }
+ } else {
+ return __Pyx_PyUnicode_READ_CHAR(ustring, i);
+ }
+}
+
+/* PyUnicode_Substring */
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_Substring(
+ PyObject* text, Py_ssize_t start, Py_ssize_t stop) {
+ Py_ssize_t length;
+ if (unlikely(__Pyx_PyUnicode_READY(text) == -1)) return NULL;
+ length = __Pyx_PyUnicode_GET_LENGTH(text);
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ else if (stop > length)
+ stop = length;
+ if (stop <= start)
+ return __Pyx_NewRef(__pyx_empty_unicode);
+#if CYTHON_PEP393_ENABLED
+ return PyUnicode_FromKindAndData(PyUnicode_KIND(text),
+ PyUnicode_1BYTE_DATA(text) + start*PyUnicode_KIND(text), stop-start);
+#else
+ return PyUnicode_FromUnicode(PyUnicode_AS_UNICODE(text)+start, stop-start);
+#endif
+}
+
+/* GetException */
+#if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
+#endif
+{
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_FAST_THREAD_STATE
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ #if CYTHON_USE_EXC_INFO_STACK
+ {
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ tmp_type = exc_info->exc_type;
+ tmp_value = exc_info->exc_value;
+ tmp_tb = exc_info->exc_traceback;
+ exc_info->exc_type = local_type;
+ exc_info->exc_value = local_value;
+ exc_info->exc_traceback = local_tb;
+ }
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+/* SwapException */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ tmp_type = exc_info->exc_type;
+ tmp_value = exc_info->exc_value;
+ tmp_tb = exc_info->exc_traceback;
+ exc_info->exc_type = *type;
+ exc_info->exc_value = *value;
+ exc_info->exc_traceback = *tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+ #endif
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+#endif
+
+/* GetTopmostException */
+#if CYTHON_USE_EXC_INFO_STACK
+static _PyErr_StackItem *
+__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
+{
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
+ exc_info->previous_item != NULL)
+ {
+ exc_info = exc_info->previous_item;
+ }
+ return exc_info;
+}
+#endif
+
+/* SaveResetException */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
+ *type = exc_info->exc_type;
+ *value = exc_info->exc_value;
+ *tb = exc_info->exc_traceback;
+ #else
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ #endif
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ tmp_type = exc_info->exc_type;
+ tmp_value = exc_info->exc_value;
+ tmp_tb = exc_info->exc_traceback;
+ exc_info->exc_type = type;
+ exc_info->exc_value = value;
+ exc_info->exc_traceback = tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+#endif
+
+/* Import */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* ImportFrom */
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+/* HasAttr */
+static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
+ PyObject *r;
+ if (unlikely(!__Pyx_PyBaseString_Check(n))) {
+ PyErr_SetString(PyExc_TypeError,
+ "hasattr(): attribute name must be string");
+ return -1;
+ }
+ r = __Pyx_GetAttr(o, n);
+ if (unlikely(!r)) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ Py_DECREF(r);
+ return 1;
+ }
+}
+
+/* PyObject_GenericGetAttrNoDict */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
+ PyErr_Format(PyExc_AttributeError,
+#if PY_MAJOR_VERSION >= 3
+ "'%.50s' object has no attribute '%U'",
+ tp->tp_name, attr_name);
+#else
+ "'%.50s' object has no attribute '%.400s'",
+ tp->tp_name, PyString_AS_STRING(attr_name));
+#endif
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
+ PyObject *descr;
+ PyTypeObject *tp = Py_TYPE(obj);
+ if (unlikely(!PyString_Check(attr_name))) {
+ return PyObject_GenericGetAttr(obj, attr_name);
+ }
+ assert(!tp->tp_dictoffset);
+ descr = _PyType_Lookup(tp, attr_name);
+ if (unlikely(!descr)) {
+ return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
+ }
+ Py_INCREF(descr);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
+ #endif
+ {
+ descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
+ if (unlikely(f)) {
+ PyObject *res = f(descr, obj, (PyObject *)tp);
+ Py_DECREF(descr);
+ return res;
+ }
+ }
+ return descr;
+}
+#endif
+
+/* PyObject_GenericGetAttr */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
+ if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
+ return PyObject_GenericGetAttr(obj, attr_name);
+ }
+ return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
+}
+#endif
+
+/* PyObjectGetAttrStrNoError */
+static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+ __Pyx_PyErr_Clear();
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
+ PyObject *result;
+#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
+ return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
+ }
+#endif
+ result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
+ if (unlikely(!result)) {
+ __Pyx_PyObject_GetAttrStr_ClearAttributeError();
+ }
+ return result;
+}
+
+/* SetupReduce */
+static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
+ int ret;
+ PyObject *name_attr;
+ name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
+ if (likely(name_attr)) {
+ ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
+ } else {
+ ret = -1;
+ }
+ if (unlikely(ret < 0)) {
+ PyErr_Clear();
+ ret = 0;
+ }
+ Py_XDECREF(name_attr);
+ return ret;
+}
+static int __Pyx_setup_reduce(PyObject* type_obj) {
+ int ret = 0;
+ PyObject *object_reduce = NULL;
+ PyObject *object_getstate = NULL;
+ PyObject *object_reduce_ex = NULL;
+ PyObject *reduce = NULL;
+ PyObject *reduce_ex = NULL;
+ PyObject *reduce_cython = NULL;
+ PyObject *setstate = NULL;
+ PyObject *setstate_cython = NULL;
+ PyObject *getstate = NULL;
+#if CYTHON_USE_PYTYPE_LOOKUP
+ getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
+#else
+ getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
+ if (!getstate && PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
+#endif
+ if (getstate) {
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
+#else
+ object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
+ if (!object_getstate && PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
+#endif
+ if (object_getstate != getstate) {
+ goto __PYX_GOOD;
+ }
+ }
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
+#else
+ object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
+#endif
+ reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
+ if (reduce_ex == object_reduce_ex) {
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
+#else
+ object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
+#endif
+ reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
+ if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
+ reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
+ if (likely(reduce_cython)) {
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ } else if (reduce == object_reduce || PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
+ setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
+ if (!setstate) PyErr_Clear();
+ if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
+ setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
+ if (likely(setstate_cython)) {
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
+ } else if (!setstate || PyErr_Occurred()) {
+ goto __PYX_BAD;
+ }
+ }
+ PyType_Modified((PyTypeObject*)type_obj);
+ }
+ }
+ goto __PYX_GOOD;
+__PYX_BAD:
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
+ ret = -1;
+__PYX_GOOD:
+#if !CYTHON_USE_PYTYPE_LOOKUP
+ Py_XDECREF(object_reduce);
+ Py_XDECREF(object_reduce_ex);
+ Py_XDECREF(object_getstate);
+ Py_XDECREF(getstate);
+#endif
+ Py_XDECREF(reduce);
+ Py_XDECREF(reduce_ex);
+ Py_XDECREF(reduce_cython);
+ Py_XDECREF(setstate);
+ Py_XDECREF(setstate_cython);
+ return ret;
+}
+
+/* SetVTable */
+static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+/* TypeImport */
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
+ size_t size, enum __Pyx_ImportType_CheckSize check_size)
+{
+ PyObject *result = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ result = PyObject_GetAttrString(module, class_name);
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if ((size_t)basicsize < size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ goto bad;
+ }
+ if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ goto bad;
+ }
+ else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+/* decode_c_string */
+static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
+ const char* cstring, Py_ssize_t start, Py_ssize_t stop,
+ const char* encoding, const char* errors,
+ PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
+ Py_ssize_t length;
+ if (unlikely((start < 0) | (stop < 0))) {
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ if (unlikely(stop <= start))
+ return __Pyx_NewRef(__pyx_empty_unicode);
+ length = stop - start;
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+/* CLineInTraceback */
+#ifndef CYTHON_CLINE_IN_TRACEBACK
+static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
+ PyObject *use_cline;
+ PyObject *ptype, *pvalue, *ptraceback;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject **cython_runtime_dict;
+#endif
+ if (unlikely(!__pyx_cython_runtime)) {
+ return c_line;
+ }
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+#if CYTHON_COMPILING_IN_CPYTHON
+ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
+ if (likely(cython_runtime_dict)) {
+ __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
+ use_cline, *cython_runtime_dict,
+ __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
+ } else
+#endif
+ {
+ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
+ if (use_cline_obj) {
+ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
+ Py_DECREF(use_cline_obj);
+ } else {
+ PyErr_Clear();
+ use_cline = NULL;
+ }
+ }
+ if (!use_cline) {
+ c_line = 0;
+ (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
+ }
+ else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
+ c_line = 0;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ return c_line;
+}
+#endif
+
+/* CodeObjectCache */
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = start + (end - start) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+/* AddTraceback */
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = NULL;
+ PyObject *py_funcname = NULL;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_srcfile = NULL;
+ py_srcfile = PyString_FromString(filename);
+ if (!py_srcfile) goto bad;
+ #endif
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ if (!py_funcname) goto bad;
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ if (!py_funcname) goto bad;
+ funcname = PyUnicode_AsUTF8(py_funcname);
+ if (!funcname) goto bad;
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ if (!py_funcname) goto bad;
+ #endif
+ }
+ #if PY_MAJOR_VERSION < 3
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ #else
+ py_code = PyCode_NewEmpty(filename, funcname, py_line);
+ #endif
+ Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
+ return py_code;
+bad:
+ Py_XDECREF(py_funcname);
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_srcfile);
+ #endif
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject *ptype, *pvalue, *ptraceback;
+ if (c_line) {
+ c_line = __Pyx_CLineForTraceback(tstate, c_line);
+ }
+ py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
+ if (!py_code) {
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) {
+ /* If the code object creation fails, then we should clear the
+ fetched exception references and propagate the new exception */
+ Py_XDECREF(ptype);
+ Py_XDECREF(pvalue);
+ Py_XDECREF(ptraceback);
+ goto bad;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ tstate, /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+/* CIntFromPyVerify */
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntToPy */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const int neg_one = (int) -1, const_zero = (int) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntFromPy */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const int neg_one = (int) -1, const_zero = (int) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+/* CIntFromPy */
+static CYTHON_INLINE enum llhttp_method __Pyx_PyInt_As_enum__llhttp_method(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const enum llhttp_method neg_one = (enum llhttp_method) -1, const_zero = (enum llhttp_method) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(enum llhttp_method) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (enum llhttp_method) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (enum llhttp_method) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(enum llhttp_method, digit, digits[0])
+ case 2:
+ if (8 * sizeof(enum llhttp_method) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) >= 2 * PyLong_SHIFT) {
+ return (enum llhttp_method) (((((enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(enum llhttp_method) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) >= 3 * PyLong_SHIFT) {
+ return (enum llhttp_method) (((((((enum llhttp_method)digits[2]) << PyLong_SHIFT) | (enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(enum llhttp_method) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) >= 4 * PyLong_SHIFT) {
+ return (enum llhttp_method) (((((((((enum llhttp_method)digits[3]) << PyLong_SHIFT) | (enum llhttp_method)digits[2]) << PyLong_SHIFT) | (enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (enum llhttp_method) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(enum llhttp_method) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(enum llhttp_method, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum llhttp_method) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(enum llhttp_method, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (enum llhttp_method) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(enum llhttp_method, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(enum llhttp_method, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(enum llhttp_method) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) - 1 > 2 * PyLong_SHIFT) {
+ return (enum llhttp_method) (((enum llhttp_method)-1)*(((((enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(enum llhttp_method) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) - 1 > 2 * PyLong_SHIFT) {
+ return (enum llhttp_method) ((((((enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(enum llhttp_method) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) - 1 > 3 * PyLong_SHIFT) {
+ return (enum llhttp_method) (((enum llhttp_method)-1)*(((((((enum llhttp_method)digits[2]) << PyLong_SHIFT) | (enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(enum llhttp_method) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) - 1 > 3 * PyLong_SHIFT) {
+ return (enum llhttp_method) ((((((((enum llhttp_method)digits[2]) << PyLong_SHIFT) | (enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(enum llhttp_method) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) - 1 > 4 * PyLong_SHIFT) {
+ return (enum llhttp_method) (((enum llhttp_method)-1)*(((((((((enum llhttp_method)digits[3]) << PyLong_SHIFT) | (enum llhttp_method)digits[2]) << PyLong_SHIFT) | (enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(enum llhttp_method) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(enum llhttp_method, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(enum llhttp_method) - 1 > 4 * PyLong_SHIFT) {
+ return (enum llhttp_method) ((((((((((enum llhttp_method)digits[3]) << PyLong_SHIFT) | (enum llhttp_method)digits[2]) << PyLong_SHIFT) | (enum llhttp_method)digits[1]) << PyLong_SHIFT) | (enum llhttp_method)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(enum llhttp_method) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(enum llhttp_method, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum llhttp_method) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(enum llhttp_method, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ enum llhttp_method val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (enum llhttp_method) -1;
+ }
+ } else {
+ enum llhttp_method val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (enum llhttp_method) -1;
+ val = __Pyx_PyInt_As_enum__llhttp_method(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to enum llhttp_method");
+ return (enum llhttp_method) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to enum llhttp_method");
+ return (enum llhttp_method) -1;
+}
+
+/* CIntFromPy */
+static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(size_t) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (size_t) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (size_t) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
+ case 2:
+ if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
+ return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
+ return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
+ return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (size_t) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(size_t) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (size_t) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
+ return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
+ return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(size_t) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ size_t val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (size_t) -1;
+ }
+ } else {
+ size_t val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (size_t) -1;
+ val = __Pyx_PyInt_As_size_t(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to size_t");
+ return (size_t) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to size_t");
+ return (size_t) -1;
+}
+
+/* CIntFromPy */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const long neg_one = (long) -1, const_zero = (long) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+/* CIntToPy */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint8_t(uint8_t value) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(uint8_t) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(uint8_t) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntToPy */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const long neg_one = (long) -1, const_zero = (long) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* FastTypeChecks */
+#if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+ while (a) {
+ a = a->tp_base;
+ if (a == b)
+ return 1;
+ }
+ return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+ PyObject *mro;
+ if (a == b) return 1;
+ mro = a->tp_mro;
+ if (likely(mro)) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(mro);
+ for (i = 0; i < n; i++) {
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+ return 1;
+ }
+ return 0;
+ }
+ return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+ PyObject *exception, *value, *tb;
+ int res;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&exception, &value, &tb);
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ if (!res) {
+ res = PyObject_IsSubclass(err, exc_type2);
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ }
+ __Pyx_ErrRestore(exception, value, tb);
+ return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+ if (!res) {
+ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+ }
+ return res;
+}
+#endif
+static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ assert(PyExceptionClass_Check(exc_type));
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ PyObject *t = PyTuple_GET_ITEM(tuple, i);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(exc_type == t)) return 1;
+ #endif
+ if (likely(PyExceptionClass_Check(t))) {
+ if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
+ } else {
+ }
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+ if (likely(err == exc_type)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ if (likely(PyExceptionClass_Check(exc_type))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+ } else if (likely(PyTuple_Check(exc_type))) {
+ return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
+ } else {
+ }
+ }
+ return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+ assert(PyExceptionClass_Check(exc_type1));
+ assert(PyExceptionClass_Check(exc_type2));
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+ }
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
+/* FetchCommonType */
+static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
+ PyObject* fake_module;
+ PyTypeObject* cached_type = NULL;
+ fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
+ if (!fake_module) return NULL;
+ Py_INCREF(fake_module);
+ cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
+ if (cached_type) {
+ if (!PyType_Check((PyObject*)cached_type)) {
+ PyErr_Format(PyExc_TypeError,
+ "Shared Cython type %.200s is not a type object",
+ type->tp_name);
+ goto bad;
+ }
+ if (cached_type->tp_basicsize != type->tp_basicsize) {
+ PyErr_Format(PyExc_TypeError,
+ "Shared Cython type %.200s has the wrong size, try recompiling",
+ type->tp_name);
+ goto bad;
+ }
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
+ PyErr_Clear();
+ if (PyType_Ready(type) < 0) goto bad;
+ if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
+ goto bad;
+ Py_INCREF(type);
+ cached_type = type;
+ }
+done:
+ Py_DECREF(fake_module);
+ return cached_type;
+bad:
+ Py_XDECREF(cached_type);
+ cached_type = NULL;
+ goto done;
+}
+
+/* PyObjectGetMethod */
+static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
+ PyObject *attr;
+#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
+ PyTypeObject *tp = Py_TYPE(obj);
+ PyObject *descr;
+ descrgetfunc f = NULL;
+ PyObject **dictptr, *dict;
+ int meth_found = 0;
+ assert (*method == NULL);
+ if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
+ attr = __Pyx_PyObject_GetAttrStr(obj, name);
+ goto try_unpack;
+ }
+ if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
+ return 0;
+ }
+ descr = _PyType_Lookup(tp, name);
+ if (likely(descr != NULL)) {
+ Py_INCREF(descr);
+#if PY_MAJOR_VERSION >= 3
+ #ifdef __Pyx_CyFunction_USED
+ if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
+ #else
+ if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
+ #endif
+#else
+ #ifdef __Pyx_CyFunction_USED
+ if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
+ #else
+ if (likely(PyFunction_Check(descr)))
+ #endif
+#endif
+ {
+ meth_found = 1;
+ } else {
+ f = Py_TYPE(descr)->tp_descr_get;
+ if (f != NULL && PyDescr_IsData(descr)) {
+ attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
+ Py_DECREF(descr);
+ goto try_unpack;
+ }
+ }
+ }
+ dictptr = _PyObject_GetDictPtr(obj);
+ if (dictptr != NULL && (dict = *dictptr) != NULL) {
+ Py_INCREF(dict);
+ attr = __Pyx_PyDict_GetItemStr(dict, name);
+ if (attr != NULL) {
+ Py_INCREF(attr);
+ Py_DECREF(dict);
+ Py_XDECREF(descr);
+ goto try_unpack;
+ }
+ Py_DECREF(dict);
+ }
+ if (meth_found) {
+ *method = descr;
+ return 1;
+ }
+ if (f != NULL) {
+ attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
+ Py_DECREF(descr);
+ goto try_unpack;
+ }
+ if (descr != NULL) {
+ *method = descr;
+ return 0;
+ }
+ PyErr_Format(PyExc_AttributeError,
+#if PY_MAJOR_VERSION >= 3
+ "'%.50s' object has no attribute '%U'",
+ tp->tp_name, name);
+#else
+ "'%.50s' object has no attribute '%.400s'",
+ tp->tp_name, PyString_AS_STRING(name));
+#endif
+ return 0;
+#else
+ attr = __Pyx_PyObject_GetAttrStr(obj, name);
+ goto try_unpack;
+#endif
+try_unpack:
+#if CYTHON_UNPACK_METHODS
+ if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
+ PyObject *function = PyMethod_GET_FUNCTION(attr);
+ Py_INCREF(function);
+ Py_DECREF(attr);
+ *method = function;
+ return 1;
+ }
+#endif
+ *method = attr;
+ return 0;
+}
+
+/* PyObjectCallMethod1 */
+static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
+ PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
+ Py_DECREF(method);
+ return result;
+}
+static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
+ PyObject *method = NULL, *result;
+ int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
+ if (likely(is_method)) {
+ result = __Pyx_PyObject_Call2Args(method, obj, arg);
+ Py_DECREF(method);
+ return result;
+ }
+ if (unlikely(!method)) return NULL;
+ return __Pyx__PyObject_CallMethod1(method, arg);
+}
+
+/* CoroutineBase */
+#include <structmember.h>
+#include <frameobject.h>
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
+static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
+ PyObject *et, *ev, *tb;
+ PyObject *value = NULL;
+ __Pyx_ErrFetch(&et, &ev, &tb);
+ if (!et) {
+ Py_XDECREF(tb);
+ Py_XDECREF(ev);
+ Py_INCREF(Py_None);
+ *pvalue = Py_None;
+ return 0;
+ }
+ if (likely(et == PyExc_StopIteration)) {
+ if (!ev) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#if PY_VERSION_HEX >= 0x030300A0
+ else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
+ value = ((PyStopIterationObject *)ev)->value;
+ Py_INCREF(value);
+ Py_DECREF(ev);
+ }
+#endif
+ else if (unlikely(PyTuple_Check(ev))) {
+ if (PyTuple_GET_SIZE(ev) >= 1) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ value = PyTuple_GET_ITEM(ev, 0);
+ Py_INCREF(value);
+#else
+ value = PySequence_ITEM(ev, 0);
+#endif
+ } else {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+ Py_DECREF(ev);
+ }
+ else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
+ value = ev;
+ }
+ if (likely(value)) {
+ Py_XDECREF(tb);
+ Py_DECREF(et);
+ *pvalue = value;
+ return 0;
+ }
+ } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
+ __Pyx_ErrRestore(et, ev, tb);
+ return -1;
+ }
+ PyErr_NormalizeException(&et, &ev, &tb);
+ if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
+ __Pyx_ErrRestore(et, ev, tb);
+ return -1;
+ }
+ Py_XDECREF(tb);
+ Py_DECREF(et);
+#if PY_VERSION_HEX >= 0x030300A0
+ value = ((PyStopIterationObject *)ev)->value;
+ Py_INCREF(value);
+ Py_DECREF(ev);
+#else
+ {
+ PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
+ Py_DECREF(ev);
+ if (likely(args)) {
+ value = PySequence_GetItem(args, 0);
+ Py_DECREF(args);
+ }
+ if (unlikely(!value)) {
+ __Pyx_ErrRestore(NULL, NULL, NULL);
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+ }
+#endif
+ *pvalue = value;
+ return 0;
+}
+static CYTHON_INLINE
+void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
+ PyObject *t, *v, *tb;
+ t = exc_state->exc_type;
+ v = exc_state->exc_value;
+ tb = exc_state->exc_traceback;
+ exc_state->exc_type = NULL;
+ exc_state->exc_value = NULL;
+ exc_state->exc_traceback = NULL;
+ Py_XDECREF(t);
+ Py_XDECREF(v);
+ Py_XDECREF(tb);
+}
+#define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
+static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
+ const char *msg;
+ if ((0)) {
+ #ifdef __Pyx_Coroutine_USED
+ } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
+ msg = "coroutine already executing";
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
+ msg = "async generator already executing";
+ #endif
+ } else {
+ msg = "generator already executing";
+ }
+ PyErr_SetString(PyExc_ValueError, msg);
+}
+#define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
+static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
+ const char *msg;
+ if ((0)) {
+ #ifdef __Pyx_Coroutine_USED
+ } else if (__Pyx_Coroutine_Check(gen)) {
+ msg = "can't send non-None value to a just-started coroutine";
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ } else if (__Pyx_AsyncGen_CheckExact(gen)) {
+ msg = "can't send non-None value to a just-started async generator";
+ #endif
+ } else {
+ msg = "can't send non-None value to a just-started generator";
+ }
+ PyErr_SetString(PyExc_TypeError, msg);
+}
+#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
+static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
+ #ifdef __Pyx_Coroutine_USED
+ if (!closing && __Pyx_Coroutine_Check(gen)) {
+ PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
+ } else
+ #endif
+ if (value) {
+ #ifdef __Pyx_AsyncGen_USED
+ if (__Pyx_AsyncGen_CheckExact(gen))
+ PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
+ else
+ #endif
+ PyErr_SetNone(PyExc_StopIteration);
+ }
+}
+static
+PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
+ __Pyx_PyThreadState_declare
+ PyThreadState *tstate;
+ __Pyx_ExcInfoStruct *exc_state;
+ PyObject *retval;
+ assert(!self->is_running);
+ if (unlikely(self->resume_label == 0)) {
+ if (unlikely(value && value != Py_None)) {
+ return __Pyx_Coroutine_NotStartedError((PyObject*)self);
+ }
+ }
+ if (unlikely(self->resume_label == -1)) {
+ return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
+ }
+#if CYTHON_FAST_THREAD_STATE
+ __Pyx_PyThreadState_assign
+ tstate = __pyx_tstate;
+#else
+ tstate = __Pyx_PyThreadState_Current;
+#endif
+ exc_state = &self->gi_exc_state;
+ if (exc_state->exc_type) {
+ #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
+ #else
+ if (exc_state->exc_traceback) {
+ PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
+ PyFrameObject *f = tb->tb_frame;
+ assert(f->f_back == NULL);
+ #if PY_VERSION_HEX >= 0x030B00A1
+ f->f_back = PyThreadState_GetFrame(tstate);
+ #else
+ Py_XINCREF(tstate->frame);
+ f->f_back = tstate->frame;
+ #endif
+ }
+ #endif
+ }
+#if CYTHON_USE_EXC_INFO_STACK
+ exc_state->previous_item = tstate->exc_info;
+ tstate->exc_info = exc_state;
+#else
+ if (exc_state->exc_type) {
+ __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
+ } else {
+ __Pyx_Coroutine_ExceptionClear(exc_state);
+ __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
+ }
+#endif
+ self->is_running = 1;
+ retval = self->body((PyObject *) self, tstate, value);
+ self->is_running = 0;
+#if CYTHON_USE_EXC_INFO_STACK
+ exc_state = &self->gi_exc_state;
+ tstate->exc_info = exc_state->previous_item;
+ exc_state->previous_item = NULL;
+ __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
+#endif
+ return retval;
+}
+static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
+ PyObject *exc_tb = exc_state->exc_traceback;
+ if (likely(exc_tb)) {
+#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
+#else
+ PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
+ PyFrameObject *f = tb->tb_frame;
+ Py_CLEAR(f->f_back);
+#endif
+ }
+}
+static CYTHON_INLINE
+PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
+ if (unlikely(!retval)) {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ if (!__Pyx_PyErr_Occurred()) {
+ PyObject *exc = PyExc_StopIteration;
+ #ifdef __Pyx_AsyncGen_USED
+ if (__Pyx_AsyncGen_CheckExact(gen))
+ exc = __Pyx_PyExc_StopAsyncIteration;
+ #endif
+ __Pyx_PyErr_SetNone(exc);
+ }
+ }
+ return retval;
+}
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
+static CYTHON_INLINE
+PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
+#if PY_VERSION_HEX <= 0x030A00A1
+ return _PyGen_Send(gen, arg);
+#else
+ PyObject *result;
+ if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
+ if (PyAsyncGen_CheckExact(gen)) {
+ assert(result == Py_None);
+ PyErr_SetNone(PyExc_StopAsyncIteration);
+ }
+ else if (result == Py_None) {
+ PyErr_SetNone(PyExc_StopIteration);
+ }
+ else {
+ _PyGen_SetStopIterationValue(result);
+ }
+ Py_CLEAR(result);
+ }
+ return result;
+#endif
+}
+#endif
+static CYTHON_INLINE
+PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
+ PyObject *ret;
+ PyObject *val = NULL;
+ __Pyx_Coroutine_Undelegate(gen);
+ __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
+ ret = __Pyx_Coroutine_SendEx(gen, val, 0);
+ Py_XDECREF(val);
+ return ret;
+}
+static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
+ PyObject *retval;
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
+ PyObject *yf = gen->yieldfrom;
+ if (unlikely(gen->is_running))
+ return __Pyx_Coroutine_AlreadyRunningError(gen);
+ if (yf) {
+ PyObject *ret;
+ gen->is_running = 1;
+ #ifdef __Pyx_Generator_USED
+ if (__Pyx_Generator_CheckExact(yf)) {
+ ret = __Pyx_Coroutine_Send(yf, value);
+ } else
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__Pyx_Coroutine_Check(yf)) {
+ ret = __Pyx_Coroutine_Send(yf, value);
+ } else
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
+ ret = __Pyx_async_gen_asend_send(yf, value);
+ } else
+ #endif
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
+ if (PyGen_CheckExact(yf)) {
+ ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
+ } else
+ #endif
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
+ if (PyCoro_CheckExact(yf)) {
+ ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
+ } else
+ #endif
+ {
+ if (value == Py_None)
+ ret = Py_TYPE(yf)->tp_iternext(yf);
+ else
+ ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
+ }
+ gen->is_running = 0;
+ if (likely(ret)) {
+ return ret;
+ }
+ retval = __Pyx_Coroutine_FinishDelegation(gen);
+ } else {
+ retval = __Pyx_Coroutine_SendEx(gen, value, 0);
+ }
+ return __Pyx_Coroutine_MethodReturn(self, retval);
+}
+static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
+ PyObject *retval = NULL;
+ int err = 0;
+ #ifdef __Pyx_Generator_USED
+ if (__Pyx_Generator_CheckExact(yf)) {
+ retval = __Pyx_Coroutine_Close(yf);
+ if (!retval)
+ return -1;
+ } else
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__Pyx_Coroutine_Check(yf)) {
+ retval = __Pyx_Coroutine_Close(yf);
+ if (!retval)
+ return -1;
+ } else
+ if (__Pyx_CoroutineAwait_CheckExact(yf)) {
+ retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
+ if (!retval)
+ return -1;
+ } else
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
+ retval = __Pyx_async_gen_asend_close(yf, NULL);
+ } else
+ if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
+ retval = __Pyx_async_gen_athrow_close(yf, NULL);
+ } else
+ #endif
+ {
+ PyObject *meth;
+ gen->is_running = 1;
+ meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
+ if (unlikely(!meth)) {
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_WriteUnraisable(yf);
+ }
+ PyErr_Clear();
+ } else {
+ retval = PyObject_CallFunction(meth, NULL);
+ Py_DECREF(meth);
+ if (!retval)
+ err = -1;
+ }
+ gen->is_running = 0;
+ }
+ Py_XDECREF(retval);
+ return err;
+}
+static PyObject *__Pyx_Generator_Next(PyObject *self) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
+ PyObject *yf = gen->yieldfrom;
+ if (unlikely(gen->is_running))
+ return __Pyx_Coroutine_AlreadyRunningError(gen);
+ if (yf) {
+ PyObject *ret;
+ gen->is_running = 1;
+ #ifdef __Pyx_Generator_USED
+ if (__Pyx_Generator_CheckExact(yf)) {
+ ret = __Pyx_Generator_Next(yf);
+ } else
+ #endif
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
+ if (PyGen_CheckExact(yf)) {
+ ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
+ } else
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__Pyx_Coroutine_Check(yf)) {
+ ret = __Pyx_Coroutine_Send(yf, Py_None);
+ } else
+ #endif
+ ret = Py_TYPE(yf)->tp_iternext(yf);
+ gen->is_running = 0;
+ if (likely(ret)) {
+ return ret;
+ }
+ return __Pyx_Coroutine_FinishDelegation(gen);
+ }
+ return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
+}
+static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
+ return __Pyx_Coroutine_Close(self);
+}
+static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+ PyObject *retval, *raised_exception;
+ PyObject *yf = gen->yieldfrom;
+ int err = 0;
+ if (unlikely(gen->is_running))
+ return __Pyx_Coroutine_AlreadyRunningError(gen);
+ if (yf) {
+ Py_INCREF(yf);
+ err = __Pyx_Coroutine_CloseIter(gen, yf);
+ __Pyx_Coroutine_Undelegate(gen);
+ Py_DECREF(yf);
+ }
+ if (err == 0)
+ PyErr_SetNone(PyExc_GeneratorExit);
+ retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
+ if (unlikely(retval)) {
+ const char *msg;
+ Py_DECREF(retval);
+ if ((0)) {
+ #ifdef __Pyx_Coroutine_USED
+ } else if (__Pyx_Coroutine_Check(self)) {
+ msg = "coroutine ignored GeneratorExit";
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ } else if (__Pyx_AsyncGen_CheckExact(self)) {
+#if PY_VERSION_HEX < 0x03060000
+ msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
+#else
+ msg = "async generator ignored GeneratorExit";
+#endif
+ #endif
+ } else {
+ msg = "generator ignored GeneratorExit";
+ }
+ PyErr_SetString(PyExc_RuntimeError, msg);
+ return NULL;
+ }
+ raised_exception = PyErr_Occurred();
+ if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
+ if (raised_exception) PyErr_Clear();
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ return NULL;
+}
+static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
+ PyObject *args, int close_on_genexit) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+ PyObject *yf = gen->yieldfrom;
+ if (unlikely(gen->is_running))
+ return __Pyx_Coroutine_AlreadyRunningError(gen);
+ if (yf) {
+ PyObject *ret;
+ Py_INCREF(yf);
+ if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
+ int err = __Pyx_Coroutine_CloseIter(gen, yf);
+ Py_DECREF(yf);
+ __Pyx_Coroutine_Undelegate(gen);
+ if (err < 0)
+ return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
+ goto throw_here;
+ }
+ gen->is_running = 1;
+ if (0
+ #ifdef __Pyx_Generator_USED
+ || __Pyx_Generator_CheckExact(yf)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ || __Pyx_Coroutine_Check(yf)
+ #endif
+ ) {
+ ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
+ #ifdef __Pyx_Coroutine_USED
+ } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
+ ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
+ #endif
+ } else {
+ PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
+ if (unlikely(!meth)) {
+ Py_DECREF(yf);
+ if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ gen->is_running = 0;
+ return NULL;
+ }
+ PyErr_Clear();
+ __Pyx_Coroutine_Undelegate(gen);
+ gen->is_running = 0;
+ goto throw_here;
+ }
+ if (likely(args)) {
+ ret = PyObject_CallObject(meth, args);
+ } else {
+ ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
+ }
+ Py_DECREF(meth);
+ }
+ gen->is_running = 0;
+ Py_DECREF(yf);
+ if (!ret) {
+ ret = __Pyx_Coroutine_FinishDelegation(gen);
+ }
+ return __Pyx_Coroutine_MethodReturn(self, ret);
+ }
+throw_here:
+ __Pyx_Raise(typ, val, tb, NULL);
+ return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
+}
+static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
+ PyObject *typ;
+ PyObject *val = NULL;
+ PyObject *tb = NULL;
+ if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
+ return NULL;
+ return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
+}
+static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
+ Py_VISIT(exc_state->exc_type);
+ Py_VISIT(exc_state->exc_value);
+ Py_VISIT(exc_state->exc_traceback);
+ return 0;
+}
+static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
+ Py_VISIT(gen->closure);
+ Py_VISIT(gen->classobj);
+ Py_VISIT(gen->yieldfrom);
+ return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
+}
+static int __Pyx_Coroutine_clear(PyObject *self) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+ Py_CLEAR(gen->closure);
+ Py_CLEAR(gen->classobj);
+ Py_CLEAR(gen->yieldfrom);
+ __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
+#ifdef __Pyx_AsyncGen_USED
+ if (__Pyx_AsyncGen_CheckExact(self)) {
+ Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
+ }
+#endif
+ Py_CLEAR(gen->gi_code);
+ Py_CLEAR(gen->gi_frame);
+ Py_CLEAR(gen->gi_name);
+ Py_CLEAR(gen->gi_qualname);
+ Py_CLEAR(gen->gi_modulename);
+ return 0;
+}
+static void __Pyx_Coroutine_dealloc(PyObject *self) {
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+ PyObject_GC_UnTrack(gen);
+ if (gen->gi_weakreflist != NULL)
+ PyObject_ClearWeakRefs(self);
+ if (gen->resume_label >= 0) {
+ PyObject_GC_Track(self);
+#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
+ if (PyObject_CallFinalizerFromDealloc(self))
+#else
+ Py_TYPE(gen)->tp_del(self);
+ if (Py_REFCNT(self) > 0)
+#endif
+ {
+ return;
+ }
+ PyObject_GC_UnTrack(self);
+ }
+#ifdef __Pyx_AsyncGen_USED
+ if (__Pyx_AsyncGen_CheckExact(self)) {
+ /* We have to handle this case for asynchronous generators
+ right here, because this code has to be between UNTRACK
+ and GC_Del. */
+ Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
+ }
+#endif
+ __Pyx_Coroutine_clear(self);
+ PyObject_GC_Del(gen);
+}
+static void __Pyx_Coroutine_del(PyObject *self) {
+ PyObject *error_type, *error_value, *error_traceback;
+ __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
+ __Pyx_PyThreadState_declare
+ if (gen->resume_label < 0) {
+ return;
+ }
+#if !CYTHON_USE_TP_FINALIZE
+ assert(self->ob_refcnt == 0);
+ __Pyx_SET_REFCNT(self, 1);
+#endif
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
+#ifdef __Pyx_AsyncGen_USED
+ if (__Pyx_AsyncGen_CheckExact(self)) {
+ __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
+ PyObject *finalizer = agen->ag_finalizer;
+ if (finalizer && !agen->ag_closed) {
+ PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
+ if (unlikely(!res)) {
+ PyErr_WriteUnraisable(self);
+ } else {
+ Py_DECREF(res);
+ }
+ __Pyx_ErrRestore(error_type, error_value, error_traceback);
+ return;
+ }
+ }
+#endif
+ if (unlikely(gen->resume_label == 0 && !error_value)) {
+#ifdef __Pyx_Coroutine_USED
+#ifdef __Pyx_Generator_USED
+ if (!__Pyx_Generator_CheckExact(self))
+#endif
+ {
+ PyObject_GC_UnTrack(self);
+#if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
+ if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
+ PyErr_WriteUnraisable(self);
+#else
+ {PyObject *msg;
+ char *cmsg;
+ #if CYTHON_COMPILING_IN_PYPY
+ msg = NULL;
+ cmsg = (char*) "coroutine was never awaited";
+ #else
+ char *cname;
+ PyObject *qualname;
+ qualname = gen->gi_qualname;
+ cname = PyString_AS_STRING(qualname);
+ msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
+ if (unlikely(!msg)) {
+ PyErr_Clear();
+ cmsg = (char*) "coroutine was never awaited";
+ } else {
+ cmsg = PyString_AS_STRING(msg);
+ }
+ #endif
+ if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
+ PyErr_WriteUnraisable(self);
+ Py_XDECREF(msg);}
+#endif
+ PyObject_GC_Track(self);
+ }
+#endif
+ } else {
+ PyObject *res = __Pyx_Coroutine_Close(self);
+ if (unlikely(!res)) {
+ if (PyErr_Occurred())
+ PyErr_WriteUnraisable(self);
+ } else {
+ Py_DECREF(res);
+ }
+ }
+ __Pyx_ErrRestore(error_type, error_value, error_traceback);
+#if !CYTHON_USE_TP_FINALIZE
+ assert(Py_REFCNT(self) > 0);
+ if (--self->ob_refcnt == 0) {
+ return;
+ }
+ {
+ Py_ssize_t refcnt = Py_REFCNT(self);
+ _Py_NewReference(self);
+ __Pyx_SET_REFCNT(self, refcnt);
+ }
+#if CYTHON_COMPILING_IN_CPYTHON
+ assert(PyType_IS_GC(Py_TYPE(self)) &&
+ _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
+ _Py_DEC_REFTOTAL;
+#endif
+#ifdef COUNT_ALLOCS
+ --Py_TYPE(self)->tp_frees;
+ --Py_TYPE(self)->tp_allocs;
+#endif
+#endif
+}
+static PyObject *
+__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
+{
+ PyObject *name = self->gi_name;
+ if (unlikely(!name)) name = Py_None;
+ Py_INCREF(name);
+ return name;
+}
+static int
+__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
+{
+ PyObject *tmp;
+#if PY_MAJOR_VERSION >= 3
+ if (unlikely(value == NULL || !PyUnicode_Check(value)))
+#else
+ if (unlikely(value == NULL || !PyString_Check(value)))
+#endif
+ {
+ PyErr_SetString(PyExc_TypeError,
+ "__name__ must be set to a string object");
+ return -1;
+ }
+ tmp = self->gi_name;
+ Py_INCREF(value);
+ self->gi_name = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
+{
+ PyObject *name = self->gi_qualname;
+ if (unlikely(!name)) name = Py_None;
+ Py_INCREF(name);
+ return name;
+}
+static int
+__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
+{
+ PyObject *tmp;
+#if PY_MAJOR_VERSION >= 3
+ if (unlikely(value == NULL || !PyUnicode_Check(value)))
+#else
+ if (unlikely(value == NULL || !PyString_Check(value)))
+#endif
+ {
+ PyErr_SetString(PyExc_TypeError,
+ "__qualname__ must be set to a string object");
+ return -1;
+ }
+ tmp = self->gi_qualname;
+ Py_INCREF(value);
+ self->gi_qualname = value;
+ Py_XDECREF(tmp);
+ return 0;
+}
+static PyObject *
+__Pyx_Coroutine_get_frame(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
+{
+ PyObject *frame = self->gi_frame;
+ if (!frame) {
+ if (unlikely(!self->gi_code)) {
+ Py_RETURN_NONE;
+ }
+ frame = (PyObject *) PyFrame_New(
+ PyThreadState_Get(), /*PyThreadState *tstate,*/
+ (PyCodeObject*) self->gi_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (unlikely(!frame))
+ return NULL;
+ self->gi_frame = frame;
+ }
+ Py_INCREF(frame);
+ return frame;
+}
+static __pyx_CoroutineObject *__Pyx__Coroutine_New(
+ PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
+ PyObject *name, PyObject *qualname, PyObject *module_name) {
+ __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
+ if (unlikely(!gen))
+ return NULL;
+ return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
+}
+static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
+ __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
+ PyObject *name, PyObject *qualname, PyObject *module_name) {
+ gen->body = body;
+ gen->closure = closure;
+ Py_XINCREF(closure);
+ gen->is_running = 0;
+ gen->resume_label = 0;
+ gen->classobj = NULL;
+ gen->yieldfrom = NULL;
+ gen->gi_exc_state.exc_type = NULL;
+ gen->gi_exc_state.exc_value = NULL;
+ gen->gi_exc_state.exc_traceback = NULL;
+#if CYTHON_USE_EXC_INFO_STACK
+ gen->gi_exc_state.previous_item = NULL;
+#endif
+ gen->gi_weakreflist = NULL;
+ Py_XINCREF(qualname);
+ gen->gi_qualname = qualname;
+ Py_XINCREF(name);
+ gen->gi_name = name;
+ Py_XINCREF(module_name);
+ gen->gi_modulename = module_name;
+ Py_XINCREF(code);
+ gen->gi_code = code;
+ gen->gi_frame = NULL;
+ PyObject_GC_Track(gen);
+ return gen;
+}
+
+/* PatchModuleWithCoroutine */
+static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
+#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ int result;
+ PyObject *globals, *result_obj;
+ globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
+ result = PyDict_SetItemString(globals, "_cython_coroutine_type",
+ #ifdef __Pyx_Coroutine_USED
+ (PyObject*)__pyx_CoroutineType);
+ #else
+ Py_None);
+ #endif
+ if (unlikely(result < 0)) goto ignore;
+ result = PyDict_SetItemString(globals, "_cython_generator_type",
+ #ifdef __Pyx_Generator_USED
+ (PyObject*)__pyx_GeneratorType);
+ #else
+ Py_None);
+ #endif
+ if (unlikely(result < 0)) goto ignore;
+ if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
+ if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
+ result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
+ if (unlikely(!result_obj)) goto ignore;
+ Py_DECREF(result_obj);
+ Py_DECREF(globals);
+ return module;
+ignore:
+ Py_XDECREF(globals);
+ PyErr_WriteUnraisable(module);
+ if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
+ Py_DECREF(module);
+ module = NULL;
+ }
+#else
+ py_code++;
+#endif
+ return module;
+}
+
+/* PatchGeneratorABC */
+#ifndef CYTHON_REGISTER_ABCS
+#define CYTHON_REGISTER_ABCS 1
+#endif
+#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+static PyObject* __Pyx_patch_abc_module(PyObject *module);
+static PyObject* __Pyx_patch_abc_module(PyObject *module) {
+ module = __Pyx_Coroutine_patch_module(
+ module, ""
+"if _cython_generator_type is not None:\n"
+" try: Generator = _module.Generator\n"
+" except AttributeError: pass\n"
+" else: Generator.register(_cython_generator_type)\n"
+"if _cython_coroutine_type is not None:\n"
+" try: Coroutine = _module.Coroutine\n"
+" except AttributeError: pass\n"
+" else: Coroutine.register(_cython_coroutine_type)\n"
+ );
+ return module;
+}
+#endif
+static int __Pyx_patch_abc(void) {
+#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ static int abc_patched = 0;
+ if (CYTHON_REGISTER_ABCS && !abc_patched) {
+ PyObject *module;
+ module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
+ if (!module) {
+ PyErr_WriteUnraisable(NULL);
+ if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
+ ((PY_MAJOR_VERSION >= 3) ?
+ "Cython module failed to register with collections.abc module" :
+ "Cython module failed to register with collections module"), 1) < 0)) {
+ return -1;
+ }
+ } else {
+ module = __Pyx_patch_abc_module(module);
+ abc_patched = 1;
+ if (unlikely(!module))
+ return -1;
+ Py_DECREF(module);
+ }
+ module = PyImport_ImportModule("backports_abc");
+ if (module) {
+ module = __Pyx_patch_abc_module(module);
+ Py_XDECREF(module);
+ }
+ if (!module) {
+ PyErr_Clear();
+ }
+ }
+#else
+ if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
+#endif
+ return 0;
+}
+
+/* Generator */
+static PyMethodDef __pyx_Generator_methods[] = {
+ {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
+ (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
+ {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
+ (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
+ {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
+ (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
+ {0, 0, 0, 0}
+};
+static PyMemberDef __pyx_Generator_memberlist[] = {
+ {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
+ {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
+ (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
+ {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
+ {0, 0, 0, 0, 0}
+};
+static PyGetSetDef __pyx_Generator_getsets[] = {
+ {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
+ (char*) PyDoc_STR("name of the generator"), 0},
+ {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
+ (char*) PyDoc_STR("qualified name of the generator"), 0},
+ {(char *) "gi_frame", (getter)__Pyx_Coroutine_get_frame, NULL,
+ (char*) PyDoc_STR("Frame of the generator"), 0},
+ {0, 0, 0, 0, 0}
+};
+static PyTypeObject __pyx_GeneratorType_type = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "generator",
+ sizeof(__pyx_CoroutineObject),
+ 0,
+ (destructor) __Pyx_Coroutine_dealloc,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
+ 0,
+ (traverseproc) __Pyx_Coroutine_traverse,
+ 0,
+ 0,
+ offsetof(__pyx_CoroutineObject, gi_weakreflist),
+ 0,
+ (iternextfunc) __Pyx_Generator_Next,
+ __pyx_Generator_methods,
+ __pyx_Generator_memberlist,
+ __pyx_Generator_getsets,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+#if CYTHON_USE_TP_FINALIZE
+ 0,
+#else
+ __Pyx_Coroutine_del,
+#endif
+ 0,
+#if CYTHON_USE_TP_FINALIZE
+ __Pyx_Coroutine_del,
+#elif PY_VERSION_HEX >= 0x030400a1
+ 0,
+#endif
+#if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
+ 0,
+#endif
+#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
+ 0,
+#endif
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
+ 0,
+#endif
+};
+static int __pyx_Generator_init(void) {
+ __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
+ __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
+ __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
+ if (unlikely(!__pyx_GeneratorType)) {
+ return -1;
+ }
+ return 0;
+}
+
+/* CheckBinaryVersion */
+static int __Pyx_check_binary_version(void) {
+ char ctversion[5];
+ int same=1, i, found_dot;
+ const char* rt_from_call = Py_GetVersion();
+ PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ found_dot = 0;
+ for (i = 0; i < 4; i++) {
+ if (!ctversion[i]) {
+ same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
+ break;
+ }
+ if (rt_from_call[i] != ctversion[i]) {
+ same = 0;
+ break;
+ }
+ }
+ if (!same) {
+ char rtversion[5] = {'\0'};
+ char message[200];
+ for (i=0; i<4; ++i) {
+ if (rt_from_call[i] == '.') {
+ if (found_dot) break;
+ found_dot = 1;
+ } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
+ break;
+ }
+ rtversion[i] = rt_from_call[i];
+ }
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+/* InitStrings */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ if (PyObject_Hash(*t->p) == -1)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+}
+#else
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (likely(PyUnicode_IS_ASCII(o))) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+ return __Pyx_PyUnicode_AsStringAndSize(o, length);
+ } else
+#endif
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
+ int retval;
+ if (unlikely(!x)) return -1;
+ retval = __Pyx_PyObject_IsTrue(x);
+ Py_DECREF(x);
+ return retval;
+}
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+ if (PyLong_Check(result)) {
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "__int__ returned non-int (type %.200s). "
+ "The ability to return an instance of a strict subclass of int "
+ "is deprecated, and may be removed in a future version of Python.",
+ Py_TYPE(result)->tp_name)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ return result;
+ }
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ type_name, type_name, Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
+ PyNumberMethods *m;
+#endif
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x) || PyLong_Check(x)))
+#else
+ if (likely(PyLong_Check(x)))
+#endif
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
+ m = Py_TYPE(x)->tp_as_number;
+ #if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = m->nb_long(x);
+ }
+ #else
+ if (likely(m && m->nb_int)) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ #endif
+#else
+ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+ res = PyNumber_Int(x);
+ }
+#endif
+ if (likely(res)) {
+#if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
+#else
+ if (unlikely(!PyLong_CheckExact(res))) {
+#endif
+ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(b);
+ }
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
+ if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
+ return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
+#if PY_MAJOR_VERSION < 3
+ } else if (likely(PyInt_CheckExact(o))) {
+ return PyInt_AS_LONG(o);
+#endif
+ } else {
+ Py_ssize_t ival;
+ PyObject *x;
+ x = PyNumber_Index(o);
+ if (!x) return -1;
+ ival = PyInt_AsLong(x);
+ Py_DECREF(x);
+ return ival;
+ }
+}
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
+ return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/third_party/python/aiohttp/aiohttp/_http_parser.pyx b/third_party/python/aiohttp/aiohttp/_http_parser.pyx
new file mode 100644
index 0000000000..4f39dd0c97
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_http_parser.pyx
@@ -0,0 +1,838 @@
+#cython: language_level=3
+#
+# Based on https://github.com/MagicStack/httptools
+#
+from __future__ import absolute_import, print_function
+
+from cpython cimport (
+ Py_buffer,
+ PyBUF_SIMPLE,
+ PyBuffer_Release,
+ PyBytes_AsString,
+ PyBytes_AsStringAndSize,
+ PyObject_GetBuffer,
+)
+from cpython.mem cimport PyMem_Free, PyMem_Malloc
+from libc.limits cimport ULLONG_MAX
+from libc.string cimport memcpy
+
+from multidict import CIMultiDict as _CIMultiDict, CIMultiDictProxy as _CIMultiDictProxy
+from yarl import URL as _URL
+
+from aiohttp import hdrs
+
+from .http_exceptions import (
+ BadHttpMessage,
+ BadStatusLine,
+ ContentLengthError,
+ InvalidHeader,
+ InvalidURLError,
+ LineTooLong,
+ PayloadEncodingError,
+ TransferEncodingError,
+)
+from .http_parser import DeflateBuffer as _DeflateBuffer
+from .http_writer import (
+ HttpVersion as _HttpVersion,
+ HttpVersion10 as _HttpVersion10,
+ HttpVersion11 as _HttpVersion11,
+)
+from .streams import EMPTY_PAYLOAD as _EMPTY_PAYLOAD, StreamReader as _StreamReader
+
+cimport cython
+
+from aiohttp cimport _cparser as cparser
+
+include "_headers.pxi"
+
+from aiohttp cimport _find_header
+
+DEF DEFAULT_FREELIST_SIZE = 250
+
+cdef extern from "Python.h":
+ int PyByteArray_Resize(object, Py_ssize_t) except -1
+ Py_ssize_t PyByteArray_Size(object) except -1
+ char* PyByteArray_AsString(object)
+
+__all__ = ('HttpRequestParser', 'HttpResponseParser',
+ 'RawRequestMessage', 'RawResponseMessage')
+
+cdef object URL = _URL
+cdef object URL_build = URL.build
+cdef object CIMultiDict = _CIMultiDict
+cdef object CIMultiDictProxy = _CIMultiDictProxy
+cdef object HttpVersion = _HttpVersion
+cdef object HttpVersion10 = _HttpVersion10
+cdef object HttpVersion11 = _HttpVersion11
+cdef object SEC_WEBSOCKET_KEY1 = hdrs.SEC_WEBSOCKET_KEY1
+cdef object CONTENT_ENCODING = hdrs.CONTENT_ENCODING
+cdef object EMPTY_PAYLOAD = _EMPTY_PAYLOAD
+cdef object StreamReader = _StreamReader
+cdef object DeflateBuffer = _DeflateBuffer
+
+
+cdef inline object extend(object buf, const char* at, size_t length):
+ cdef Py_ssize_t s
+ cdef char* ptr
+ s = PyByteArray_Size(buf)
+ PyByteArray_Resize(buf, s + length)
+ ptr = PyByteArray_AsString(buf)
+ memcpy(ptr + s, at, length)
+
+
+DEF METHODS_COUNT = 46;
+
+cdef list _http_method = []
+
+for i in range(METHODS_COUNT):
+ _http_method.append(
+ cparser.llhttp_method_name(<cparser.llhttp_method_t> i).decode('ascii'))
+
+
+cdef inline str http_method_str(int i):
+ if i < METHODS_COUNT:
+ return <str>_http_method[i]
+ else:
+ return "<unknown>"
+
+cdef inline object find_header(bytes raw_header):
+ cdef Py_ssize_t size
+ cdef char *buf
+ cdef int idx
+ PyBytes_AsStringAndSize(raw_header, &buf, &size)
+ idx = _find_header.find_header(buf, size)
+ if idx == -1:
+ return raw_header.decode('utf-8', 'surrogateescape')
+ return headers[idx]
+
+
+@cython.freelist(DEFAULT_FREELIST_SIZE)
+cdef class RawRequestMessage:
+ cdef readonly str method
+ cdef readonly str path
+ cdef readonly object version # HttpVersion
+ cdef readonly object headers # CIMultiDict
+ cdef readonly object raw_headers # tuple
+ cdef readonly object should_close
+ cdef readonly object compression
+ cdef readonly object upgrade
+ cdef readonly object chunked
+ cdef readonly object url # yarl.URL
+
+ def __init__(self, method, path, version, headers, raw_headers,
+ should_close, compression, upgrade, chunked, url):
+ self.method = method
+ self.path = path
+ self.version = version
+ self.headers = headers
+ self.raw_headers = raw_headers
+ self.should_close = should_close
+ self.compression = compression
+ self.upgrade = upgrade
+ self.chunked = chunked
+ self.url = url
+
+ def __repr__(self):
+ info = []
+ info.append(("method", self.method))
+ info.append(("path", self.path))
+ info.append(("version", self.version))
+ info.append(("headers", self.headers))
+ info.append(("raw_headers", self.raw_headers))
+ info.append(("should_close", self.should_close))
+ info.append(("compression", self.compression))
+ info.append(("upgrade", self.upgrade))
+ info.append(("chunked", self.chunked))
+ info.append(("url", self.url))
+ sinfo = ', '.join(name + '=' + repr(val) for name, val in info)
+ return '<RawRequestMessage(' + sinfo + ')>'
+
+ def _replace(self, **dct):
+ cdef RawRequestMessage ret
+ ret = _new_request_message(self.method,
+ self.path,
+ self.version,
+ self.headers,
+ self.raw_headers,
+ self.should_close,
+ self.compression,
+ self.upgrade,
+ self.chunked,
+ self.url)
+ if "method" in dct:
+ ret.method = dct["method"]
+ if "path" in dct:
+ ret.path = dct["path"]
+ if "version" in dct:
+ ret.version = dct["version"]
+ if "headers" in dct:
+ ret.headers = dct["headers"]
+ if "raw_headers" in dct:
+ ret.raw_headers = dct["raw_headers"]
+ if "should_close" in dct:
+ ret.should_close = dct["should_close"]
+ if "compression" in dct:
+ ret.compression = dct["compression"]
+ if "upgrade" in dct:
+ ret.upgrade = dct["upgrade"]
+ if "chunked" in dct:
+ ret.chunked = dct["chunked"]
+ if "url" in dct:
+ ret.url = dct["url"]
+ return ret
+
+cdef _new_request_message(str method,
+ str path,
+ object version,
+ object headers,
+ object raw_headers,
+ bint should_close,
+ object compression,
+ bint upgrade,
+ bint chunked,
+ object url):
+ cdef RawRequestMessage ret
+ ret = RawRequestMessage.__new__(RawRequestMessage)
+ ret.method = method
+ ret.path = path
+ ret.version = version
+ ret.headers = headers
+ ret.raw_headers = raw_headers
+ ret.should_close = should_close
+ ret.compression = compression
+ ret.upgrade = upgrade
+ ret.chunked = chunked
+ ret.url = url
+ return ret
+
+
+@cython.freelist(DEFAULT_FREELIST_SIZE)
+cdef class RawResponseMessage:
+ cdef readonly object version # HttpVersion
+ cdef readonly int code
+ cdef readonly str reason
+ cdef readonly object headers # CIMultiDict
+ cdef readonly object raw_headers # tuple
+ cdef readonly object should_close
+ cdef readonly object compression
+ cdef readonly object upgrade
+ cdef readonly object chunked
+
+ def __init__(self, version, code, reason, headers, raw_headers,
+ should_close, compression, upgrade, chunked):
+ self.version = version
+ self.code = code
+ self.reason = reason
+ self.headers = headers
+ self.raw_headers = raw_headers
+ self.should_close = should_close
+ self.compression = compression
+ self.upgrade = upgrade
+ self.chunked = chunked
+
+ def __repr__(self):
+ info = []
+ info.append(("version", self.version))
+ info.append(("code", self.code))
+ info.append(("reason", self.reason))
+ info.append(("headers", self.headers))
+ info.append(("raw_headers", self.raw_headers))
+ info.append(("should_close", self.should_close))
+ info.append(("compression", self.compression))
+ info.append(("upgrade", self.upgrade))
+ info.append(("chunked", self.chunked))
+ sinfo = ', '.join(name + '=' + repr(val) for name, val in info)
+ return '<RawResponseMessage(' + sinfo + ')>'
+
+
+cdef _new_response_message(object version,
+ int code,
+ str reason,
+ object headers,
+ object raw_headers,
+ bint should_close,
+ object compression,
+ bint upgrade,
+ bint chunked):
+ cdef RawResponseMessage ret
+ ret = RawResponseMessage.__new__(RawResponseMessage)
+ ret.version = version
+ ret.code = code
+ ret.reason = reason
+ ret.headers = headers
+ ret.raw_headers = raw_headers
+ ret.should_close = should_close
+ ret.compression = compression
+ ret.upgrade = upgrade
+ ret.chunked = chunked
+ return ret
+
+
+@cython.internal
+cdef class HttpParser:
+
+ cdef:
+ cparser.llhttp_t* _cparser
+ cparser.llhttp_settings_t* _csettings
+
+ bytearray _raw_name
+ bytearray _raw_value
+ bint _has_value
+
+ object _protocol
+ object _loop
+ object _timer
+
+ size_t _max_line_size
+ size_t _max_field_size
+ size_t _max_headers
+ bint _response_with_body
+ bint _read_until_eof
+
+ bint _started
+ object _url
+ bytearray _buf
+ str _path
+ str _reason
+ object _headers
+ list _raw_headers
+ bint _upgraded
+ list _messages
+ object _payload
+ bint _payload_error
+ object _payload_exception
+ object _last_error
+ bint _auto_decompress
+ int _limit
+
+ str _content_encoding
+
+ Py_buffer py_buf
+
+ def __cinit__(self):
+ self._cparser = <cparser.llhttp_t*> \
+ PyMem_Malloc(sizeof(cparser.llhttp_t))
+ if self._cparser is NULL:
+ raise MemoryError()
+
+ self._csettings = <cparser.llhttp_settings_t*> \
+ PyMem_Malloc(sizeof(cparser.llhttp_settings_t))
+ if self._csettings is NULL:
+ raise MemoryError()
+
+ def __dealloc__(self):
+ PyMem_Free(self._cparser)
+ PyMem_Free(self._csettings)
+
+ cdef _init(
+ self, cparser.llhttp_type mode,
+ object protocol, object loop, int limit,
+ object timer=None,
+ size_t max_line_size=8190, size_t max_headers=32768,
+ size_t max_field_size=8190, payload_exception=None,
+ bint response_with_body=True, bint read_until_eof=False,
+ bint auto_decompress=True,
+ ):
+ cparser.llhttp_settings_init(self._csettings)
+ cparser.llhttp_init(self._cparser, mode, self._csettings)
+ self._cparser.data = <void*>self
+ self._cparser.content_length = 0
+
+ self._protocol = protocol
+ self._loop = loop
+ self._timer = timer
+
+ self._buf = bytearray()
+ self._payload = None
+ self._payload_error = 0
+ self._payload_exception = payload_exception
+ self._messages = []
+
+ self._raw_name = bytearray()
+ self._raw_value = bytearray()
+ self._has_value = False
+
+ self._max_line_size = max_line_size
+ self._max_headers = max_headers
+ self._max_field_size = max_field_size
+ self._response_with_body = response_with_body
+ self._read_until_eof = read_until_eof
+ self._upgraded = False
+ self._auto_decompress = auto_decompress
+ self._content_encoding = None
+
+ self._csettings.on_url = cb_on_url
+ self._csettings.on_status = cb_on_status
+ self._csettings.on_header_field = cb_on_header_field
+ self._csettings.on_header_value = cb_on_header_value
+ self._csettings.on_headers_complete = cb_on_headers_complete
+ self._csettings.on_body = cb_on_body
+ self._csettings.on_message_begin = cb_on_message_begin
+ self._csettings.on_message_complete = cb_on_message_complete
+ self._csettings.on_chunk_header = cb_on_chunk_header
+ self._csettings.on_chunk_complete = cb_on_chunk_complete
+
+ self._last_error = None
+ self._limit = limit
+
+ cdef _process_header(self):
+ if self._raw_name:
+ raw_name = bytes(self._raw_name)
+ raw_value = bytes(self._raw_value)
+
+ name = find_header(raw_name)
+ value = raw_value.decode('utf-8', 'surrogateescape')
+
+ self._headers.add(name, value)
+
+ if name is CONTENT_ENCODING:
+ self._content_encoding = value
+
+ PyByteArray_Resize(self._raw_name, 0)
+ PyByteArray_Resize(self._raw_value, 0)
+ self._has_value = False
+ self._raw_headers.append((raw_name, raw_value))
+
+ cdef _on_header_field(self, char* at, size_t length):
+ cdef Py_ssize_t size
+ cdef char *buf
+ if self._has_value:
+ self._process_header()
+
+ size = PyByteArray_Size(self._raw_name)
+ PyByteArray_Resize(self._raw_name, size + length)
+ buf = PyByteArray_AsString(self._raw_name)
+ memcpy(buf + size, at, length)
+
+ cdef _on_header_value(self, char* at, size_t length):
+ cdef Py_ssize_t size
+ cdef char *buf
+
+ size = PyByteArray_Size(self._raw_value)
+ PyByteArray_Resize(self._raw_value, size + length)
+ buf = PyByteArray_AsString(self._raw_value)
+ memcpy(buf + size, at, length)
+ self._has_value = True
+
+ cdef _on_headers_complete(self):
+ self._process_header()
+
+ method = http_method_str(self._cparser.method)
+ should_close = not cparser.llhttp_should_keep_alive(self._cparser)
+ upgrade = self._cparser.upgrade
+ chunked = self._cparser.flags & cparser.F_CHUNKED
+
+ raw_headers = tuple(self._raw_headers)
+ headers = CIMultiDictProxy(self._headers)
+
+ if upgrade or self._cparser.method == cparser.HTTP_CONNECT:
+ self._upgraded = True
+
+ # do not support old websocket spec
+ if SEC_WEBSOCKET_KEY1 in headers:
+ raise InvalidHeader(SEC_WEBSOCKET_KEY1)
+
+ encoding = None
+ enc = self._content_encoding
+ if enc is not None:
+ self._content_encoding = None
+ enc = enc.lower()
+ if enc in ('gzip', 'deflate', 'br'):
+ encoding = enc
+
+ if self._cparser.type == cparser.HTTP_REQUEST:
+ msg = _new_request_message(
+ method, self._path,
+ self.http_version(), headers, raw_headers,
+ should_close, encoding, upgrade, chunked, self._url)
+ else:
+ msg = _new_response_message(
+ self.http_version(), self._cparser.status_code, self._reason,
+ headers, raw_headers, should_close, encoding,
+ upgrade, chunked)
+
+ if (
+ ULLONG_MAX > self._cparser.content_length > 0 or chunked or
+ self._cparser.method == cparser.HTTP_CONNECT or
+ (self._cparser.status_code >= 199 and
+ self._cparser.content_length == 0 and
+ self._read_until_eof)
+ ):
+ payload = StreamReader(
+ self._protocol, timer=self._timer, loop=self._loop,
+ limit=self._limit)
+ else:
+ payload = EMPTY_PAYLOAD
+
+ self._payload = payload
+ if encoding is not None and self._auto_decompress:
+ self._payload = DeflateBuffer(payload, encoding)
+
+ if not self._response_with_body:
+ payload = EMPTY_PAYLOAD
+
+ self._messages.append((msg, payload))
+
+ cdef _on_message_complete(self):
+ self._payload.feed_eof()
+ self._payload = None
+
+ cdef _on_chunk_header(self):
+ self._payload.begin_http_chunk_receiving()
+
+ cdef _on_chunk_complete(self):
+ self._payload.end_http_chunk_receiving()
+
+ cdef object _on_status_complete(self):
+ pass
+
+ cdef inline http_version(self):
+ cdef cparser.llhttp_t* parser = self._cparser
+
+ if parser.http_major == 1:
+ if parser.http_minor == 0:
+ return HttpVersion10
+ elif parser.http_minor == 1:
+ return HttpVersion11
+
+ return HttpVersion(parser.http_major, parser.http_minor)
+
+ ### Public API ###
+
+ def feed_eof(self):
+ cdef bytes desc
+
+ if self._payload is not None:
+ if self._cparser.flags & cparser.F_CHUNKED:
+ raise TransferEncodingError(
+ "Not enough data for satisfy transfer length header.")
+ elif self._cparser.flags & cparser.F_CONTENT_LENGTH:
+ raise ContentLengthError(
+ "Not enough data for satisfy content length header.")
+ elif cparser.llhttp_get_errno(self._cparser) != cparser.HPE_OK:
+ desc = cparser.llhttp_get_error_reason(self._cparser)
+ raise PayloadEncodingError(desc.decode('latin-1'))
+ else:
+ self._payload.feed_eof()
+ elif self._started:
+ self._on_headers_complete()
+ if self._messages:
+ return self._messages[-1][0]
+
+ def feed_data(self, data):
+ cdef:
+ size_t data_len
+ size_t nb
+ cdef cparser.llhttp_errno_t errno
+
+ PyObject_GetBuffer(data, &self.py_buf, PyBUF_SIMPLE)
+ data_len = <size_t>self.py_buf.len
+
+ errno = cparser.llhttp_execute(
+ self._cparser,
+ <char*>self.py_buf.buf,
+ data_len)
+
+ if errno is cparser.HPE_PAUSED_UPGRADE:
+ cparser.llhttp_resume_after_upgrade(self._cparser)
+
+ nb = cparser.llhttp_get_error_pos(self._cparser) - <char*>self.py_buf.buf
+
+ PyBuffer_Release(&self.py_buf)
+
+ if errno not in (cparser.HPE_OK, cparser.HPE_PAUSED_UPGRADE):
+ if self._payload_error == 0:
+ if self._last_error is not None:
+ ex = self._last_error
+ self._last_error = None
+ else:
+ after = cparser.llhttp_get_error_pos(self._cparser)
+ before = data[:after - <char*>self.py_buf.buf]
+ after_b = after.split(b"\n", 1)[0]
+ before = before.rsplit(b"\n", 1)[-1]
+ data = before + after_b
+ pointer = " " * (len(repr(before))-1) + "^"
+ ex = parser_error_from_errno(self._cparser, data, pointer)
+ self._payload = None
+ raise ex
+
+ if self._messages:
+ messages = self._messages
+ self._messages = []
+ else:
+ messages = ()
+
+ if self._upgraded:
+ return messages, True, data[nb:]
+ else:
+ return messages, False, b''
+
+ def set_upgraded(self, val):
+ self._upgraded = val
+
+
+cdef class HttpRequestParser(HttpParser):
+
+ def __init__(
+ self, protocol, loop, int limit, timer=None,
+ size_t max_line_size=8190, size_t max_headers=32768,
+ size_t max_field_size=8190, payload_exception=None,
+ bint response_with_body=True, bint read_until_eof=False,
+ bint auto_decompress=True,
+ ):
+ self._init(cparser.HTTP_REQUEST, protocol, loop, limit, timer,
+ max_line_size, max_headers, max_field_size,
+ payload_exception, response_with_body, read_until_eof,
+ auto_decompress)
+
+ cdef object _on_status_complete(self):
+ cdef int idx1, idx2
+ if not self._buf:
+ return
+ self._path = self._buf.decode('utf-8', 'surrogateescape')
+ try:
+ idx3 = len(self._path)
+ if self._cparser.method == cparser.HTTP_CONNECT:
+ # authority-form,
+ # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3
+ self._url = URL.build(authority=self._path, encoded=True)
+ elif idx3 > 1 and self._path[0] == '/':
+ # origin-form,
+ # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1
+ idx1 = self._path.find("?")
+ if idx1 == -1:
+ query = ""
+ idx2 = self._path.find("#")
+ if idx2 == -1:
+ path = self._path
+ fragment = ""
+ else:
+ path = self._path[0: idx2]
+ fragment = self._path[idx2+1:]
+
+ else:
+ path = self._path[0:idx1]
+ idx1 += 1
+ idx2 = self._path.find("#", idx1+1)
+ if idx2 == -1:
+ query = self._path[idx1:]
+ fragment = ""
+ else:
+ query = self._path[idx1: idx2]
+ fragment = self._path[idx2+1:]
+
+ self._url = URL.build(
+ path=path,
+ query_string=query,
+ fragment=fragment,
+ encoded=True,
+ )
+ else:
+ # absolute-form for proxy maybe,
+ # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.2
+ self._url = URL(self._path, encoded=True)
+ finally:
+ PyByteArray_Resize(self._buf, 0)
+
+
+cdef class HttpResponseParser(HttpParser):
+
+ def __init__(
+ self, protocol, loop, int limit, timer=None,
+ size_t max_line_size=8190, size_t max_headers=32768,
+ size_t max_field_size=8190, payload_exception=None,
+ bint response_with_body=True, bint read_until_eof=False,
+ bint auto_decompress=True
+ ):
+ self._init(cparser.HTTP_RESPONSE, protocol, loop, limit, timer,
+ max_line_size, max_headers, max_field_size,
+ payload_exception, response_with_body, read_until_eof,
+ auto_decompress)
+
+ cdef object _on_status_complete(self):
+ if self._buf:
+ self._reason = self._buf.decode('utf-8', 'surrogateescape')
+ PyByteArray_Resize(self._buf, 0)
+ else:
+ self._reason = self._reason or ''
+
+cdef int cb_on_message_begin(cparser.llhttp_t* parser) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+
+ pyparser._started = True
+ pyparser._headers = CIMultiDict()
+ pyparser._raw_headers = []
+ PyByteArray_Resize(pyparser._buf, 0)
+ pyparser._path = None
+ pyparser._reason = None
+ return 0
+
+
+cdef int cb_on_url(cparser.llhttp_t* parser,
+ const char *at, size_t length) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ try:
+ if length > pyparser._max_line_size:
+ raise LineTooLong(
+ 'Status line is too long', pyparser._max_line_size, length)
+ extend(pyparser._buf, at, length)
+ except BaseException as ex:
+ pyparser._last_error = ex
+ return -1
+ else:
+ return 0
+
+
+cdef int cb_on_status(cparser.llhttp_t* parser,
+ const char *at, size_t length) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ cdef str reason
+ try:
+ if length > pyparser._max_line_size:
+ raise LineTooLong(
+ 'Status line is too long', pyparser._max_line_size, length)
+ extend(pyparser._buf, at, length)
+ except BaseException as ex:
+ pyparser._last_error = ex
+ return -1
+ else:
+ return 0
+
+
+cdef int cb_on_header_field(cparser.llhttp_t* parser,
+ const char *at, size_t length) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ cdef Py_ssize_t size
+ try:
+ pyparser._on_status_complete()
+ size = len(pyparser._raw_name) + length
+ if size > pyparser._max_field_size:
+ raise LineTooLong(
+ 'Header name is too long', pyparser._max_field_size, size)
+ pyparser._on_header_field(at, length)
+ except BaseException as ex:
+ pyparser._last_error = ex
+ return -1
+ else:
+ return 0
+
+
+cdef int cb_on_header_value(cparser.llhttp_t* parser,
+ const char *at, size_t length) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ cdef Py_ssize_t size
+ try:
+ size = len(pyparser._raw_value) + length
+ if size > pyparser._max_field_size:
+ raise LineTooLong(
+ 'Header value is too long', pyparser._max_field_size, size)
+ pyparser._on_header_value(at, length)
+ except BaseException as ex:
+ pyparser._last_error = ex
+ return -1
+ else:
+ return 0
+
+
+cdef int cb_on_headers_complete(cparser.llhttp_t* parser) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ try:
+ pyparser._on_status_complete()
+ pyparser._on_headers_complete()
+ except BaseException as exc:
+ pyparser._last_error = exc
+ return -1
+ else:
+ if (
+ pyparser._cparser.upgrade or
+ pyparser._cparser.method == cparser.HTTP_CONNECT
+ ):
+ return 2
+ else:
+ return 0
+
+
+cdef int cb_on_body(cparser.llhttp_t* parser,
+ const char *at, size_t length) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ cdef bytes body = at[:length]
+ try:
+ pyparser._payload.feed_data(body, length)
+ except BaseException as exc:
+ if pyparser._payload_exception is not None:
+ pyparser._payload.set_exception(pyparser._payload_exception(str(exc)))
+ else:
+ pyparser._payload.set_exception(exc)
+ pyparser._payload_error = 1
+ return -1
+ else:
+ return 0
+
+
+cdef int cb_on_message_complete(cparser.llhttp_t* parser) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ try:
+ pyparser._started = False
+ pyparser._on_message_complete()
+ except BaseException as exc:
+ pyparser._last_error = exc
+ return -1
+ else:
+ return 0
+
+
+cdef int cb_on_chunk_header(cparser.llhttp_t* parser) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ try:
+ pyparser._on_chunk_header()
+ except BaseException as exc:
+ pyparser._last_error = exc
+ return -1
+ else:
+ return 0
+
+
+cdef int cb_on_chunk_complete(cparser.llhttp_t* parser) except -1:
+ cdef HttpParser pyparser = <HttpParser>parser.data
+ try:
+ pyparser._on_chunk_complete()
+ except BaseException as exc:
+ pyparser._last_error = exc
+ return -1
+ else:
+ return 0
+
+
+cdef parser_error_from_errno(cparser.llhttp_t* parser, data, pointer):
+ cdef cparser.llhttp_errno_t errno = cparser.llhttp_get_errno(parser)
+ cdef bytes desc = cparser.llhttp_get_error_reason(parser)
+
+ if errno in (cparser.HPE_CB_MESSAGE_BEGIN,
+ cparser.HPE_CB_HEADERS_COMPLETE,
+ cparser.HPE_CB_MESSAGE_COMPLETE,
+ cparser.HPE_CB_CHUNK_HEADER,
+ cparser.HPE_CB_CHUNK_COMPLETE,
+ cparser.HPE_INVALID_CONSTANT,
+ cparser.HPE_INVALID_HEADER_TOKEN,
+ cparser.HPE_INVALID_CONTENT_LENGTH,
+ cparser.HPE_INVALID_CHUNK_SIZE,
+ cparser.HPE_INVALID_EOF_STATE,
+ cparser.HPE_INVALID_TRANSFER_ENCODING):
+ cls = BadHttpMessage
+
+ elif errno == cparser.HPE_INVALID_STATUS:
+ cls = BadStatusLine
+
+ elif errno == cparser.HPE_INVALID_METHOD:
+ cls = BadStatusLine
+
+ elif errno == cparser.HPE_INVALID_VERSION:
+ cls = BadStatusLine
+
+ elif errno == cparser.HPE_INVALID_URL:
+ cls = InvalidURLError
+
+ else:
+ cls = BadHttpMessage
+
+ return cls("{}:\n\n {!r}\n {}".format(desc.decode("latin-1"), data, pointer))
diff --git a/third_party/python/aiohttp/aiohttp/_http_writer.c b/third_party/python/aiohttp/aiohttp/_http_writer.c
new file mode 100644
index 0000000000..42c099a5da
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_http_writer.c
@@ -0,0 +1,6243 @@
+/* Generated by Cython 0.29.32 */
+
+#ifndef PY_SSIZE_T_CLEAN
+#define PY_SSIZE_T_CLEAN
+#endif /* PY_SSIZE_T_CLEAN */
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+ #error Cython requires Python 2.6+ or Python 3.3+.
+#else
+#define CYTHON_ABI "0_29_32"
+#define CYTHON_HEX_VERSION 0x001D20F0
+#define CYTHON_FUTURE_DIVISION 1
+#include <stddef.h>
+#ifndef offsetof
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#define __PYX_COMMA ,
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x02070000
+ #define HAVE_LONG_LONG
+ #endif
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #if PY_VERSION_HEX < 0x03050000
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
+ #endif
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
+ #endif
+#elif defined(PY_NOGIL)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #ifndef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 1
+ #endif
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+#else
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
+ #define CYTHON_USE_PYTYPE_LOOKUP 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #if PY_VERSION_HEX >= 0x030B00A4
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #elif !defined(CYTHON_FAST_THREAD_STATE)
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
+ #endif
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+ #endif
+ #ifndef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
+ #endif
+ #if PY_VERSION_HEX >= 0x030B00A4
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #elif !defined(CYTHON_USE_EXC_INFO_STACK)
+ #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
+ #endif
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #if PY_MAJOR_VERSION < 3
+ #include "longintrepr.h"
+ #endif
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+ #ifdef SIZEOF_VOID_P
+ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
+ #endif
+#endif
+#ifndef __has_attribute
+ #define __has_attribute(x) 0
+#endif
+#ifndef __has_cpp_attribute
+ #define __has_cpp_attribute(x) 0
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+#ifdef _MSC_VER
+ #ifndef _MSC_STDINT_H_
+ #if _MSC_VER < 1300
+ typedef unsigned char uint8_t;
+ typedef unsigned int uint32_t;
+ #else
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int32 uint32_t;
+ #endif
+ #endif
+#else
+ #include <stdint.h>
+#endif
+#ifndef CYTHON_FALLTHROUGH
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+ #if __has_cpp_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH [[fallthrough]]
+ #elif __has_cpp_attribute(clang::fallthrough)
+ #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
+ #elif __has_cpp_attribute(gnu::fallthrough)
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
+ #endif
+ #endif
+ #ifndef CYTHON_FALLTHROUGH
+ #if __has_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
+ #else
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+ #if defined(__clang__ ) && defined(__apple_build_version__)
+ #if __apple_build_version__ < 7000000
+ #undef CYTHON_FALLTHROUGH
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+#endif
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_DefaultClassType PyType_Type
+#if PY_VERSION_HEX >= 0x030B00A1
+ static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
+ PyObject *code, PyObject *c, PyObject* n, PyObject *v,
+ PyObject *fv, PyObject *cell, PyObject* fn,
+ PyObject *name, int fline, PyObject *lnos) {
+ PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
+ PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
+ const char *fn_cstr=NULL;
+ const char *name_cstr=NULL;
+ PyCodeObject* co=NULL;
+ PyObject *type, *value, *traceback;
+ PyErr_Fetch(&type, &value, &traceback);
+ if (!(kwds=PyDict_New())) goto end;
+ if (!(argcount=PyLong_FromLong(a))) goto end;
+ if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
+ if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
+ if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
+ if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
+ if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
+ if (!(nlocals=PyLong_FromLong(l))) goto end;
+ if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
+ if (!(stacksize=PyLong_FromLong(s))) goto end;
+ if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
+ if (!(flags=PyLong_FromLong(f))) goto end;
+ if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
+ if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
+ if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
+ if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
+ if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
+ if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
+ if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
+ Py_XDECREF((PyObject*)co);
+ co = (PyCodeObject*)call_result;
+ call_result = NULL;
+ if (0) {
+ cleanup_code_too:
+ Py_XDECREF((PyObject*)co);
+ co = NULL;
+ }
+ end:
+ Py_XDECREF(kwds);
+ Py_XDECREF(argcount);
+ Py_XDECREF(posonlyargcount);
+ Py_XDECREF(kwonlyargcount);
+ Py_XDECREF(nlocals);
+ Py_XDECREF(stacksize);
+ Py_XDECREF(replace);
+ Py_XDECREF(call_result);
+ Py_XDECREF(empty);
+ if (type) {
+ PyErr_Restore(type, value, traceback);
+ }
+ return co;
+ }
+#else
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+#endif
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#ifndef Py_TPFLAGS_CHECKTYPES
+ #define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
+ #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#ifndef METH_STACKLESS
+ #define METH_STACKLESS 0
+#endif
+#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
+ #ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ #endif
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
+ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+ #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
+ #define PyMem_RawMalloc(n) PyMem_Malloc(n)
+ #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
+ #define PyMem_RawFree(p) PyMem_Free(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
+#endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+ #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
+#include "pythread.h"
+#define Py_tss_NEEDS_INIT 0
+typedef int Py_tss_t;
+static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
+ *key = PyThread_create_key();
+ return 0;
+}
+static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
+ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
+ *key = Py_tss_NEEDS_INIT;
+ return key;
+}
+static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
+ PyObject_Free(key);
+}
+static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
+ return *key != Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
+ PyThread_delete_key(*key);
+ *key = Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
+ return PyThread_set_key_value(*key, value);
+}
+static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
+ return PyThread_get_key_value(*key);
+}
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n) PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
+#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
+#else
+#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #if defined(PyUnicode_IS_READY)
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #else
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #endif
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
+ #endif
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
+ #endif
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#ifndef PyObject_Unicode
+ #define PyObject_Unicode PyObject_Str
+#endif
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#if PY_VERSION_HEX >= 0x030900A4
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
+#else
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
+#endif
+#if CYTHON_ASSUME_SAFE_MACROS
+ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
+#else
+ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
+ #else
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+ #endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+#endif
+
+#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
+ #if !defined(_USE_MATH_DEFINES)
+ #define _USE_MATH_DEFINES
+ #endif
+#endif
+#include <math.h>
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
+#endif
+
+#define __PYX_MARK_ERR_POS(f_index, lineno) \
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#define __PYX_HAVE__aiohttp___http_writer
+#define __PYX_HAVE_API__aiohttp___http_writer
+/* Early includes */
+#include <string.h>
+#include <stdio.h>
+#include <stdint.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
+ return (size_t) i < (size_t) limit;
+}
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER)
+ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
+#if CYTHON_ASSUME_SAFE_MACROS
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
+
+static PyObject *__pyx_m = NULL;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_cython_runtime = NULL;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "aiohttp/_http_writer.pyx",
+ "type.pxd",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_t_7aiohttp_12_http_writer_Writer;
+
+/* "aiohttp/_http_writer.pyx":18
+ * # ----------------- writer ---------------------------
+ *
+ * cdef struct Writer: # <<<<<<<<<<<<<<
+ * char *buf
+ * Py_ssize_t size
+ */
+struct __pyx_t_7aiohttp_12_http_writer_Writer {
+ char *buf;
+ Py_ssize_t size;
+ Py_ssize_t pos;
+};
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ if (acquire_gil) {\
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ PyGILState_Release(__pyx_gilstate_save);\
+ } else {\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext()\
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_XDECREF(tmp);\
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_DECREF(tmp);\
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+/* GetBuiltinName.proto */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred() PyErr_Occurred()
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* WriteUnraisableException.proto */
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback, int nogil);
+
+/* unicode_iter.proto */
+static CYTHON_INLINE int __Pyx_init_unicode_iteration(
+ PyObject* ustring, Py_ssize_t *length, void** data, int *kind);
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#define __Pyx_BUILD_ASSERT_EXPR(cond)\
+ (sizeof(char [1 - 2*!(cond)]) - 1)
+#ifndef Py_MEMBER_SIZE
+#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
+#endif
+#if CYTHON_FAST_PYCALL
+ static size_t __pyx_pyframe_localsplus_offset = 0;
+ #include "frameobject.h"
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+ #define __Pxy_PyFrame_Initialize_Offsets()\
+ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
+ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
+ #define __Pyx_PyFrame_GetLocalsplus(frame)\
+ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
+#endif // CYTHON_FAST_PYCALL
+#endif
+
+/* PyObjectCall.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+/* PyObjectCall2Args.proto */
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
+
+/* PyObjectCallMethO.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+/* PyObjectCallOneArg.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+/* RaiseException.proto */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+/* PyUnicodeContains.proto */
+static CYTHON_INLINE int __Pyx_PyUnicode_ContainsTF(PyObject* substring, PyObject* text, int eq) {
+ int result = PyUnicode_Contains(text, substring);
+ return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
+}
+
+/* RaiseArgTupleInvalid.proto */
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+/* RaiseDoubleKeywords.proto */
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
+ const char* function_name);
+
+/* ArgTypeTest.proto */
+#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
+ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
+ __Pyx__ArgTypeTest(obj, type, name, exact))
+static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
+
+/* IterFinish.proto */
+static CYTHON_INLINE int __Pyx_IterFinish(void);
+
+/* PyObjectCallNoArg.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
+#else
+#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
+#endif
+
+/* PyObjectGetMethod.proto */
+static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
+
+/* PyObjectCallMethod0.proto */
+static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
+
+/* RaiseNeedMoreValuesToUnpack.proto */
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+/* RaiseTooManyValuesToUnpack.proto */
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+
+/* UnpackItemEndCheck.proto */
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
+
+/* RaiseNoneIterError.proto */
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+/* UnpackTupleError.proto */
+static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
+
+/* UnpackTuple2.proto */
+#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
+ (likely(is_tuple || PyTuple_Check(tuple)) ?\
+ (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
+ __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
+ (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
+ __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
+static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
+ PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
+static int __Pyx_unpack_tuple2_generic(
+ PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
+
+/* dict_iter.proto */
+static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
+ Py_ssize_t* p_orig_length, int* p_is_dict);
+static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
+
+/* GetTopmostException.proto */
+#if CYTHON_USE_EXC_INFO_STACK
+static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
+#endif
+
+/* ReRaiseException.proto */
+static CYTHON_INLINE void __Pyx_ReraiseException(void);
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* TypeImport.proto */
+#ifndef __PYX_HAVE_RT_ImportType_proto
+#define __PYX_HAVE_RT_ImportType_proto
+enum __Pyx_ImportType_CheckSize {
+ __Pyx_ImportType_CheckSize_Error = 0,
+ __Pyx_ImportType_CheckSize_Warn = 1,
+ __Pyx_ImportType_CheckSize_Ignore = 2
+};
+static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+/* ImportFrom.proto */
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+/* PyDictVersioning.proto */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
+#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
+#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
+ (version_var) = __PYX_GET_DICT_VERSION(dict);\
+ (cache_var) = (value);
+#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
+ static PY_UINT64_T __pyx_dict_version = 0;\
+ static PyObject *__pyx_dict_cached_value = NULL;\
+ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
+ (VAR) = __pyx_dict_cached_value;\
+ } else {\
+ (VAR) = __pyx_dict_cached_value = (LOOKUP);\
+ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
+ }\
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
+#else
+#define __PYX_GET_DICT_VERSION(dict) (0)
+#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
+#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
+#endif
+
+/* GetModuleGlobalName.proto */
+#if CYTHON_USE_DICT_VERSIONS
+#define __Pyx_GetModuleGlobalName(var, name) {\
+ static PY_UINT64_T __pyx_dict_version = 0;\
+ static PyObject *__pyx_dict_cached_value = NULL;\
+ (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
+ (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
+ __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
+}
+#define __Pyx_GetModuleGlobalNameUncached(var, name) {\
+ PY_UINT64_T __pyx_dict_version;\
+ PyObject *__pyx_dict_cached_value;\
+ (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
+}
+static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
+#else
+#define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
+#define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
+static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
+#endif
+
+/* CLineInTraceback.proto */
+#ifdef CYTHON_CLINE_IN_TRACEBACK
+#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
+#else
+static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
+#endif
+
+/* CodeObjectCache.proto */
+typedef struct {
+ PyCodeObject* code_object;
+ int code_line;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+/* AddTraceback.proto */
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+/* GCCDiagnostics.proto */
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+#define __Pyx_HAS_GCC_DIAGNOSTIC
+#endif
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
+
+/* CheckBinaryVersion.proto */
+static int __Pyx_check_binary_version(void);
+
+/* InitStrings.proto */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'libc.stdint' */
+
+/* Module declarations from 'aiohttp._http_writer' */
+static char __pyx_v_7aiohttp_12_http_writer_BUFFER[0x4000];
+static PyObject *__pyx_v_7aiohttp_12_http_writer__istr = 0;
+static CYTHON_INLINE void __pyx_f_7aiohttp_12_http_writer__init_writer(struct __pyx_t_7aiohttp_12_http_writer_Writer *); /*proto*/
+static CYTHON_INLINE void __pyx_f_7aiohttp_12_http_writer__release_writer(struct __pyx_t_7aiohttp_12_http_writer_Writer *); /*proto*/
+static CYTHON_INLINE int __pyx_f_7aiohttp_12_http_writer__write_byte(struct __pyx_t_7aiohttp_12_http_writer_Writer *, uint8_t); /*proto*/
+static CYTHON_INLINE int __pyx_f_7aiohttp_12_http_writer__write_utf8(struct __pyx_t_7aiohttp_12_http_writer_Writer *, Py_UCS4); /*proto*/
+static CYTHON_INLINE int __pyx_f_7aiohttp_12_http_writer__write_str(struct __pyx_t_7aiohttp_12_http_writer_Writer *, PyObject *); /*proto*/
+static PyObject *__pyx_f_7aiohttp_12_http_writer_to_str(PyObject *); /*proto*/
+static void __pyx_f_7aiohttp_12_http_writer__safe_header(PyObject *); /*proto*/
+#define __Pyx_MODULE_NAME "aiohttp._http_writer"
+extern int __pyx_module_is_main_aiohttp___http_writer;
+int __pyx_module_is_main_aiohttp___http_writer = 0;
+
+/* Implementation of 'aiohttp._http_writer' */
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_ValueError;
+static const char __pyx_k_[] = "\r";
+static const char __pyx_k__2[] = "\n";
+static const char __pyx_k_key[] = "key";
+static const char __pyx_k_ret[] = "ret";
+static const char __pyx_k_val[] = "val";
+static const char __pyx_k_istr[] = "istr";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_name[] = "__name__";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_items[] = "items";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_writer[] = "writer";
+static const char __pyx_k_headers[] = "headers";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_multidict[] = "multidict";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_status_line[] = "status_line";
+static const char __pyx_k_serialize_headers[] = "_serialize_headers";
+static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
+static const char __pyx_k_aiohttp__http_writer[] = "aiohttp._http_writer";
+static const char __pyx_k_aiohttp__http_writer_pyx[] = "aiohttp/_http_writer.pyx";
+static const char __pyx_k_Cannot_serialize_non_str_key_r[] = "Cannot serialize non-str key {!r}";
+static const char __pyx_k_Newline_or_carriage_return_chara[] = "Newline or carriage return character detected in HTTP status message or header. This is a potential security issue.";
+static PyObject *__pyx_kp_u_;
+static PyObject *__pyx_kp_u_Cannot_serialize_non_str_key_r;
+static PyObject *__pyx_kp_u_Newline_or_carriage_return_chara;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_kp_u__2;
+static PyObject *__pyx_n_s_aiohttp__http_writer;
+static PyObject *__pyx_kp_s_aiohttp__http_writer_pyx;
+static PyObject *__pyx_n_s_cline_in_traceback;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_headers;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_istr;
+static PyObject *__pyx_n_s_items;
+static PyObject *__pyx_n_s_key;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_multidict;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_ret;
+static PyObject *__pyx_n_s_serialize_headers;
+static PyObject *__pyx_n_s_status_line;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_val;
+static PyObject *__pyx_n_s_writer;
+static PyObject *__pyx_pf_7aiohttp_12_http_writer__serialize_headers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_status_line, PyObject *__pyx_v_headers); /* proto */
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_codeobj__5;
+/* Late includes */
+
+/* "aiohttp/_http_writer.pyx":24
+ *
+ *
+ * cdef inline void _init_writer(Writer* writer): # <<<<<<<<<<<<<<
+ * writer.buf = &BUFFER[0]
+ * writer.size = BUF_SIZE
+ */
+
+static CYTHON_INLINE void __pyx_f_7aiohttp_12_http_writer__init_writer(struct __pyx_t_7aiohttp_12_http_writer_Writer *__pyx_v_writer) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_init_writer", 0);
+
+ /* "aiohttp/_http_writer.pyx":25
+ *
+ * cdef inline void _init_writer(Writer* writer):
+ * writer.buf = &BUFFER[0] # <<<<<<<<<<<<<<
+ * writer.size = BUF_SIZE
+ * writer.pos = 0
+ */
+ __pyx_v_writer->buf = (&(__pyx_v_7aiohttp_12_http_writer_BUFFER[0]));
+
+ /* "aiohttp/_http_writer.pyx":26
+ * cdef inline void _init_writer(Writer* writer):
+ * writer.buf = &BUFFER[0]
+ * writer.size = BUF_SIZE # <<<<<<<<<<<<<<
+ * writer.pos = 0
+ *
+ */
+ __pyx_v_writer->size = 0x4000;
+
+ /* "aiohttp/_http_writer.pyx":27
+ * writer.buf = &BUFFER[0]
+ * writer.size = BUF_SIZE
+ * writer.pos = 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_writer->pos = 0;
+
+ /* "aiohttp/_http_writer.pyx":24
+ *
+ *
+ * cdef inline void _init_writer(Writer* writer): # <<<<<<<<<<<<<<
+ * writer.buf = &BUFFER[0]
+ * writer.size = BUF_SIZE
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "aiohttp/_http_writer.pyx":30
+ *
+ *
+ * cdef inline void _release_writer(Writer* writer): # <<<<<<<<<<<<<<
+ * if writer.buf != BUFFER:
+ * PyMem_Free(writer.buf)
+ */
+
+static CYTHON_INLINE void __pyx_f_7aiohttp_12_http_writer__release_writer(struct __pyx_t_7aiohttp_12_http_writer_Writer *__pyx_v_writer) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("_release_writer", 0);
+
+ /* "aiohttp/_http_writer.pyx":31
+ *
+ * cdef inline void _release_writer(Writer* writer):
+ * if writer.buf != BUFFER: # <<<<<<<<<<<<<<
+ * PyMem_Free(writer.buf)
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_writer->buf != __pyx_v_7aiohttp_12_http_writer_BUFFER) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":32
+ * cdef inline void _release_writer(Writer* writer):
+ * if writer.buf != BUFFER:
+ * PyMem_Free(writer.buf) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ PyMem_Free(__pyx_v_writer->buf);
+
+ /* "aiohttp/_http_writer.pyx":31
+ *
+ * cdef inline void _release_writer(Writer* writer):
+ * if writer.buf != BUFFER: # <<<<<<<<<<<<<<
+ * PyMem_Free(writer.buf)
+ *
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":30
+ *
+ *
+ * cdef inline void _release_writer(Writer* writer): # <<<<<<<<<<<<<<
+ * if writer.buf != BUFFER:
+ * PyMem_Free(writer.buf)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "aiohttp/_http_writer.pyx":35
+ *
+ *
+ * cdef inline int _write_byte(Writer* writer, uint8_t ch): # <<<<<<<<<<<<<<
+ * cdef char * buf
+ * cdef Py_ssize_t size
+ */
+
+static CYTHON_INLINE int __pyx_f_7aiohttp_12_http_writer__write_byte(struct __pyx_t_7aiohttp_12_http_writer_Writer *__pyx_v_writer, uint8_t __pyx_v_ch) {
+ char *__pyx_v_buf;
+ Py_ssize_t __pyx_v_size;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_write_byte", 0);
+
+ /* "aiohttp/_http_writer.pyx":39
+ * cdef Py_ssize_t size
+ *
+ * if writer.pos == writer.size: # <<<<<<<<<<<<<<
+ * # reallocate
+ * size = writer.size + BUF_SIZE
+ */
+ __pyx_t_1 = ((__pyx_v_writer->pos == __pyx_v_writer->size) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":41
+ * if writer.pos == writer.size:
+ * # reallocate
+ * size = writer.size + BUF_SIZE # <<<<<<<<<<<<<<
+ * if writer.buf == BUFFER:
+ * buf = <char*>PyMem_Malloc(size)
+ */
+ __pyx_v_size = (__pyx_v_writer->size + 0x4000);
+
+ /* "aiohttp/_http_writer.pyx":42
+ * # reallocate
+ * size = writer.size + BUF_SIZE
+ * if writer.buf == BUFFER: # <<<<<<<<<<<<<<
+ * buf = <char*>PyMem_Malloc(size)
+ * if buf == NULL:
+ */
+ __pyx_t_1 = ((__pyx_v_writer->buf == __pyx_v_7aiohttp_12_http_writer_BUFFER) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":43
+ * size = writer.size + BUF_SIZE
+ * if writer.buf == BUFFER:
+ * buf = <char*>PyMem_Malloc(size) # <<<<<<<<<<<<<<
+ * if buf == NULL:
+ * PyErr_NoMemory()
+ */
+ __pyx_v_buf = ((char *)PyMem_Malloc(__pyx_v_size));
+
+ /* "aiohttp/_http_writer.pyx":44
+ * if writer.buf == BUFFER:
+ * buf = <char*>PyMem_Malloc(size)
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * PyErr_NoMemory()
+ * return -1
+ */
+ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":45
+ * buf = <char*>PyMem_Malloc(size)
+ * if buf == NULL:
+ * PyErr_NoMemory() # <<<<<<<<<<<<<<
+ * return -1
+ * memcpy(buf, writer.buf, writer.size)
+ */
+ __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == ((PyObject *)NULL))) __PYX_ERR(0, 45, __pyx_L1_error)
+
+ /* "aiohttp/_http_writer.pyx":46
+ * if buf == NULL:
+ * PyErr_NoMemory()
+ * return -1 # <<<<<<<<<<<<<<
+ * memcpy(buf, writer.buf, writer.size)
+ * else:
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":44
+ * if writer.buf == BUFFER:
+ * buf = <char*>PyMem_Malloc(size)
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * PyErr_NoMemory()
+ * return -1
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":47
+ * PyErr_NoMemory()
+ * return -1
+ * memcpy(buf, writer.buf, writer.size) # <<<<<<<<<<<<<<
+ * else:
+ * buf = <char*>PyMem_Realloc(writer.buf, size)
+ */
+ (void)(memcpy(__pyx_v_buf, __pyx_v_writer->buf, __pyx_v_writer->size));
+
+ /* "aiohttp/_http_writer.pyx":42
+ * # reallocate
+ * size = writer.size + BUF_SIZE
+ * if writer.buf == BUFFER: # <<<<<<<<<<<<<<
+ * buf = <char*>PyMem_Malloc(size)
+ * if buf == NULL:
+ */
+ goto __pyx_L4;
+ }
+
+ /* "aiohttp/_http_writer.pyx":49
+ * memcpy(buf, writer.buf, writer.size)
+ * else:
+ * buf = <char*>PyMem_Realloc(writer.buf, size) # <<<<<<<<<<<<<<
+ * if buf == NULL:
+ * PyErr_NoMemory()
+ */
+ /*else*/ {
+ __pyx_v_buf = ((char *)PyMem_Realloc(__pyx_v_writer->buf, __pyx_v_size));
+
+ /* "aiohttp/_http_writer.pyx":50
+ * else:
+ * buf = <char*>PyMem_Realloc(writer.buf, size)
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * PyErr_NoMemory()
+ * return -1
+ */
+ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":51
+ * buf = <char*>PyMem_Realloc(writer.buf, size)
+ * if buf == NULL:
+ * PyErr_NoMemory() # <<<<<<<<<<<<<<
+ * return -1
+ * writer.buf = buf
+ */
+ __pyx_t_2 = PyErr_NoMemory(); if (unlikely(__pyx_t_2 == ((PyObject *)NULL))) __PYX_ERR(0, 51, __pyx_L1_error)
+
+ /* "aiohttp/_http_writer.pyx":52
+ * if buf == NULL:
+ * PyErr_NoMemory()
+ * return -1 # <<<<<<<<<<<<<<
+ * writer.buf = buf
+ * writer.size = size
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":50
+ * else:
+ * buf = <char*>PyMem_Realloc(writer.buf, size)
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * PyErr_NoMemory()
+ * return -1
+ */
+ }
+ }
+ __pyx_L4:;
+
+ /* "aiohttp/_http_writer.pyx":53
+ * PyErr_NoMemory()
+ * return -1
+ * writer.buf = buf # <<<<<<<<<<<<<<
+ * writer.size = size
+ * writer.buf[writer.pos] = <char>ch
+ */
+ __pyx_v_writer->buf = __pyx_v_buf;
+
+ /* "aiohttp/_http_writer.pyx":54
+ * return -1
+ * writer.buf = buf
+ * writer.size = size # <<<<<<<<<<<<<<
+ * writer.buf[writer.pos] = <char>ch
+ * writer.pos += 1
+ */
+ __pyx_v_writer->size = __pyx_v_size;
+
+ /* "aiohttp/_http_writer.pyx":39
+ * cdef Py_ssize_t size
+ *
+ * if writer.pos == writer.size: # <<<<<<<<<<<<<<
+ * # reallocate
+ * size = writer.size + BUF_SIZE
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":55
+ * writer.buf = buf
+ * writer.size = size
+ * writer.buf[writer.pos] = <char>ch # <<<<<<<<<<<<<<
+ * writer.pos += 1
+ * return 0
+ */
+ (__pyx_v_writer->buf[__pyx_v_writer->pos]) = ((char)__pyx_v_ch);
+
+ /* "aiohttp/_http_writer.pyx":56
+ * writer.size = size
+ * writer.buf[writer.pos] = <char>ch
+ * writer.pos += 1 # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ __pyx_v_writer->pos = (__pyx_v_writer->pos + 1);
+
+ /* "aiohttp/_http_writer.pyx":57
+ * writer.buf[writer.pos] = <char>ch
+ * writer.pos += 1
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":35
+ *
+ *
+ * cdef inline int _write_byte(Writer* writer, uint8_t ch): # <<<<<<<<<<<<<<
+ * cdef char * buf
+ * cdef Py_ssize_t size
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_WriteUnraisable("aiohttp._http_writer._write_byte", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_writer.pyx":60
+ *
+ *
+ * cdef inline int _write_utf8(Writer* writer, Py_UCS4 symbol): # <<<<<<<<<<<<<<
+ * cdef uint64_t utf = <uint64_t> symbol
+ *
+ */
+
+static CYTHON_INLINE int __pyx_f_7aiohttp_12_http_writer__write_utf8(struct __pyx_t_7aiohttp_12_http_writer_Writer *__pyx_v_writer, Py_UCS4 __pyx_v_symbol) {
+ uint64_t __pyx_v_utf;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("_write_utf8", 0);
+
+ /* "aiohttp/_http_writer.pyx":61
+ *
+ * cdef inline int _write_utf8(Writer* writer, Py_UCS4 symbol):
+ * cdef uint64_t utf = <uint64_t> symbol # <<<<<<<<<<<<<<
+ *
+ * if utf < 0x80:
+ */
+ __pyx_v_utf = ((uint64_t)__pyx_v_symbol);
+
+ /* "aiohttp/_http_writer.pyx":63
+ * cdef uint64_t utf = <uint64_t> symbol
+ *
+ * if utf < 0x80: # <<<<<<<<<<<<<<
+ * return _write_byte(writer, <uint8_t>utf)
+ * elif utf < 0x800:
+ */
+ __pyx_t_1 = ((__pyx_v_utf < 0x80) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":64
+ *
+ * if utf < 0x80:
+ * return _write_byte(writer, <uint8_t>utf) # <<<<<<<<<<<<<<
+ * elif utf < 0x800:
+ * if _write_byte(writer, <uint8_t>(0xc0 | (utf >> 6))) < 0:
+ */
+ __pyx_r = __pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)__pyx_v_utf));
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":63
+ * cdef uint64_t utf = <uint64_t> symbol
+ *
+ * if utf < 0x80: # <<<<<<<<<<<<<<
+ * return _write_byte(writer, <uint8_t>utf)
+ * elif utf < 0x800:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":65
+ * if utf < 0x80:
+ * return _write_byte(writer, <uint8_t>utf)
+ * elif utf < 0x800: # <<<<<<<<<<<<<<
+ * if _write_byte(writer, <uint8_t>(0xc0 | (utf >> 6))) < 0:
+ * return -1
+ */
+ __pyx_t_1 = ((__pyx_v_utf < 0x800) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":66
+ * return _write_byte(writer, <uint8_t>utf)
+ * elif utf < 0x800:
+ * if _write_byte(writer, <uint8_t>(0xc0 | (utf >> 6))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ */
+ __pyx_t_1 = ((__pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0xc0 | (__pyx_v_utf >> 6)))) < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":67
+ * elif utf < 0x800:
+ * if _write_byte(writer, <uint8_t>(0xc0 | (utf >> 6))) < 0:
+ * return -1 # <<<<<<<<<<<<<<
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ * elif 0xD800 <= utf <= 0xDFFF:
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":66
+ * return _write_byte(writer, <uint8_t>utf)
+ * elif utf < 0x800:
+ * if _write_byte(writer, <uint8_t>(0xc0 | (utf >> 6))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":68
+ * if _write_byte(writer, <uint8_t>(0xc0 | (utf >> 6))) < 0:
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f))) # <<<<<<<<<<<<<<
+ * elif 0xD800 <= utf <= 0xDFFF:
+ * # surogate pair, ignored
+ */
+ __pyx_r = __pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0x80 | (__pyx_v_utf & 0x3f))));
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":65
+ * if utf < 0x80:
+ * return _write_byte(writer, <uint8_t>utf)
+ * elif utf < 0x800: # <<<<<<<<<<<<<<
+ * if _write_byte(writer, <uint8_t>(0xc0 | (utf >> 6))) < 0:
+ * return -1
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":69
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ * elif 0xD800 <= utf <= 0xDFFF: # <<<<<<<<<<<<<<
+ * # surogate pair, ignored
+ * return 0
+ */
+ __pyx_t_1 = (0xD800 <= __pyx_v_utf);
+ if (__pyx_t_1) {
+ __pyx_t_1 = (__pyx_v_utf <= 0xDFFF);
+ }
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":71
+ * elif 0xD800 <= utf <= 0xDFFF:
+ * # surogate pair, ignored
+ * return 0 # <<<<<<<<<<<<<<
+ * elif utf < 0x10000:
+ * if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0:
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":69
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ * elif 0xD800 <= utf <= 0xDFFF: # <<<<<<<<<<<<<<
+ * # surogate pair, ignored
+ * return 0
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":72
+ * # surogate pair, ignored
+ * return 0
+ * elif utf < 0x10000: # <<<<<<<<<<<<<<
+ * if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0:
+ * return -1
+ */
+ __pyx_t_2 = ((__pyx_v_utf < 0x10000) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":73
+ * return 0
+ * elif utf < 0x10000:
+ * if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * if _write_byte(writer, <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ */
+ __pyx_t_2 = ((__pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0xe0 | (__pyx_v_utf >> 12)))) < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":74
+ * elif utf < 0x10000:
+ * if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0:
+ * return -1 # <<<<<<<<<<<<<<
+ * if _write_byte(writer, <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ * return -1
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":73
+ * return 0
+ * elif utf < 0x10000:
+ * if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * if _write_byte(writer, <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":75
+ * if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0:
+ * return -1
+ * if _write_byte(writer, <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ */
+ __pyx_t_2 = ((__pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0x80 | ((__pyx_v_utf >> 6) & 0x3f)))) < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":76
+ * return -1
+ * if _write_byte(writer, <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ * return -1 # <<<<<<<<<<<<<<
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ * elif utf > 0x10FFFF:
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":75
+ * if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0:
+ * return -1
+ * if _write_byte(writer, <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":77
+ * if _write_byte(writer, <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f))) # <<<<<<<<<<<<<<
+ * elif utf > 0x10FFFF:
+ * # symbol is too large
+ */
+ __pyx_r = __pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0x80 | (__pyx_v_utf & 0x3f))));
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":72
+ * # surogate pair, ignored
+ * return 0
+ * elif utf < 0x10000: # <<<<<<<<<<<<<<
+ * if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0:
+ * return -1
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":78
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ * elif utf > 0x10FFFF: # <<<<<<<<<<<<<<
+ * # symbol is too large
+ * return 0
+ */
+ __pyx_t_2 = ((__pyx_v_utf > 0x10FFFF) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":80
+ * elif utf > 0x10FFFF:
+ * # symbol is too large
+ * return 0 # <<<<<<<<<<<<<<
+ * else:
+ * if _write_byte(writer, <uint8_t>(0xf0 | (utf >> 18))) < 0:
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":78
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ * elif utf > 0x10FFFF: # <<<<<<<<<<<<<<
+ * # symbol is too large
+ * return 0
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":82
+ * return 0
+ * else:
+ * if _write_byte(writer, <uint8_t>(0xf0 | (utf >> 18))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * if _write_byte(writer,
+ */
+ /*else*/ {
+ __pyx_t_2 = ((__pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0xf0 | (__pyx_v_utf >> 18)))) < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":83
+ * else:
+ * if _write_byte(writer, <uint8_t>(0xf0 | (utf >> 18))) < 0:
+ * return -1 # <<<<<<<<<<<<<<
+ * if _write_byte(writer,
+ * <uint8_t>(0x80 | ((utf >> 12) & 0x3f))) < 0:
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":82
+ * return 0
+ * else:
+ * if _write_byte(writer, <uint8_t>(0xf0 | (utf >> 18))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * if _write_byte(writer,
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":85
+ * return -1
+ * if _write_byte(writer,
+ * <uint8_t>(0x80 | ((utf >> 12) & 0x3f))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * if _write_byte(writer,
+ */
+ __pyx_t_2 = ((__pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0x80 | ((__pyx_v_utf >> 12) & 0x3f)))) < 0) != 0);
+
+ /* "aiohttp/_http_writer.pyx":84
+ * if _write_byte(writer, <uint8_t>(0xf0 | (utf >> 18))) < 0:
+ * return -1
+ * if _write_byte(writer, # <<<<<<<<<<<<<<
+ * <uint8_t>(0x80 | ((utf >> 12) & 0x3f))) < 0:
+ * return -1
+ */
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":86
+ * if _write_byte(writer,
+ * <uint8_t>(0x80 | ((utf >> 12) & 0x3f))) < 0:
+ * return -1 # <<<<<<<<<<<<<<
+ * if _write_byte(writer,
+ * <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":84
+ * if _write_byte(writer, <uint8_t>(0xf0 | (utf >> 18))) < 0:
+ * return -1
+ * if _write_byte(writer, # <<<<<<<<<<<<<<
+ * <uint8_t>(0x80 | ((utf >> 12) & 0x3f))) < 0:
+ * return -1
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":88
+ * return -1
+ * if _write_byte(writer,
+ * <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ */
+ __pyx_t_2 = ((__pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0x80 | ((__pyx_v_utf >> 6) & 0x3f)))) < 0) != 0);
+
+ /* "aiohttp/_http_writer.pyx":87
+ * <uint8_t>(0x80 | ((utf >> 12) & 0x3f))) < 0:
+ * return -1
+ * if _write_byte(writer, # <<<<<<<<<<<<<<
+ * <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ * return -1
+ */
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":89
+ * if _write_byte(writer,
+ * <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ * return -1 # <<<<<<<<<<<<<<
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ *
+ */
+ __pyx_r = -1;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":87
+ * <uint8_t>(0x80 | ((utf >> 12) & 0x3f))) < 0:
+ * return -1
+ * if _write_byte(writer, # <<<<<<<<<<<<<<
+ * <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ * return -1
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":90
+ * <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ * return -1
+ * return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f))) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_f_7aiohttp_12_http_writer__write_byte(__pyx_v_writer, ((uint8_t)(0x80 | (__pyx_v_utf & 0x3f))));
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_writer.pyx":60
+ *
+ *
+ * cdef inline int _write_utf8(Writer* writer, Py_UCS4 symbol): # <<<<<<<<<<<<<<
+ * cdef uint64_t utf = <uint64_t> symbol
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_writer.pyx":93
+ *
+ *
+ * cdef inline int _write_str(Writer* writer, str s): # <<<<<<<<<<<<<<
+ * cdef Py_UCS4 ch
+ * for ch in s:
+ */
+
+static CYTHON_INLINE int __pyx_f_7aiohttp_12_http_writer__write_str(struct __pyx_t_7aiohttp_12_http_writer_Writer *__pyx_v_writer, PyObject *__pyx_v_s) {
+ Py_UCS4 __pyx_v_ch;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ void *__pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_write_str", 0);
+
+ /* "aiohttp/_http_writer.pyx":95
+ * cdef inline int _write_str(Writer* writer, str s):
+ * cdef Py_UCS4 ch
+ * for ch in s: # <<<<<<<<<<<<<<
+ * if _write_utf8(writer, ch) < 0:
+ * return -1
+ */
+ if (unlikely(__pyx_v_s == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
+ __PYX_ERR(0, 95, __pyx_L1_error)
+ }
+ __Pyx_INCREF(__pyx_v_s);
+ __pyx_t_1 = __pyx_v_s;
+ __pyx_t_6 = __Pyx_init_unicode_iteration(__pyx_t_1, (&__pyx_t_3), (&__pyx_t_4), (&__pyx_t_5)); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 95, __pyx_L1_error)
+ for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_3; __pyx_t_7++) {
+ __pyx_t_2 = __pyx_t_7;
+ __pyx_v_ch = __Pyx_PyUnicode_READ(__pyx_t_5, __pyx_t_4, __pyx_t_2);
+
+ /* "aiohttp/_http_writer.pyx":96
+ * cdef Py_UCS4 ch
+ * for ch in s:
+ * if _write_utf8(writer, ch) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ *
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_utf8(__pyx_v_writer, __pyx_v_ch) < 0) != 0);
+ if (__pyx_t_8) {
+
+ /* "aiohttp/_http_writer.pyx":97
+ * for ch in s:
+ * if _write_utf8(writer, ch) < 0:
+ * return -1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = -1;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":96
+ * cdef Py_UCS4 ch
+ * for ch in s:
+ * if _write_utf8(writer, ch) < 0: # <<<<<<<<<<<<<<
+ * return -1
+ *
+ */
+ }
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_writer.pyx":93
+ *
+ *
+ * cdef inline int _write_str(Writer* writer, str s): # <<<<<<<<<<<<<<
+ * cdef Py_UCS4 ch
+ * for ch in s:
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_WriteUnraisable("aiohttp._http_writer._write_str", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_writer.pyx":102
+ * # --------------- _serialize_headers ----------------------
+ *
+ * cdef str to_str(object s): # <<<<<<<<<<<<<<
+ * typ = type(s)
+ * if typ is str:
+ */
+
+static PyObject *__pyx_f_7aiohttp_12_http_writer_to_str(PyObject *__pyx_v_s) {
+ PyTypeObject *__pyx_v_typ = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("to_str", 0);
+
+ /* "aiohttp/_http_writer.pyx":103
+ *
+ * cdef str to_str(object s):
+ * typ = type(s) # <<<<<<<<<<<<<<
+ * if typ is str:
+ * return <str>s
+ */
+ __Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_s)));
+ __pyx_v_typ = ((PyTypeObject*)((PyObject *)Py_TYPE(__pyx_v_s)));
+
+ /* "aiohttp/_http_writer.pyx":104
+ * cdef str to_str(object s):
+ * typ = type(s)
+ * if typ is str: # <<<<<<<<<<<<<<
+ * return <str>s
+ * elif typ is _istr:
+ */
+ __pyx_t_1 = (__pyx_v_typ == (&PyUnicode_Type));
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_http_writer.pyx":105
+ * typ = type(s)
+ * if typ is str:
+ * return <str>s # <<<<<<<<<<<<<<
+ * elif typ is _istr:
+ * return PyObject_Str(s)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject*)__pyx_v_s));
+ __pyx_r = ((PyObject*)__pyx_v_s);
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":104
+ * cdef str to_str(object s):
+ * typ = type(s)
+ * if typ is str: # <<<<<<<<<<<<<<
+ * return <str>s
+ * elif typ is _istr:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":106
+ * if typ is str:
+ * return <str>s
+ * elif typ is _istr: # <<<<<<<<<<<<<<
+ * return PyObject_Str(s)
+ * elif not isinstance(s, str):
+ */
+ __pyx_t_2 = (__pyx_v_typ == ((PyTypeObject*)__pyx_v_7aiohttp_12_http_writer__istr));
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "aiohttp/_http_writer.pyx":107
+ * return <str>s
+ * elif typ is _istr:
+ * return PyObject_Str(s) # <<<<<<<<<<<<<<
+ * elif not isinstance(s, str):
+ * raise TypeError("Cannot serialize non-str key {!r}".format(s))
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = PyObject_Str(__pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 107, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(PyUnicode_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "unicode", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 107, __pyx_L1_error)
+ __pyx_r = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "aiohttp/_http_writer.pyx":106
+ * if typ is str:
+ * return <str>s
+ * elif typ is _istr: # <<<<<<<<<<<<<<
+ * return PyObject_Str(s)
+ * elif not isinstance(s, str):
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":108
+ * elif typ is _istr:
+ * return PyObject_Str(s)
+ * elif not isinstance(s, str): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot serialize non-str key {!r}".format(s))
+ * else:
+ */
+ __pyx_t_1 = PyUnicode_Check(__pyx_v_s);
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "aiohttp/_http_writer.pyx":109
+ * return PyObject_Str(s)
+ * elif not isinstance(s, str):
+ * raise TypeError("Cannot serialize non-str key {!r}".format(s)) # <<<<<<<<<<<<<<
+ * else:
+ * return str(s)
+ */
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_u_Cannot_serialize_non_str_key_r, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_s) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_s);
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 109, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 109, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(0, 109, __pyx_L1_error)
+
+ /* "aiohttp/_http_writer.pyx":108
+ * elif typ is _istr:
+ * return PyObject_Str(s)
+ * elif not isinstance(s, str): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot serialize non-str key {!r}".format(s))
+ * else:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":111
+ * raise TypeError("Cannot serialize non-str key {!r}".format(s))
+ * else:
+ * return str(s) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_s); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 111, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_r = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "aiohttp/_http_writer.pyx":102
+ * # --------------- _serialize_headers ----------------------
+ *
+ * cdef str to_str(object s): # <<<<<<<<<<<<<<
+ * typ = type(s)
+ * if typ is str:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("aiohttp._http_writer.to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_typ);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "aiohttp/_http_writer.pyx":114
+ *
+ *
+ * cdef void _safe_header(str string) except *: # <<<<<<<<<<<<<<
+ * if "\r" in string or "\n" in string:
+ * raise ValueError(
+ */
+
+static void __pyx_f_7aiohttp_12_http_writer__safe_header(PyObject *__pyx_v_string) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_safe_header", 0);
+
+ /* "aiohttp/_http_writer.pyx":115
+ *
+ * cdef void _safe_header(str string) except *:
+ * if "\r" in string or "\n" in string: # <<<<<<<<<<<<<<
+ * raise ValueError(
+ * "Newline or carriage return character detected in HTTP status message or "
+ */
+ if (unlikely(__pyx_v_string == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ __PYX_ERR(0, 115, __pyx_L1_error)
+ }
+ __pyx_t_2 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u_, __pyx_v_string, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_1 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ if (unlikely(__pyx_v_string == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ __PYX_ERR(0, 115, __pyx_L1_error)
+ }
+ __pyx_t_3 = (__Pyx_PyUnicode_ContainsTF(__pyx_kp_u__2, __pyx_v_string, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 115, __pyx_L1_error)
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (unlikely(__pyx_t_1)) {
+
+ /* "aiohttp/_http_writer.pyx":116
+ * cdef void _safe_header(str string) except *:
+ * if "\r" in string or "\n" in string:
+ * raise ValueError( # <<<<<<<<<<<<<<
+ * "Newline or carriage return character detected in HTTP status message or "
+ * "header. This is a potential security issue."
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(0, 116, __pyx_L1_error)
+
+ /* "aiohttp/_http_writer.pyx":115
+ *
+ * cdef void _safe_header(str string) except *:
+ * if "\r" in string or "\n" in string: # <<<<<<<<<<<<<<
+ * raise ValueError(
+ * "Newline or carriage return character detected in HTTP status message or "
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":114
+ *
+ *
+ * cdef void _safe_header(str string) except *: # <<<<<<<<<<<<<<
+ * if "\r" in string or "\n" in string:
+ * raise ValueError(
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("aiohttp._http_writer._safe_header", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "aiohttp/_http_writer.pyx":122
+ *
+ *
+ * def _serialize_headers(str status_line, headers): # <<<<<<<<<<<<<<
+ * cdef Writer writer
+ * cdef object key
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_12_http_writer_1_serialize_headers(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_7aiohttp_12_http_writer_1_serialize_headers = {"_serialize_headers", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7aiohttp_12_http_writer_1_serialize_headers, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_7aiohttp_12_http_writer_1_serialize_headers(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_status_line = 0;
+ PyObject *__pyx_v_headers = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_serialize_headers (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_status_line,&__pyx_n_s_headers,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_status_line)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_headers)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_serialize_headers", 1, 2, 2, 1); __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_serialize_headers") < 0)) __PYX_ERR(0, 122, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_status_line = ((PyObject*)values[0]);
+ __pyx_v_headers = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_serialize_headers", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 122, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._http_writer._serialize_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_status_line), (&PyUnicode_Type), 1, "status_line", 1))) __PYX_ERR(0, 122, __pyx_L1_error)
+ __pyx_r = __pyx_pf_7aiohttp_12_http_writer__serialize_headers(__pyx_self, __pyx_v_status_line, __pyx_v_headers);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_12_http_writer__serialize_headers(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_status_line, PyObject *__pyx_v_headers) {
+ struct __pyx_t_7aiohttp_12_http_writer_Writer __pyx_v_writer;
+ PyObject *__pyx_v_key = 0;
+ PyObject *__pyx_v_val = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ char const *__pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ PyObject *__pyx_t_12 = NULL;
+ PyObject *__pyx_t_13 = NULL;
+ PyObject *__pyx_t_14 = NULL;
+ PyObject *__pyx_t_15 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_serialize_headers", 0);
+
+ /* "aiohttp/_http_writer.pyx":128
+ * cdef bytes ret
+ *
+ * _init_writer(&writer) # <<<<<<<<<<<<<<
+ *
+ * for key, val in headers.items():
+ */
+ __pyx_f_7aiohttp_12_http_writer__init_writer((&__pyx_v_writer));
+
+ /* "aiohttp/_http_writer.pyx":130
+ * _init_writer(&writer)
+ *
+ * for key, val in headers.items(): # <<<<<<<<<<<<<<
+ * _safe_header(to_str(key))
+ * _safe_header(to_str(val))
+ */
+ __pyx_t_2 = 0;
+ if (unlikely(__pyx_v_headers == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
+ __PYX_ERR(0, 130, __pyx_L1_error)
+ }
+ __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_headers, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 130, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_1);
+ __pyx_t_1 = __pyx_t_5;
+ __pyx_t_5 = 0;
+ while (1) {
+ __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
+ if (unlikely(__pyx_t_7 == 0)) break;
+ if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 130, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_writer.pyx":131
+ *
+ * for key, val in headers.items():
+ * _safe_header(to_str(key)) # <<<<<<<<<<<<<<
+ * _safe_header(to_str(val))
+ *
+ */
+ __pyx_t_6 = __pyx_f_7aiohttp_12_http_writer_to_str(__pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_f_7aiohttp_12_http_writer__safe_header(((PyObject*)__pyx_t_6)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "aiohttp/_http_writer.pyx":132
+ * for key, val in headers.items():
+ * _safe_header(to_str(key))
+ * _safe_header(to_str(val)) # <<<<<<<<<<<<<<
+ *
+ * try:
+ */
+ __pyx_t_6 = __pyx_f_7aiohttp_12_http_writer_to_str(__pyx_v_val); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_f_7aiohttp_12_http_writer__safe_header(((PyObject*)__pyx_t_6)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_writer.pyx":134
+ * _safe_header(to_str(val))
+ *
+ * try: # <<<<<<<<<<<<<<
+ * if _write_str(&writer, status_line) < 0:
+ * raise
+ */
+ /*try:*/ {
+
+ /* "aiohttp/_http_writer.pyx":135
+ *
+ * try:
+ * if _write_str(&writer, status_line) < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\r') < 0:
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_str((&__pyx_v_writer), __pyx_v_status_line) < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":136
+ * try:
+ * if _write_str(&writer, status_line) < 0:
+ * raise # <<<<<<<<<<<<<<
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 136, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":135
+ *
+ * try:
+ * if _write_str(&writer, status_line) < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\r') < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":137
+ * if _write_str(&writer, status_line) < 0:
+ * raise
+ * if _write_byte(&writer, b'\r') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_byte((&__pyx_v_writer), '\r') < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":138
+ * raise
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise # <<<<<<<<<<<<<<
+ * if _write_byte(&writer, b'\n') < 0:
+ * raise
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 138, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":137
+ * if _write_str(&writer, status_line) < 0:
+ * raise
+ * if _write_byte(&writer, b'\r') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":139
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise
+ * if _write_byte(&writer, b'\n') < 0: # <<<<<<<<<<<<<<
+ * raise
+ *
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_byte((&__pyx_v_writer), '\n') < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":140
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ * raise # <<<<<<<<<<<<<<
+ *
+ * for key, val in headers.items():
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 140, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":139
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise
+ * if _write_byte(&writer, b'\n') < 0: # <<<<<<<<<<<<<<
+ * raise
+ *
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":142
+ * raise
+ *
+ * for key, val in headers.items(): # <<<<<<<<<<<<<<
+ * if _write_str(&writer, to_str(key)) < 0:
+ * raise
+ */
+ __pyx_t_3 = 0;
+ if (unlikely(__pyx_v_headers == Py_None)) {
+ PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
+ __PYX_ERR(0, 142, __pyx_L6_error)
+ }
+ __pyx_t_6 = __Pyx_dict_iterator(__pyx_v_headers, 0, __pyx_n_s_items, (&__pyx_t_2), (&__pyx_t_4)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_1);
+ __pyx_t_1 = __pyx_t_6;
+ __pyx_t_6 = 0;
+ while (1) {
+ __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_2, &__pyx_t_3, &__pyx_t_6, &__pyx_t_5, NULL, __pyx_t_4);
+ if (unlikely(__pyx_t_7 == 0)) break;
+ if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 142, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "aiohttp/_http_writer.pyx":143
+ *
+ * for key, val in headers.items():
+ * if _write_str(&writer, to_str(key)) < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b':') < 0:
+ */
+ __pyx_t_5 = __pyx_f_7aiohttp_12_http_writer_to_str(__pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_str((&__pyx_v_writer), ((PyObject*)__pyx_t_5)) < 0) != 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":144
+ * for key, val in headers.items():
+ * if _write_str(&writer, to_str(key)) < 0:
+ * raise # <<<<<<<<<<<<<<
+ * if _write_byte(&writer, b':') < 0:
+ * raise
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 144, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":143
+ *
+ * for key, val in headers.items():
+ * if _write_str(&writer, to_str(key)) < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b':') < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":145
+ * if _write_str(&writer, to_str(key)) < 0:
+ * raise
+ * if _write_byte(&writer, b':') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b' ') < 0:
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_byte((&__pyx_v_writer), ':') < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":146
+ * raise
+ * if _write_byte(&writer, b':') < 0:
+ * raise # <<<<<<<<<<<<<<
+ * if _write_byte(&writer, b' ') < 0:
+ * raise
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 146, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":145
+ * if _write_str(&writer, to_str(key)) < 0:
+ * raise
+ * if _write_byte(&writer, b':') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b' ') < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":147
+ * if _write_byte(&writer, b':') < 0:
+ * raise
+ * if _write_byte(&writer, b' ') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_str(&writer, to_str(val)) < 0:
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_byte((&__pyx_v_writer), ' ') < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":148
+ * raise
+ * if _write_byte(&writer, b' ') < 0:
+ * raise # <<<<<<<<<<<<<<
+ * if _write_str(&writer, to_str(val)) < 0:
+ * raise
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 148, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":147
+ * if _write_byte(&writer, b':') < 0:
+ * raise
+ * if _write_byte(&writer, b' ') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_str(&writer, to_str(val)) < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":149
+ * if _write_byte(&writer, b' ') < 0:
+ * raise
+ * if _write_str(&writer, to_str(val)) < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\r') < 0:
+ */
+ __pyx_t_5 = __pyx_f_7aiohttp_12_http_writer_to_str(__pyx_v_val); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_str((&__pyx_v_writer), ((PyObject*)__pyx_t_5)) < 0) != 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":150
+ * raise
+ * if _write_str(&writer, to_str(val)) < 0:
+ * raise # <<<<<<<<<<<<<<
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 150, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":149
+ * if _write_byte(&writer, b' ') < 0:
+ * raise
+ * if _write_str(&writer, to_str(val)) < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\r') < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":151
+ * if _write_str(&writer, to_str(val)) < 0:
+ * raise
+ * if _write_byte(&writer, b'\r') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_byte((&__pyx_v_writer), '\r') < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":152
+ * raise
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise # <<<<<<<<<<<<<<
+ * if _write_byte(&writer, b'\n') < 0:
+ * raise
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 152, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":151
+ * if _write_str(&writer, to_str(val)) < 0:
+ * raise
+ * if _write_byte(&writer, b'\r') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":153
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise
+ * if _write_byte(&writer, b'\n') < 0: # <<<<<<<<<<<<<<
+ * raise
+ *
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_byte((&__pyx_v_writer), '\n') < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":154
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ * raise # <<<<<<<<<<<<<<
+ *
+ * if _write_byte(&writer, b'\r') < 0:
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 154, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":153
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise
+ * if _write_byte(&writer, b'\n') < 0: # <<<<<<<<<<<<<<
+ * raise
+ *
+ */
+ }
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_http_writer.pyx":156
+ * raise
+ *
+ * if _write_byte(&writer, b'\r') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_byte((&__pyx_v_writer), '\r') < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":157
+ *
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise # <<<<<<<<<<<<<<
+ * if _write_byte(&writer, b'\n') < 0:
+ * raise
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 157, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":156
+ * raise
+ *
+ * if _write_byte(&writer, b'\r') < 0: # <<<<<<<<<<<<<<
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":158
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise
+ * if _write_byte(&writer, b'\n') < 0: # <<<<<<<<<<<<<<
+ * raise
+ *
+ */
+ __pyx_t_8 = ((__pyx_f_7aiohttp_12_http_writer__write_byte((&__pyx_v_writer), '\n') < 0) != 0);
+ if (unlikely(__pyx_t_8)) {
+
+ /* "aiohttp/_http_writer.pyx":159
+ * raise
+ * if _write_byte(&writer, b'\n') < 0:
+ * raise # <<<<<<<<<<<<<<
+ *
+ * return PyBytes_FromStringAndSize(writer.buf, writer.pos)
+ */
+ __Pyx_ReraiseException(); __PYX_ERR(0, 159, __pyx_L6_error)
+
+ /* "aiohttp/_http_writer.pyx":158
+ * if _write_byte(&writer, b'\r') < 0:
+ * raise
+ * if _write_byte(&writer, b'\n') < 0: # <<<<<<<<<<<<<<
+ * raise
+ *
+ */
+ }
+
+ /* "aiohttp/_http_writer.pyx":161
+ * raise
+ *
+ * return PyBytes_FromStringAndSize(writer.buf, writer.pos) # <<<<<<<<<<<<<<
+ * finally:
+ * _release_writer(&writer)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyBytes_FromStringAndSize(__pyx_v_writer.buf, __pyx_v_writer.pos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L5_return;
+ }
+
+ /* "aiohttp/_http_writer.pyx":163
+ * return PyBytes_FromStringAndSize(writer.buf, writer.pos)
+ * finally:
+ * _release_writer(&writer) # <<<<<<<<<<<<<<
+ */
+ /*finally:*/ {
+ __pyx_L6_error:;
+ /*exception exit:*/{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
+ if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
+ __Pyx_XGOTREF(__pyx_t_10);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __Pyx_XGOTREF(__pyx_t_12);
+ __Pyx_XGOTREF(__pyx_t_13);
+ __Pyx_XGOTREF(__pyx_t_14);
+ __Pyx_XGOTREF(__pyx_t_15);
+ __pyx_t_4 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
+ {
+ __pyx_f_7aiohttp_12_http_writer__release_writer((&__pyx_v_writer));
+ }
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_13);
+ __Pyx_XGIVEREF(__pyx_t_14);
+ __Pyx_XGIVEREF(__pyx_t_15);
+ __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
+ }
+ __Pyx_XGIVEREF(__pyx_t_10);
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_XGIVEREF(__pyx_t_12);
+ __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
+ __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
+ __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_9;
+ goto __pyx_L1_error;
+ }
+ __pyx_L5_return: {
+ __pyx_t_15 = __pyx_r;
+ __pyx_r = 0;
+ __pyx_f_7aiohttp_12_http_writer__release_writer((&__pyx_v_writer));
+ __pyx_r = __pyx_t_15;
+ __pyx_t_15 = 0;
+ goto __pyx_L0;
+ }
+ }
+
+ /* "aiohttp/_http_writer.pyx":122
+ *
+ *
+ * def _serialize_headers(str status_line, headers): # <<<<<<<<<<<<<<
+ * cdef Writer writer
+ * cdef object key
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("aiohttp._http_writer._serialize_headers", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_key);
+ __Pyx_XDECREF(__pyx_v_val);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec__http_writer(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+ {Py_mod_create, (void*)__pyx_pymod_create},
+ {Py_mod_exec, (void*)__pyx_pymod_exec__http_writer},
+ {0, NULL}
+};
+#endif
+
+static struct PyModuleDef __pyx_moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "_http_writer",
+ 0, /* m_doc */
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ 0, /* m_size */
+ #else
+ -1, /* m_size */
+ #endif
+ __pyx_methods /* m_methods */,
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_moduledef_slots, /* m_slots */
+ #else
+ NULL, /* m_reload */
+ #endif
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+#ifndef CYTHON_SMALL_CODE
+#if defined(__clang__)
+ #define CYTHON_SMALL_CODE
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+ #define CYTHON_SMALL_CODE __attribute__((cold))
+#else
+ #define CYTHON_SMALL_CODE
+#endif
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
+ {&__pyx_kp_u_Cannot_serialize_non_str_key_r, __pyx_k_Cannot_serialize_non_str_key_r, sizeof(__pyx_k_Cannot_serialize_non_str_key_r), 0, 1, 0, 0},
+ {&__pyx_kp_u_Newline_or_carriage_return_chara, __pyx_k_Newline_or_carriage_return_chara, sizeof(__pyx_k_Newline_or_carriage_return_chara), 0, 1, 0, 0},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_kp_u__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0, 0},
+ {&__pyx_n_s_aiohttp__http_writer, __pyx_k_aiohttp__http_writer, sizeof(__pyx_k_aiohttp__http_writer), 0, 0, 1, 1},
+ {&__pyx_kp_s_aiohttp__http_writer_pyx, __pyx_k_aiohttp__http_writer_pyx, sizeof(__pyx_k_aiohttp__http_writer_pyx), 0, 0, 1, 0},
+ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
+ {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_headers, __pyx_k_headers, sizeof(__pyx_k_headers), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_istr, __pyx_k_istr, sizeof(__pyx_k_istr), 0, 0, 1, 1},
+ {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
+ {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_multidict, __pyx_k_multidict, sizeof(__pyx_k_multidict), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_ret, __pyx_k_ret, sizeof(__pyx_k_ret), 0, 0, 1, 1},
+ {&__pyx_n_s_serialize_headers, __pyx_k_serialize_headers, sizeof(__pyx_k_serialize_headers), 0, 0, 1, 1},
+ {&__pyx_n_s_status_line, __pyx_k_status_line, sizeof(__pyx_k_status_line), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_val, __pyx_k_val, sizeof(__pyx_k_val), 0, 0, 1, 1},
+ {&__pyx_n_s_writer, __pyx_k_writer, sizeof(__pyx_k_writer), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 109, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 116, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "aiohttp/_http_writer.pyx":116
+ * cdef void _safe_header(str string) except *:
+ * if "\r" in string or "\n" in string:
+ * raise ValueError( # <<<<<<<<<<<<<<
+ * "Newline or carriage return character detected in HTTP status message or "
+ * "header. This is a potential security issue."
+ */
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Newline_or_carriage_return_chara); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 116, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "aiohttp/_http_writer.pyx":122
+ *
+ *
+ * def _serialize_headers(str status_line, headers): # <<<<<<<<<<<<<<
+ * cdef Writer writer
+ * cdef object key
+ */
+ __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_status_line, __pyx_n_s_headers, __pyx_n_s_writer, __pyx_n_s_key, __pyx_n_s_val, __pyx_n_s_ret); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 122, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+ __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_aiohttp__http_writer_pyx, __pyx_n_s_serialize_headers, 122, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) __PYX_ERR(0, 122, __pyx_L1_error)
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
+
+static int __Pyx_modinit_global_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
+ /*--- Global init code ---*/
+ __pyx_v_7aiohttp_12_http_writer__istr = Py_None; Py_INCREF(Py_None);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_variable_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
+ /*--- Variable export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
+ /*--- Function export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_type_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
+ /*--- Type init code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_type_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
+ /*--- Type import code ---*/
+ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
+ #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ __Pyx_ImportType_CheckSize_Warn);
+ if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_variable_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
+ /*--- Variable import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
+ /*--- Function import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+
+#ifndef CYTHON_NO_PYINIT_EXPORT
+#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#elif PY_MAJOR_VERSION < 3
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" void
+#else
+#define __Pyx_PyMODINIT_FUNC void
+#endif
+#else
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
+#else
+#define __Pyx_PyMODINIT_FUNC PyObject *
+#endif
+#endif
+
+
+#if PY_MAJOR_VERSION < 3
+__Pyx_PyMODINIT_FUNC init_http_writer(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC init_http_writer(void)
+#else
+__Pyx_PyMODINIT_FUNC PyInit__http_writer(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC PyInit__http_writer(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+ return PyModuleDef_Init(&__pyx_moduledef);
+}
+static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
+ #if PY_VERSION_HEX >= 0x030700A1
+ static PY_INT64_T main_interpreter_id = -1;
+ PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
+ if (main_interpreter_id == -1) {
+ main_interpreter_id = current_id;
+ return (unlikely(current_id == -1)) ? -1 : 0;
+ } else if (unlikely(main_interpreter_id != current_id))
+ #else
+ static PyInterpreterState *main_interpreter = NULL;
+ PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
+ if (!main_interpreter) {
+ main_interpreter = current_interpreter;
+ } else if (unlikely(main_interpreter != current_interpreter))
+ #endif
+ {
+ PyErr_SetString(
+ PyExc_ImportError,
+ "Interpreter change detected - this module can only be loaded into one interpreter per process.");
+ return -1;
+ }
+ return 0;
+}
+static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
+ PyObject *value = PyObject_GetAttrString(spec, from_name);
+ int result = 0;
+ if (likely(value)) {
+ if (allow_none || value != Py_None) {
+ result = PyDict_SetItemString(moddict, to_name, value);
+ }
+ Py_DECREF(value);
+ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ } else {
+ result = -1;
+ }
+ return result;
+}
+static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+ PyObject *module = NULL, *moddict, *modname;
+ if (__Pyx_check_single_interpreter())
+ return NULL;
+ if (__pyx_m)
+ return __Pyx_NewRef(__pyx_m);
+ modname = PyObject_GetAttrString(spec, "name");
+ if (unlikely(!modname)) goto bad;
+ module = PyModule_NewObject(modname);
+ Py_DECREF(modname);
+ if (unlikely(!module)) goto bad;
+ moddict = PyModule_GetDict(module);
+ if (unlikely(!moddict)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
+ return module;
+bad:
+ Py_XDECREF(module);
+ return NULL;
+}
+
+
+static CYTHON_SMALL_CODE int __pyx_pymod_exec__http_writer(PyObject *__pyx_pyinit_module)
+#endif
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ if (__pyx_m) {
+ if (__pyx_m == __pyx_pyinit_module) return 0;
+ PyErr_SetString(PyExc_RuntimeError, "Module '_http_writer' has already been imported. Re-initialisation is not supported.");
+ return -1;
+ }
+ #elif PY_MAJOR_VERSION >= 3
+ if (__pyx_m) return __Pyx_NewRef(__pyx_m);
+ #endif
+ #if CYTHON_REFNANNY
+__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+}
+#endif
+ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__http_writer(void)", 0);
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pxy_PyFrame_Initialize_Offsets
+ __Pxy_PyFrame_Initialize_Offsets();
+ #endif
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pyx_CyFunction_USED
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ PyEval_InitThreads();
+ #endif
+ /*--- Module creation code ---*/
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_m = __pyx_pyinit_module;
+ Py_INCREF(__pyx_m);
+ #else
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_http_writer", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_b);
+ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_cython_runtime);
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ /*--- Initialize various global constants etc. ---*/
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ if (__pyx_module_is_main_aiohttp___http_writer) {
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "aiohttp._http_writer")) {
+ if (unlikely(PyDict_SetItemString(modules, "aiohttp._http_writer", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Constants init code ---*/
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Global type/function init code ---*/
+ (void)__Pyx_modinit_global_init_code();
+ (void)__Pyx_modinit_variable_export_code();
+ (void)__Pyx_modinit_function_export_code();
+ (void)__Pyx_modinit_type_init_code();
+ if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ (void)__Pyx_modinit_variable_import_code();
+ (void)__Pyx_modinit_function_import_code();
+ /*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+
+ /* "aiohttp/_http_writer.pyx":8
+ * from libc.string cimport memcpy
+ *
+ * from multidict import istr # <<<<<<<<<<<<<<
+ *
+ * DEF BUF_SIZE = 16 * 1024 # 16KiB
+ */
+ __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_n_s_istr);
+ __Pyx_GIVEREF(__pyx_n_s_istr);
+ PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_istr);
+ __pyx_t_2 = __Pyx_Import(__pyx_n_s_multidict, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_istr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_istr, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_writer.pyx":13
+ * cdef char BUFFER[BUF_SIZE]
+ *
+ * cdef object _istr = istr # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_istr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_v_7aiohttp_12_http_writer__istr);
+ __Pyx_DECREF_SET(__pyx_v_7aiohttp_12_http_writer__istr, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_writer.pyx":122
+ *
+ *
+ * def _serialize_headers(str status_line, headers): # <<<<<<<<<<<<<<
+ * cdef Writer writer
+ * cdef object key
+ */
+ __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7aiohttp_12_http_writer_1_serialize_headers, NULL, __pyx_n_s_aiohttp__http_writer); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_serialize_headers, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "aiohttp/_http_writer.pyx":1
+ * from cpython.bytes cimport PyBytes_FromStringAndSize # <<<<<<<<<<<<<<
+ * from cpython.exc cimport PyErr_NoMemory
+ * from cpython.mem cimport PyMem_Free, PyMem_Malloc, PyMem_Realloc
+ */
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init aiohttp._http_writer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_CLEAR(__pyx_m);
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init aiohttp._http_writer");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ return (__pyx_m != NULL) ? 0 : -1;
+ #elif PY_MAJOR_VERSION >= 3
+ return __pyx_m;
+ #else
+ return;
+ #endif
+}
+
+/* --- Runtime support code --- */
+/* Refnanny */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule(modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, "RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+/* PyObjectGetAttrStr */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#endif
+
+/* GetBuiltinName */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+/* PyErrFetchRestore */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+}
+#endif
+
+/* WriteUnraisableException */
+static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
+ CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
+ int full_traceback, CYTHON_UNUSED int nogil) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
+}
+
+/* unicode_iter */
+static CYTHON_INLINE int __Pyx_init_unicode_iteration(
+ PyObject* ustring, Py_ssize_t *length, void** data, int *kind) {
+#if CYTHON_PEP393_ENABLED
+ if (unlikely(__Pyx_PyUnicode_READY(ustring) < 0)) return -1;
+ *kind = PyUnicode_KIND(ustring);
+ *length = PyUnicode_GET_LENGTH(ustring);
+ *data = PyUnicode_DATA(ustring);
+#else
+ *kind = 0;
+ *length = PyUnicode_GET_SIZE(ustring);
+ *data = (void*)PyUnicode_AS_UNICODE(ustring);
+#endif
+ return 0;
+}
+
+/* PyCFunctionFastCall */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ int flags = PyCFunction_GET_FLAGS(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
+ return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
+ } else {
+ return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
+ }
+}
+#endif
+
+/* PyFunctionFastCall */
+#if CYTHON_FAST_PYCALL
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, (int)nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, (int)nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif
+#endif
+
+/* PyObjectCall */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = Py_TYPE(func)->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCall2Args */
+static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
+ PyObject *args, *result = NULL;
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(function)) {
+ PyObject *args[2] = {arg1, arg2};
+ return __Pyx_PyFunction_FastCall(function, args, 2);
+ }
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(function)) {
+ PyObject *args[2] = {arg1, arg2};
+ return __Pyx_PyCFunction_FastCall(function, args, 2);
+ }
+ #endif
+ args = PyTuple_New(2);
+ if (unlikely(!args)) goto done;
+ Py_INCREF(arg1);
+ PyTuple_SET_ITEM(args, 0, arg1);
+ Py_INCREF(arg2);
+ PyTuple_SET_ITEM(args, 1, arg2);
+ Py_INCREF(function);
+ result = __Pyx_PyObject_Call(function, args, NULL);
+ Py_DECREF(args);
+ Py_DECREF(function);
+done:
+ return result;
+}
+
+/* PyObjectCallMethO */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallOneArg */
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
+ if (likely(PyCFunction_Check(func))) {
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (__Pyx_PyFastCFunction_Check(func)) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+#endif
+
+/* RaiseException */
+#if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
+ instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+ if (cause) {
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+/* RaiseArgTupleInvalid */
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+/* RaiseDoubleKeywords */
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+/* ParseKeywords */
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+/* ArgTypeTest */
+static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ else if (exact) {
+ #if PY_MAJOR_VERSION == 2
+ if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(__Pyx_TypeCheck(obj, type))) return 1;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+ return 0;
+}
+
+/* IterFinish */
+static CYTHON_INLINE int __Pyx_IterFinish(void) {
+#if CYTHON_FAST_THREAD_STATE
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject* exc_type = tstate->curexc_type;
+ if (unlikely(exc_type)) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
+ PyObject *exc_value, *exc_tb;
+ exc_value = tstate->curexc_value;
+ exc_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+ Py_DECREF(exc_type);
+ Py_XDECREF(exc_value);
+ Py_XDECREF(exc_tb);
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#else
+ if (unlikely(PyErr_Occurred())) {
+ if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ return -1;
+ }
+ }
+ return 0;
+#endif
+}
+
+/* PyObjectCallNoArg */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, NULL, 0);
+ }
+#endif
+#ifdef __Pyx_CyFunction_USED
+ if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
+#else
+ if (likely(PyCFunction_Check(func)))
+#endif
+ {
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
+ return __Pyx_PyObject_CallMethO(func, NULL);
+ }
+ }
+ return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
+}
+#endif
+
+/* PyObjectGetMethod */
+static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
+ PyObject *attr;
+#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
+ PyTypeObject *tp = Py_TYPE(obj);
+ PyObject *descr;
+ descrgetfunc f = NULL;
+ PyObject **dictptr, *dict;
+ int meth_found = 0;
+ assert (*method == NULL);
+ if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
+ attr = __Pyx_PyObject_GetAttrStr(obj, name);
+ goto try_unpack;
+ }
+ if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
+ return 0;
+ }
+ descr = _PyType_Lookup(tp, name);
+ if (likely(descr != NULL)) {
+ Py_INCREF(descr);
+#if PY_MAJOR_VERSION >= 3
+ #ifdef __Pyx_CyFunction_USED
+ if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
+ #else
+ if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
+ #endif
+#else
+ #ifdef __Pyx_CyFunction_USED
+ if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
+ #else
+ if (likely(PyFunction_Check(descr)))
+ #endif
+#endif
+ {
+ meth_found = 1;
+ } else {
+ f = Py_TYPE(descr)->tp_descr_get;
+ if (f != NULL && PyDescr_IsData(descr)) {
+ attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
+ Py_DECREF(descr);
+ goto try_unpack;
+ }
+ }
+ }
+ dictptr = _PyObject_GetDictPtr(obj);
+ if (dictptr != NULL && (dict = *dictptr) != NULL) {
+ Py_INCREF(dict);
+ attr = __Pyx_PyDict_GetItemStr(dict, name);
+ if (attr != NULL) {
+ Py_INCREF(attr);
+ Py_DECREF(dict);
+ Py_XDECREF(descr);
+ goto try_unpack;
+ }
+ Py_DECREF(dict);
+ }
+ if (meth_found) {
+ *method = descr;
+ return 1;
+ }
+ if (f != NULL) {
+ attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
+ Py_DECREF(descr);
+ goto try_unpack;
+ }
+ if (descr != NULL) {
+ *method = descr;
+ return 0;
+ }
+ PyErr_Format(PyExc_AttributeError,
+#if PY_MAJOR_VERSION >= 3
+ "'%.50s' object has no attribute '%U'",
+ tp->tp_name, name);
+#else
+ "'%.50s' object has no attribute '%.400s'",
+ tp->tp_name, PyString_AS_STRING(name));
+#endif
+ return 0;
+#else
+ attr = __Pyx_PyObject_GetAttrStr(obj, name);
+ goto try_unpack;
+#endif
+try_unpack:
+#if CYTHON_UNPACK_METHODS
+ if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
+ PyObject *function = PyMethod_GET_FUNCTION(attr);
+ Py_INCREF(function);
+ Py_DECREF(attr);
+ *method = function;
+ return 1;
+ }
+#endif
+ *method = attr;
+ return 0;
+}
+
+/* PyObjectCallMethod0 */
+static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
+ PyObject *method = NULL, *result = NULL;
+ int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
+ if (likely(is_method)) {
+ result = __Pyx_PyObject_CallOneArg(method, obj);
+ Py_DECREF(method);
+ return result;
+ }
+ if (unlikely(!method)) goto bad;
+ result = __Pyx_PyObject_CallNoArg(method);
+ Py_DECREF(method);
+bad:
+ return result;
+}
+
+/* RaiseNeedMoreValuesToUnpack */
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+ PyErr_Format(PyExc_ValueError,
+ "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
+ index, (index == 1) ? "" : "s");
+}
+
+/* RaiseTooManyValuesToUnpack */
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+ PyErr_Format(PyExc_ValueError,
+ "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
+}
+
+/* UnpackItemEndCheck */
+static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
+ if (unlikely(retval)) {
+ Py_DECREF(retval);
+ __Pyx_RaiseTooManyValuesError(expected);
+ return -1;
+ } else {
+ return __Pyx_IterFinish();
+ }
+ return 0;
+}
+
+/* RaiseNoneIterError */
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+/* UnpackTupleError */
+static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
+ if (t == Py_None) {
+ __Pyx_RaiseNoneNotIterableError();
+ } else if (PyTuple_GET_SIZE(t) < index) {
+ __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
+ } else {
+ __Pyx_RaiseTooManyValuesError(index);
+ }
+}
+
+/* UnpackTuple2 */
+static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
+ PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
+ PyObject *value1 = NULL, *value2 = NULL;
+#if CYTHON_COMPILING_IN_PYPY
+ value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
+ value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
+#else
+ value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
+ value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
+#endif
+ if (decref_tuple) {
+ Py_DECREF(tuple);
+ }
+ *pvalue1 = value1;
+ *pvalue2 = value2;
+ return 0;
+#if CYTHON_COMPILING_IN_PYPY
+bad:
+ Py_XDECREF(value1);
+ Py_XDECREF(value2);
+ if (decref_tuple) { Py_XDECREF(tuple); }
+ return -1;
+#endif
+}
+static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
+ int has_known_size, int decref_tuple) {
+ Py_ssize_t index;
+ PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
+ iternextfunc iternext;
+ iter = PyObject_GetIter(tuple);
+ if (unlikely(!iter)) goto bad;
+ if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
+ iternext = Py_TYPE(iter)->tp_iternext;
+ value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
+ value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
+ if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
+ Py_DECREF(iter);
+ *pvalue1 = value1;
+ *pvalue2 = value2;
+ return 0;
+unpacking_failed:
+ if (!has_known_size && __Pyx_IterFinish() == 0)
+ __Pyx_RaiseNeedMoreValuesError(index);
+bad:
+ Py_XDECREF(iter);
+ Py_XDECREF(value1);
+ Py_XDECREF(value2);
+ if (decref_tuple) { Py_XDECREF(tuple); }
+ return -1;
+}
+
+/* dict_iter */
+static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
+ Py_ssize_t* p_orig_length, int* p_source_is_dict) {
+ is_dict = is_dict || likely(PyDict_CheckExact(iterable));
+ *p_source_is_dict = is_dict;
+ if (is_dict) {
+#if !CYTHON_COMPILING_IN_PYPY
+ *p_orig_length = PyDict_Size(iterable);
+ Py_INCREF(iterable);
+ return iterable;
+#elif PY_MAJOR_VERSION >= 3
+ static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
+ PyObject **pp = NULL;
+ if (method_name) {
+ const char *name = PyUnicode_AsUTF8(method_name);
+ if (strcmp(name, "iteritems") == 0) pp = &py_items;
+ else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
+ else if (strcmp(name, "itervalues") == 0) pp = &py_values;
+ if (pp) {
+ if (!*pp) {
+ *pp = PyUnicode_FromString(name + 4);
+ if (!*pp)
+ return NULL;
+ }
+ method_name = *pp;
+ }
+ }
+#endif
+ }
+ *p_orig_length = 0;
+ if (method_name) {
+ PyObject* iter;
+ iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
+ if (!iterable)
+ return NULL;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
+ return iterable;
+#endif
+ iter = PyObject_GetIter(iterable);
+ Py_DECREF(iterable);
+ return iter;
+ }
+ return PyObject_GetIter(iterable);
+}
+static CYTHON_INLINE int __Pyx_dict_iter_next(
+ PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
+ PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
+ PyObject* next_item;
+#if !CYTHON_COMPILING_IN_PYPY
+ if (source_is_dict) {
+ PyObject *key, *value;
+ if (unlikely(orig_length != PyDict_Size(iter_obj))) {
+ PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
+ return -1;
+ }
+ if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
+ return 0;
+ }
+ if (pitem) {
+ PyObject* tuple = PyTuple_New(2);
+ if (unlikely(!tuple)) {
+ return -1;
+ }
+ Py_INCREF(key);
+ Py_INCREF(value);
+ PyTuple_SET_ITEM(tuple, 0, key);
+ PyTuple_SET_ITEM(tuple, 1, value);
+ *pitem = tuple;
+ } else {
+ if (pkey) {
+ Py_INCREF(key);
+ *pkey = key;
+ }
+ if (pvalue) {
+ Py_INCREF(value);
+ *pvalue = value;
+ }
+ }
+ return 1;
+ } else if (PyTuple_CheckExact(iter_obj)) {
+ Py_ssize_t pos = *ppos;
+ if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
+ *ppos = pos + 1;
+ next_item = PyTuple_GET_ITEM(iter_obj, pos);
+ Py_INCREF(next_item);
+ } else if (PyList_CheckExact(iter_obj)) {
+ Py_ssize_t pos = *ppos;
+ if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
+ *ppos = pos + 1;
+ next_item = PyList_GET_ITEM(iter_obj, pos);
+ Py_INCREF(next_item);
+ } else
+#endif
+ {
+ next_item = PyIter_Next(iter_obj);
+ if (unlikely(!next_item)) {
+ return __Pyx_IterFinish();
+ }
+ }
+ if (pitem) {
+ *pitem = next_item;
+ } else if (pkey && pvalue) {
+ if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
+ return -1;
+ } else if (pkey) {
+ *pkey = next_item;
+ } else {
+ *pvalue = next_item;
+ }
+ return 1;
+}
+
+/* GetTopmostException */
+#if CYTHON_USE_EXC_INFO_STACK
+static _PyErr_StackItem *
+__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
+{
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
+ exc_info->previous_item != NULL)
+ {
+ exc_info = exc_info->previous_item;
+ }
+ return exc_info;
+}
+#endif
+
+/* ReRaiseException */
+static CYTHON_INLINE void __Pyx_ReraiseException(void) {
+ PyObject *type = NULL, *value = NULL, *tb = NULL;
+#if CYTHON_FAST_THREAD_STATE
+ PyThreadState *tstate = PyThreadState_GET();
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
+ type = exc_info->exc_type;
+ value = exc_info->exc_value;
+ tb = exc_info->exc_traceback;
+ #else
+ type = tstate->exc_type;
+ value = tstate->exc_value;
+ tb = tstate->exc_traceback;
+ #endif
+#else
+ PyErr_GetExcInfo(&type, &value, &tb);
+#endif
+ if (!type || type == Py_None) {
+#if !CYTHON_FAST_THREAD_STATE
+ Py_XDECREF(type);
+ Py_XDECREF(value);
+ Py_XDECREF(tb);
+#endif
+ PyErr_SetString(PyExc_RuntimeError,
+ "No active exception to reraise");
+ } else {
+#if CYTHON_FAST_THREAD_STATE
+ Py_INCREF(type);
+ Py_XINCREF(value);
+ Py_XINCREF(tb);
+#endif
+ PyErr_Restore(type, value, tb);
+ }
+}
+
+/* GetException */
+#if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
+#endif
+{
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_FAST_THREAD_STATE
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ #if CYTHON_USE_EXC_INFO_STACK
+ {
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ tmp_type = exc_info->exc_type;
+ tmp_value = exc_info->exc_value;
+ tmp_tb = exc_info->exc_traceback;
+ exc_info->exc_type = local_type;
+ exc_info->exc_value = local_value;
+ exc_info->exc_traceback = local_tb;
+ }
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+/* SwapException */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ tmp_type = exc_info->exc_type;
+ tmp_value = exc_info->exc_value;
+ tmp_tb = exc_info->exc_traceback;
+ exc_info->exc_type = *type;
+ exc_info->exc_value = *value;
+ exc_info->exc_traceback = *tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+ #endif
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+#endif
+
+/* SaveResetException */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
+ *type = exc_info->exc_type;
+ *value = exc_info->exc_value;
+ *tb = exc_info->exc_traceback;
+ #else
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ #endif
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if CYTHON_USE_EXC_INFO_STACK
+ _PyErr_StackItem *exc_info = tstate->exc_info;
+ tmp_type = exc_info->exc_type;
+ tmp_value = exc_info->exc_value;
+ tmp_tb = exc_info->exc_traceback;
+ exc_info->exc_type = type;
+ exc_info->exc_value = value;
+ exc_info->exc_traceback = tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+#endif
+
+/* TypeImport */
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
+ size_t size, enum __Pyx_ImportType_CheckSize check_size)
+{
+ PyObject *result = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ result = PyObject_GetAttrString(module, class_name);
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if ((size_t)basicsize < size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ goto bad;
+ }
+ if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ goto bad;
+ }
+ else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+/* Import */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* ImportFrom */
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+/* PyDictVersioning */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
+ PyObject **dictptr = NULL;
+ Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
+ if (offset) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
+#else
+ dictptr = _PyObject_GetDictPtr(obj);
+#endif
+ }
+ return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
+}
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
+ return 0;
+ return obj_dict_version == __Pyx_get_object_dict_version(obj);
+}
+#endif
+
+/* GetModuleGlobalName */
+#if CYTHON_USE_DICT_VERSIONS
+static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
+#else
+static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
+#endif
+{
+ PyObject *result;
+#if !CYTHON_AVOID_BORROWED_REFS
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
+ result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ } else if (unlikely(PyErr_Occurred())) {
+ return NULL;
+ }
+#else
+ result = PyDict_GetItem(__pyx_d, name);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ }
+#endif
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
+ if (likely(result)) {
+ return __Pyx_NewRef(result);
+ }
+ PyErr_Clear();
+#endif
+ return __Pyx_GetBuiltinName(name);
+}
+
+/* CLineInTraceback */
+#ifndef CYTHON_CLINE_IN_TRACEBACK
+static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
+ PyObject *use_cline;
+ PyObject *ptype, *pvalue, *ptraceback;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject **cython_runtime_dict;
+#endif
+ if (unlikely(!__pyx_cython_runtime)) {
+ return c_line;
+ }
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+#if CYTHON_COMPILING_IN_CPYTHON
+ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
+ if (likely(cython_runtime_dict)) {
+ __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
+ use_cline, *cython_runtime_dict,
+ __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
+ } else
+#endif
+ {
+ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
+ if (use_cline_obj) {
+ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
+ Py_DECREF(use_cline_obj);
+ } else {
+ PyErr_Clear();
+ use_cline = NULL;
+ }
+ }
+ if (!use_cline) {
+ c_line = 0;
+ (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
+ }
+ else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
+ c_line = 0;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ return c_line;
+}
+#endif
+
+/* CodeObjectCache */
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = start + (end - start) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+/* AddTraceback */
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = NULL;
+ PyObject *py_funcname = NULL;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_srcfile = NULL;
+ py_srcfile = PyString_FromString(filename);
+ if (!py_srcfile) goto bad;
+ #endif
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ if (!py_funcname) goto bad;
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ if (!py_funcname) goto bad;
+ funcname = PyUnicode_AsUTF8(py_funcname);
+ if (!funcname) goto bad;
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ if (!py_funcname) goto bad;
+ #endif
+ }
+ #if PY_MAJOR_VERSION < 3
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ #else
+ py_code = PyCode_NewEmpty(filename, funcname, py_line);
+ #endif
+ Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
+ return py_code;
+bad:
+ Py_XDECREF(py_funcname);
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_srcfile);
+ #endif
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject *ptype, *pvalue, *ptraceback;
+ if (c_line) {
+ c_line = __Pyx_CLineForTraceback(tstate, c_line);
+ }
+ py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
+ if (!py_code) {
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) {
+ /* If the code object creation fails, then we should clear the
+ fetched exception references and propagate the new exception */
+ Py_XDECREF(ptype);
+ Py_XDECREF(pvalue);
+ Py_XDECREF(ptraceback);
+ goto bad;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ tstate, /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+/* CIntToPy */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const long neg_one = (long) -1, const_zero = (long) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntFromPyVerify */
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntFromPy */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const long neg_one = (long) -1, const_zero = (long) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+/* CIntFromPy */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const int neg_one = (int) -1, const_zero = (int) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+/* FastTypeChecks */
+#if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+ while (a) {
+ a = a->tp_base;
+ if (a == b)
+ return 1;
+ }
+ return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+ PyObject *mro;
+ if (a == b) return 1;
+ mro = a->tp_mro;
+ if (likely(mro)) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(mro);
+ for (i = 0; i < n; i++) {
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+ return 1;
+ }
+ return 0;
+ }
+ return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+ PyObject *exception, *value, *tb;
+ int res;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&exception, &value, &tb);
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ if (!res) {
+ res = PyObject_IsSubclass(err, exc_type2);
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ }
+ __Pyx_ErrRestore(exception, value, tb);
+ return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+ if (!res) {
+ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+ }
+ return res;
+}
+#endif
+static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ assert(PyExceptionClass_Check(exc_type));
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ PyObject *t = PyTuple_GET_ITEM(tuple, i);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(exc_type == t)) return 1;
+ #endif
+ if (likely(PyExceptionClass_Check(t))) {
+ if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
+ } else {
+ }
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+ if (likely(err == exc_type)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ if (likely(PyExceptionClass_Check(exc_type))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+ } else if (likely(PyTuple_Check(exc_type))) {
+ return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
+ } else {
+ }
+ }
+ return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+ assert(PyExceptionClass_Check(exc_type1));
+ assert(PyExceptionClass_Check(exc_type2));
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+ }
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
+/* CheckBinaryVersion */
+static int __Pyx_check_binary_version(void) {
+ char ctversion[5];
+ int same=1, i, found_dot;
+ const char* rt_from_call = Py_GetVersion();
+ PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ found_dot = 0;
+ for (i = 0; i < 4; i++) {
+ if (!ctversion[i]) {
+ same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
+ break;
+ }
+ if (rt_from_call[i] != ctversion[i]) {
+ same = 0;
+ break;
+ }
+ }
+ if (!same) {
+ char rtversion[5] = {'\0'};
+ char message[200];
+ for (i=0; i<4; ++i) {
+ if (rt_from_call[i] == '.') {
+ if (found_dot) break;
+ found_dot = 1;
+ } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
+ break;
+ }
+ rtversion[i] = rt_from_call[i];
+ }
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+/* InitStrings */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ if (PyObject_Hash(*t->p) == -1)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+}
+#else
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (likely(PyUnicode_IS_ASCII(o))) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+ return __Pyx_PyUnicode_AsStringAndSize(o, length);
+ } else
+#endif
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
+ int retval;
+ if (unlikely(!x)) return -1;
+ retval = __Pyx_PyObject_IsTrue(x);
+ Py_DECREF(x);
+ return retval;
+}
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+ if (PyLong_Check(result)) {
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "__int__ returned non-int (type %.200s). "
+ "The ability to return an instance of a strict subclass of int "
+ "is deprecated, and may be removed in a future version of Python.",
+ Py_TYPE(result)->tp_name)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ return result;
+ }
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ type_name, type_name, Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
+ PyNumberMethods *m;
+#endif
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x) || PyLong_Check(x)))
+#else
+ if (likely(PyLong_Check(x)))
+#endif
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
+ m = Py_TYPE(x)->tp_as_number;
+ #if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = m->nb_long(x);
+ }
+ #else
+ if (likely(m && m->nb_int)) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ #endif
+#else
+ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+ res = PyNumber_Int(x);
+ }
+#endif
+ if (likely(res)) {
+#if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
+#else
+ if (unlikely(!PyLong_CheckExact(res))) {
+#endif
+ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(b);
+ }
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
+ if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
+ return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
+#if PY_MAJOR_VERSION < 3
+ } else if (likely(PyInt_CheckExact(o))) {
+ return PyInt_AS_LONG(o);
+#endif
+ } else {
+ Py_ssize_t ival;
+ PyObject *x;
+ x = PyNumber_Index(o);
+ if (!x) return -1;
+ ival = PyInt_AsLong(x);
+ Py_DECREF(x);
+ return ival;
+ }
+}
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
+ return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/third_party/python/aiohttp/aiohttp/_http_writer.pyx b/third_party/python/aiohttp/aiohttp/_http_writer.pyx
new file mode 100644
index 0000000000..eff8521958
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_http_writer.pyx
@@ -0,0 +1,163 @@
+from cpython.bytes cimport PyBytes_FromStringAndSize
+from cpython.exc cimport PyErr_NoMemory
+from cpython.mem cimport PyMem_Free, PyMem_Malloc, PyMem_Realloc
+from cpython.object cimport PyObject_Str
+from libc.stdint cimport uint8_t, uint64_t
+from libc.string cimport memcpy
+
+from multidict import istr
+
+DEF BUF_SIZE = 16 * 1024 # 16KiB
+cdef char BUFFER[BUF_SIZE]
+
+cdef object _istr = istr
+
+
+# ----------------- writer ---------------------------
+
+cdef struct Writer:
+ char *buf
+ Py_ssize_t size
+ Py_ssize_t pos
+
+
+cdef inline void _init_writer(Writer* writer):
+ writer.buf = &BUFFER[0]
+ writer.size = BUF_SIZE
+ writer.pos = 0
+
+
+cdef inline void _release_writer(Writer* writer):
+ if writer.buf != BUFFER:
+ PyMem_Free(writer.buf)
+
+
+cdef inline int _write_byte(Writer* writer, uint8_t ch):
+ cdef char * buf
+ cdef Py_ssize_t size
+
+ if writer.pos == writer.size:
+ # reallocate
+ size = writer.size + BUF_SIZE
+ if writer.buf == BUFFER:
+ buf = <char*>PyMem_Malloc(size)
+ if buf == NULL:
+ PyErr_NoMemory()
+ return -1
+ memcpy(buf, writer.buf, writer.size)
+ else:
+ buf = <char*>PyMem_Realloc(writer.buf, size)
+ if buf == NULL:
+ PyErr_NoMemory()
+ return -1
+ writer.buf = buf
+ writer.size = size
+ writer.buf[writer.pos] = <char>ch
+ writer.pos += 1
+ return 0
+
+
+cdef inline int _write_utf8(Writer* writer, Py_UCS4 symbol):
+ cdef uint64_t utf = <uint64_t> symbol
+
+ if utf < 0x80:
+ return _write_byte(writer, <uint8_t>utf)
+ elif utf < 0x800:
+ if _write_byte(writer, <uint8_t>(0xc0 | (utf >> 6))) < 0:
+ return -1
+ return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ elif 0xD800 <= utf <= 0xDFFF:
+ # surogate pair, ignored
+ return 0
+ elif utf < 0x10000:
+ if _write_byte(writer, <uint8_t>(0xe0 | (utf >> 12))) < 0:
+ return -1
+ if _write_byte(writer, <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ return -1
+ return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+ elif utf > 0x10FFFF:
+ # symbol is too large
+ return 0
+ else:
+ if _write_byte(writer, <uint8_t>(0xf0 | (utf >> 18))) < 0:
+ return -1
+ if _write_byte(writer,
+ <uint8_t>(0x80 | ((utf >> 12) & 0x3f))) < 0:
+ return -1
+ if _write_byte(writer,
+ <uint8_t>(0x80 | ((utf >> 6) & 0x3f))) < 0:
+ return -1
+ return _write_byte(writer, <uint8_t>(0x80 | (utf & 0x3f)))
+
+
+cdef inline int _write_str(Writer* writer, str s):
+ cdef Py_UCS4 ch
+ for ch in s:
+ if _write_utf8(writer, ch) < 0:
+ return -1
+
+
+# --------------- _serialize_headers ----------------------
+
+cdef str to_str(object s):
+ typ = type(s)
+ if typ is str:
+ return <str>s
+ elif typ is _istr:
+ return PyObject_Str(s)
+ elif not isinstance(s, str):
+ raise TypeError("Cannot serialize non-str key {!r}".format(s))
+ else:
+ return str(s)
+
+
+cdef void _safe_header(str string) except *:
+ if "\r" in string or "\n" in string:
+ raise ValueError(
+ "Newline or carriage return character detected in HTTP status message or "
+ "header. This is a potential security issue."
+ )
+
+
+def _serialize_headers(str status_line, headers):
+ cdef Writer writer
+ cdef object key
+ cdef object val
+ cdef bytes ret
+
+ _init_writer(&writer)
+
+ for key, val in headers.items():
+ _safe_header(to_str(key))
+ _safe_header(to_str(val))
+
+ try:
+ if _write_str(&writer, status_line) < 0:
+ raise
+ if _write_byte(&writer, b'\r') < 0:
+ raise
+ if _write_byte(&writer, b'\n') < 0:
+ raise
+
+ for key, val in headers.items():
+ if _write_str(&writer, to_str(key)) < 0:
+ raise
+ if _write_byte(&writer, b':') < 0:
+ raise
+ if _write_byte(&writer, b' ') < 0:
+ raise
+ if _write_str(&writer, to_str(val)) < 0:
+ raise
+ if _write_byte(&writer, b'\r') < 0:
+ raise
+ if _write_byte(&writer, b'\n') < 0:
+ raise
+
+ if _write_byte(&writer, b'\r') < 0:
+ raise
+ if _write_byte(&writer, b'\n') < 0:
+ raise
+
+ return PyBytes_FromStringAndSize(writer.buf, writer.pos)
+ finally:
+ _release_writer(&writer)
diff --git a/third_party/python/aiohttp/aiohttp/_websocket.c b/third_party/python/aiohttp/aiohttp/_websocket.c
new file mode 100644
index 0000000000..de83e09576
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_websocket.c
@@ -0,0 +1,3818 @@
+/* Generated by Cython 0.29.32 */
+
+#ifndef PY_SSIZE_T_CLEAN
+#define PY_SSIZE_T_CLEAN
+#endif /* PY_SSIZE_T_CLEAN */
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+ #error Cython requires Python 2.6+ or Python 3.3+.
+#else
+#define CYTHON_ABI "0_29_32"
+#define CYTHON_HEX_VERSION 0x001D20F0
+#define CYTHON_FUTURE_DIVISION 1
+#include <stddef.h>
+#ifndef offsetof
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#define __PYX_COMMA ,
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x02070000
+ #define HAVE_LONG_LONG
+ #endif
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #if PY_VERSION_HEX < 0x03050000
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
+ #endif
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
+ #endif
+#elif defined(PY_NOGIL)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #define CYTHON_COMPILING_IN_NOGIL 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #ifndef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 1
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 1
+ #endif
+ #undef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS 0
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+#else
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #define CYTHON_COMPILING_IN_NOGIL 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
+ #define CYTHON_USE_PYTYPE_LOOKUP 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #if PY_VERSION_HEX >= 0x030B00A4
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #elif !defined(CYTHON_FAST_THREAD_STATE)
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
+ #endif
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+ #endif
+ #ifndef CYTHON_USE_DICT_VERSIONS
+ #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
+ #endif
+ #if PY_VERSION_HEX >= 0x030B00A4
+ #undef CYTHON_USE_EXC_INFO_STACK
+ #define CYTHON_USE_EXC_INFO_STACK 0
+ #elif !defined(CYTHON_USE_EXC_INFO_STACK)
+ #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
+ #endif
+ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
+ #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #if PY_MAJOR_VERSION < 3
+ #include "longintrepr.h"
+ #endif
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+ #ifdef SIZEOF_VOID_P
+ enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
+ #endif
+#endif
+#ifndef __has_attribute
+ #define __has_attribute(x) 0
+#endif
+#ifndef __has_cpp_attribute
+ #define __has_cpp_attribute(x) 0
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+#ifdef _MSC_VER
+ #ifndef _MSC_STDINT_H_
+ #if _MSC_VER < 1300
+ typedef unsigned char uint8_t;
+ typedef unsigned int uint32_t;
+ #else
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int32 uint32_t;
+ #endif
+ #endif
+#else
+ #include <stdint.h>
+#endif
+#ifndef CYTHON_FALLTHROUGH
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+ #if __has_cpp_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH [[fallthrough]]
+ #elif __has_cpp_attribute(clang::fallthrough)
+ #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
+ #elif __has_cpp_attribute(gnu::fallthrough)
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
+ #endif
+ #endif
+ #ifndef CYTHON_FALLTHROUGH
+ #if __has_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
+ #else
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+ #if defined(__clang__ ) && defined(__apple_build_version__)
+ #if __apple_build_version__ < 7000000
+ #undef CYTHON_FALLTHROUGH
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+#endif
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_DefaultClassType PyType_Type
+#if PY_VERSION_HEX >= 0x030B00A1
+ static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
+ PyObject *code, PyObject *c, PyObject* n, PyObject *v,
+ PyObject *fv, PyObject *cell, PyObject* fn,
+ PyObject *name, int fline, PyObject *lnos) {
+ PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
+ PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
+ const char *fn_cstr=NULL;
+ const char *name_cstr=NULL;
+ PyCodeObject* co=NULL;
+ PyObject *type, *value, *traceback;
+ PyErr_Fetch(&type, &value, &traceback);
+ if (!(kwds=PyDict_New())) goto end;
+ if (!(argcount=PyLong_FromLong(a))) goto end;
+ if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
+ if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
+ if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
+ if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
+ if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
+ if (!(nlocals=PyLong_FromLong(l))) goto end;
+ if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
+ if (!(stacksize=PyLong_FromLong(s))) goto end;
+ if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
+ if (!(flags=PyLong_FromLong(f))) goto end;
+ if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
+ if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
+ if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
+ if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
+ if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
+ if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
+ if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
+ if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
+ Py_XDECREF((PyObject*)co);
+ co = (PyCodeObject*)call_result;
+ call_result = NULL;
+ if (0) {
+ cleanup_code_too:
+ Py_XDECREF((PyObject*)co);
+ co = NULL;
+ }
+ end:
+ Py_XDECREF(kwds);
+ Py_XDECREF(argcount);
+ Py_XDECREF(posonlyargcount);
+ Py_XDECREF(kwonlyargcount);
+ Py_XDECREF(nlocals);
+ Py_XDECREF(stacksize);
+ Py_XDECREF(replace);
+ Py_XDECREF(call_result);
+ Py_XDECREF(empty);
+ if (type) {
+ PyErr_Restore(type, value, traceback);
+ }
+ return co;
+ }
+#else
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+#endif
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#ifndef Py_TPFLAGS_CHECKTYPES
+ #define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
+ #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#ifndef METH_STACKLESS
+ #define METH_STACKLESS 0
+#endif
+#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
+ #ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ #endif
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
+ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+ #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
+ #define PyMem_RawMalloc(n) PyMem_Malloc(n)
+ #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
+ #define PyMem_RawFree(p) PyMem_Free(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
+#endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+ #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
+#include "pythread.h"
+#define Py_tss_NEEDS_INIT 0
+typedef int Py_tss_t;
+static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
+ *key = PyThread_create_key();
+ return 0;
+}
+static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
+ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
+ *key = Py_tss_NEEDS_INIT;
+ return key;
+}
+static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
+ PyObject_Free(key);
+}
+static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
+ return *key != Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
+ PyThread_delete_key(*key);
+ *key = Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
+ return PyThread_set_key_value(*key, value);
+}
+static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
+ return PyThread_get_key_value(*key);
+}
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n) PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
+#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
+#else
+#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #if defined(PyUnicode_IS_READY)
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #else
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #endif
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
+ #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
+ #endif
+ #else
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
+ #endif
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+#ifndef PyObject_Unicode
+ #define PyObject_Unicode PyObject_Str
+#endif
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#if PY_VERSION_HEX >= 0x030900A4
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
+#else
+ #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
+ #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
+#endif
+#if CYTHON_ASSUME_SAFE_MACROS
+ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
+#else
+ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
+ #else
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+ #endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+#endif
+
+#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
+ #if !defined(_USE_MATH_DEFINES)
+ #define _USE_MATH_DEFINES
+ #endif
+#endif
+#include <math.h>
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
+#endif
+
+#define __PYX_MARK_ERR_POS(f_index, lineno) \
+ { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#define __PYX_HAVE__aiohttp___websocket
+#define __PYX_HAVE_API__aiohttp___websocket
+/* Early includes */
+#include <string.h>
+#include <stdio.h>
+#include "pythread.h"
+#include <stdint.h>
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX))) )
+static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
+ return (size_t) i < (size_t) limit;
+}
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER)
+ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
+#if CYTHON_ASSUME_SAFE_MACROS
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
+
+static PyObject *__pyx_m = NULL;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_cython_runtime = NULL;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+ "aiohttp/_websocket.pyx",
+ "type.pxd",
+ "bool.pxd",
+ "complex.pxd",
+};
+
+/*--- Type declarations ---*/
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ if (acquire_gil) {\
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ PyGILState_Release(__pyx_gilstate_save);\
+ } else {\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext()\
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_XDECREF(tmp);\
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_DECREF(tmp);\
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+/* GetBuiltinName.proto */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+/* RaiseArgTupleInvalid.proto */
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+/* RaiseDoubleKeywords.proto */
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
+ const char* function_name);
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#define __Pyx_BUILD_ASSERT_EXPR(cond)\
+ (sizeof(char [1 - 2*!(cond)]) - 1)
+#ifndef Py_MEMBER_SIZE
+#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
+#endif
+#if CYTHON_FAST_PYCALL
+ static size_t __pyx_pyframe_localsplus_offset = 0;
+ #include "frameobject.h"
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+ #define __Pxy_PyFrame_Initialize_Offsets()\
+ ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
+ (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
+ #define __Pyx_PyFrame_GetLocalsplus(frame)\
+ (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
+#endif // CYTHON_FAST_PYCALL
+#endif
+
+/* PyObjectCall.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+/* PyObjectCallMethO.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+/* PyObjectCallOneArg.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+/* TypeImport.proto */
+#ifndef __PYX_HAVE_RT_ImportType_proto
+#define __PYX_HAVE_RT_ImportType_proto
+enum __Pyx_ImportType_CheckSize {
+ __Pyx_ImportType_CheckSize_Error = 0,
+ __Pyx_ImportType_CheckSize_Warn = 1,
+ __Pyx_ImportType_CheckSize_Ignore = 2
+};
+static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
+#endif
+
+/* PyDictVersioning.proto */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
+#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
+#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
+ (version_var) = __PYX_GET_DICT_VERSION(dict);\
+ (cache_var) = (value);
+#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
+ static PY_UINT64_T __pyx_dict_version = 0;\
+ static PyObject *__pyx_dict_cached_value = NULL;\
+ if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
+ (VAR) = __pyx_dict_cached_value;\
+ } else {\
+ (VAR) = __pyx_dict_cached_value = (LOOKUP);\
+ __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
+ }\
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
+#else
+#define __PYX_GET_DICT_VERSION(dict) (0)
+#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
+#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
+#endif
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred() PyErr_Occurred()
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* CLineInTraceback.proto */
+#ifdef CYTHON_CLINE_IN_TRACEBACK
+#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
+#else
+static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
+#endif
+
+/* CodeObjectCache.proto */
+typedef struct {
+ PyCodeObject* code_object;
+ int code_line;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+/* AddTraceback.proto */
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+/* GCCDiagnostics.proto */
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
+#define __Pyx_HAS_GCC_DIAGNOSTIC
+#endif
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
+
+/* CheckBinaryVersion.proto */
+static int __Pyx_check_binary_version(void);
+
+/* InitStrings.proto */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'libc.stdint' */
+
+/* Module declarations from 'aiohttp._websocket' */
+#define __Pyx_MODULE_NAME "aiohttp._websocket"
+extern int __pyx_module_is_main_aiohttp___websocket;
+int __pyx_module_is_main_aiohttp___websocket = 0;
+
+/* Implementation of 'aiohttp._websocket' */
+static PyObject *__pyx_builtin_range;
+static const char __pyx_k_i[] = "i";
+static const char __pyx_k_data[] = "data";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mask[] = "mask";
+static const char __pyx_k_name[] = "__name__";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_in_buf[] = "in_buf";
+static const char __pyx_k_data_len[] = "data_len";
+static const char __pyx_k_mask_buf[] = "mask_buf";
+static const char __pyx_k_uint32_msk[] = "uint32_msk";
+static const char __pyx_k_uint64_msk[] = "uint64_msk";
+static const char __pyx_k_aiohttp__websocket[] = "aiohttp._websocket";
+static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
+static const char __pyx_k_websocket_mask_cython[] = "_websocket_mask_cython";
+static const char __pyx_k_aiohttp__websocket_pyx[] = "aiohttp/_websocket.pyx";
+static PyObject *__pyx_n_s_aiohttp__websocket;
+static PyObject *__pyx_kp_s_aiohttp__websocket_pyx;
+static PyObject *__pyx_n_s_cline_in_traceback;
+static PyObject *__pyx_n_s_data;
+static PyObject *__pyx_n_s_data_len;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_in_buf;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_mask;
+static PyObject *__pyx_n_s_mask_buf;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_uint32_msk;
+static PyObject *__pyx_n_s_uint64_msk;
+static PyObject *__pyx_n_s_websocket_mask_cython;
+static PyObject *__pyx_pf_7aiohttp_10_websocket__websocket_mask_cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mask, PyObject *__pyx_v_data); /* proto */
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_codeobj__2;
+/* Late includes */
+
+/* "aiohttp/_websocket.pyx":11
+ *
+ *
+ * def _websocket_mask_cython(object mask, object data): # <<<<<<<<<<<<<<
+ * """Note, this function mutates its `data` argument
+ * """
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_7aiohttp_10_websocket_1_websocket_mask_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_7aiohttp_10_websocket__websocket_mask_cython[] = "Note, this function mutates its `data` argument\n ";
+static PyMethodDef __pyx_mdef_7aiohttp_10_websocket_1_websocket_mask_cython = {"_websocket_mask_cython", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_7aiohttp_10_websocket_1_websocket_mask_cython, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7aiohttp_10_websocket__websocket_mask_cython};
+static PyObject *__pyx_pw_7aiohttp_10_websocket_1_websocket_mask_cython(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_mask = 0;
+ PyObject *__pyx_v_data = 0;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_websocket_mask_cython (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mask,&__pyx_n_s_data,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mask)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_websocket_mask_cython", 1, 2, 2, 1); __PYX_ERR(0, 11, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_websocket_mask_cython") < 0)) __PYX_ERR(0, 11, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ }
+ __pyx_v_mask = values[0];
+ __pyx_v_data = values[1];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_websocket_mask_cython", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 11, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("aiohttp._websocket._websocket_mask_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_7aiohttp_10_websocket__websocket_mask_cython(__pyx_self, __pyx_v_mask, __pyx_v_data);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_7aiohttp_10_websocket__websocket_mask_cython(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_mask, PyObject *__pyx_v_data) {
+ Py_ssize_t __pyx_v_data_len;
+ Py_ssize_t __pyx_v_i;
+ unsigned char *__pyx_v_in_buf;
+ unsigned char const *__pyx_v_mask_buf;
+ uint32_t __pyx_v_uint32_msk;
+ uint64_t __pyx_v_uint64_msk;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ char *__pyx_t_5;
+ uint64_t *__pyx_t_6;
+ long __pyx_t_7;
+ uint32_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("_websocket_mask_cython", 0);
+ __Pyx_INCREF(__pyx_v_mask);
+ __Pyx_INCREF(__pyx_v_data);
+
+ /* "aiohttp/_websocket.pyx":22
+ * uint64_t uint64_msk
+ *
+ * assert len(mask) == 4 # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(mask, bytes):
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ __pyx_t_1 = PyObject_Length(__pyx_v_mask); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 22, __pyx_L1_error)
+ if (unlikely(!((__pyx_t_1 == 4) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(0, 22, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "aiohttp/_websocket.pyx":24
+ * assert len(mask) == 4
+ *
+ * if not isinstance(mask, bytes): # <<<<<<<<<<<<<<
+ * mask = bytes(mask)
+ *
+ */
+ __pyx_t_2 = PyBytes_Check(__pyx_v_mask);
+ __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_3) {
+
+ /* "aiohttp/_websocket.pyx":25
+ *
+ * if not isinstance(mask, bytes):
+ * mask = bytes(mask) # <<<<<<<<<<<<<<
+ *
+ * if isinstance(data, bytearray):
+ */
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyBytes_Type)), __pyx_v_mask); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 25, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF_SET(__pyx_v_mask, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "aiohttp/_websocket.pyx":24
+ * assert len(mask) == 4
+ *
+ * if not isinstance(mask, bytes): # <<<<<<<<<<<<<<
+ * mask = bytes(mask)
+ *
+ */
+ }
+
+ /* "aiohttp/_websocket.pyx":27
+ * mask = bytes(mask)
+ *
+ * if isinstance(data, bytearray): # <<<<<<<<<<<<<<
+ * data = <bytearray>data
+ * else:
+ */
+ __pyx_t_3 = PyByteArray_Check(__pyx_v_data);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_websocket.pyx":28
+ *
+ * if isinstance(data, bytearray):
+ * data = <bytearray>data # <<<<<<<<<<<<<<
+ * else:
+ * data = bytearray(data)
+ */
+ __pyx_t_4 = __pyx_v_data;
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "aiohttp/_websocket.pyx":27
+ * mask = bytes(mask)
+ *
+ * if isinstance(data, bytearray): # <<<<<<<<<<<<<<
+ * data = <bytearray>data
+ * else:
+ */
+ goto __pyx_L4;
+ }
+
+ /* "aiohttp/_websocket.pyx":30
+ * data = <bytearray>data
+ * else:
+ * data = bytearray(data) # <<<<<<<<<<<<<<
+ *
+ * data_len = len(data)
+ */
+ /*else*/ {
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyByteArray_Type)), __pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 30, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_4);
+ __pyx_t_4 = 0;
+ }
+ __pyx_L4:;
+
+ /* "aiohttp/_websocket.pyx":32
+ * data = bytearray(data)
+ *
+ * data_len = len(data) # <<<<<<<<<<<<<<
+ * in_buf = <unsigned char*>PyByteArray_AsString(data)
+ * mask_buf = <const unsigned char*>PyBytes_AsString(mask)
+ */
+ __pyx_t_1 = PyObject_Length(__pyx_v_data); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 32, __pyx_L1_error)
+ __pyx_v_data_len = __pyx_t_1;
+
+ /* "aiohttp/_websocket.pyx":33
+ *
+ * data_len = len(data)
+ * in_buf = <unsigned char*>PyByteArray_AsString(data) # <<<<<<<<<<<<<<
+ * mask_buf = <const unsigned char*>PyBytes_AsString(mask)
+ * uint32_msk = (<uint32_t*>mask_buf)[0]
+ */
+ if (!(likely(PyByteArray_CheckExact(__pyx_v_data))||((__pyx_v_data) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytearray", Py_TYPE(__pyx_v_data)->tp_name), 0))) __PYX_ERR(0, 33, __pyx_L1_error)
+ __pyx_t_5 = PyByteArray_AsString(((PyObject*)__pyx_v_data)); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(0, 33, __pyx_L1_error)
+ __pyx_v_in_buf = ((unsigned char *)__pyx_t_5);
+
+ /* "aiohttp/_websocket.pyx":34
+ * data_len = len(data)
+ * in_buf = <unsigned char*>PyByteArray_AsString(data)
+ * mask_buf = <const unsigned char*>PyBytes_AsString(mask) # <<<<<<<<<<<<<<
+ * uint32_msk = (<uint32_t*>mask_buf)[0]
+ *
+ */
+ __pyx_t_5 = PyBytes_AsString(__pyx_v_mask); if (unlikely(__pyx_t_5 == ((char *)NULL))) __PYX_ERR(0, 34, __pyx_L1_error)
+ __pyx_v_mask_buf = ((unsigned char const *)__pyx_t_5);
+
+ /* "aiohttp/_websocket.pyx":35
+ * in_buf = <unsigned char*>PyByteArray_AsString(data)
+ * mask_buf = <const unsigned char*>PyBytes_AsString(mask)
+ * uint32_msk = (<uint32_t*>mask_buf)[0] # <<<<<<<<<<<<<<
+ *
+ * # TODO: align in_data ptr to achieve even faster speeds
+ */
+ __pyx_v_uint32_msk = (((uint32_t *)__pyx_v_mask_buf)[0]);
+
+ /* "aiohttp/_websocket.pyx":40
+ * # does it need in python ?! malloc() always aligns to sizeof(long) bytes
+ *
+ * if sizeof(size_t) >= 8: # <<<<<<<<<<<<<<
+ * uint64_msk = uint32_msk
+ * uint64_msk = (uint64_msk << 32) | uint32_msk
+ */
+ __pyx_t_2 = (((sizeof(size_t)) >= 8) != 0);
+ if (__pyx_t_2) {
+
+ /* "aiohttp/_websocket.pyx":41
+ *
+ * if sizeof(size_t) >= 8:
+ * uint64_msk = uint32_msk # <<<<<<<<<<<<<<
+ * uint64_msk = (uint64_msk << 32) | uint32_msk
+ *
+ */
+ __pyx_v_uint64_msk = __pyx_v_uint32_msk;
+
+ /* "aiohttp/_websocket.pyx":42
+ * if sizeof(size_t) >= 8:
+ * uint64_msk = uint32_msk
+ * uint64_msk = (uint64_msk << 32) | uint32_msk # <<<<<<<<<<<<<<
+ *
+ * while data_len >= 8:
+ */
+ __pyx_v_uint64_msk = ((__pyx_v_uint64_msk << 32) | __pyx_v_uint32_msk);
+
+ /* "aiohttp/_websocket.pyx":44
+ * uint64_msk = (uint64_msk << 32) | uint32_msk
+ *
+ * while data_len >= 8: # <<<<<<<<<<<<<<
+ * (<uint64_t*>in_buf)[0] ^= uint64_msk
+ * in_buf += 8
+ */
+ while (1) {
+ __pyx_t_2 = ((__pyx_v_data_len >= 8) != 0);
+ if (!__pyx_t_2) break;
+
+ /* "aiohttp/_websocket.pyx":45
+ *
+ * while data_len >= 8:
+ * (<uint64_t*>in_buf)[0] ^= uint64_msk # <<<<<<<<<<<<<<
+ * in_buf += 8
+ * data_len -= 8
+ */
+ __pyx_t_6 = ((uint64_t *)__pyx_v_in_buf);
+ __pyx_t_7 = 0;
+ (__pyx_t_6[__pyx_t_7]) = ((__pyx_t_6[__pyx_t_7]) ^ __pyx_v_uint64_msk);
+
+ /* "aiohttp/_websocket.pyx":46
+ * while data_len >= 8:
+ * (<uint64_t*>in_buf)[0] ^= uint64_msk
+ * in_buf += 8 # <<<<<<<<<<<<<<
+ * data_len -= 8
+ *
+ */
+ __pyx_v_in_buf = (__pyx_v_in_buf + 8);
+
+ /* "aiohttp/_websocket.pyx":47
+ * (<uint64_t*>in_buf)[0] ^= uint64_msk
+ * in_buf += 8
+ * data_len -= 8 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data_len = (__pyx_v_data_len - 8);
+ }
+
+ /* "aiohttp/_websocket.pyx":40
+ * # does it need in python ?! malloc() always aligns to sizeof(long) bytes
+ *
+ * if sizeof(size_t) >= 8: # <<<<<<<<<<<<<<
+ * uint64_msk = uint32_msk
+ * uint64_msk = (uint64_msk << 32) | uint32_msk
+ */
+ }
+
+ /* "aiohttp/_websocket.pyx":50
+ *
+ *
+ * while data_len >= 4: # <<<<<<<<<<<<<<
+ * (<uint32_t*>in_buf)[0] ^= uint32_msk
+ * in_buf += 4
+ */
+ while (1) {
+ __pyx_t_2 = ((__pyx_v_data_len >= 4) != 0);
+ if (!__pyx_t_2) break;
+
+ /* "aiohttp/_websocket.pyx":51
+ *
+ * while data_len >= 4:
+ * (<uint32_t*>in_buf)[0] ^= uint32_msk # <<<<<<<<<<<<<<
+ * in_buf += 4
+ * data_len -= 4
+ */
+ __pyx_t_8 = ((uint32_t *)__pyx_v_in_buf);
+ __pyx_t_7 = 0;
+ (__pyx_t_8[__pyx_t_7]) = ((__pyx_t_8[__pyx_t_7]) ^ __pyx_v_uint32_msk);
+
+ /* "aiohttp/_websocket.pyx":52
+ * while data_len >= 4:
+ * (<uint32_t*>in_buf)[0] ^= uint32_msk
+ * in_buf += 4 # <<<<<<<<<<<<<<
+ * data_len -= 4
+ *
+ */
+ __pyx_v_in_buf = (__pyx_v_in_buf + 4);
+
+ /* "aiohttp/_websocket.pyx":53
+ * (<uint32_t*>in_buf)[0] ^= uint32_msk
+ * in_buf += 4
+ * data_len -= 4 # <<<<<<<<<<<<<<
+ *
+ * for i in range(0, data_len):
+ */
+ __pyx_v_data_len = (__pyx_v_data_len - 4);
+ }
+
+ /* "aiohttp/_websocket.pyx":55
+ * data_len -= 4
+ *
+ * for i in range(0, data_len): # <<<<<<<<<<<<<<
+ * in_buf[i] ^= mask_buf[i]
+ */
+ __pyx_t_1 = __pyx_v_data_len;
+ __pyx_t_9 = __pyx_t_1;
+ for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
+ __pyx_v_i = __pyx_t_10;
+
+ /* "aiohttp/_websocket.pyx":56
+ *
+ * for i in range(0, data_len):
+ * in_buf[i] ^= mask_buf[i] # <<<<<<<<<<<<<<
+ */
+ __pyx_t_11 = __pyx_v_i;
+ (__pyx_v_in_buf[__pyx_t_11]) = ((__pyx_v_in_buf[__pyx_t_11]) ^ (__pyx_v_mask_buf[__pyx_v_i]));
+ }
+
+ /* "aiohttp/_websocket.pyx":11
+ *
+ *
+ * def _websocket_mask_cython(object mask, object data): # <<<<<<<<<<<<<<
+ * """Note, this function mutates its `data` argument
+ * """
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("aiohttp._websocket._websocket_mask_cython", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_mask);
+ __Pyx_XDECREF(__pyx_v_data);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec__websocket(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+ {Py_mod_create, (void*)__pyx_pymod_create},
+ {Py_mod_exec, (void*)__pyx_pymod_exec__websocket},
+ {0, NULL}
+};
+#endif
+
+static struct PyModuleDef __pyx_moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "_websocket",
+ 0, /* m_doc */
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ 0, /* m_size */
+ #else
+ -1, /* m_size */
+ #endif
+ __pyx_methods /* m_methods */,
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_moduledef_slots, /* m_slots */
+ #else
+ NULL, /* m_reload */
+ #endif
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+#ifndef CYTHON_SMALL_CODE
+#if defined(__clang__)
+ #define CYTHON_SMALL_CODE
+#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
+ #define CYTHON_SMALL_CODE __attribute__((cold))
+#else
+ #define CYTHON_SMALL_CODE
+#endif
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_aiohttp__websocket, __pyx_k_aiohttp__websocket, sizeof(__pyx_k_aiohttp__websocket), 0, 0, 1, 1},
+ {&__pyx_kp_s_aiohttp__websocket_pyx, __pyx_k_aiohttp__websocket_pyx, sizeof(__pyx_k_aiohttp__websocket_pyx), 0, 0, 1, 0},
+ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
+ {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
+ {&__pyx_n_s_data_len, __pyx_k_data_len, sizeof(__pyx_k_data_len), 0, 0, 1, 1},
+ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+ {&__pyx_n_s_in_buf, __pyx_k_in_buf, sizeof(__pyx_k_in_buf), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
+ {&__pyx_n_s_mask_buf, __pyx_k_mask_buf, sizeof(__pyx_k_mask_buf), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_uint32_msk, __pyx_k_uint32_msk, sizeof(__pyx_k_uint32_msk), 0, 0, 1, 1},
+ {&__pyx_n_s_uint64_msk, __pyx_k_uint64_msk, sizeof(__pyx_k_uint64_msk), 0, 0, 1, 1},
+ {&__pyx_n_s_websocket_mask_cython, __pyx_k_websocket_mask_cython, sizeof(__pyx_k_websocket_mask_cython), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 55, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "aiohttp/_websocket.pyx":11
+ *
+ *
+ * def _websocket_mask_cython(object mask, object data): # <<<<<<<<<<<<<<
+ * """Note, this function mutates its `data` argument
+ * """
+ */
+ __pyx_tuple_ = PyTuple_Pack(8, __pyx_n_s_mask, __pyx_n_s_data, __pyx_n_s_data_len, __pyx_n_s_i, __pyx_n_s_in_buf, __pyx_n_s_mask_buf, __pyx_n_s_uint32_msk, __pyx_n_s_uint64_msk); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+ __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple_, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_aiohttp__websocket_pyx, __pyx_n_s_websocket_mask_cython, 11, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 11, __pyx_L1_error)
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
+static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
+
+static int __Pyx_modinit_global_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
+ /*--- Global init code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_variable_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
+ /*--- Variable export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
+ /*--- Function export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_type_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
+ /*--- Type init code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_type_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
+ /*--- Type import code ---*/
+ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
+ #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ __Pyx_ImportType_CheckSize_Warn);
+ if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(1, 9, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
+ if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(2, 8, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
+ if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(3, 15, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_variable_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
+ /*--- Variable import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
+ /*--- Function import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+
+#ifndef CYTHON_NO_PYINIT_EXPORT
+#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#elif PY_MAJOR_VERSION < 3
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" void
+#else
+#define __Pyx_PyMODINIT_FUNC void
+#endif
+#else
+#ifdef __cplusplus
+#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
+#else
+#define __Pyx_PyMODINIT_FUNC PyObject *
+#endif
+#endif
+
+
+#if PY_MAJOR_VERSION < 3
+__Pyx_PyMODINIT_FUNC init_websocket(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC init_websocket(void)
+#else
+__Pyx_PyMODINIT_FUNC PyInit__websocket(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC PyInit__websocket(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+ return PyModuleDef_Init(&__pyx_moduledef);
+}
+static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
+ #if PY_VERSION_HEX >= 0x030700A1
+ static PY_INT64_T main_interpreter_id = -1;
+ PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
+ if (main_interpreter_id == -1) {
+ main_interpreter_id = current_id;
+ return (unlikely(current_id == -1)) ? -1 : 0;
+ } else if (unlikely(main_interpreter_id != current_id))
+ #else
+ static PyInterpreterState *main_interpreter = NULL;
+ PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
+ if (!main_interpreter) {
+ main_interpreter = current_interpreter;
+ } else if (unlikely(main_interpreter != current_interpreter))
+ #endif
+ {
+ PyErr_SetString(
+ PyExc_ImportError,
+ "Interpreter change detected - this module can only be loaded into one interpreter per process.");
+ return -1;
+ }
+ return 0;
+}
+static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
+ PyObject *value = PyObject_GetAttrString(spec, from_name);
+ int result = 0;
+ if (likely(value)) {
+ if (allow_none || value != Py_None) {
+ result = PyDict_SetItemString(moddict, to_name, value);
+ }
+ Py_DECREF(value);
+ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ } else {
+ result = -1;
+ }
+ return result;
+}
+static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+ PyObject *module = NULL, *moddict, *modname;
+ if (__Pyx_check_single_interpreter())
+ return NULL;
+ if (__pyx_m)
+ return __Pyx_NewRef(__pyx_m);
+ modname = PyObject_GetAttrString(spec, "name");
+ if (unlikely(!modname)) goto bad;
+ module = PyModule_NewObject(modname);
+ Py_DECREF(modname);
+ if (unlikely(!module)) goto bad;
+ moddict = PyModule_GetDict(module);
+ if (unlikely(!moddict)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
+ return module;
+bad:
+ Py_XDECREF(module);
+ return NULL;
+}
+
+
+static CYTHON_SMALL_CODE int __pyx_pymod_exec__websocket(PyObject *__pyx_pyinit_module)
+#endif
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_lineno = 0;
+ const char *__pyx_filename = NULL;
+ int __pyx_clineno = 0;
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ if (__pyx_m) {
+ if (__pyx_m == __pyx_pyinit_module) return 0;
+ PyErr_SetString(PyExc_RuntimeError, "Module '_websocket' has already been imported. Re-initialisation is not supported.");
+ return -1;
+ }
+ #elif PY_MAJOR_VERSION >= 3
+ if (__pyx_m) return __Pyx_NewRef(__pyx_m);
+ #endif
+ #if CYTHON_REFNANNY
+__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+}
+#endif
+ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__websocket(void)", 0);
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pxy_PyFrame_Initialize_Offsets
+ __Pxy_PyFrame_Initialize_Offsets();
+ #endif
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pyx_CyFunction_USED
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ PyEval_InitThreads();
+ #endif
+ /*--- Module creation code ---*/
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_m = __pyx_pyinit_module;
+ Py_INCREF(__pyx_m);
+ #else
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_websocket", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_b);
+ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_cython_runtime);
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ /*--- Initialize various global constants etc. ---*/
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ if (__pyx_module_is_main_aiohttp___websocket) {
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "aiohttp._websocket")) {
+ if (unlikely(PyDict_SetItemString(modules, "aiohttp._websocket", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Constants init code ---*/
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Global type/function init code ---*/
+ (void)__Pyx_modinit_global_init_code();
+ (void)__Pyx_modinit_variable_export_code();
+ (void)__Pyx_modinit_function_export_code();
+ (void)__Pyx_modinit_type_init_code();
+ if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ (void)__Pyx_modinit_variable_import_code();
+ (void)__Pyx_modinit_function_import_code();
+ /*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+
+ /* "aiohttp/_websocket.pyx":11
+ *
+ *
+ * def _websocket_mask_cython(object mask, object data): # <<<<<<<<<<<<<<
+ * """Note, this function mutates its `data` argument
+ * """
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7aiohttp_10_websocket_1_websocket_mask_cython, NULL, __pyx_n_s_aiohttp__websocket); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_websocket_mask_cython, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "aiohttp/_websocket.pyx":1
+ * from cpython cimport PyBytes_AsString # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init aiohttp._websocket", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ }
+ Py_CLEAR(__pyx_m);
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init aiohttp._websocket");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ return (__pyx_m != NULL) ? 0 : -1;
+ #elif PY_MAJOR_VERSION >= 3
+ return __pyx_m;
+ #else
+ return;
+ #endif
+}
+
+/* --- Runtime support code --- */
+/* Refnanny */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule(modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, "RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+/* PyObjectGetAttrStr */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#endif
+
+/* GetBuiltinName */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+/* RaiseArgTupleInvalid */
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+/* RaiseDoubleKeywords */
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+/* ParseKeywords */
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+/* PyCFunctionFastCall */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ int flags = PyCFunction_GET_FLAGS(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
+ return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
+ } else {
+ return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
+ }
+}
+#endif
+
+/* PyFunctionFastCall */
+#if CYTHON_FAST_PYCALL
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, (int)nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, (int)nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif
+#endif
+
+/* PyObjectCall */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = Py_TYPE(func)->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallMethO */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallOneArg */
+#if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
+ if (likely(PyCFunction_Check(func))) {
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (__Pyx_PyFastCFunction_Check(func)) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+#endif
+
+/* TypeImport */
+#ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
+ size_t size, enum __Pyx_ImportType_CheckSize check_size)
+{
+ PyObject *result = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ result = PyObject_GetAttrString(module, class_name);
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if ((size_t)basicsize < size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ goto bad;
+ }
+ if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ goto bad;
+ }
+ else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility. "
+ "Expected %zd from C header, got %zd from PyObject",
+ module_name, class_name, size, basicsize);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+/* PyDictVersioning */
+#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
+}
+static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
+ PyObject **dictptr = NULL;
+ Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
+ if (offset) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
+#else
+ dictptr = _PyObject_GetDictPtr(obj);
+#endif
+ }
+ return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
+}
+static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
+ PyObject *dict = Py_TYPE(obj)->tp_dict;
+ if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
+ return 0;
+ return obj_dict_version == __Pyx_get_object_dict_version(obj);
+}
+#endif
+
+/* PyErrFetchRestore */
+#if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+}
+#endif
+
+/* CLineInTraceback */
+#ifndef CYTHON_CLINE_IN_TRACEBACK
+static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
+ PyObject *use_cline;
+ PyObject *ptype, *pvalue, *ptraceback;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject **cython_runtime_dict;
+#endif
+ if (unlikely(!__pyx_cython_runtime)) {
+ return c_line;
+ }
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+#if CYTHON_COMPILING_IN_CPYTHON
+ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
+ if (likely(cython_runtime_dict)) {
+ __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
+ use_cline, *cython_runtime_dict,
+ __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
+ } else
+#endif
+ {
+ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
+ if (use_cline_obj) {
+ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
+ Py_DECREF(use_cline_obj);
+ } else {
+ PyErr_Clear();
+ use_cline = NULL;
+ }
+ }
+ if (!use_cline) {
+ c_line = 0;
+ (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
+ }
+ else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
+ c_line = 0;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ return c_line;
+}
+#endif
+
+/* CodeObjectCache */
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = start + (end - start) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+/* AddTraceback */
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+#if PY_VERSION_HEX >= 0x030b00a6
+ #ifndef Py_BUILD_CORE
+ #define Py_BUILD_CORE 1
+ #endif
+ #include "internal/pycore_frame.h"
+#endif
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = NULL;
+ PyObject *py_funcname = NULL;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_srcfile = NULL;
+ py_srcfile = PyString_FromString(filename);
+ if (!py_srcfile) goto bad;
+ #endif
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ if (!py_funcname) goto bad;
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ if (!py_funcname) goto bad;
+ funcname = PyUnicode_AsUTF8(py_funcname);
+ if (!funcname) goto bad;
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ if (!py_funcname) goto bad;
+ #endif
+ }
+ #if PY_MAJOR_VERSION < 3
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ #else
+ py_code = PyCode_NewEmpty(filename, funcname, py_line);
+ #endif
+ Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
+ return py_code;
+bad:
+ Py_XDECREF(py_funcname);
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_srcfile);
+ #endif
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject *ptype, *pvalue, *ptraceback;
+ if (c_line) {
+ c_line = __Pyx_CLineForTraceback(tstate, c_line);
+ }
+ py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
+ if (!py_code) {
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) {
+ /* If the code object creation fails, then we should clear the
+ fetched exception references and propagate the new exception */
+ Py_XDECREF(ptype);
+ Py_XDECREF(pvalue);
+ Py_XDECREF(ptraceback);
+ goto bad;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ tstate, /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+/* CIntToPy */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const long neg_one = (long) -1, const_zero = (long) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntFromPyVerify */
+#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntFromPy */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const long neg_one = (long) -1, const_zero = (long) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+/* CIntFromPy */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wconversion"
+#endif
+ const int neg_one = (int) -1, const_zero = (int) 0;
+#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
+#pragma GCC diagnostic pop
+#endif
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+/* FastTypeChecks */
+#if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+ while (a) {
+ a = a->tp_base;
+ if (a == b)
+ return 1;
+ }
+ return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+ PyObject *mro;
+ if (a == b) return 1;
+ mro = a->tp_mro;
+ if (likely(mro)) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(mro);
+ for (i = 0; i < n; i++) {
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+ return 1;
+ }
+ return 0;
+ }
+ return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+ PyObject *exception, *value, *tb;
+ int res;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&exception, &value, &tb);
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ if (!res) {
+ res = PyObject_IsSubclass(err, exc_type2);
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ }
+ __Pyx_ErrRestore(exception, value, tb);
+ return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+ if (!res) {
+ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+ }
+ return res;
+}
+#endif
+static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ assert(PyExceptionClass_Check(exc_type));
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ PyObject *t = PyTuple_GET_ITEM(tuple, i);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(exc_type == t)) return 1;
+ #endif
+ if (likely(PyExceptionClass_Check(t))) {
+ if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
+ } else {
+ }
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+ if (likely(err == exc_type)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ if (likely(PyExceptionClass_Check(exc_type))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+ } else if (likely(PyTuple_Check(exc_type))) {
+ return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
+ } else {
+ }
+ }
+ return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+ assert(PyExceptionClass_Check(exc_type1));
+ assert(PyExceptionClass_Check(exc_type2));
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+ }
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
+/* CheckBinaryVersion */
+static int __Pyx_check_binary_version(void) {
+ char ctversion[5];
+ int same=1, i, found_dot;
+ const char* rt_from_call = Py_GetVersion();
+ PyOS_snprintf(ctversion, 5, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ found_dot = 0;
+ for (i = 0; i < 4; i++) {
+ if (!ctversion[i]) {
+ same = (rt_from_call[i] < '0' || rt_from_call[i] > '9');
+ break;
+ }
+ if (rt_from_call[i] != ctversion[i]) {
+ same = 0;
+ break;
+ }
+ }
+ if (!same) {
+ char rtversion[5] = {'\0'};
+ char message[200];
+ for (i=0; i<4; ++i) {
+ if (rt_from_call[i] == '.') {
+ if (found_dot) break;
+ found_dot = 1;
+ } else if (rt_from_call[i] < '0' || rt_from_call[i] > '9') {
+ break;
+ }
+ rtversion[i] = rt_from_call[i];
+ }
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+/* InitStrings */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ if (PyObject_Hash(*t->p) == -1)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+}
+#else
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (likely(PyUnicode_IS_ASCII(o))) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+ return __Pyx_PyUnicode_AsStringAndSize(o, length);
+ } else
+#endif
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
+ int retval;
+ if (unlikely(!x)) return -1;
+ retval = __Pyx_PyObject_IsTrue(x);
+ Py_DECREF(x);
+ return retval;
+}
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+ if (PyLong_Check(result)) {
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "__int__ returned non-int (type %.200s). "
+ "The ability to return an instance of a strict subclass of int "
+ "is deprecated, and may be removed in a future version of Python.",
+ Py_TYPE(result)->tp_name)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ return result;
+ }
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ type_name, type_name, Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
+ PyNumberMethods *m;
+#endif
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x) || PyLong_Check(x)))
+#else
+ if (likely(PyLong_Check(x)))
+#endif
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
+ m = Py_TYPE(x)->tp_as_number;
+ #if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = m->nb_long(x);
+ }
+ #else
+ if (likely(m && m->nb_int)) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ #endif
+#else
+ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+ res = PyNumber_Int(x);
+ }
+#endif
+ if (likely(res)) {
+#if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
+#else
+ if (unlikely(!PyLong_CheckExact(res))) {
+#endif
+ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(b);
+ }
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ }
+ }
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
+ if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
+ return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
+#if PY_MAJOR_VERSION < 3
+ } else if (likely(PyInt_CheckExact(o))) {
+ return PyInt_AS_LONG(o);
+#endif
+ } else {
+ Py_ssize_t ival;
+ PyObject *x;
+ x = PyNumber_Index(o);
+ if (!x) return -1;
+ ival = PyInt_AsLong(x);
+ Py_DECREF(x);
+ return ival;
+ }
+}
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
+ return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/third_party/python/aiohttp/aiohttp/_websocket.pyx b/third_party/python/aiohttp/aiohttp/_websocket.pyx
new file mode 100644
index 0000000000..94318d2b1b
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/_websocket.pyx
@@ -0,0 +1,56 @@
+from cpython cimport PyBytes_AsString
+
+
+#from cpython cimport PyByteArray_AsString # cython still not exports that
+cdef extern from "Python.h":
+ char* PyByteArray_AsString(bytearray ba) except NULL
+
+from libc.stdint cimport uint32_t, uint64_t, uintmax_t
+
+
+def _websocket_mask_cython(object mask, object data):
+ """Note, this function mutates its `data` argument
+ """
+ cdef:
+ Py_ssize_t data_len, i
+ # bit operations on signed integers are implementation-specific
+ unsigned char * in_buf
+ const unsigned char * mask_buf
+ uint32_t uint32_msk
+ uint64_t uint64_msk
+
+ assert len(mask) == 4
+
+ if not isinstance(mask, bytes):
+ mask = bytes(mask)
+
+ if isinstance(data, bytearray):
+ data = <bytearray>data
+ else:
+ data = bytearray(data)
+
+ data_len = len(data)
+ in_buf = <unsigned char*>PyByteArray_AsString(data)
+ mask_buf = <const unsigned char*>PyBytes_AsString(mask)
+ uint32_msk = (<uint32_t*>mask_buf)[0]
+
+ # TODO: align in_data ptr to achieve even faster speeds
+ # does it need in python ?! malloc() always aligns to sizeof(long) bytes
+
+ if sizeof(size_t) >= 8:
+ uint64_msk = uint32_msk
+ uint64_msk = (uint64_msk << 32) | uint32_msk
+
+ while data_len >= 8:
+ (<uint64_t*>in_buf)[0] ^= uint64_msk
+ in_buf += 8
+ data_len -= 8
+
+
+ while data_len >= 4:
+ (<uint32_t*>in_buf)[0] ^= uint32_msk
+ in_buf += 4
+ data_len -= 4
+
+ for i in range(0, data_len):
+ in_buf[i] ^= mask_buf[i]
diff --git a/third_party/python/aiohttp/aiohttp/abc.py b/third_party/python/aiohttp/aiohttp/abc.py
new file mode 100644
index 0000000000..44a3bda346
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/abc.py
@@ -0,0 +1,207 @@
+import asyncio
+import logging
+from abc import ABC, abstractmethod
+from collections.abc import Sized
+from http.cookies import BaseCookie, Morsel
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Awaitable,
+ Callable,
+ Dict,
+ Generator,
+ Iterable,
+ List,
+ Optional,
+ Tuple,
+)
+
+from multidict import CIMultiDict
+from yarl import URL
+
+from .helpers import get_running_loop
+from .typedefs import LooseCookies
+
+if TYPE_CHECKING: # pragma: no cover
+ from .web_app import Application
+ from .web_exceptions import HTTPException
+ from .web_request import BaseRequest, Request
+ from .web_response import StreamResponse
+else:
+ BaseRequest = Request = Application = StreamResponse = None
+ HTTPException = None
+
+
+class AbstractRouter(ABC):
+ def __init__(self) -> None:
+ self._frozen = False
+
+ def post_init(self, app: Application) -> None:
+ """Post init stage.
+
+ Not an abstract method for sake of backward compatibility,
+ but if the router wants to be aware of the application
+ it can override this.
+ """
+
+ @property
+ def frozen(self) -> bool:
+ return self._frozen
+
+ def freeze(self) -> None:
+ """Freeze router."""
+ self._frozen = True
+
+ @abstractmethod
+ async def resolve(self, request: Request) -> "AbstractMatchInfo":
+ """Return MATCH_INFO for given request"""
+
+
+class AbstractMatchInfo(ABC):
+ @property # pragma: no branch
+ @abstractmethod
+ def handler(self) -> Callable[[Request], Awaitable[StreamResponse]]:
+ """Execute matched request handler"""
+
+ @property
+ @abstractmethod
+ def expect_handler(self) -> Callable[[Request], Awaitable[None]]:
+ """Expect handler for 100-continue processing"""
+
+ @property # pragma: no branch
+ @abstractmethod
+ def http_exception(self) -> Optional[HTTPException]:
+ """HTTPException instance raised on router's resolving, or None"""
+
+ @abstractmethod # pragma: no branch
+ def get_info(self) -> Dict[str, Any]:
+ """Return a dict with additional info useful for introspection"""
+
+ @property # pragma: no branch
+ @abstractmethod
+ def apps(self) -> Tuple[Application, ...]:
+ """Stack of nested applications.
+
+ Top level application is left-most element.
+
+ """
+
+ @abstractmethod
+ def add_app(self, app: Application) -> None:
+ """Add application to the nested apps stack."""
+
+ @abstractmethod
+ def freeze(self) -> None:
+ """Freeze the match info.
+
+ The method is called after route resolution.
+
+ After the call .add_app() is forbidden.
+
+ """
+
+
+class AbstractView(ABC):
+ """Abstract class based view."""
+
+ def __init__(self, request: Request) -> None:
+ self._request = request
+
+ @property
+ def request(self) -> Request:
+ """Request instance."""
+ return self._request
+
+ @abstractmethod
+ def __await__(self) -> Generator[Any, None, StreamResponse]:
+ """Execute the view handler."""
+
+
+class AbstractResolver(ABC):
+ """Abstract DNS resolver."""
+
+ @abstractmethod
+ async def resolve(self, host: str, port: int, family: int) -> List[Dict[str, Any]]:
+ """Return IP address for given hostname"""
+
+ @abstractmethod
+ async def close(self) -> None:
+ """Release resolver"""
+
+
+if TYPE_CHECKING: # pragma: no cover
+ IterableBase = Iterable[Morsel[str]]
+else:
+ IterableBase = Iterable
+
+
+ClearCookiePredicate = Callable[["Morsel[str]"], bool]
+
+
+class AbstractCookieJar(Sized, IterableBase):
+ """Abstract Cookie Jar."""
+
+ def __init__(self, *, loop: Optional[asyncio.AbstractEventLoop] = None) -> None:
+ self._loop = get_running_loop(loop)
+
+ @abstractmethod
+ def clear(self, predicate: Optional[ClearCookiePredicate] = None) -> None:
+ """Clear all cookies if no predicate is passed."""
+
+ @abstractmethod
+ def clear_domain(self, domain: str) -> None:
+ """Clear all cookies for domain and all subdomains."""
+
+ @abstractmethod
+ def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> None:
+ """Update cookies."""
+
+ @abstractmethod
+ def filter_cookies(self, request_url: URL) -> "BaseCookie[str]":
+ """Return the jar's cookies filtered by their attributes."""
+
+
+class AbstractStreamWriter(ABC):
+ """Abstract stream writer."""
+
+ buffer_size = 0
+ output_size = 0
+ length: Optional[int] = 0
+
+ @abstractmethod
+ async def write(self, chunk: bytes) -> None:
+ """Write chunk into stream."""
+
+ @abstractmethod
+ async def write_eof(self, chunk: bytes = b"") -> None:
+ """Write last chunk."""
+
+ @abstractmethod
+ async def drain(self) -> None:
+ """Flush the write buffer."""
+
+ @abstractmethod
+ def enable_compression(self, encoding: str = "deflate") -> None:
+ """Enable HTTP body compression"""
+
+ @abstractmethod
+ def enable_chunking(self) -> None:
+ """Enable HTTP chunked mode"""
+
+ @abstractmethod
+ async def write_headers(
+ self, status_line: str, headers: "CIMultiDict[str]"
+ ) -> None:
+ """Write HTTP headers"""
+
+
+class AbstractAccessLogger(ABC):
+ """Abstract writer to access log."""
+
+ def __init__(self, logger: logging.Logger, log_format: str) -> None:
+ self.logger = logger
+ self.log_format = log_format
+
+ @abstractmethod
+ def log(self, request: BaseRequest, response: StreamResponse, time: float) -> None:
+ """Emit log to logger."""
diff --git a/third_party/python/aiohttp/aiohttp/base_protocol.py b/third_party/python/aiohttp/aiohttp/base_protocol.py
new file mode 100644
index 0000000000..4c9f0a752e
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/base_protocol.py
@@ -0,0 +1,90 @@
+import asyncio
+from typing import Optional, cast
+
+from .tcp_helpers import tcp_nodelay
+
+
+class BaseProtocol(asyncio.Protocol):
+ __slots__ = (
+ "_loop",
+ "_paused",
+ "_drain_waiter",
+ "_connection_lost",
+ "_reading_paused",
+ "transport",
+ )
+
+ def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
+ self._loop: asyncio.AbstractEventLoop = loop
+ self._paused = False
+ self._drain_waiter: Optional[asyncio.Future[None]] = None
+ self._reading_paused = False
+
+ self.transport: Optional[asyncio.Transport] = None
+
+ @property
+ def connected(self) -> bool:
+ """Return True if the connection is open."""
+ return self.transport is not None
+
+ def pause_writing(self) -> None:
+ assert not self._paused
+ self._paused = True
+
+ def resume_writing(self) -> None:
+ assert self._paused
+ self._paused = False
+
+ waiter = self._drain_waiter
+ if waiter is not None:
+ self._drain_waiter = None
+ if not waiter.done():
+ waiter.set_result(None)
+
+ def pause_reading(self) -> None:
+ if not self._reading_paused and self.transport is not None:
+ try:
+ self.transport.pause_reading()
+ except (AttributeError, NotImplementedError, RuntimeError):
+ pass
+ self._reading_paused = True
+
+ def resume_reading(self) -> None:
+ if self._reading_paused and self.transport is not None:
+ try:
+ self.transport.resume_reading()
+ except (AttributeError, NotImplementedError, RuntimeError):
+ pass
+ self._reading_paused = False
+
+ def connection_made(self, transport: asyncio.BaseTransport) -> None:
+ tr = cast(asyncio.Transport, transport)
+ tcp_nodelay(tr, True)
+ self.transport = tr
+
+ def connection_lost(self, exc: Optional[BaseException]) -> None:
+ # Wake up the writer if currently paused.
+ self.transport = None
+ if not self._paused:
+ return
+ waiter = self._drain_waiter
+ if waiter is None:
+ return
+ self._drain_waiter = None
+ if waiter.done():
+ return
+ if exc is None:
+ waiter.set_result(None)
+ else:
+ waiter.set_exception(exc)
+
+ async def _drain_helper(self) -> None:
+ if not self.connected:
+ raise ConnectionResetError("Connection lost")
+ if not self._paused:
+ return
+ waiter = self._drain_waiter
+ if waiter is None:
+ waiter = self._loop.create_future()
+ self._drain_waiter = waiter
+ await asyncio.shield(waiter)
diff --git a/third_party/python/aiohttp/aiohttp/client.py b/third_party/python/aiohttp/aiohttp/client.py
new file mode 100644
index 0000000000..0d0f4c16c0
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/client.py
@@ -0,0 +1,1305 @@
+"""HTTP Client for asyncio."""
+
+import asyncio
+import base64
+import hashlib
+import json
+import os
+import sys
+import traceback
+import warnings
+from contextlib import suppress
+from types import SimpleNamespace, TracebackType
+from typing import (
+ Any,
+ Awaitable,
+ Callable,
+ Coroutine,
+ FrozenSet,
+ Generator,
+ Generic,
+ Iterable,
+ List,
+ Mapping,
+ Optional,
+ Set,
+ Tuple,
+ Type,
+ TypeVar,
+ Union,
+)
+
+import attr
+from multidict import CIMultiDict, MultiDict, MultiDictProxy, istr
+from yarl import URL
+
+from . import hdrs, http, payload
+from .abc import AbstractCookieJar
+from .client_exceptions import (
+ ClientConnectionError as ClientConnectionError,
+ ClientConnectorCertificateError as ClientConnectorCertificateError,
+ ClientConnectorError as ClientConnectorError,
+ ClientConnectorSSLError as ClientConnectorSSLError,
+ ClientError as ClientError,
+ ClientHttpProxyError as ClientHttpProxyError,
+ ClientOSError as ClientOSError,
+ ClientPayloadError as ClientPayloadError,
+ ClientProxyConnectionError as ClientProxyConnectionError,
+ ClientResponseError as ClientResponseError,
+ ClientSSLError as ClientSSLError,
+ ContentTypeError as ContentTypeError,
+ InvalidURL as InvalidURL,
+ ServerConnectionError as ServerConnectionError,
+ ServerDisconnectedError as ServerDisconnectedError,
+ ServerFingerprintMismatch as ServerFingerprintMismatch,
+ ServerTimeoutError as ServerTimeoutError,
+ TooManyRedirects as TooManyRedirects,
+ WSServerHandshakeError as WSServerHandshakeError,
+)
+from .client_reqrep import (
+ ClientRequest as ClientRequest,
+ ClientResponse as ClientResponse,
+ Fingerprint as Fingerprint,
+ RequestInfo as RequestInfo,
+ _merge_ssl_params,
+)
+from .client_ws import ClientWebSocketResponse as ClientWebSocketResponse
+from .connector import (
+ BaseConnector as BaseConnector,
+ NamedPipeConnector as NamedPipeConnector,
+ TCPConnector as TCPConnector,
+ UnixConnector as UnixConnector,
+)
+from .cookiejar import CookieJar
+from .helpers import (
+ DEBUG,
+ PY_36,
+ BasicAuth,
+ TimeoutHandle,
+ ceil_timeout,
+ get_env_proxy_for_url,
+ get_running_loop,
+ sentinel,
+ strip_auth_from_url,
+)
+from .http import WS_KEY, HttpVersion, WebSocketReader, WebSocketWriter
+from .http_websocket import WSHandshakeError, WSMessage, ws_ext_gen, ws_ext_parse
+from .streams import FlowControlDataQueue
+from .tracing import Trace, TraceConfig
+from .typedefs import Final, JSONEncoder, LooseCookies, LooseHeaders, StrOrURL
+
+__all__ = (
+ # client_exceptions
+ "ClientConnectionError",
+ "ClientConnectorCertificateError",
+ "ClientConnectorError",
+ "ClientConnectorSSLError",
+ "ClientError",
+ "ClientHttpProxyError",
+ "ClientOSError",
+ "ClientPayloadError",
+ "ClientProxyConnectionError",
+ "ClientResponseError",
+ "ClientSSLError",
+ "ContentTypeError",
+ "InvalidURL",
+ "ServerConnectionError",
+ "ServerDisconnectedError",
+ "ServerFingerprintMismatch",
+ "ServerTimeoutError",
+ "TooManyRedirects",
+ "WSServerHandshakeError",
+ # client_reqrep
+ "ClientRequest",
+ "ClientResponse",
+ "Fingerprint",
+ "RequestInfo",
+ # connector
+ "BaseConnector",
+ "TCPConnector",
+ "UnixConnector",
+ "NamedPipeConnector",
+ # client_ws
+ "ClientWebSocketResponse",
+ # client
+ "ClientSession",
+ "ClientTimeout",
+ "request",
+)
+
+
+try:
+ from ssl import SSLContext
+except ImportError: # pragma: no cover
+ SSLContext = object # type: ignore[misc,assignment]
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class ClientTimeout:
+ total: Optional[float] = None
+ connect: Optional[float] = None
+ sock_read: Optional[float] = None
+ sock_connect: Optional[float] = None
+
+ # pool_queue_timeout: Optional[float] = None
+ # dns_resolution_timeout: Optional[float] = None
+ # socket_connect_timeout: Optional[float] = None
+ # connection_acquiring_timeout: Optional[float] = None
+ # new_connection_timeout: Optional[float] = None
+ # http_header_timeout: Optional[float] = None
+ # response_body_timeout: Optional[float] = None
+
+ # to create a timeout specific for a single request, either
+ # - create a completely new one to overwrite the default
+ # - or use http://www.attrs.org/en/stable/api.html#attr.evolve
+ # to overwrite the defaults
+
+
+# 5 Minute default read timeout
+DEFAULT_TIMEOUT: Final[ClientTimeout] = ClientTimeout(total=5 * 60)
+
+_RetType = TypeVar("_RetType")
+
+
+class ClientSession:
+ """First-class interface for making HTTP requests."""
+
+ ATTRS = frozenset(
+ [
+ "_base_url",
+ "_source_traceback",
+ "_connector",
+ "requote_redirect_url",
+ "_loop",
+ "_cookie_jar",
+ "_connector_owner",
+ "_default_auth",
+ "_version",
+ "_json_serialize",
+ "_requote_redirect_url",
+ "_timeout",
+ "_raise_for_status",
+ "_auto_decompress",
+ "_trust_env",
+ "_default_headers",
+ "_skip_auto_headers",
+ "_request_class",
+ "_response_class",
+ "_ws_response_class",
+ "_trace_configs",
+ "_read_bufsize",
+ ]
+ )
+
+ _source_traceback = None # type: Optional[traceback.StackSummary]
+ _connector = None # type: Optional[BaseConnector]
+
+ def __init__(
+ self,
+ base_url: Optional[StrOrURL] = None,
+ *,
+ connector: Optional[BaseConnector] = None,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ cookies: Optional[LooseCookies] = None,
+ headers: Optional[LooseHeaders] = None,
+ skip_auto_headers: Optional[Iterable[str]] = None,
+ auth: Optional[BasicAuth] = None,
+ json_serialize: JSONEncoder = json.dumps,
+ request_class: Type[ClientRequest] = ClientRequest,
+ response_class: Type[ClientResponse] = ClientResponse,
+ ws_response_class: Type[ClientWebSocketResponse] = ClientWebSocketResponse,
+ version: HttpVersion = http.HttpVersion11,
+ cookie_jar: Optional[AbstractCookieJar] = None,
+ connector_owner: bool = True,
+ raise_for_status: bool = False,
+ read_timeout: Union[float, object] = sentinel,
+ conn_timeout: Optional[float] = None,
+ timeout: Union[object, ClientTimeout] = sentinel,
+ auto_decompress: bool = True,
+ trust_env: bool = False,
+ requote_redirect_url: bool = True,
+ trace_configs: Optional[List[TraceConfig]] = None,
+ read_bufsize: int = 2**16,
+ ) -> None:
+ if loop is None:
+ if connector is not None:
+ loop = connector._loop
+
+ loop = get_running_loop(loop)
+
+ if base_url is None or isinstance(base_url, URL):
+ self._base_url: Optional[URL] = base_url
+ else:
+ self._base_url = URL(base_url)
+ assert (
+ self._base_url.origin() == self._base_url
+ ), "Only absolute URLs without path part are supported"
+
+ if connector is None:
+ connector = TCPConnector(loop=loop)
+
+ if connector._loop is not loop:
+ raise RuntimeError("Session and connector has to use same event loop")
+
+ self._loop = loop
+
+ if loop.get_debug():
+ self._source_traceback = traceback.extract_stack(sys._getframe(1))
+
+ if cookie_jar is None:
+ cookie_jar = CookieJar(loop=loop)
+ self._cookie_jar = cookie_jar
+
+ if cookies is not None:
+ self._cookie_jar.update_cookies(cookies)
+
+ self._connector = connector
+ self._connector_owner = connector_owner
+ self._default_auth = auth
+ self._version = version
+ self._json_serialize = json_serialize
+ if timeout is sentinel:
+ self._timeout = DEFAULT_TIMEOUT
+ if read_timeout is not sentinel:
+ warnings.warn(
+ "read_timeout is deprecated, " "use timeout argument instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ self._timeout = attr.evolve(self._timeout, total=read_timeout)
+ if conn_timeout is not None:
+ self._timeout = attr.evolve(self._timeout, connect=conn_timeout)
+ warnings.warn(
+ "conn_timeout is deprecated, " "use timeout argument instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ else:
+ self._timeout = timeout # type: ignore[assignment]
+ if read_timeout is not sentinel:
+ raise ValueError(
+ "read_timeout and timeout parameters "
+ "conflict, please setup "
+ "timeout.read"
+ )
+ if conn_timeout is not None:
+ raise ValueError(
+ "conn_timeout and timeout parameters "
+ "conflict, please setup "
+ "timeout.connect"
+ )
+ self._raise_for_status = raise_for_status
+ self._auto_decompress = auto_decompress
+ self._trust_env = trust_env
+ self._requote_redirect_url = requote_redirect_url
+ self._read_bufsize = read_bufsize
+
+ # Convert to list of tuples
+ if headers:
+ real_headers: CIMultiDict[str] = CIMultiDict(headers)
+ else:
+ real_headers = CIMultiDict()
+ self._default_headers: CIMultiDict[str] = real_headers
+ if skip_auto_headers is not None:
+ self._skip_auto_headers = frozenset(istr(i) for i in skip_auto_headers)
+ else:
+ self._skip_auto_headers = frozenset()
+
+ self._request_class = request_class
+ self._response_class = response_class
+ self._ws_response_class = ws_response_class
+
+ self._trace_configs = trace_configs or []
+ for trace_config in self._trace_configs:
+ trace_config.freeze()
+
+ def __init_subclass__(cls: Type["ClientSession"]) -> None:
+ warnings.warn(
+ "Inheritance class {} from ClientSession "
+ "is discouraged".format(cls.__name__),
+ DeprecationWarning,
+ stacklevel=2,
+ )
+
+ if DEBUG:
+
+ def __setattr__(self, name: str, val: Any) -> None:
+ if name not in self.ATTRS:
+ warnings.warn(
+ "Setting custom ClientSession.{} attribute "
+ "is discouraged".format(name),
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ super().__setattr__(name, val)
+
+ def __del__(self, _warnings: Any = warnings) -> None:
+ if not self.closed:
+ if PY_36:
+ kwargs = {"source": self}
+ else:
+ kwargs = {}
+ _warnings.warn(
+ f"Unclosed client session {self!r}", ResourceWarning, **kwargs
+ )
+ context = {"client_session": self, "message": "Unclosed client session"}
+ if self._source_traceback is not None:
+ context["source_traceback"] = self._source_traceback
+ self._loop.call_exception_handler(context)
+
+ def request(
+ self, method: str, url: StrOrURL, **kwargs: Any
+ ) -> "_RequestContextManager":
+ """Perform HTTP request."""
+ return _RequestContextManager(self._request(method, url, **kwargs))
+
+ def _build_url(self, str_or_url: StrOrURL) -> URL:
+ url = URL(str_or_url)
+ if self._base_url is None:
+ return url
+ else:
+ assert not url.is_absolute() and url.path.startswith("/")
+ return self._base_url.join(url)
+
+ async def _request(
+ self,
+ method: str,
+ str_or_url: StrOrURL,
+ *,
+ params: Optional[Mapping[str, str]] = None,
+ data: Any = None,
+ json: Any = None,
+ cookies: Optional[LooseCookies] = None,
+ headers: Optional[LooseHeaders] = None,
+ skip_auto_headers: Optional[Iterable[str]] = None,
+ auth: Optional[BasicAuth] = None,
+ allow_redirects: bool = True,
+ max_redirects: int = 10,
+ compress: Optional[str] = None,
+ chunked: Optional[bool] = None,
+ expect100: bool = False,
+ raise_for_status: Optional[bool] = None,
+ read_until_eof: bool = True,
+ proxy: Optional[StrOrURL] = None,
+ proxy_auth: Optional[BasicAuth] = None,
+ timeout: Union[ClientTimeout, object] = sentinel,
+ verify_ssl: Optional[bool] = None,
+ fingerprint: Optional[bytes] = None,
+ ssl_context: Optional[SSLContext] = None,
+ ssl: Optional[Union[SSLContext, bool, Fingerprint]] = None,
+ proxy_headers: Optional[LooseHeaders] = None,
+ trace_request_ctx: Optional[SimpleNamespace] = None,
+ read_bufsize: Optional[int] = None,
+ ) -> ClientResponse:
+
+ # NOTE: timeout clamps existing connect and read timeouts. We cannot
+ # set the default to None because we need to detect if the user wants
+ # to use the existing timeouts by setting timeout to None.
+
+ if self.closed:
+ raise RuntimeError("Session is closed")
+
+ ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint)
+
+ if data is not None and json is not None:
+ raise ValueError(
+ "data and json parameters can not be used at the same time"
+ )
+ elif json is not None:
+ data = payload.JsonPayload(json, dumps=self._json_serialize)
+
+ if not isinstance(chunked, bool) and chunked is not None:
+ warnings.warn("Chunk size is deprecated #1615", DeprecationWarning)
+
+ redirects = 0
+ history = []
+ version = self._version
+
+ # Merge with default headers and transform to CIMultiDict
+ headers = self._prepare_headers(headers)
+ proxy_headers = self._prepare_headers(proxy_headers)
+
+ try:
+ url = self._build_url(str_or_url)
+ except ValueError as e:
+ raise InvalidURL(str_or_url) from e
+
+ skip_headers = set(self._skip_auto_headers)
+ if skip_auto_headers is not None:
+ for i in skip_auto_headers:
+ skip_headers.add(istr(i))
+
+ if proxy is not None:
+ try:
+ proxy = URL(proxy)
+ except ValueError as e:
+ raise InvalidURL(proxy) from e
+
+ if timeout is sentinel:
+ real_timeout: ClientTimeout = self._timeout
+ else:
+ if not isinstance(timeout, ClientTimeout):
+ real_timeout = ClientTimeout(total=timeout) # type: ignore[arg-type]
+ else:
+ real_timeout = timeout
+ # timeout is cumulative for all request operations
+ # (request, redirects, responses, data consuming)
+ tm = TimeoutHandle(self._loop, real_timeout.total)
+ handle = tm.start()
+
+ if read_bufsize is None:
+ read_bufsize = self._read_bufsize
+
+ traces = [
+ Trace(
+ self,
+ trace_config,
+ trace_config.trace_config_ctx(trace_request_ctx=trace_request_ctx),
+ )
+ for trace_config in self._trace_configs
+ ]
+
+ for trace in traces:
+ await trace.send_request_start(method, url.update_query(params), headers)
+
+ timer = tm.timer()
+ try:
+ with timer:
+ while True:
+ url, auth_from_url = strip_auth_from_url(url)
+ if auth and auth_from_url:
+ raise ValueError(
+ "Cannot combine AUTH argument with "
+ "credentials encoded in URL"
+ )
+
+ if auth is None:
+ auth = auth_from_url
+ if auth is None:
+ auth = self._default_auth
+ # It would be confusing if we support explicit
+ # Authorization header with auth argument
+ if (
+ headers is not None
+ and auth is not None
+ and hdrs.AUTHORIZATION in headers
+ ):
+ raise ValueError(
+ "Cannot combine AUTHORIZATION header "
+ "with AUTH argument or credentials "
+ "encoded in URL"
+ )
+
+ all_cookies = self._cookie_jar.filter_cookies(url)
+
+ if cookies is not None:
+ tmp_cookie_jar = CookieJar()
+ tmp_cookie_jar.update_cookies(cookies)
+ req_cookies = tmp_cookie_jar.filter_cookies(url)
+ if req_cookies:
+ all_cookies.load(req_cookies)
+
+ if proxy is not None:
+ proxy = URL(proxy)
+ elif self._trust_env:
+ with suppress(LookupError):
+ proxy, proxy_auth = get_env_proxy_for_url(url)
+
+ req = self._request_class(
+ method,
+ url,
+ params=params,
+ headers=headers,
+ skip_auto_headers=skip_headers,
+ data=data,
+ cookies=all_cookies,
+ auth=auth,
+ version=version,
+ compress=compress,
+ chunked=chunked,
+ expect100=expect100,
+ loop=self._loop,
+ response_class=self._response_class,
+ proxy=proxy,
+ proxy_auth=proxy_auth,
+ timer=timer,
+ session=self,
+ ssl=ssl,
+ proxy_headers=proxy_headers,
+ traces=traces,
+ )
+
+ # connection timeout
+ try:
+ async with ceil_timeout(real_timeout.connect):
+ assert self._connector is not None
+ conn = await self._connector.connect(
+ req, traces=traces, timeout=real_timeout
+ )
+ except asyncio.TimeoutError as exc:
+ raise ServerTimeoutError(
+ "Connection timeout " "to host {}".format(url)
+ ) from exc
+
+ assert conn.transport is not None
+
+ assert conn.protocol is not None
+ conn.protocol.set_response_params(
+ timer=timer,
+ skip_payload=method.upper() == "HEAD",
+ read_until_eof=read_until_eof,
+ auto_decompress=self._auto_decompress,
+ read_timeout=real_timeout.sock_read,
+ read_bufsize=read_bufsize,
+ )
+
+ try:
+ try:
+ resp = await req.send(conn)
+ try:
+ await resp.start(conn)
+ except BaseException:
+ resp.close()
+ raise
+ except BaseException:
+ conn.close()
+ raise
+ except ClientError:
+ raise
+ except OSError as exc:
+ if exc.errno is None and isinstance(exc, asyncio.TimeoutError):
+ raise
+ raise ClientOSError(*exc.args) from exc
+
+ self._cookie_jar.update_cookies(resp.cookies, resp.url)
+
+ # redirects
+ if resp.status in (301, 302, 303, 307, 308) and allow_redirects:
+
+ for trace in traces:
+ await trace.send_request_redirect(
+ method, url.update_query(params), headers, resp
+ )
+
+ redirects += 1
+ history.append(resp)
+ if max_redirects and redirects >= max_redirects:
+ resp.close()
+ raise TooManyRedirects(
+ history[0].request_info, tuple(history)
+ )
+
+ # For 301 and 302, mimic IE, now changed in RFC
+ # https://github.com/kennethreitz/requests/pull/269
+ if (resp.status == 303 and resp.method != hdrs.METH_HEAD) or (
+ resp.status in (301, 302) and resp.method == hdrs.METH_POST
+ ):
+ method = hdrs.METH_GET
+ data = None
+ if headers.get(hdrs.CONTENT_LENGTH):
+ headers.pop(hdrs.CONTENT_LENGTH)
+
+ r_url = resp.headers.get(hdrs.LOCATION) or resp.headers.get(
+ hdrs.URI
+ )
+ if r_url is None:
+ # see github.com/aio-libs/aiohttp/issues/2022
+ break
+ else:
+ # reading from correct redirection
+ # response is forbidden
+ resp.release()
+
+ try:
+ parsed_url = URL(
+ r_url, encoded=not self._requote_redirect_url
+ )
+
+ except ValueError as e:
+ raise InvalidURL(r_url) from e
+
+ scheme = parsed_url.scheme
+ if scheme not in ("http", "https", ""):
+ resp.close()
+ raise ValueError("Can redirect only to http or https")
+ elif not scheme:
+ parsed_url = url.join(parsed_url)
+
+ if url.origin() != parsed_url.origin():
+ auth = None
+ headers.pop(hdrs.AUTHORIZATION, None)
+
+ url = parsed_url
+ params = None
+ resp.release()
+ continue
+
+ break
+
+ # check response status
+ if raise_for_status is None:
+ raise_for_status = self._raise_for_status
+ if raise_for_status:
+ resp.raise_for_status()
+
+ # register connection
+ if handle is not None:
+ if resp.connection is not None:
+ resp.connection.add_callback(handle.cancel)
+ else:
+ handle.cancel()
+
+ resp._history = tuple(history)
+
+ for trace in traces:
+ await trace.send_request_end(
+ method, url.update_query(params), headers, resp
+ )
+ return resp
+
+ except BaseException as e:
+ # cleanup timer
+ tm.close()
+ if handle:
+ handle.cancel()
+ handle = None
+
+ for trace in traces:
+ await trace.send_request_exception(
+ method, url.update_query(params), headers, e
+ )
+ raise
+
+ def ws_connect(
+ self,
+ url: StrOrURL,
+ *,
+ method: str = hdrs.METH_GET,
+ protocols: Iterable[str] = (),
+ timeout: float = 10.0,
+ receive_timeout: Optional[float] = None,
+ autoclose: bool = True,
+ autoping: bool = True,
+ heartbeat: Optional[float] = None,
+ auth: Optional[BasicAuth] = None,
+ origin: Optional[str] = None,
+ params: Optional[Mapping[str, str]] = None,
+ headers: Optional[LooseHeaders] = None,
+ proxy: Optional[StrOrURL] = None,
+ proxy_auth: Optional[BasicAuth] = None,
+ ssl: Union[SSLContext, bool, None, Fingerprint] = None,
+ verify_ssl: Optional[bool] = None,
+ fingerprint: Optional[bytes] = None,
+ ssl_context: Optional[SSLContext] = None,
+ proxy_headers: Optional[LooseHeaders] = None,
+ compress: int = 0,
+ max_msg_size: int = 4 * 1024 * 1024,
+ ) -> "_WSRequestContextManager":
+ """Initiate websocket connection."""
+ return _WSRequestContextManager(
+ self._ws_connect(
+ url,
+ method=method,
+ protocols=protocols,
+ timeout=timeout,
+ receive_timeout=receive_timeout,
+ autoclose=autoclose,
+ autoping=autoping,
+ heartbeat=heartbeat,
+ auth=auth,
+ origin=origin,
+ params=params,
+ headers=headers,
+ proxy=proxy,
+ proxy_auth=proxy_auth,
+ ssl=ssl,
+ verify_ssl=verify_ssl,
+ fingerprint=fingerprint,
+ ssl_context=ssl_context,
+ proxy_headers=proxy_headers,
+ compress=compress,
+ max_msg_size=max_msg_size,
+ )
+ )
+
+ async def _ws_connect(
+ self,
+ url: StrOrURL,
+ *,
+ method: str = hdrs.METH_GET,
+ protocols: Iterable[str] = (),
+ timeout: float = 10.0,
+ receive_timeout: Optional[float] = None,
+ autoclose: bool = True,
+ autoping: bool = True,
+ heartbeat: Optional[float] = None,
+ auth: Optional[BasicAuth] = None,
+ origin: Optional[str] = None,
+ params: Optional[Mapping[str, str]] = None,
+ headers: Optional[LooseHeaders] = None,
+ proxy: Optional[StrOrURL] = None,
+ proxy_auth: Optional[BasicAuth] = None,
+ ssl: Union[SSLContext, bool, None, Fingerprint] = None,
+ verify_ssl: Optional[bool] = None,
+ fingerprint: Optional[bytes] = None,
+ ssl_context: Optional[SSLContext] = None,
+ proxy_headers: Optional[LooseHeaders] = None,
+ compress: int = 0,
+ max_msg_size: int = 4 * 1024 * 1024,
+ ) -> ClientWebSocketResponse:
+
+ if headers is None:
+ real_headers: CIMultiDict[str] = CIMultiDict()
+ else:
+ real_headers = CIMultiDict(headers)
+
+ default_headers = {
+ hdrs.UPGRADE: "websocket",
+ hdrs.CONNECTION: "upgrade",
+ hdrs.SEC_WEBSOCKET_VERSION: "13",
+ }
+
+ for key, value in default_headers.items():
+ real_headers.setdefault(key, value)
+
+ sec_key = base64.b64encode(os.urandom(16))
+ real_headers[hdrs.SEC_WEBSOCKET_KEY] = sec_key.decode()
+
+ if protocols:
+ real_headers[hdrs.SEC_WEBSOCKET_PROTOCOL] = ",".join(protocols)
+ if origin is not None:
+ real_headers[hdrs.ORIGIN] = origin
+ if compress:
+ extstr = ws_ext_gen(compress=compress)
+ real_headers[hdrs.SEC_WEBSOCKET_EXTENSIONS] = extstr
+
+ ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint)
+
+ # send request
+ resp = await self.request(
+ method,
+ url,
+ params=params,
+ headers=real_headers,
+ read_until_eof=False,
+ auth=auth,
+ proxy=proxy,
+ proxy_auth=proxy_auth,
+ ssl=ssl,
+ proxy_headers=proxy_headers,
+ )
+
+ try:
+ # check handshake
+ if resp.status != 101:
+ raise WSServerHandshakeError(
+ resp.request_info,
+ resp.history,
+ message="Invalid response status",
+ status=resp.status,
+ headers=resp.headers,
+ )
+
+ if resp.headers.get(hdrs.UPGRADE, "").lower() != "websocket":
+ raise WSServerHandshakeError(
+ resp.request_info,
+ resp.history,
+ message="Invalid upgrade header",
+ status=resp.status,
+ headers=resp.headers,
+ )
+
+ if resp.headers.get(hdrs.CONNECTION, "").lower() != "upgrade":
+ raise WSServerHandshakeError(
+ resp.request_info,
+ resp.history,
+ message="Invalid connection header",
+ status=resp.status,
+ headers=resp.headers,
+ )
+
+ # key calculation
+ r_key = resp.headers.get(hdrs.SEC_WEBSOCKET_ACCEPT, "")
+ match = base64.b64encode(hashlib.sha1(sec_key + WS_KEY).digest()).decode()
+ if r_key != match:
+ raise WSServerHandshakeError(
+ resp.request_info,
+ resp.history,
+ message="Invalid challenge response",
+ status=resp.status,
+ headers=resp.headers,
+ )
+
+ # websocket protocol
+ protocol = None
+ if protocols and hdrs.SEC_WEBSOCKET_PROTOCOL in resp.headers:
+ resp_protocols = [
+ proto.strip()
+ for proto in resp.headers[hdrs.SEC_WEBSOCKET_PROTOCOL].split(",")
+ ]
+
+ for proto in resp_protocols:
+ if proto in protocols:
+ protocol = proto
+ break
+
+ # websocket compress
+ notakeover = False
+ if compress:
+ compress_hdrs = resp.headers.get(hdrs.SEC_WEBSOCKET_EXTENSIONS)
+ if compress_hdrs:
+ try:
+ compress, notakeover = ws_ext_parse(compress_hdrs)
+ except WSHandshakeError as exc:
+ raise WSServerHandshakeError(
+ resp.request_info,
+ resp.history,
+ message=exc.args[0],
+ status=resp.status,
+ headers=resp.headers,
+ ) from exc
+ else:
+ compress = 0
+ notakeover = False
+
+ conn = resp.connection
+ assert conn is not None
+ conn_proto = conn.protocol
+ assert conn_proto is not None
+ transport = conn.transport
+ assert transport is not None
+ reader: FlowControlDataQueue[WSMessage] = FlowControlDataQueue(
+ conn_proto, 2**16, loop=self._loop
+ )
+ conn_proto.set_parser(WebSocketReader(reader, max_msg_size), reader)
+ writer = WebSocketWriter(
+ conn_proto,
+ transport,
+ use_mask=True,
+ compress=compress,
+ notakeover=notakeover,
+ )
+ except BaseException:
+ resp.close()
+ raise
+ else:
+ return self._ws_response_class(
+ reader,
+ writer,
+ protocol,
+ resp,
+ timeout,
+ autoclose,
+ autoping,
+ self._loop,
+ receive_timeout=receive_timeout,
+ heartbeat=heartbeat,
+ compress=compress,
+ client_notakeover=notakeover,
+ )
+
+ def _prepare_headers(self, headers: Optional[LooseHeaders]) -> "CIMultiDict[str]":
+ """Add default headers and transform it to CIMultiDict"""
+ # Convert headers to MultiDict
+ result = CIMultiDict(self._default_headers)
+ if headers:
+ if not isinstance(headers, (MultiDictProxy, MultiDict)):
+ headers = CIMultiDict(headers)
+ added_names: Set[str] = set()
+ for key, value in headers.items():
+ if key in added_names:
+ result.add(key, value)
+ else:
+ result[key] = value
+ added_names.add(key)
+ return result
+
+ def get(
+ self, url: StrOrURL, *, allow_redirects: bool = True, **kwargs: Any
+ ) -> "_RequestContextManager":
+ """Perform HTTP GET request."""
+ return _RequestContextManager(
+ self._request(hdrs.METH_GET, url, allow_redirects=allow_redirects, **kwargs)
+ )
+
+ def options(
+ self, url: StrOrURL, *, allow_redirects: bool = True, **kwargs: Any
+ ) -> "_RequestContextManager":
+ """Perform HTTP OPTIONS request."""
+ return _RequestContextManager(
+ self._request(
+ hdrs.METH_OPTIONS, url, allow_redirects=allow_redirects, **kwargs
+ )
+ )
+
+ def head(
+ self, url: StrOrURL, *, allow_redirects: bool = False, **kwargs: Any
+ ) -> "_RequestContextManager":
+ """Perform HTTP HEAD request."""
+ return _RequestContextManager(
+ self._request(
+ hdrs.METH_HEAD, url, allow_redirects=allow_redirects, **kwargs
+ )
+ )
+
+ def post(
+ self, url: StrOrURL, *, data: Any = None, **kwargs: Any
+ ) -> "_RequestContextManager":
+ """Perform HTTP POST request."""
+ return _RequestContextManager(
+ self._request(hdrs.METH_POST, url, data=data, **kwargs)
+ )
+
+ def put(
+ self, url: StrOrURL, *, data: Any = None, **kwargs: Any
+ ) -> "_RequestContextManager":
+ """Perform HTTP PUT request."""
+ return _RequestContextManager(
+ self._request(hdrs.METH_PUT, url, data=data, **kwargs)
+ )
+
+ def patch(
+ self, url: StrOrURL, *, data: Any = None, **kwargs: Any
+ ) -> "_RequestContextManager":
+ """Perform HTTP PATCH request."""
+ return _RequestContextManager(
+ self._request(hdrs.METH_PATCH, url, data=data, **kwargs)
+ )
+
+ def delete(self, url: StrOrURL, **kwargs: Any) -> "_RequestContextManager":
+ """Perform HTTP DELETE request."""
+ return _RequestContextManager(self._request(hdrs.METH_DELETE, url, **kwargs))
+
+ async def close(self) -> None:
+ """Close underlying connector.
+
+ Release all acquired resources.
+ """
+ if not self.closed:
+ if self._connector is not None and self._connector_owner:
+ await self._connector.close()
+ self._connector = None
+
+ @property
+ def closed(self) -> bool:
+ """Is client session closed.
+
+ A readonly property.
+ """
+ return self._connector is None or self._connector.closed
+
+ @property
+ def connector(self) -> Optional[BaseConnector]:
+ """Connector instance used for the session."""
+ return self._connector
+
+ @property
+ def cookie_jar(self) -> AbstractCookieJar:
+ """The session cookies."""
+ return self._cookie_jar
+
+ @property
+ def version(self) -> Tuple[int, int]:
+ """The session HTTP protocol version."""
+ return self._version
+
+ @property
+ def requote_redirect_url(self) -> bool:
+ """Do URL requoting on redirection handling."""
+ return self._requote_redirect_url
+
+ @requote_redirect_url.setter
+ def requote_redirect_url(self, val: bool) -> None:
+ """Do URL requoting on redirection handling."""
+ warnings.warn(
+ "session.requote_redirect_url modification " "is deprecated #2778",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ self._requote_redirect_url = val
+
+ @property
+ def loop(self) -> asyncio.AbstractEventLoop:
+ """Session's loop."""
+ warnings.warn(
+ "client.loop property is deprecated", DeprecationWarning, stacklevel=2
+ )
+ return self._loop
+
+ @property
+ def timeout(self) -> ClientTimeout:
+ """Timeout for the session."""
+ return self._timeout
+
+ @property
+ def headers(self) -> "CIMultiDict[str]":
+ """The default headers of the client session."""
+ return self._default_headers
+
+ @property
+ def skip_auto_headers(self) -> FrozenSet[istr]:
+ """Headers for which autogeneration should be skipped"""
+ return self._skip_auto_headers
+
+ @property
+ def auth(self) -> Optional[BasicAuth]:
+ """An object that represents HTTP Basic Authorization"""
+ return self._default_auth
+
+ @property
+ def json_serialize(self) -> JSONEncoder:
+ """Json serializer callable"""
+ return self._json_serialize
+
+ @property
+ def connector_owner(self) -> bool:
+ """Should connector be closed on session closing"""
+ return self._connector_owner
+
+ @property
+ def raise_for_status(
+ self,
+ ) -> Union[bool, Callable[[ClientResponse], Awaitable[None]]]:
+ """Should `ClientResponse.raise_for_status()` be called for each response."""
+ return self._raise_for_status
+
+ @property
+ def auto_decompress(self) -> bool:
+ """Should the body response be automatically decompressed."""
+ return self._auto_decompress
+
+ @property
+ def trust_env(self) -> bool:
+ """
+ Should proxies information from environment or netrc be trusted.
+
+ Information is from HTTP_PROXY / HTTPS_PROXY environment variables
+ or ~/.netrc file if present.
+ """
+ return self._trust_env
+
+ @property
+ def trace_configs(self) -> List[TraceConfig]:
+ """A list of TraceConfig instances used for client tracing"""
+ return self._trace_configs
+
+ def detach(self) -> None:
+ """Detach connector from session without closing the former.
+
+ Session is switched to closed state anyway.
+ """
+ self._connector = None
+
+ def __enter__(self) -> None:
+ raise TypeError("Use async with instead")
+
+ def __exit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc_val: Optional[BaseException],
+ exc_tb: Optional[TracebackType],
+ ) -> None:
+ # __exit__ should exist in pair with __enter__ but never executed
+ pass # pragma: no cover
+
+ async def __aenter__(self) -> "ClientSession":
+ return self
+
+ async def __aexit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc_val: Optional[BaseException],
+ exc_tb: Optional[TracebackType],
+ ) -> None:
+ await self.close()
+
+
+class _BaseRequestContextManager(Coroutine[Any, Any, _RetType], Generic[_RetType]):
+
+ __slots__ = ("_coro", "_resp")
+
+ def __init__(self, coro: Coroutine["asyncio.Future[Any]", None, _RetType]) -> None:
+ self._coro = coro
+
+ def send(self, arg: None) -> "asyncio.Future[Any]":
+ return self._coro.send(arg)
+
+ def throw(self, arg: BaseException) -> None: # type: ignore[arg-type,override]
+ self._coro.throw(arg)
+
+ def close(self) -> None:
+ return self._coro.close()
+
+ def __await__(self) -> Generator[Any, None, _RetType]:
+ ret = self._coro.__await__()
+ return ret
+
+ def __iter__(self) -> Generator[Any, None, _RetType]:
+ return self.__await__()
+
+ async def __aenter__(self) -> _RetType:
+ self._resp = await self._coro
+ return self._resp
+
+
+class _RequestContextManager(_BaseRequestContextManager[ClientResponse]):
+ __slots__ = ()
+
+ async def __aexit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc: Optional[BaseException],
+ tb: Optional[TracebackType],
+ ) -> None:
+ # We're basing behavior on the exception as it can be caused by
+ # user code unrelated to the status of the connection. If you
+ # would like to close a connection you must do that
+ # explicitly. Otherwise connection error handling should kick in
+ # and close/recycle the connection as required.
+ self._resp.release()
+
+
+class _WSRequestContextManager(_BaseRequestContextManager[ClientWebSocketResponse]):
+ __slots__ = ()
+
+ async def __aexit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc: Optional[BaseException],
+ tb: Optional[TracebackType],
+ ) -> None:
+ await self._resp.close()
+
+
+class _SessionRequestContextManager:
+
+ __slots__ = ("_coro", "_resp", "_session")
+
+ def __init__(
+ self,
+ coro: Coroutine["asyncio.Future[Any]", None, ClientResponse],
+ session: ClientSession,
+ ) -> None:
+ self._coro = coro
+ self._resp: Optional[ClientResponse] = None
+ self._session = session
+
+ async def __aenter__(self) -> ClientResponse:
+ try:
+ self._resp = await self._coro
+ except BaseException:
+ await self._session.close()
+ raise
+ else:
+ return self._resp
+
+ async def __aexit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc: Optional[BaseException],
+ tb: Optional[TracebackType],
+ ) -> None:
+ assert self._resp is not None
+ self._resp.close()
+ await self._session.close()
+
+
+def request(
+ method: str,
+ url: StrOrURL,
+ *,
+ params: Optional[Mapping[str, str]] = None,
+ data: Any = None,
+ json: Any = None,
+ headers: Optional[LooseHeaders] = None,
+ skip_auto_headers: Optional[Iterable[str]] = None,
+ auth: Optional[BasicAuth] = None,
+ allow_redirects: bool = True,
+ max_redirects: int = 10,
+ compress: Optional[str] = None,
+ chunked: Optional[bool] = None,
+ expect100: bool = False,
+ raise_for_status: Optional[bool] = None,
+ read_until_eof: bool = True,
+ proxy: Optional[StrOrURL] = None,
+ proxy_auth: Optional[BasicAuth] = None,
+ timeout: Union[ClientTimeout, object] = sentinel,
+ cookies: Optional[LooseCookies] = None,
+ version: HttpVersion = http.HttpVersion11,
+ connector: Optional[BaseConnector] = None,
+ read_bufsize: Optional[int] = None,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+) -> _SessionRequestContextManager:
+ """Constructs and sends a request.
+
+ Returns response object.
+ method - HTTP method
+ url - request url
+ params - (optional) Dictionary or bytes to be sent in the query
+ string of the new request
+ data - (optional) Dictionary, bytes, or file-like object to
+ send in the body of the request
+ json - (optional) Any json compatible python object
+ headers - (optional) Dictionary of HTTP Headers to send with
+ the request
+ cookies - (optional) Dict object to send with the request
+ auth - (optional) BasicAuth named tuple represent HTTP Basic Auth
+ auth - aiohttp.helpers.BasicAuth
+ allow_redirects - (optional) If set to False, do not follow
+ redirects
+ version - Request HTTP version.
+ compress - Set to True if request has to be compressed
+ with deflate encoding.
+ chunked - Set to chunk size for chunked transfer encoding.
+ expect100 - Expect 100-continue response from server.
+ connector - BaseConnector sub-class instance to support
+ connection pooling.
+ read_until_eof - Read response until eof if response
+ does not have Content-Length header.
+ loop - Optional event loop.
+ timeout - Optional ClientTimeout settings structure, 5min
+ total timeout by default.
+ Usage::
+ >>> import aiohttp
+ >>> resp = await aiohttp.request('GET', 'http://python.org/')
+ >>> resp
+ <ClientResponse(python.org/) [200]>
+ >>> data = await resp.read()
+ """
+ connector_owner = False
+ if connector is None:
+ connector_owner = True
+ connector = TCPConnector(loop=loop, force_close=True)
+
+ session = ClientSession(
+ loop=loop,
+ cookies=cookies,
+ version=version,
+ timeout=timeout,
+ connector=connector,
+ connector_owner=connector_owner,
+ )
+
+ return _SessionRequestContextManager(
+ session._request(
+ method,
+ url,
+ params=params,
+ data=data,
+ json=json,
+ headers=headers,
+ skip_auto_headers=skip_auto_headers,
+ auth=auth,
+ allow_redirects=allow_redirects,
+ max_redirects=max_redirects,
+ compress=compress,
+ chunked=chunked,
+ expect100=expect100,
+ raise_for_status=raise_for_status,
+ read_until_eof=read_until_eof,
+ proxy=proxy,
+ proxy_auth=proxy_auth,
+ read_bufsize=read_bufsize,
+ ),
+ session,
+ )
diff --git a/third_party/python/aiohttp/aiohttp/client_exceptions.py b/third_party/python/aiohttp/aiohttp/client_exceptions.py
new file mode 100644
index 0000000000..c640e1e7fb
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/client_exceptions.py
@@ -0,0 +1,342 @@
+"""HTTP related errors."""
+
+import asyncio
+import warnings
+from typing import TYPE_CHECKING, Any, Optional, Tuple, Union
+
+from .http_parser import RawResponseMessage
+from .typedefs import LooseHeaders
+
+try:
+ import ssl
+
+ SSLContext = ssl.SSLContext
+except ImportError: # pragma: no cover
+ ssl = SSLContext = None # type: ignore[assignment]
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from .client_reqrep import ClientResponse, ConnectionKey, Fingerprint, RequestInfo
+else:
+ RequestInfo = ClientResponse = ConnectionKey = None
+
+__all__ = (
+ "ClientError",
+ "ClientConnectionError",
+ "ClientOSError",
+ "ClientConnectorError",
+ "ClientProxyConnectionError",
+ "ClientSSLError",
+ "ClientConnectorSSLError",
+ "ClientConnectorCertificateError",
+ "ServerConnectionError",
+ "ServerTimeoutError",
+ "ServerDisconnectedError",
+ "ServerFingerprintMismatch",
+ "ClientResponseError",
+ "ClientHttpProxyError",
+ "WSServerHandshakeError",
+ "ContentTypeError",
+ "ClientPayloadError",
+ "InvalidURL",
+)
+
+
+class ClientError(Exception):
+ """Base class for client connection errors."""
+
+
+class ClientResponseError(ClientError):
+ """Connection error during reading response.
+
+ request_info: instance of RequestInfo
+ """
+
+ def __init__(
+ self,
+ request_info: RequestInfo,
+ history: Tuple[ClientResponse, ...],
+ *,
+ code: Optional[int] = None,
+ status: Optional[int] = None,
+ message: str = "",
+ headers: Optional[LooseHeaders] = None,
+ ) -> None:
+ self.request_info = request_info
+ if code is not None:
+ if status is not None:
+ raise ValueError(
+ "Both code and status arguments are provided; "
+ "code is deprecated, use status instead"
+ )
+ warnings.warn(
+ "code argument is deprecated, use status instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ if status is not None:
+ self.status = status
+ elif code is not None:
+ self.status = code
+ else:
+ self.status = 0
+ self.message = message
+ self.headers = headers
+ self.history = history
+ self.args = (request_info, history)
+
+ def __str__(self) -> str:
+ return "{}, message={!r}, url={!r}".format(
+ self.status,
+ self.message,
+ self.request_info.real_url,
+ )
+
+ def __repr__(self) -> str:
+ args = f"{self.request_info!r}, {self.history!r}"
+ if self.status != 0:
+ args += f", status={self.status!r}"
+ if self.message != "":
+ args += f", message={self.message!r}"
+ if self.headers is not None:
+ args += f", headers={self.headers!r}"
+ return f"{type(self).__name__}({args})"
+
+ @property
+ def code(self) -> int:
+ warnings.warn(
+ "code property is deprecated, use status instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ return self.status
+
+ @code.setter
+ def code(self, value: int) -> None:
+ warnings.warn(
+ "code property is deprecated, use status instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ self.status = value
+
+
+class ContentTypeError(ClientResponseError):
+ """ContentType found is not valid."""
+
+
+class WSServerHandshakeError(ClientResponseError):
+ """websocket server handshake error."""
+
+
+class ClientHttpProxyError(ClientResponseError):
+ """HTTP proxy error.
+
+ Raised in :class:`aiohttp.connector.TCPConnector` if
+ proxy responds with status other than ``200 OK``
+ on ``CONNECT`` request.
+ """
+
+
+class TooManyRedirects(ClientResponseError):
+ """Client was redirected too many times."""
+
+
+class ClientConnectionError(ClientError):
+ """Base class for client socket errors."""
+
+
+class ClientOSError(ClientConnectionError, OSError):
+ """OSError error."""
+
+
+class ClientConnectorError(ClientOSError):
+ """Client connector error.
+
+ Raised in :class:`aiohttp.connector.TCPConnector` if
+ a connection can not be established.
+ """
+
+ def __init__(self, connection_key: ConnectionKey, os_error: OSError) -> None:
+ self._conn_key = connection_key
+ self._os_error = os_error
+ super().__init__(os_error.errno, os_error.strerror)
+ self.args = (connection_key, os_error)
+
+ @property
+ def os_error(self) -> OSError:
+ return self._os_error
+
+ @property
+ def host(self) -> str:
+ return self._conn_key.host
+
+ @property
+ def port(self) -> Optional[int]:
+ return self._conn_key.port
+
+ @property
+ def ssl(self) -> Union[SSLContext, None, bool, "Fingerprint"]:
+ return self._conn_key.ssl
+
+ def __str__(self) -> str:
+ return "Cannot connect to host {0.host}:{0.port} ssl:{1} [{2}]".format(
+ self, self.ssl if self.ssl is not None else "default", self.strerror
+ )
+
+ # OSError.__reduce__ does too much black magick
+ __reduce__ = BaseException.__reduce__
+
+
+class ClientProxyConnectionError(ClientConnectorError):
+ """Proxy connection error.
+
+ Raised in :class:`aiohttp.connector.TCPConnector` if
+ connection to proxy can not be established.
+ """
+
+
+class UnixClientConnectorError(ClientConnectorError):
+ """Unix connector error.
+
+ Raised in :py:class:`aiohttp.connector.UnixConnector`
+ if connection to unix socket can not be established.
+ """
+
+ def __init__(
+ self, path: str, connection_key: ConnectionKey, os_error: OSError
+ ) -> None:
+ self._path = path
+ super().__init__(connection_key, os_error)
+
+ @property
+ def path(self) -> str:
+ return self._path
+
+ def __str__(self) -> str:
+ return "Cannot connect to unix socket {0.path} ssl:{1} [{2}]".format(
+ self, self.ssl if self.ssl is not None else "default", self.strerror
+ )
+
+
+class ServerConnectionError(ClientConnectionError):
+ """Server connection errors."""
+
+
+class ServerDisconnectedError(ServerConnectionError):
+ """Server disconnected."""
+
+ def __init__(self, message: Union[RawResponseMessage, str, None] = None) -> None:
+ if message is None:
+ message = "Server disconnected"
+
+ self.args = (message,)
+ self.message = message
+
+
+class ServerTimeoutError(ServerConnectionError, asyncio.TimeoutError):
+ """Server timeout error."""
+
+
+class ServerFingerprintMismatch(ServerConnectionError):
+ """SSL certificate does not match expected fingerprint."""
+
+ def __init__(self, expected: bytes, got: bytes, host: str, port: int) -> None:
+ self.expected = expected
+ self.got = got
+ self.host = host
+ self.port = port
+ self.args = (expected, got, host, port)
+
+ def __repr__(self) -> str:
+ return "<{} expected={!r} got={!r} host={!r} port={!r}>".format(
+ self.__class__.__name__, self.expected, self.got, self.host, self.port
+ )
+
+
+class ClientPayloadError(ClientError):
+ """Response payload error."""
+
+
+class InvalidURL(ClientError, ValueError):
+ """Invalid URL.
+
+ URL used for fetching is malformed, e.g. it doesn't contains host
+ part.
+ """
+
+ # Derive from ValueError for backward compatibility
+
+ def __init__(self, url: Any) -> None:
+ # The type of url is not yarl.URL because the exception can be raised
+ # on URL(url) call
+ super().__init__(url)
+
+ @property
+ def url(self) -> Any:
+ return self.args[0]
+
+ def __repr__(self) -> str:
+ return f"<{self.__class__.__name__} {self.url}>"
+
+
+class ClientSSLError(ClientConnectorError):
+ """Base error for ssl.*Errors."""
+
+
+if ssl is not None:
+ cert_errors = (ssl.CertificateError,)
+ cert_errors_bases = (
+ ClientSSLError,
+ ssl.CertificateError,
+ )
+
+ ssl_errors = (ssl.SSLError,)
+ ssl_error_bases = (ClientSSLError, ssl.SSLError)
+else: # pragma: no cover
+ cert_errors = tuple()
+ cert_errors_bases = (
+ ClientSSLError,
+ ValueError,
+ )
+
+ ssl_errors = tuple()
+ ssl_error_bases = (ClientSSLError,)
+
+
+class ClientConnectorSSLError(*ssl_error_bases): # type: ignore[misc]
+ """Response ssl error."""
+
+
+class ClientConnectorCertificateError(*cert_errors_bases): # type: ignore[misc]
+ """Response certificate error."""
+
+ def __init__(
+ self, connection_key: ConnectionKey, certificate_error: Exception
+ ) -> None:
+ self._conn_key = connection_key
+ self._certificate_error = certificate_error
+ self.args = (connection_key, certificate_error)
+
+ @property
+ def certificate_error(self) -> Exception:
+ return self._certificate_error
+
+ @property
+ def host(self) -> str:
+ return self._conn_key.host
+
+ @property
+ def port(self) -> Optional[int]:
+ return self._conn_key.port
+
+ @property
+ def ssl(self) -> bool:
+ return self._conn_key.is_ssl
+
+ def __str__(self) -> str:
+ return (
+ "Cannot connect to host {0.host}:{0.port} ssl:{0.ssl} "
+ "[{0.certificate_error.__class__.__name__}: "
+ "{0.certificate_error.args}]".format(self)
+ )
diff --git a/third_party/python/aiohttp/aiohttp/client_proto.py b/third_party/python/aiohttp/aiohttp/client_proto.py
new file mode 100644
index 0000000000..3041157d61
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/client_proto.py
@@ -0,0 +1,251 @@
+import asyncio
+from contextlib import suppress
+from typing import Any, Optional, Tuple
+
+from .base_protocol import BaseProtocol
+from .client_exceptions import (
+ ClientOSError,
+ ClientPayloadError,
+ ServerDisconnectedError,
+ ServerTimeoutError,
+)
+from .helpers import BaseTimerContext
+from .http import HttpResponseParser, RawResponseMessage
+from .streams import EMPTY_PAYLOAD, DataQueue, StreamReader
+
+
+class ResponseHandler(BaseProtocol, DataQueue[Tuple[RawResponseMessage, StreamReader]]):
+ """Helper class to adapt between Protocol and StreamReader."""
+
+ def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
+ BaseProtocol.__init__(self, loop=loop)
+ DataQueue.__init__(self, loop)
+
+ self._should_close = False
+
+ self._payload: Optional[StreamReader] = None
+ self._skip_payload = False
+ self._payload_parser = None
+
+ self._timer = None
+
+ self._tail = b""
+ self._upgraded = False
+ self._parser: Optional[HttpResponseParser] = None
+
+ self._read_timeout: Optional[float] = None
+ self._read_timeout_handle: Optional[asyncio.TimerHandle] = None
+
+ @property
+ def upgraded(self) -> bool:
+ return self._upgraded
+
+ @property
+ def should_close(self) -> bool:
+ if self._payload is not None and not self._payload.is_eof() or self._upgraded:
+ return True
+
+ return (
+ self._should_close
+ or self._upgraded
+ or self.exception() is not None
+ or self._payload_parser is not None
+ or len(self) > 0
+ or bool(self._tail)
+ )
+
+ def force_close(self) -> None:
+ self._should_close = True
+
+ def close(self) -> None:
+ transport = self.transport
+ if transport is not None:
+ transport.close()
+ self.transport = None
+ self._payload = None
+ self._drop_timeout()
+
+ def is_connected(self) -> bool:
+ return self.transport is not None and not self.transport.is_closing()
+
+ def connection_lost(self, exc: Optional[BaseException]) -> None:
+ self._drop_timeout()
+
+ if self._payload_parser is not None:
+ with suppress(Exception):
+ self._payload_parser.feed_eof()
+
+ uncompleted = None
+ if self._parser is not None:
+ try:
+ uncompleted = self._parser.feed_eof()
+ except Exception:
+ if self._payload is not None:
+ self._payload.set_exception(
+ ClientPayloadError("Response payload is not completed")
+ )
+
+ if not self.is_eof():
+ if isinstance(exc, OSError):
+ exc = ClientOSError(*exc.args)
+ if exc is None:
+ exc = ServerDisconnectedError(uncompleted)
+ # assigns self._should_close to True as side effect,
+ # we do it anyway below
+ self.set_exception(exc)
+
+ self._should_close = True
+ self._parser = None
+ self._payload = None
+ self._payload_parser = None
+ self._reading_paused = False
+
+ super().connection_lost(exc)
+
+ def eof_received(self) -> None:
+ # should call parser.feed_eof() most likely
+ self._drop_timeout()
+
+ def pause_reading(self) -> None:
+ super().pause_reading()
+ self._drop_timeout()
+
+ def resume_reading(self) -> None:
+ super().resume_reading()
+ self._reschedule_timeout()
+
+ def set_exception(self, exc: BaseException) -> None:
+ self._should_close = True
+ self._drop_timeout()
+ super().set_exception(exc)
+
+ def set_parser(self, parser: Any, payload: Any) -> None:
+ # TODO: actual types are:
+ # parser: WebSocketReader
+ # payload: FlowControlDataQueue
+ # but they are not generi enough
+ # Need an ABC for both types
+ self._payload = payload
+ self._payload_parser = parser
+
+ self._drop_timeout()
+
+ if self._tail:
+ data, self._tail = self._tail, b""
+ self.data_received(data)
+
+ def set_response_params(
+ self,
+ *,
+ timer: Optional[BaseTimerContext] = None,
+ skip_payload: bool = False,
+ read_until_eof: bool = False,
+ auto_decompress: bool = True,
+ read_timeout: Optional[float] = None,
+ read_bufsize: int = 2**16,
+ ) -> None:
+ self._skip_payload = skip_payload
+
+ self._read_timeout = read_timeout
+ self._reschedule_timeout()
+
+ self._parser = HttpResponseParser(
+ self,
+ self._loop,
+ read_bufsize,
+ timer=timer,
+ payload_exception=ClientPayloadError,
+ response_with_body=not skip_payload,
+ read_until_eof=read_until_eof,
+ auto_decompress=auto_decompress,
+ )
+
+ if self._tail:
+ data, self._tail = self._tail, b""
+ self.data_received(data)
+
+ def _drop_timeout(self) -> None:
+ if self._read_timeout_handle is not None:
+ self._read_timeout_handle.cancel()
+ self._read_timeout_handle = None
+
+ def _reschedule_timeout(self) -> None:
+ timeout = self._read_timeout
+ if self._read_timeout_handle is not None:
+ self._read_timeout_handle.cancel()
+
+ if timeout:
+ self._read_timeout_handle = self._loop.call_later(
+ timeout, self._on_read_timeout
+ )
+ else:
+ self._read_timeout_handle = None
+
+ def _on_read_timeout(self) -> None:
+ exc = ServerTimeoutError("Timeout on reading data from socket")
+ self.set_exception(exc)
+ if self._payload is not None:
+ self._payload.set_exception(exc)
+
+ def data_received(self, data: bytes) -> None:
+ self._reschedule_timeout()
+
+ if not data:
+ return
+
+ # custom payload parser
+ if self._payload_parser is not None:
+ eof, tail = self._payload_parser.feed_data(data)
+ if eof:
+ self._payload = None
+ self._payload_parser = None
+
+ if tail:
+ self.data_received(tail)
+ return
+ else:
+ if self._upgraded or self._parser is None:
+ # i.e. websocket connection, websocket parser is not set yet
+ self._tail += data
+ else:
+ # parse http messages
+ try:
+ messages, upgraded, tail = self._parser.feed_data(data)
+ except BaseException as exc:
+ if self.transport is not None:
+ # connection.release() could be called BEFORE
+ # data_received(), the transport is already
+ # closed in this case
+ self.transport.close()
+ # should_close is True after the call
+ self.set_exception(exc)
+ return
+
+ self._upgraded = upgraded
+
+ payload: Optional[StreamReader] = None
+ for message, payload in messages:
+ if message.should_close:
+ self._should_close = True
+
+ self._payload = payload
+
+ if self._skip_payload or message.code in (204, 304):
+ self.feed_data((message, EMPTY_PAYLOAD), 0)
+ else:
+ self.feed_data((message, payload), 0)
+ if payload is not None:
+ # new message(s) was processed
+ # register timeout handler unsubscribing
+ # either on end-of-stream or immediately for
+ # EMPTY_PAYLOAD
+ if payload is not EMPTY_PAYLOAD:
+ payload.on_eof(self._drop_timeout)
+ else:
+ self._drop_timeout()
+
+ if tail:
+ if upgraded:
+ self.data_received(tail)
+ else:
+ self._tail = tail
diff --git a/third_party/python/aiohttp/aiohttp/client_reqrep.py b/third_party/python/aiohttp/aiohttp/client_reqrep.py
new file mode 100644
index 0000000000..28b8a28d0d
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/client_reqrep.py
@@ -0,0 +1,1134 @@
+import asyncio
+import codecs
+import functools
+import io
+import re
+import sys
+import traceback
+import warnings
+from hashlib import md5, sha1, sha256
+from http.cookies import CookieError, Morsel, SimpleCookie
+from types import MappingProxyType, TracebackType
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Dict,
+ Iterable,
+ List,
+ Mapping,
+ Optional,
+ Tuple,
+ Type,
+ Union,
+ cast,
+)
+
+import attr
+from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy
+from yarl import URL
+
+from . import hdrs, helpers, http, multipart, payload
+from .abc import AbstractStreamWriter
+from .client_exceptions import (
+ ClientConnectionError,
+ ClientOSError,
+ ClientResponseError,
+ ContentTypeError,
+ InvalidURL,
+ ServerFingerprintMismatch,
+)
+from .formdata import FormData
+from .helpers import (
+ PY_36,
+ BaseTimerContext,
+ BasicAuth,
+ HeadersMixin,
+ TimerNoop,
+ noop,
+ reify,
+ set_result,
+)
+from .http import SERVER_SOFTWARE, HttpVersion10, HttpVersion11, StreamWriter
+from .log import client_logger
+from .streams import StreamReader
+from .typedefs import (
+ DEFAULT_JSON_DECODER,
+ JSONDecoder,
+ LooseCookies,
+ LooseHeaders,
+ RawHeaders,
+)
+
+try:
+ import ssl
+ from ssl import SSLContext
+except ImportError: # pragma: no cover
+ ssl = None # type: ignore[assignment]
+ SSLContext = object # type: ignore[misc,assignment]
+
+try:
+ import cchardet as chardet
+except ImportError: # pragma: no cover
+ import charset_normalizer as chardet # type: ignore[no-redef]
+
+
+__all__ = ("ClientRequest", "ClientResponse", "RequestInfo", "Fingerprint")
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from .client import ClientSession
+ from .connector import Connection
+ from .tracing import Trace
+
+
+json_re = re.compile(r"^application/(?:[\w.+-]+?\+)?json")
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class ContentDisposition:
+ type: Optional[str]
+ parameters: "MappingProxyType[str, str]"
+ filename: Optional[str]
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class RequestInfo:
+ url: URL
+ method: str
+ headers: "CIMultiDictProxy[str]"
+ real_url: URL = attr.ib()
+
+ @real_url.default
+ def real_url_default(self) -> URL:
+ return self.url
+
+
+class Fingerprint:
+ HASHFUNC_BY_DIGESTLEN = {
+ 16: md5,
+ 20: sha1,
+ 32: sha256,
+ }
+
+ def __init__(self, fingerprint: bytes) -> None:
+ digestlen = len(fingerprint)
+ hashfunc = self.HASHFUNC_BY_DIGESTLEN.get(digestlen)
+ if not hashfunc:
+ raise ValueError("fingerprint has invalid length")
+ elif hashfunc is md5 or hashfunc is sha1:
+ raise ValueError(
+ "md5 and sha1 are insecure and " "not supported. Use sha256."
+ )
+ self._hashfunc = hashfunc
+ self._fingerprint = fingerprint
+
+ @property
+ def fingerprint(self) -> bytes:
+ return self._fingerprint
+
+ def check(self, transport: asyncio.Transport) -> None:
+ if not transport.get_extra_info("sslcontext"):
+ return
+ sslobj = transport.get_extra_info("ssl_object")
+ cert = sslobj.getpeercert(binary_form=True)
+ got = self._hashfunc(cert).digest()
+ if got != self._fingerprint:
+ host, port, *_ = transport.get_extra_info("peername")
+ raise ServerFingerprintMismatch(self._fingerprint, got, host, port)
+
+
+if ssl is not None:
+ SSL_ALLOWED_TYPES = (ssl.SSLContext, bool, Fingerprint, type(None))
+else: # pragma: no cover
+ SSL_ALLOWED_TYPES = type(None)
+
+
+def _merge_ssl_params(
+ ssl: Union["SSLContext", bool, Fingerprint, None],
+ verify_ssl: Optional[bool],
+ ssl_context: Optional["SSLContext"],
+ fingerprint: Optional[bytes],
+) -> Union["SSLContext", bool, Fingerprint, None]:
+ if verify_ssl is not None and not verify_ssl:
+ warnings.warn(
+ "verify_ssl is deprecated, use ssl=False instead",
+ DeprecationWarning,
+ stacklevel=3,
+ )
+ if ssl is not None:
+ raise ValueError(
+ "verify_ssl, ssl_context, fingerprint and ssl "
+ "parameters are mutually exclusive"
+ )
+ else:
+ ssl = False
+ if ssl_context is not None:
+ warnings.warn(
+ "ssl_context is deprecated, use ssl=context instead",
+ DeprecationWarning,
+ stacklevel=3,
+ )
+ if ssl is not None:
+ raise ValueError(
+ "verify_ssl, ssl_context, fingerprint and ssl "
+ "parameters are mutually exclusive"
+ )
+ else:
+ ssl = ssl_context
+ if fingerprint is not None:
+ warnings.warn(
+ "fingerprint is deprecated, " "use ssl=Fingerprint(fingerprint) instead",
+ DeprecationWarning,
+ stacklevel=3,
+ )
+ if ssl is not None:
+ raise ValueError(
+ "verify_ssl, ssl_context, fingerprint and ssl "
+ "parameters are mutually exclusive"
+ )
+ else:
+ ssl = Fingerprint(fingerprint)
+ if not isinstance(ssl, SSL_ALLOWED_TYPES):
+ raise TypeError(
+ "ssl should be SSLContext, bool, Fingerprint or None, "
+ "got {!r} instead.".format(ssl)
+ )
+ return ssl
+
+
+@attr.s(auto_attribs=True, slots=True, frozen=True)
+class ConnectionKey:
+ # the key should contain an information about used proxy / TLS
+ # to prevent reusing wrong connections from a pool
+ host: str
+ port: Optional[int]
+ is_ssl: bool
+ ssl: Union[SSLContext, None, bool, Fingerprint]
+ proxy: Optional[URL]
+ proxy_auth: Optional[BasicAuth]
+ proxy_headers_hash: Optional[int] # hash(CIMultiDict)
+
+
+def _is_expected_content_type(
+ response_content_type: str, expected_content_type: str
+) -> bool:
+ if expected_content_type == "application/json":
+ return json_re.match(response_content_type) is not None
+ return expected_content_type in response_content_type
+
+
+class ClientRequest:
+ GET_METHODS = {
+ hdrs.METH_GET,
+ hdrs.METH_HEAD,
+ hdrs.METH_OPTIONS,
+ hdrs.METH_TRACE,
+ }
+ POST_METHODS = {hdrs.METH_PATCH, hdrs.METH_POST, hdrs.METH_PUT}
+ ALL_METHODS = GET_METHODS.union(POST_METHODS).union({hdrs.METH_DELETE})
+
+ DEFAULT_HEADERS = {
+ hdrs.ACCEPT: "*/*",
+ hdrs.ACCEPT_ENCODING: "gzip, deflate",
+ }
+
+ body = b""
+ auth = None
+ response = None
+
+ _writer = None # async task for streaming data
+ _continue = None # waiter future for '100 Continue' response
+
+ # N.B.
+ # Adding __del__ method with self._writer closing doesn't make sense
+ # because _writer is instance method, thus it keeps a reference to self.
+ # Until writer has finished finalizer will not be called.
+
+ def __init__(
+ self,
+ method: str,
+ url: URL,
+ *,
+ params: Optional[Mapping[str, str]] = None,
+ headers: Optional[LooseHeaders] = None,
+ skip_auto_headers: Iterable[str] = frozenset(),
+ data: Any = None,
+ cookies: Optional[LooseCookies] = None,
+ auth: Optional[BasicAuth] = None,
+ version: http.HttpVersion = http.HttpVersion11,
+ compress: Optional[str] = None,
+ chunked: Optional[bool] = None,
+ expect100: bool = False,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ response_class: Optional[Type["ClientResponse"]] = None,
+ proxy: Optional[URL] = None,
+ proxy_auth: Optional[BasicAuth] = None,
+ timer: Optional[BaseTimerContext] = None,
+ session: Optional["ClientSession"] = None,
+ ssl: Union[SSLContext, bool, Fingerprint, None] = None,
+ proxy_headers: Optional[LooseHeaders] = None,
+ traces: Optional[List["Trace"]] = None,
+ ):
+
+ if loop is None:
+ loop = asyncio.get_event_loop()
+
+ assert isinstance(url, URL), url
+ assert isinstance(proxy, (URL, type(None))), proxy
+ # FIXME: session is None in tests only, need to fix tests
+ # assert session is not None
+ self._session = cast("ClientSession", session)
+ if params:
+ q = MultiDict(url.query)
+ url2 = url.with_query(params)
+ q.extend(url2.query)
+ url = url.with_query(q)
+ self.original_url = url
+ self.url = url.with_fragment(None)
+ self.method = method.upper()
+ self.chunked = chunked
+ self.compress = compress
+ self.loop = loop
+ self.length = None
+ if response_class is None:
+ real_response_class = ClientResponse
+ else:
+ real_response_class = response_class
+ self.response_class: Type[ClientResponse] = real_response_class
+ self._timer = timer if timer is not None else TimerNoop()
+ self._ssl = ssl
+
+ if loop.get_debug():
+ self._source_traceback = traceback.extract_stack(sys._getframe(1))
+
+ self.update_version(version)
+ self.update_host(url)
+ self.update_headers(headers)
+ self.update_auto_headers(skip_auto_headers)
+ self.update_cookies(cookies)
+ self.update_content_encoding(data)
+ self.update_auth(auth)
+ self.update_proxy(proxy, proxy_auth, proxy_headers)
+
+ self.update_body_from_data(data)
+ if data is not None or self.method not in self.GET_METHODS:
+ self.update_transfer_encoding()
+ self.update_expect_continue(expect100)
+ if traces is None:
+ traces = []
+ self._traces = traces
+
+ def is_ssl(self) -> bool:
+ return self.url.scheme in ("https", "wss")
+
+ @property
+ def ssl(self) -> Union["SSLContext", None, bool, Fingerprint]:
+ return self._ssl
+
+ @property
+ def connection_key(self) -> ConnectionKey:
+ proxy_headers = self.proxy_headers
+ if proxy_headers:
+ h: Optional[int] = hash(tuple((k, v) for k, v in proxy_headers.items()))
+ else:
+ h = None
+ return ConnectionKey(
+ self.host,
+ self.port,
+ self.is_ssl(),
+ self.ssl,
+ self.proxy,
+ self.proxy_auth,
+ h,
+ )
+
+ @property
+ def host(self) -> str:
+ ret = self.url.raw_host
+ assert ret is not None
+ return ret
+
+ @property
+ def port(self) -> Optional[int]:
+ return self.url.port
+
+ @property
+ def request_info(self) -> RequestInfo:
+ headers: CIMultiDictProxy[str] = CIMultiDictProxy(self.headers)
+ return RequestInfo(self.url, self.method, headers, self.original_url)
+
+ def update_host(self, url: URL) -> None:
+ """Update destination host, port and connection type (ssl)."""
+ # get host/port
+ if not url.raw_host:
+ raise InvalidURL(url)
+
+ # basic auth info
+ username, password = url.user, url.password
+ if username:
+ self.auth = helpers.BasicAuth(username, password or "")
+
+ def update_version(self, version: Union[http.HttpVersion, str]) -> None:
+ """Convert request version to two elements tuple.
+
+ parser HTTP version '1.1' => (1, 1)
+ """
+ if isinstance(version, str):
+ v = [part.strip() for part in version.split(".", 1)]
+ try:
+ version = http.HttpVersion(int(v[0]), int(v[1]))
+ except ValueError:
+ raise ValueError(
+ f"Can not parse http version number: {version}"
+ ) from None
+ self.version = version
+
+ def update_headers(self, headers: Optional[LooseHeaders]) -> None:
+ """Update request headers."""
+ self.headers: CIMultiDict[str] = CIMultiDict()
+
+ # add host
+ netloc = cast(str, self.url.raw_host)
+ if helpers.is_ipv6_address(netloc):
+ netloc = f"[{netloc}]"
+ if self.url.port is not None and not self.url.is_default_port():
+ netloc += ":" + str(self.url.port)
+ self.headers[hdrs.HOST] = netloc
+
+ if headers:
+ if isinstance(headers, (dict, MultiDictProxy, MultiDict)):
+ headers = headers.items() # type: ignore[assignment]
+
+ for key, value in headers: # type: ignore[misc]
+ # A special case for Host header
+ if key.lower() == "host":
+ self.headers[key] = value
+ else:
+ self.headers.add(key, value)
+
+ def update_auto_headers(self, skip_auto_headers: Iterable[str]) -> None:
+ self.skip_auto_headers = CIMultiDict(
+ (hdr, None) for hdr in sorted(skip_auto_headers)
+ )
+ used_headers = self.headers.copy()
+ used_headers.extend(self.skip_auto_headers) # type: ignore[arg-type]
+
+ for hdr, val in self.DEFAULT_HEADERS.items():
+ if hdr not in used_headers:
+ self.headers.add(hdr, val)
+
+ if hdrs.USER_AGENT not in used_headers:
+ self.headers[hdrs.USER_AGENT] = SERVER_SOFTWARE
+
+ def update_cookies(self, cookies: Optional[LooseCookies]) -> None:
+ """Update request cookies header."""
+ if not cookies:
+ return
+
+ c: SimpleCookie[str] = SimpleCookie()
+ if hdrs.COOKIE in self.headers:
+ c.load(self.headers.get(hdrs.COOKIE, ""))
+ del self.headers[hdrs.COOKIE]
+
+ if isinstance(cookies, Mapping):
+ iter_cookies = cookies.items()
+ else:
+ iter_cookies = cookies # type: ignore[assignment]
+ for name, value in iter_cookies:
+ if isinstance(value, Morsel):
+ # Preserve coded_value
+ mrsl_val = value.get(value.key, Morsel())
+ mrsl_val.set(value.key, value.value, value.coded_value)
+ c[name] = mrsl_val
+ else:
+ c[name] = value # type: ignore[assignment]
+
+ self.headers[hdrs.COOKIE] = c.output(header="", sep=";").strip()
+
+ def update_content_encoding(self, data: Any) -> None:
+ """Set request content encoding."""
+ if data is None:
+ return
+
+ enc = self.headers.get(hdrs.CONTENT_ENCODING, "").lower()
+ if enc:
+ if self.compress:
+ raise ValueError(
+ "compress can not be set " "if Content-Encoding header is set"
+ )
+ elif self.compress:
+ if not isinstance(self.compress, str):
+ self.compress = "deflate"
+ self.headers[hdrs.CONTENT_ENCODING] = self.compress
+ self.chunked = True # enable chunked, no need to deal with length
+
+ def update_transfer_encoding(self) -> None:
+ """Analyze transfer-encoding header."""
+ te = self.headers.get(hdrs.TRANSFER_ENCODING, "").lower()
+
+ if "chunked" in te:
+ if self.chunked:
+ raise ValueError(
+ "chunked can not be set "
+ 'if "Transfer-Encoding: chunked" header is set'
+ )
+
+ elif self.chunked:
+ if hdrs.CONTENT_LENGTH in self.headers:
+ raise ValueError(
+ "chunked can not be set " "if Content-Length header is set"
+ )
+
+ self.headers[hdrs.TRANSFER_ENCODING] = "chunked"
+ else:
+ if hdrs.CONTENT_LENGTH not in self.headers:
+ self.headers[hdrs.CONTENT_LENGTH] = str(len(self.body))
+
+ def update_auth(self, auth: Optional[BasicAuth]) -> None:
+ """Set basic auth."""
+ if auth is None:
+ auth = self.auth
+ if auth is None:
+ return
+
+ if not isinstance(auth, helpers.BasicAuth):
+ raise TypeError("BasicAuth() tuple is required instead")
+
+ self.headers[hdrs.AUTHORIZATION] = auth.encode()
+
+ def update_body_from_data(self, body: Any) -> None:
+ if body is None:
+ return
+
+ # FormData
+ if isinstance(body, FormData):
+ body = body()
+
+ try:
+ body = payload.PAYLOAD_REGISTRY.get(body, disposition=None)
+ except payload.LookupError:
+ body = FormData(body)()
+
+ self.body = body
+
+ # enable chunked encoding if needed
+ if not self.chunked:
+ if hdrs.CONTENT_LENGTH not in self.headers:
+ size = body.size
+ if size is None:
+ self.chunked = True
+ else:
+ if hdrs.CONTENT_LENGTH not in self.headers:
+ self.headers[hdrs.CONTENT_LENGTH] = str(size)
+
+ # copy payload headers
+ assert body.headers
+ for (key, value) in body.headers.items():
+ if key in self.headers:
+ continue
+ if key in self.skip_auto_headers:
+ continue
+ self.headers[key] = value
+
+ def update_expect_continue(self, expect: bool = False) -> None:
+ if expect:
+ self.headers[hdrs.EXPECT] = "100-continue"
+ elif self.headers.get(hdrs.EXPECT, "").lower() == "100-continue":
+ expect = True
+
+ if expect:
+ self._continue = self.loop.create_future()
+
+ def update_proxy(
+ self,
+ proxy: Optional[URL],
+ proxy_auth: Optional[BasicAuth],
+ proxy_headers: Optional[LooseHeaders],
+ ) -> None:
+ if proxy_auth and not isinstance(proxy_auth, helpers.BasicAuth):
+ raise ValueError("proxy_auth must be None or BasicAuth() tuple")
+ self.proxy = proxy
+ self.proxy_auth = proxy_auth
+ self.proxy_headers = proxy_headers
+
+ def keep_alive(self) -> bool:
+ if self.version < HttpVersion10:
+ # keep alive not supported at all
+ return False
+ if self.version == HttpVersion10:
+ if self.headers.get(hdrs.CONNECTION) == "keep-alive":
+ return True
+ else: # no headers means we close for Http 1.0
+ return False
+ elif self.headers.get(hdrs.CONNECTION) == "close":
+ return False
+
+ return True
+
+ async def write_bytes(
+ self, writer: AbstractStreamWriter, conn: "Connection"
+ ) -> None:
+ """Support coroutines that yields bytes objects."""
+ # 100 response
+ if self._continue is not None:
+ await writer.drain()
+ await self._continue
+
+ protocol = conn.protocol
+ assert protocol is not None
+ try:
+ if isinstance(self.body, payload.Payload):
+ await self.body.write(writer)
+ else:
+ if isinstance(self.body, (bytes, bytearray)):
+ self.body = (self.body,) # type: ignore[assignment]
+
+ for chunk in self.body:
+ await writer.write(chunk) # type: ignore[arg-type]
+
+ await writer.write_eof()
+ except OSError as exc:
+ if exc.errno is None and isinstance(exc, asyncio.TimeoutError):
+ protocol.set_exception(exc)
+ else:
+ new_exc = ClientOSError(
+ exc.errno, "Can not write request body for %s" % self.url
+ )
+ new_exc.__context__ = exc
+ new_exc.__cause__ = exc
+ protocol.set_exception(new_exc)
+ except asyncio.CancelledError as exc:
+ if not conn.closed:
+ protocol.set_exception(exc)
+ except Exception as exc:
+ protocol.set_exception(exc)
+ finally:
+ self._writer = None
+
+ async def send(self, conn: "Connection") -> "ClientResponse":
+ # Specify request target:
+ # - CONNECT request must send authority form URI
+ # - not CONNECT proxy must send absolute form URI
+ # - most common is origin form URI
+ if self.method == hdrs.METH_CONNECT:
+ connect_host = self.url.raw_host
+ assert connect_host is not None
+ if helpers.is_ipv6_address(connect_host):
+ connect_host = f"[{connect_host}]"
+ path = f"{connect_host}:{self.url.port}"
+ elif self.proxy and not self.is_ssl():
+ path = str(self.url)
+ else:
+ path = self.url.raw_path
+ if self.url.raw_query_string:
+ path += "?" + self.url.raw_query_string
+
+ protocol = conn.protocol
+ assert protocol is not None
+ writer = StreamWriter(
+ protocol,
+ self.loop,
+ on_chunk_sent=functools.partial(
+ self._on_chunk_request_sent, self.method, self.url
+ ),
+ on_headers_sent=functools.partial(
+ self._on_headers_request_sent, self.method, self.url
+ ),
+ )
+
+ if self.compress:
+ writer.enable_compression(self.compress)
+
+ if self.chunked is not None:
+ writer.enable_chunking()
+
+ # set default content-type
+ if (
+ self.method in self.POST_METHODS
+ and hdrs.CONTENT_TYPE not in self.skip_auto_headers
+ and hdrs.CONTENT_TYPE not in self.headers
+ ):
+ self.headers[hdrs.CONTENT_TYPE] = "application/octet-stream"
+
+ # set the connection header
+ connection = self.headers.get(hdrs.CONNECTION)
+ if not connection:
+ if self.keep_alive():
+ if self.version == HttpVersion10:
+ connection = "keep-alive"
+ else:
+ if self.version == HttpVersion11:
+ connection = "close"
+
+ if connection is not None:
+ self.headers[hdrs.CONNECTION] = connection
+
+ # status + headers
+ status_line = "{0} {1} HTTP/{2[0]}.{2[1]}".format(
+ self.method, path, self.version
+ )
+ await writer.write_headers(status_line, self.headers)
+
+ self._writer = self.loop.create_task(self.write_bytes(writer, conn))
+
+ response_class = self.response_class
+ assert response_class is not None
+ self.response = response_class(
+ self.method,
+ self.original_url,
+ writer=self._writer,
+ continue100=self._continue,
+ timer=self._timer,
+ request_info=self.request_info,
+ traces=self._traces,
+ loop=self.loop,
+ session=self._session,
+ )
+ return self.response
+
+ async def close(self) -> None:
+ if self._writer is not None:
+ try:
+ await self._writer
+ finally:
+ self._writer = None
+
+ def terminate(self) -> None:
+ if self._writer is not None:
+ if not self.loop.is_closed():
+ self._writer.cancel()
+ self._writer = None
+
+ async def _on_chunk_request_sent(self, method: str, url: URL, chunk: bytes) -> None:
+ for trace in self._traces:
+ await trace.send_request_chunk_sent(method, url, chunk)
+
+ async def _on_headers_request_sent(
+ self, method: str, url: URL, headers: "CIMultiDict[str]"
+ ) -> None:
+ for trace in self._traces:
+ await trace.send_request_headers(method, url, headers)
+
+
+class ClientResponse(HeadersMixin):
+
+ # from the Status-Line of the response
+ version = None # HTTP-Version
+ status: int = None # type: ignore[assignment] # Status-Code
+ reason = None # Reason-Phrase
+
+ content: StreamReader = None # type: ignore[assignment] # Payload stream
+ _headers: "CIMultiDictProxy[str]" = None # type: ignore[assignment]
+ _raw_headers: RawHeaders = None # type: ignore[assignment] # Response raw headers
+
+ _connection = None # current connection
+ _source_traceback = None
+ # setted up by ClientRequest after ClientResponse object creation
+ # post-init stage allows to not change ctor signature
+ _closed = True # to allow __del__ for non-initialized properly response
+ _released = False
+
+ def __init__(
+ self,
+ method: str,
+ url: URL,
+ *,
+ writer: "asyncio.Task[None]",
+ continue100: Optional["asyncio.Future[bool]"],
+ timer: BaseTimerContext,
+ request_info: RequestInfo,
+ traces: List["Trace"],
+ loop: asyncio.AbstractEventLoop,
+ session: "ClientSession",
+ ) -> None:
+ assert isinstance(url, URL)
+
+ self.method = method
+ self.cookies: SimpleCookie[str] = SimpleCookie()
+
+ self._real_url = url
+ self._url = url.with_fragment(None)
+ self._body: Any = None
+ self._writer: Optional[asyncio.Task[None]] = writer
+ self._continue = continue100 # None by default
+ self._closed = True
+ self._history: Tuple[ClientResponse, ...] = ()
+ self._request_info = request_info
+ self._timer = timer if timer is not None else TimerNoop()
+ self._cache: Dict[str, Any] = {}
+ self._traces = traces
+ self._loop = loop
+ # store a reference to session #1985
+ self._session: Optional[ClientSession] = session
+ if loop.get_debug():
+ self._source_traceback = traceback.extract_stack(sys._getframe(1))
+
+ @reify
+ def url(self) -> URL:
+ return self._url
+
+ @reify
+ def url_obj(self) -> URL:
+ warnings.warn("Deprecated, use .url #1654", DeprecationWarning, stacklevel=2)
+ return self._url
+
+ @reify
+ def real_url(self) -> URL:
+ return self._real_url
+
+ @reify
+ def host(self) -> str:
+ assert self._url.host is not None
+ return self._url.host
+
+ @reify
+ def headers(self) -> "CIMultiDictProxy[str]":
+ return self._headers
+
+ @reify
+ def raw_headers(self) -> RawHeaders:
+ return self._raw_headers
+
+ @reify
+ def request_info(self) -> RequestInfo:
+ return self._request_info
+
+ @reify
+ def content_disposition(self) -> Optional[ContentDisposition]:
+ raw = self._headers.get(hdrs.CONTENT_DISPOSITION)
+ if raw is None:
+ return None
+ disposition_type, params_dct = multipart.parse_content_disposition(raw)
+ params = MappingProxyType(params_dct)
+ filename = multipart.content_disposition_filename(params)
+ return ContentDisposition(disposition_type, params, filename)
+
+ def __del__(self, _warnings: Any = warnings) -> None:
+ if self._closed:
+ return
+
+ if self._connection is not None:
+ self._connection.release()
+ self._cleanup_writer()
+
+ if self._loop.get_debug():
+ if PY_36:
+ kwargs = {"source": self}
+ else:
+ kwargs = {}
+ _warnings.warn(f"Unclosed response {self!r}", ResourceWarning, **kwargs)
+ context = {"client_response": self, "message": "Unclosed response"}
+ if self._source_traceback:
+ context["source_traceback"] = self._source_traceback
+ self._loop.call_exception_handler(context)
+
+ def __repr__(self) -> str:
+ out = io.StringIO()
+ ascii_encodable_url = str(self.url)
+ if self.reason:
+ ascii_encodable_reason = self.reason.encode(
+ "ascii", "backslashreplace"
+ ).decode("ascii")
+ else:
+ ascii_encodable_reason = self.reason
+ print(
+ "<ClientResponse({}) [{} {}]>".format(
+ ascii_encodable_url, self.status, ascii_encodable_reason
+ ),
+ file=out,
+ )
+ print(self.headers, file=out)
+ return out.getvalue()
+
+ @property
+ def connection(self) -> Optional["Connection"]:
+ return self._connection
+
+ @reify
+ def history(self) -> Tuple["ClientResponse", ...]:
+ """A sequence of of responses, if redirects occurred."""
+ return self._history
+
+ @reify
+ def links(self) -> "MultiDictProxy[MultiDictProxy[Union[str, URL]]]":
+ links_str = ", ".join(self.headers.getall("link", []))
+
+ if not links_str:
+ return MultiDictProxy(MultiDict())
+
+ links: MultiDict[MultiDictProxy[Union[str, URL]]] = MultiDict()
+
+ for val in re.split(r",(?=\s*<)", links_str):
+ match = re.match(r"\s*<(.*)>(.*)", val)
+ if match is None: # pragma: no cover
+ # the check exists to suppress mypy error
+ continue
+ url, params_str = match.groups()
+ params = params_str.split(";")[1:]
+
+ link: MultiDict[Union[str, URL]] = MultiDict()
+
+ for param in params:
+ match = re.match(r"^\s*(\S*)\s*=\s*(['\"]?)(.*?)(\2)\s*$", param, re.M)
+ if match is None: # pragma: no cover
+ # the check exists to suppress mypy error
+ continue
+ key, _, value, _ = match.groups()
+
+ link.add(key, value)
+
+ key = link.get("rel", url) # type: ignore[assignment]
+
+ link.add("url", self.url.join(URL(url)))
+
+ links.add(key, MultiDictProxy(link))
+
+ return MultiDictProxy(links)
+
+ async def start(self, connection: "Connection") -> "ClientResponse":
+ """Start response processing."""
+ self._closed = False
+ self._protocol = connection.protocol
+ self._connection = connection
+
+ with self._timer:
+ while True:
+ # read response
+ try:
+ protocol = self._protocol
+ message, payload = await protocol.read() # type: ignore[union-attr]
+ except http.HttpProcessingError as exc:
+ raise ClientResponseError(
+ self.request_info,
+ self.history,
+ status=exc.code,
+ message=exc.message,
+ headers=exc.headers,
+ ) from exc
+
+ if message.code < 100 or message.code > 199 or message.code == 101:
+ break
+
+ if self._continue is not None:
+ set_result(self._continue, True)
+ self._continue = None
+
+ # payload eof handler
+ payload.on_eof(self._response_eof)
+
+ # response status
+ self.version = message.version
+ self.status = message.code
+ self.reason = message.reason
+
+ # headers
+ self._headers = message.headers # type is CIMultiDictProxy
+ self._raw_headers = message.raw_headers # type is Tuple[bytes, bytes]
+
+ # payload
+ self.content = payload
+
+ # cookies
+ for hdr in self.headers.getall(hdrs.SET_COOKIE, ()):
+ try:
+ self.cookies.load(hdr)
+ except CookieError as exc:
+ client_logger.warning("Can not load response cookies: %s", exc)
+ return self
+
+ def _response_eof(self) -> None:
+ if self._closed:
+ return
+
+ if self._connection is not None:
+ # websocket, protocol could be None because
+ # connection could be detached
+ if (
+ self._connection.protocol is not None
+ and self._connection.protocol.upgraded
+ ):
+ return
+
+ self._connection.release()
+ self._connection = None
+
+ self._closed = True
+ self._cleanup_writer()
+
+ @property
+ def closed(self) -> bool:
+ return self._closed
+
+ def close(self) -> None:
+ if not self._released:
+ self._notify_content()
+ if self._closed:
+ return
+
+ self._closed = True
+ if self._loop is None or self._loop.is_closed():
+ return
+
+ if self._connection is not None:
+ self._connection.close()
+ self._connection = None
+ self._cleanup_writer()
+
+ def release(self) -> Any:
+ if not self._released:
+ self._notify_content()
+ if self._closed:
+ return noop()
+
+ self._closed = True
+ if self._connection is not None:
+ self._connection.release()
+ self._connection = None
+
+ self._cleanup_writer()
+ return noop()
+
+ @property
+ def ok(self) -> bool:
+ """Returns ``True`` if ``status`` is less than ``400``, ``False`` if not.
+
+ This is **not** a check for ``200 OK`` but a check that the response
+ status is under 400.
+ """
+ return 400 > self.status
+
+ def raise_for_status(self) -> None:
+ if not self.ok:
+ # reason should always be not None for a started response
+ assert self.reason is not None
+ self.release()
+ raise ClientResponseError(
+ self.request_info,
+ self.history,
+ status=self.status,
+ message=self.reason,
+ headers=self.headers,
+ )
+
+ def _cleanup_writer(self) -> None:
+ if self._writer is not None:
+ self._writer.cancel()
+ self._writer = None
+ self._session = None
+
+ def _notify_content(self) -> None:
+ content = self.content
+ if content and content.exception() is None:
+ content.set_exception(ClientConnectionError("Connection closed"))
+ self._released = True
+
+ async def wait_for_close(self) -> None:
+ if self._writer is not None:
+ try:
+ await self._writer
+ finally:
+ self._writer = None
+ self.release()
+
+ async def read(self) -> bytes:
+ """Read response payload."""
+ if self._body is None:
+ try:
+ self._body = await self.content.read()
+ for trace in self._traces:
+ await trace.send_response_chunk_received(
+ self.method, self.url, self._body
+ )
+ except BaseException:
+ self.close()
+ raise
+ elif self._released:
+ raise ClientConnectionError("Connection closed")
+
+ return self._body # type: ignore[no-any-return]
+
+ def get_encoding(self) -> str:
+ ctype = self.headers.get(hdrs.CONTENT_TYPE, "").lower()
+ mimetype = helpers.parse_mimetype(ctype)
+
+ encoding = mimetype.parameters.get("charset")
+ if encoding:
+ try:
+ codecs.lookup(encoding)
+ except LookupError:
+ encoding = None
+ if not encoding:
+ if mimetype.type == "application" and (
+ mimetype.subtype == "json" or mimetype.subtype == "rdap"
+ ):
+ # RFC 7159 states that the default encoding is UTF-8.
+ # RFC 7483 defines application/rdap+json
+ encoding = "utf-8"
+ elif self._body is None:
+ raise RuntimeError(
+ "Cannot guess the encoding of " "a not yet read body"
+ )
+ else:
+ encoding = chardet.detect(self._body)["encoding"]
+ if not encoding:
+ encoding = "utf-8"
+
+ return encoding
+
+ async def text(self, encoding: Optional[str] = None, errors: str = "strict") -> str:
+ """Read response payload and decode."""
+ if self._body is None:
+ await self.read()
+
+ if encoding is None:
+ encoding = self.get_encoding()
+
+ return self._body.decode( # type: ignore[no-any-return,union-attr]
+ encoding, errors=errors
+ )
+
+ async def json(
+ self,
+ *,
+ encoding: Optional[str] = None,
+ loads: JSONDecoder = DEFAULT_JSON_DECODER,
+ content_type: Optional[str] = "application/json",
+ ) -> Any:
+ """Read and decodes JSON response."""
+ if self._body is None:
+ await self.read()
+
+ if content_type:
+ ctype = self.headers.get(hdrs.CONTENT_TYPE, "").lower()
+ if not _is_expected_content_type(ctype, content_type):
+ raise ContentTypeError(
+ self.request_info,
+ self.history,
+ message=(
+ "Attempt to decode JSON with " "unexpected mimetype: %s" % ctype
+ ),
+ headers=self.headers,
+ )
+
+ stripped = self._body.strip() # type: ignore[union-attr]
+ if not stripped:
+ return None
+
+ if encoding is None:
+ encoding = self.get_encoding()
+
+ return loads(stripped.decode(encoding))
+
+ async def __aenter__(self) -> "ClientResponse":
+ return self
+
+ async def __aexit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc_val: Optional[BaseException],
+ exc_tb: Optional[TracebackType],
+ ) -> None:
+ # similar to _RequestContextManager, we do not need to check
+ # for exceptions, response object can close connection
+ # if state is broken
+ self.release()
diff --git a/third_party/python/aiohttp/aiohttp/client_ws.py b/third_party/python/aiohttp/aiohttp/client_ws.py
new file mode 100644
index 0000000000..9a8ba84ca5
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/client_ws.py
@@ -0,0 +1,300 @@
+"""WebSocket client for asyncio."""
+
+import asyncio
+from typing import Any, Optional, cast
+
+import async_timeout
+
+from .client_exceptions import ClientError
+from .client_reqrep import ClientResponse
+from .helpers import call_later, set_result
+from .http import (
+ WS_CLOSED_MESSAGE,
+ WS_CLOSING_MESSAGE,
+ WebSocketError,
+ WSCloseCode,
+ WSMessage,
+ WSMsgType,
+)
+from .http_websocket import WebSocketWriter # WSMessage
+from .streams import EofStream, FlowControlDataQueue
+from .typedefs import (
+ DEFAULT_JSON_DECODER,
+ DEFAULT_JSON_ENCODER,
+ JSONDecoder,
+ JSONEncoder,
+)
+
+
+class ClientWebSocketResponse:
+ def __init__(
+ self,
+ reader: "FlowControlDataQueue[WSMessage]",
+ writer: WebSocketWriter,
+ protocol: Optional[str],
+ response: ClientResponse,
+ timeout: float,
+ autoclose: bool,
+ autoping: bool,
+ loop: asyncio.AbstractEventLoop,
+ *,
+ receive_timeout: Optional[float] = None,
+ heartbeat: Optional[float] = None,
+ compress: int = 0,
+ client_notakeover: bool = False,
+ ) -> None:
+ self._response = response
+ self._conn = response.connection
+
+ self._writer = writer
+ self._reader = reader
+ self._protocol = protocol
+ self._closed = False
+ self._closing = False
+ self._close_code: Optional[int] = None
+ self._timeout = timeout
+ self._receive_timeout = receive_timeout
+ self._autoclose = autoclose
+ self._autoping = autoping
+ self._heartbeat = heartbeat
+ self._heartbeat_cb: Optional[asyncio.TimerHandle] = None
+ if heartbeat is not None:
+ self._pong_heartbeat = heartbeat / 2.0
+ self._pong_response_cb: Optional[asyncio.TimerHandle] = None
+ self._loop = loop
+ self._waiting: Optional[asyncio.Future[bool]] = None
+ self._exception: Optional[BaseException] = None
+ self._compress = compress
+ self._client_notakeover = client_notakeover
+
+ self._reset_heartbeat()
+
+ def _cancel_heartbeat(self) -> None:
+ if self._pong_response_cb is not None:
+ self._pong_response_cb.cancel()
+ self._pong_response_cb = None
+
+ if self._heartbeat_cb is not None:
+ self._heartbeat_cb.cancel()
+ self._heartbeat_cb = None
+
+ def _reset_heartbeat(self) -> None:
+ self._cancel_heartbeat()
+
+ if self._heartbeat is not None:
+ self._heartbeat_cb = call_later(
+ self._send_heartbeat, self._heartbeat, self._loop
+ )
+
+ def _send_heartbeat(self) -> None:
+ if self._heartbeat is not None and not self._closed:
+ # fire-and-forget a task is not perfect but maybe ok for
+ # sending ping. Otherwise we need a long-living heartbeat
+ # task in the class.
+ self._loop.create_task(self._writer.ping())
+
+ if self._pong_response_cb is not None:
+ self._pong_response_cb.cancel()
+ self._pong_response_cb = call_later(
+ self._pong_not_received, self._pong_heartbeat, self._loop
+ )
+
+ def _pong_not_received(self) -> None:
+ if not self._closed:
+ self._closed = True
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._exception = asyncio.TimeoutError()
+ self._response.close()
+
+ @property
+ def closed(self) -> bool:
+ return self._closed
+
+ @property
+ def close_code(self) -> Optional[int]:
+ return self._close_code
+
+ @property
+ def protocol(self) -> Optional[str]:
+ return self._protocol
+
+ @property
+ def compress(self) -> int:
+ return self._compress
+
+ @property
+ def client_notakeover(self) -> bool:
+ return self._client_notakeover
+
+ def get_extra_info(self, name: str, default: Any = None) -> Any:
+ """extra info from connection transport"""
+ conn = self._response.connection
+ if conn is None:
+ return default
+ transport = conn.transport
+ if transport is None:
+ return default
+ return transport.get_extra_info(name, default)
+
+ def exception(self) -> Optional[BaseException]:
+ return self._exception
+
+ async def ping(self, message: bytes = b"") -> None:
+ await self._writer.ping(message)
+
+ async def pong(self, message: bytes = b"") -> None:
+ await self._writer.pong(message)
+
+ async def send_str(self, data: str, compress: Optional[int] = None) -> None:
+ if not isinstance(data, str):
+ raise TypeError("data argument must be str (%r)" % type(data))
+ await self._writer.send(data, binary=False, compress=compress)
+
+ async def send_bytes(self, data: bytes, compress: Optional[int] = None) -> None:
+ if not isinstance(data, (bytes, bytearray, memoryview)):
+ raise TypeError("data argument must be byte-ish (%r)" % type(data))
+ await self._writer.send(data, binary=True, compress=compress)
+
+ async def send_json(
+ self,
+ data: Any,
+ compress: Optional[int] = None,
+ *,
+ dumps: JSONEncoder = DEFAULT_JSON_ENCODER,
+ ) -> None:
+ await self.send_str(dumps(data), compress=compress)
+
+ async def close(self, *, code: int = WSCloseCode.OK, message: bytes = b"") -> bool:
+ # we need to break `receive()` cycle first,
+ # `close()` may be called from different task
+ if self._waiting is not None and not self._closed:
+ self._reader.feed_data(WS_CLOSING_MESSAGE, 0)
+ await self._waiting
+
+ if not self._closed:
+ self._cancel_heartbeat()
+ self._closed = True
+ try:
+ await self._writer.close(code, message)
+ except asyncio.CancelledError:
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._response.close()
+ raise
+ except Exception as exc:
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._exception = exc
+ self._response.close()
+ return True
+
+ if self._closing:
+ self._response.close()
+ return True
+
+ while True:
+ try:
+ async with async_timeout.timeout(self._timeout):
+ msg = await self._reader.read()
+ except asyncio.CancelledError:
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._response.close()
+ raise
+ except Exception as exc:
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._exception = exc
+ self._response.close()
+ return True
+
+ if msg.type == WSMsgType.CLOSE:
+ self._close_code = msg.data
+ self._response.close()
+ return True
+ else:
+ return False
+
+ async def receive(self, timeout: Optional[float] = None) -> WSMessage:
+ while True:
+ if self._waiting is not None:
+ raise RuntimeError("Concurrent call to receive() is not allowed")
+
+ if self._closed:
+ return WS_CLOSED_MESSAGE
+ elif self._closing:
+ await self.close()
+ return WS_CLOSED_MESSAGE
+
+ try:
+ self._waiting = self._loop.create_future()
+ try:
+ async with async_timeout.timeout(timeout or self._receive_timeout):
+ msg = await self._reader.read()
+ self._reset_heartbeat()
+ finally:
+ waiter = self._waiting
+ self._waiting = None
+ set_result(waiter, True)
+ except (asyncio.CancelledError, asyncio.TimeoutError):
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ raise
+ except EofStream:
+ self._close_code = WSCloseCode.OK
+ await self.close()
+ return WSMessage(WSMsgType.CLOSED, None, None)
+ except ClientError:
+ self._closed = True
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ return WS_CLOSED_MESSAGE
+ except WebSocketError as exc:
+ self._close_code = exc.code
+ await self.close(code=exc.code)
+ return WSMessage(WSMsgType.ERROR, exc, None)
+ except Exception as exc:
+ self._exception = exc
+ self._closing = True
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ await self.close()
+ return WSMessage(WSMsgType.ERROR, exc, None)
+
+ if msg.type == WSMsgType.CLOSE:
+ self._closing = True
+ self._close_code = msg.data
+ if not self._closed and self._autoclose:
+ await self.close()
+ elif msg.type == WSMsgType.CLOSING:
+ self._closing = True
+ elif msg.type == WSMsgType.PING and self._autoping:
+ await self.pong(msg.data)
+ continue
+ elif msg.type == WSMsgType.PONG and self._autoping:
+ continue
+
+ return msg
+
+ async def receive_str(self, *, timeout: Optional[float] = None) -> str:
+ msg = await self.receive(timeout)
+ if msg.type != WSMsgType.TEXT:
+ raise TypeError(f"Received message {msg.type}:{msg.data!r} is not str")
+ return cast(str, msg.data)
+
+ async def receive_bytes(self, *, timeout: Optional[float] = None) -> bytes:
+ msg = await self.receive(timeout)
+ if msg.type != WSMsgType.BINARY:
+ raise TypeError(f"Received message {msg.type}:{msg.data!r} is not bytes")
+ return cast(bytes, msg.data)
+
+ async def receive_json(
+ self,
+ *,
+ loads: JSONDecoder = DEFAULT_JSON_DECODER,
+ timeout: Optional[float] = None,
+ ) -> Any:
+ data = await self.receive_str(timeout=timeout)
+ return loads(data)
+
+ def __aiter__(self) -> "ClientWebSocketResponse":
+ return self
+
+ async def __anext__(self) -> WSMessage:
+ msg = await self.receive()
+ if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING, WSMsgType.CLOSED):
+ raise StopAsyncIteration
+ return msg
diff --git a/third_party/python/aiohttp/aiohttp/connector.py b/third_party/python/aiohttp/aiohttp/connector.py
new file mode 100644
index 0000000000..2499a2dabe
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/connector.py
@@ -0,0 +1,1456 @@
+import asyncio
+import functools
+import random
+import sys
+import traceback
+import warnings
+from collections import defaultdict, deque
+from contextlib import suppress
+from http.cookies import SimpleCookie
+from itertools import cycle, islice
+from time import monotonic
+from types import TracebackType
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Awaitable,
+ Callable,
+ DefaultDict,
+ Dict,
+ Iterator,
+ List,
+ Optional,
+ Set,
+ Tuple,
+ Type,
+ Union,
+ cast,
+)
+
+import attr
+
+from . import hdrs, helpers
+from .abc import AbstractResolver
+from .client_exceptions import (
+ ClientConnectionError,
+ ClientConnectorCertificateError,
+ ClientConnectorError,
+ ClientConnectorSSLError,
+ ClientHttpProxyError,
+ ClientProxyConnectionError,
+ ServerFingerprintMismatch,
+ UnixClientConnectorError,
+ cert_errors,
+ ssl_errors,
+)
+from .client_proto import ResponseHandler
+from .client_reqrep import ClientRequest, Fingerprint, _merge_ssl_params
+from .helpers import (
+ PY_36,
+ ceil_timeout,
+ get_running_loop,
+ is_ip_address,
+ noop,
+ sentinel,
+)
+from .http import RESPONSES
+from .locks import EventResultOrError
+from .resolver import DefaultResolver
+
+try:
+ import ssl
+
+ SSLContext = ssl.SSLContext
+except ImportError: # pragma: no cover
+ ssl = None # type: ignore[assignment]
+ SSLContext = object # type: ignore[misc,assignment]
+
+
+__all__ = ("BaseConnector", "TCPConnector", "UnixConnector", "NamedPipeConnector")
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from .client import ClientTimeout
+ from .client_reqrep import ConnectionKey
+ from .tracing import Trace
+
+
+class _DeprecationWaiter:
+ __slots__ = ("_awaitable", "_awaited")
+
+ def __init__(self, awaitable: Awaitable[Any]) -> None:
+ self._awaitable = awaitable
+ self._awaited = False
+
+ def __await__(self) -> Any:
+ self._awaited = True
+ return self._awaitable.__await__()
+
+ def __del__(self) -> None:
+ if not self._awaited:
+ warnings.warn(
+ "Connector.close() is a coroutine, "
+ "please use await connector.close()",
+ DeprecationWarning,
+ )
+
+
+class Connection:
+
+ _source_traceback = None
+ _transport = None
+
+ def __init__(
+ self,
+ connector: "BaseConnector",
+ key: "ConnectionKey",
+ protocol: ResponseHandler,
+ loop: asyncio.AbstractEventLoop,
+ ) -> None:
+ self._key = key
+ self._connector = connector
+ self._loop = loop
+ self._protocol: Optional[ResponseHandler] = protocol
+ self._callbacks: List[Callable[[], None]] = []
+
+ if loop.get_debug():
+ self._source_traceback = traceback.extract_stack(sys._getframe(1))
+
+ def __repr__(self) -> str:
+ return f"Connection<{self._key}>"
+
+ def __del__(self, _warnings: Any = warnings) -> None:
+ if self._protocol is not None:
+ if PY_36:
+ kwargs = {"source": self}
+ else:
+ kwargs = {}
+ _warnings.warn(f"Unclosed connection {self!r}", ResourceWarning, **kwargs)
+ if self._loop.is_closed():
+ return
+
+ self._connector._release(self._key, self._protocol, should_close=True)
+
+ context = {"client_connection": self, "message": "Unclosed connection"}
+ if self._source_traceback is not None:
+ context["source_traceback"] = self._source_traceback
+ self._loop.call_exception_handler(context)
+
+ @property
+ def loop(self) -> asyncio.AbstractEventLoop:
+ warnings.warn(
+ "connector.loop property is deprecated", DeprecationWarning, stacklevel=2
+ )
+ return self._loop
+
+ @property
+ def transport(self) -> Optional[asyncio.Transport]:
+ if self._protocol is None:
+ return None
+ return self._protocol.transport
+
+ @property
+ def protocol(self) -> Optional[ResponseHandler]:
+ return self._protocol
+
+ def add_callback(self, callback: Callable[[], None]) -> None:
+ if callback is not None:
+ self._callbacks.append(callback)
+
+ def _notify_release(self) -> None:
+ callbacks, self._callbacks = self._callbacks[:], []
+
+ for cb in callbacks:
+ with suppress(Exception):
+ cb()
+
+ def close(self) -> None:
+ self._notify_release()
+
+ if self._protocol is not None:
+ self._connector._release(self._key, self._protocol, should_close=True)
+ self._protocol = None
+
+ def release(self) -> None:
+ self._notify_release()
+
+ if self._protocol is not None:
+ self._connector._release(
+ self._key, self._protocol, should_close=self._protocol.should_close
+ )
+ self._protocol = None
+
+ @property
+ def closed(self) -> bool:
+ return self._protocol is None or not self._protocol.is_connected()
+
+
+class _TransportPlaceholder:
+ """placeholder for BaseConnector.connect function"""
+
+ def close(self) -> None:
+ pass
+
+
+class BaseConnector:
+ """Base connector class.
+
+ keepalive_timeout - (optional) Keep-alive timeout.
+ force_close - Set to True to force close and do reconnect
+ after each request (and between redirects).
+ limit - The total number of simultaneous connections.
+ limit_per_host - Number of simultaneous connections to one host.
+ enable_cleanup_closed - Enables clean-up closed ssl transports.
+ Disabled by default.
+ loop - Optional event loop.
+ """
+
+ _closed = True # prevent AttributeError in __del__ if ctor was failed
+ _source_traceback = None
+
+ # abort transport after 2 seconds (cleanup broken connections)
+ _cleanup_closed_period = 2.0
+
+ def __init__(
+ self,
+ *,
+ keepalive_timeout: Union[object, None, float] = sentinel,
+ force_close: bool = False,
+ limit: int = 100,
+ limit_per_host: int = 0,
+ enable_cleanup_closed: bool = False,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ ) -> None:
+
+ if force_close:
+ if keepalive_timeout is not None and keepalive_timeout is not sentinel:
+ raise ValueError(
+ "keepalive_timeout cannot " "be set if force_close is True"
+ )
+ else:
+ if keepalive_timeout is sentinel:
+ keepalive_timeout = 15.0
+
+ loop = get_running_loop(loop)
+
+ self._closed = False
+ if loop.get_debug():
+ self._source_traceback = traceback.extract_stack(sys._getframe(1))
+
+ self._conns: Dict[ConnectionKey, List[Tuple[ResponseHandler, float]]] = {}
+ self._limit = limit
+ self._limit_per_host = limit_per_host
+ self._acquired: Set[ResponseHandler] = set()
+ self._acquired_per_host: DefaultDict[
+ ConnectionKey, Set[ResponseHandler]
+ ] = defaultdict(set)
+ self._keepalive_timeout = cast(float, keepalive_timeout)
+ self._force_close = force_close
+
+ # {host_key: FIFO list of waiters}
+ self._waiters = defaultdict(deque) # type: ignore[var-annotated]
+
+ self._loop = loop
+ self._factory = functools.partial(ResponseHandler, loop=loop)
+
+ self.cookies: SimpleCookie[str] = SimpleCookie()
+
+ # start keep-alive connection cleanup task
+ self._cleanup_handle: Optional[asyncio.TimerHandle] = None
+
+ # start cleanup closed transports task
+ self._cleanup_closed_handle: Optional[asyncio.TimerHandle] = None
+ self._cleanup_closed_disabled = not enable_cleanup_closed
+ self._cleanup_closed_transports: List[Optional[asyncio.Transport]] = []
+ self._cleanup_closed()
+
+ def __del__(self, _warnings: Any = warnings) -> None:
+ if self._closed:
+ return
+ if not self._conns:
+ return
+
+ conns = [repr(c) for c in self._conns.values()]
+
+ self._close()
+
+ if PY_36:
+ kwargs = {"source": self}
+ else:
+ kwargs = {}
+ _warnings.warn(f"Unclosed connector {self!r}", ResourceWarning, **kwargs)
+ context = {
+ "connector": self,
+ "connections": conns,
+ "message": "Unclosed connector",
+ }
+ if self._source_traceback is not None:
+ context["source_traceback"] = self._source_traceback
+ self._loop.call_exception_handler(context)
+
+ def __enter__(self) -> "BaseConnector":
+ warnings.warn(
+ '"with Connector():" is deprecated, '
+ 'use "async with Connector():" instead',
+ DeprecationWarning,
+ )
+ return self
+
+ def __exit__(self, *exc: Any) -> None:
+ self._close()
+
+ async def __aenter__(self) -> "BaseConnector":
+ return self
+
+ async def __aexit__(
+ self,
+ exc_type: Optional[Type[BaseException]] = None,
+ exc_value: Optional[BaseException] = None,
+ exc_traceback: Optional[TracebackType] = None,
+ ) -> None:
+ await self.close()
+
+ @property
+ def force_close(self) -> bool:
+ """Ultimately close connection on releasing if True."""
+ return self._force_close
+
+ @property
+ def limit(self) -> int:
+ """The total number for simultaneous connections.
+
+ If limit is 0 the connector has no limit.
+ The default limit size is 100.
+ """
+ return self._limit
+
+ @property
+ def limit_per_host(self) -> int:
+ """The limit for simultaneous connections to the same endpoint.
+
+ Endpoints are the same if they are have equal
+ (host, port, is_ssl) triple.
+ """
+ return self._limit_per_host
+
+ def _cleanup(self) -> None:
+ """Cleanup unused transports."""
+ if self._cleanup_handle:
+ self._cleanup_handle.cancel()
+ # _cleanup_handle should be unset, otherwise _release() will not
+ # recreate it ever!
+ self._cleanup_handle = None
+
+ now = self._loop.time()
+ timeout = self._keepalive_timeout
+
+ if self._conns:
+ connections = {}
+ deadline = now - timeout
+ for key, conns in self._conns.items():
+ alive = []
+ for proto, use_time in conns:
+ if proto.is_connected():
+ if use_time - deadline < 0:
+ transport = proto.transport
+ proto.close()
+ if key.is_ssl and not self._cleanup_closed_disabled:
+ self._cleanup_closed_transports.append(transport)
+ else:
+ alive.append((proto, use_time))
+ else:
+ transport = proto.transport
+ proto.close()
+ if key.is_ssl and not self._cleanup_closed_disabled:
+ self._cleanup_closed_transports.append(transport)
+
+ if alive:
+ connections[key] = alive
+
+ self._conns = connections
+
+ if self._conns:
+ self._cleanup_handle = helpers.weakref_handle(
+ self, "_cleanup", timeout, self._loop
+ )
+
+ def _drop_acquired_per_host(
+ self, key: "ConnectionKey", val: ResponseHandler
+ ) -> None:
+ acquired_per_host = self._acquired_per_host
+ if key not in acquired_per_host:
+ return
+ conns = acquired_per_host[key]
+ conns.remove(val)
+ if not conns:
+ del self._acquired_per_host[key]
+
+ def _cleanup_closed(self) -> None:
+ """Double confirmation for transport close.
+
+ Some broken ssl servers may leave socket open without proper close.
+ """
+ if self._cleanup_closed_handle:
+ self._cleanup_closed_handle.cancel()
+
+ for transport in self._cleanup_closed_transports:
+ if transport is not None:
+ transport.abort()
+
+ self._cleanup_closed_transports = []
+
+ if not self._cleanup_closed_disabled:
+ self._cleanup_closed_handle = helpers.weakref_handle(
+ self, "_cleanup_closed", self._cleanup_closed_period, self._loop
+ )
+
+ def close(self) -> Awaitable[None]:
+ """Close all opened transports."""
+ self._close()
+ return _DeprecationWaiter(noop())
+
+ def _close(self) -> None:
+ if self._closed:
+ return
+
+ self._closed = True
+
+ try:
+ if self._loop.is_closed():
+ return
+
+ # cancel cleanup task
+ if self._cleanup_handle:
+ self._cleanup_handle.cancel()
+
+ # cancel cleanup close task
+ if self._cleanup_closed_handle:
+ self._cleanup_closed_handle.cancel()
+
+ for data in self._conns.values():
+ for proto, t0 in data:
+ proto.close()
+
+ for proto in self._acquired:
+ proto.close()
+
+ for transport in self._cleanup_closed_transports:
+ if transport is not None:
+ transport.abort()
+
+ finally:
+ self._conns.clear()
+ self._acquired.clear()
+ self._waiters.clear()
+ self._cleanup_handle = None
+ self._cleanup_closed_transports.clear()
+ self._cleanup_closed_handle = None
+
+ @property
+ def closed(self) -> bool:
+ """Is connector closed.
+
+ A readonly property.
+ """
+ return self._closed
+
+ def _available_connections(self, key: "ConnectionKey") -> int:
+ """
+ Return number of available connections.
+
+ The limit, limit_per_host and the connection key are taken into account.
+
+ If it returns less than 1 means that there are no connections
+ available.
+ """
+ if self._limit:
+ # total calc available connections
+ available = self._limit - len(self._acquired)
+
+ # check limit per host
+ if (
+ self._limit_per_host
+ and available > 0
+ and key in self._acquired_per_host
+ ):
+ acquired = self._acquired_per_host.get(key)
+ assert acquired is not None
+ available = self._limit_per_host - len(acquired)
+
+ elif self._limit_per_host and key in self._acquired_per_host:
+ # check limit per host
+ acquired = self._acquired_per_host.get(key)
+ assert acquired is not None
+ available = self._limit_per_host - len(acquired)
+ else:
+ available = 1
+
+ return available
+
+ async def connect(
+ self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout"
+ ) -> Connection:
+ """Get from pool or create new connection."""
+ key = req.connection_key
+ available = self._available_connections(key)
+
+ # Wait if there are no available connections or if there are/were
+ # waiters (i.e. don't steal connection from a waiter about to wake up)
+ if available <= 0 or key in self._waiters:
+ fut = self._loop.create_future()
+
+ # This connection will now count towards the limit.
+ self._waiters[key].append(fut)
+
+ if traces:
+ for trace in traces:
+ await trace.send_connection_queued_start()
+
+ try:
+ await fut
+ except BaseException as e:
+ if key in self._waiters:
+ # remove a waiter even if it was cancelled, normally it's
+ # removed when it's notified
+ try:
+ self._waiters[key].remove(fut)
+ except ValueError: # fut may no longer be in list
+ pass
+
+ raise e
+ finally:
+ if key in self._waiters and not self._waiters[key]:
+ del self._waiters[key]
+
+ if traces:
+ for trace in traces:
+ await trace.send_connection_queued_end()
+
+ proto = self._get(key)
+ if proto is None:
+ placeholder = cast(ResponseHandler, _TransportPlaceholder())
+ self._acquired.add(placeholder)
+ self._acquired_per_host[key].add(placeholder)
+
+ if traces:
+ for trace in traces:
+ await trace.send_connection_create_start()
+
+ try:
+ proto = await self._create_connection(req, traces, timeout)
+ if self._closed:
+ proto.close()
+ raise ClientConnectionError("Connector is closed.")
+ except BaseException:
+ if not self._closed:
+ self._acquired.remove(placeholder)
+ self._drop_acquired_per_host(key, placeholder)
+ self._release_waiter()
+ raise
+ else:
+ if not self._closed:
+ self._acquired.remove(placeholder)
+ self._drop_acquired_per_host(key, placeholder)
+
+ if traces:
+ for trace in traces:
+ await trace.send_connection_create_end()
+ else:
+ if traces:
+ # Acquire the connection to prevent race conditions with limits
+ placeholder = cast(ResponseHandler, _TransportPlaceholder())
+ self._acquired.add(placeholder)
+ self._acquired_per_host[key].add(placeholder)
+ for trace in traces:
+ await trace.send_connection_reuseconn()
+ self._acquired.remove(placeholder)
+ self._drop_acquired_per_host(key, placeholder)
+
+ self._acquired.add(proto)
+ self._acquired_per_host[key].add(proto)
+ return Connection(self, key, proto, self._loop)
+
+ def _get(self, key: "ConnectionKey") -> Optional[ResponseHandler]:
+ try:
+ conns = self._conns[key]
+ except KeyError:
+ return None
+
+ t1 = self._loop.time()
+ while conns:
+ proto, t0 = conns.pop()
+ if proto.is_connected():
+ if t1 - t0 > self._keepalive_timeout:
+ transport = proto.transport
+ proto.close()
+ # only for SSL transports
+ if key.is_ssl and not self._cleanup_closed_disabled:
+ self._cleanup_closed_transports.append(transport)
+ else:
+ if not conns:
+ # The very last connection was reclaimed: drop the key
+ del self._conns[key]
+ return proto
+ else:
+ transport = proto.transport
+ proto.close()
+ if key.is_ssl and not self._cleanup_closed_disabled:
+ self._cleanup_closed_transports.append(transport)
+
+ # No more connections: drop the key
+ del self._conns[key]
+ return None
+
+ def _release_waiter(self) -> None:
+ """
+ Iterates over all waiters until one to be released is found.
+
+ The one to be released is not finsihed and
+ belongs to a host that has available connections.
+ """
+ if not self._waiters:
+ return
+
+ # Having the dict keys ordered this avoids to iterate
+ # at the same order at each call.
+ queues = list(self._waiters.keys())
+ random.shuffle(queues)
+
+ for key in queues:
+ if self._available_connections(key) < 1:
+ continue
+
+ waiters = self._waiters[key]
+ while waiters:
+ waiter = waiters.popleft()
+ if not waiter.done():
+ waiter.set_result(None)
+ return
+
+ def _release_acquired(self, key: "ConnectionKey", proto: ResponseHandler) -> None:
+ if self._closed:
+ # acquired connection is already released on connector closing
+ return
+
+ try:
+ self._acquired.remove(proto)
+ self._drop_acquired_per_host(key, proto)
+ except KeyError: # pragma: no cover
+ # this may be result of undetermenistic order of objects
+ # finalization due garbage collection.
+ pass
+ else:
+ self._release_waiter()
+
+ def _release(
+ self,
+ key: "ConnectionKey",
+ protocol: ResponseHandler,
+ *,
+ should_close: bool = False,
+ ) -> None:
+ if self._closed:
+ # acquired connection is already released on connector closing
+ return
+
+ self._release_acquired(key, protocol)
+
+ if self._force_close:
+ should_close = True
+
+ if should_close or protocol.should_close:
+ transport = protocol.transport
+ protocol.close()
+
+ if key.is_ssl and not self._cleanup_closed_disabled:
+ self._cleanup_closed_transports.append(transport)
+ else:
+ conns = self._conns.get(key)
+ if conns is None:
+ conns = self._conns[key] = []
+ conns.append((protocol, self._loop.time()))
+
+ if self._cleanup_handle is None:
+ self._cleanup_handle = helpers.weakref_handle(
+ self, "_cleanup", self._keepalive_timeout, self._loop
+ )
+
+ async def _create_connection(
+ self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout"
+ ) -> ResponseHandler:
+ raise NotImplementedError()
+
+
+class _DNSCacheTable:
+ def __init__(self, ttl: Optional[float] = None) -> None:
+ self._addrs_rr: Dict[Tuple[str, int], Tuple[Iterator[Dict[str, Any]], int]] = {}
+ self._timestamps: Dict[Tuple[str, int], float] = {}
+ self._ttl = ttl
+
+ def __contains__(self, host: object) -> bool:
+ return host in self._addrs_rr
+
+ def add(self, key: Tuple[str, int], addrs: List[Dict[str, Any]]) -> None:
+ self._addrs_rr[key] = (cycle(addrs), len(addrs))
+
+ if self._ttl:
+ self._timestamps[key] = monotonic()
+
+ def remove(self, key: Tuple[str, int]) -> None:
+ self._addrs_rr.pop(key, None)
+
+ if self._ttl:
+ self._timestamps.pop(key, None)
+
+ def clear(self) -> None:
+ self._addrs_rr.clear()
+ self._timestamps.clear()
+
+ def next_addrs(self, key: Tuple[str, int]) -> List[Dict[str, Any]]:
+ loop, length = self._addrs_rr[key]
+ addrs = list(islice(loop, length))
+ # Consume one more element to shift internal state of `cycle`
+ next(loop)
+ return addrs
+
+ def expired(self, key: Tuple[str, int]) -> bool:
+ if self._ttl is None:
+ return False
+
+ return self._timestamps[key] + self._ttl < monotonic()
+
+
+class TCPConnector(BaseConnector):
+ """TCP connector.
+
+ verify_ssl - Set to True to check ssl certifications.
+ fingerprint - Pass the binary sha256
+ digest of the expected certificate in DER format to verify
+ that the certificate the server presents matches. See also
+ https://en.wikipedia.org/wiki/Transport_Layer_Security#Certificate_pinning
+ resolver - Enable DNS lookups and use this
+ resolver
+ use_dns_cache - Use memory cache for DNS lookups.
+ ttl_dns_cache - Max seconds having cached a DNS entry, None forever.
+ family - socket address family
+ local_addr - local tuple of (host, port) to bind socket to
+
+ keepalive_timeout - (optional) Keep-alive timeout.
+ force_close - Set to True to force close and do reconnect
+ after each request (and between redirects).
+ limit - The total number of simultaneous connections.
+ limit_per_host - Number of simultaneous connections to one host.
+ enable_cleanup_closed - Enables clean-up closed ssl transports.
+ Disabled by default.
+ loop - Optional event loop.
+ """
+
+ def __init__(
+ self,
+ *,
+ verify_ssl: bool = True,
+ fingerprint: Optional[bytes] = None,
+ use_dns_cache: bool = True,
+ ttl_dns_cache: Optional[int] = 10,
+ family: int = 0,
+ ssl_context: Optional[SSLContext] = None,
+ ssl: Union[None, bool, Fingerprint, SSLContext] = None,
+ local_addr: Optional[Tuple[str, int]] = None,
+ resolver: Optional[AbstractResolver] = None,
+ keepalive_timeout: Union[None, float, object] = sentinel,
+ force_close: bool = False,
+ limit: int = 100,
+ limit_per_host: int = 0,
+ enable_cleanup_closed: bool = False,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ ):
+ super().__init__(
+ keepalive_timeout=keepalive_timeout,
+ force_close=force_close,
+ limit=limit,
+ limit_per_host=limit_per_host,
+ enable_cleanup_closed=enable_cleanup_closed,
+ loop=loop,
+ )
+
+ self._ssl = _merge_ssl_params(ssl, verify_ssl, ssl_context, fingerprint)
+ if resolver is None:
+ resolver = DefaultResolver(loop=self._loop)
+ self._resolver = resolver
+
+ self._use_dns_cache = use_dns_cache
+ self._cached_hosts = _DNSCacheTable(ttl=ttl_dns_cache)
+ self._throttle_dns_events: Dict[Tuple[str, int], EventResultOrError] = {}
+ self._family = family
+ self._local_addr = local_addr
+
+ def close(self) -> Awaitable[None]:
+ """Close all ongoing DNS calls."""
+ for ev in self._throttle_dns_events.values():
+ ev.cancel()
+
+ return super().close()
+
+ @property
+ def family(self) -> int:
+ """Socket family like AF_INET."""
+ return self._family
+
+ @property
+ def use_dns_cache(self) -> bool:
+ """True if local DNS caching is enabled."""
+ return self._use_dns_cache
+
+ def clear_dns_cache(
+ self, host: Optional[str] = None, port: Optional[int] = None
+ ) -> None:
+ """Remove specified host/port or clear all dns local cache."""
+ if host is not None and port is not None:
+ self._cached_hosts.remove((host, port))
+ elif host is not None or port is not None:
+ raise ValueError("either both host and port " "or none of them are allowed")
+ else:
+ self._cached_hosts.clear()
+
+ async def _resolve_host(
+ self, host: str, port: int, traces: Optional[List["Trace"]] = None
+ ) -> List[Dict[str, Any]]:
+ if is_ip_address(host):
+ return [
+ {
+ "hostname": host,
+ "host": host,
+ "port": port,
+ "family": self._family,
+ "proto": 0,
+ "flags": 0,
+ }
+ ]
+
+ if not self._use_dns_cache:
+
+ if traces:
+ for trace in traces:
+ await trace.send_dns_resolvehost_start(host)
+
+ res = await self._resolver.resolve(host, port, family=self._family)
+
+ if traces:
+ for trace in traces:
+ await trace.send_dns_resolvehost_end(host)
+
+ return res
+
+ key = (host, port)
+
+ if (key in self._cached_hosts) and (not self._cached_hosts.expired(key)):
+ # get result early, before any await (#4014)
+ result = self._cached_hosts.next_addrs(key)
+
+ if traces:
+ for trace in traces:
+ await trace.send_dns_cache_hit(host)
+ return result
+
+ if key in self._throttle_dns_events:
+ # get event early, before any await (#4014)
+ event = self._throttle_dns_events[key]
+ if traces:
+ for trace in traces:
+ await trace.send_dns_cache_hit(host)
+ await event.wait()
+ else:
+ # update dict early, before any await (#4014)
+ self._throttle_dns_events[key] = EventResultOrError(self._loop)
+ if traces:
+ for trace in traces:
+ await trace.send_dns_cache_miss(host)
+ try:
+
+ if traces:
+ for trace in traces:
+ await trace.send_dns_resolvehost_start(host)
+
+ addrs = await self._resolver.resolve(host, port, family=self._family)
+ if traces:
+ for trace in traces:
+ await trace.send_dns_resolvehost_end(host)
+
+ self._cached_hosts.add(key, addrs)
+ self._throttle_dns_events[key].set()
+ except BaseException as e:
+ # any DNS exception, independently of the implementation
+ # is set for the waiters to raise the same exception.
+ self._throttle_dns_events[key].set(exc=e)
+ raise
+ finally:
+ self._throttle_dns_events.pop(key)
+
+ return self._cached_hosts.next_addrs(key)
+
+ async def _create_connection(
+ self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout"
+ ) -> ResponseHandler:
+ """Create connection.
+
+ Has same keyword arguments as BaseEventLoop.create_connection.
+ """
+ if req.proxy:
+ _, proto = await self._create_proxy_connection(req, traces, timeout)
+ else:
+ _, proto = await self._create_direct_connection(req, traces, timeout)
+
+ return proto
+
+ @staticmethod
+ @functools.lru_cache(None)
+ def _make_ssl_context(verified: bool) -> SSLContext:
+ if verified:
+ return ssl.create_default_context()
+ else:
+ sslcontext = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
+ sslcontext.options |= ssl.OP_NO_SSLv2
+ sslcontext.options |= ssl.OP_NO_SSLv3
+ sslcontext.check_hostname = False
+ sslcontext.verify_mode = ssl.CERT_NONE
+ try:
+ sslcontext.options |= ssl.OP_NO_COMPRESSION
+ except AttributeError as attr_err:
+ warnings.warn(
+ "{!s}: The Python interpreter is compiled "
+ "against OpenSSL < 1.0.0. Ref: "
+ "https://docs.python.org/3/library/ssl.html"
+ "#ssl.OP_NO_COMPRESSION".format(attr_err),
+ )
+ sslcontext.set_default_verify_paths()
+ return sslcontext
+
+ def _get_ssl_context(self, req: "ClientRequest") -> Optional[SSLContext]:
+ """Logic to get the correct SSL context
+
+ 0. if req.ssl is false, return None
+
+ 1. if ssl_context is specified in req, use it
+ 2. if _ssl_context is specified in self, use it
+ 3. otherwise:
+ 1. if verify_ssl is not specified in req, use self.ssl_context
+ (will generate a default context according to self.verify_ssl)
+ 2. if verify_ssl is True in req, generate a default SSL context
+ 3. if verify_ssl is False in req, generate a SSL context that
+ won't verify
+ """
+ if req.is_ssl():
+ if ssl is None: # pragma: no cover
+ raise RuntimeError("SSL is not supported.")
+ sslcontext = req.ssl
+ if isinstance(sslcontext, ssl.SSLContext):
+ return sslcontext
+ if sslcontext is not None:
+ # not verified or fingerprinted
+ return self._make_ssl_context(False)
+ sslcontext = self._ssl
+ if isinstance(sslcontext, ssl.SSLContext):
+ return sslcontext
+ if sslcontext is not None:
+ # not verified or fingerprinted
+ return self._make_ssl_context(False)
+ return self._make_ssl_context(True)
+ else:
+ return None
+
+ def _get_fingerprint(self, req: "ClientRequest") -> Optional["Fingerprint"]:
+ ret = req.ssl
+ if isinstance(ret, Fingerprint):
+ return ret
+ ret = self._ssl
+ if isinstance(ret, Fingerprint):
+ return ret
+ return None
+
+ async def _wrap_create_connection(
+ self,
+ *args: Any,
+ req: "ClientRequest",
+ timeout: "ClientTimeout",
+ client_error: Type[Exception] = ClientConnectorError,
+ **kwargs: Any,
+ ) -> Tuple[asyncio.Transport, ResponseHandler]:
+ try:
+ async with ceil_timeout(timeout.sock_connect):
+ return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa
+ except cert_errors as exc:
+ raise ClientConnectorCertificateError(req.connection_key, exc) from exc
+ except ssl_errors as exc:
+ raise ClientConnectorSSLError(req.connection_key, exc) from exc
+ except OSError as exc:
+ if exc.errno is None and isinstance(exc, asyncio.TimeoutError):
+ raise
+ raise client_error(req.connection_key, exc) from exc
+
+ def _fail_on_no_start_tls(self, req: "ClientRequest") -> None:
+ """Raise a :py:exc:`RuntimeError` on missing ``start_tls()``.
+
+ One case is that :py:meth:`asyncio.loop.start_tls` is not yet
+ implemented under Python 3.6. It is necessary for TLS-in-TLS so
+ that it is possible to send HTTPS queries through HTTPS proxies.
+
+ This doesn't affect regular HTTP requests, though.
+ """
+ if not req.is_ssl():
+ return
+
+ proxy_url = req.proxy
+ assert proxy_url is not None
+ if proxy_url.scheme != "https":
+ return
+
+ self._check_loop_for_start_tls()
+
+ def _check_loop_for_start_tls(self) -> None:
+ try:
+ self._loop.start_tls
+ except AttributeError as attr_exc:
+ raise RuntimeError(
+ "An HTTPS request is being sent through an HTTPS proxy. "
+ "This needs support for TLS in TLS but it is not implemented "
+ "in your runtime for the stdlib asyncio.\n\n"
+ "Please upgrade to Python 3.7 or higher. For more details, "
+ "please see:\n"
+ "* https://bugs.python.org/issue37179\n"
+ "* https://github.com/python/cpython/pull/28073\n"
+ "* https://docs.aiohttp.org/en/stable/"
+ "client_advanced.html#proxy-support\n"
+ "* https://github.com/aio-libs/aiohttp/discussions/6044\n",
+ ) from attr_exc
+
+ def _loop_supports_start_tls(self) -> bool:
+ try:
+ self._check_loop_for_start_tls()
+ except RuntimeError:
+ return False
+ else:
+ return True
+
+ def _warn_about_tls_in_tls(
+ self,
+ underlying_transport: asyncio.Transport,
+ req: "ClientRequest",
+ ) -> None:
+ """Issue a warning if the requested URL has HTTPS scheme."""
+ if req.request_info.url.scheme != "https":
+ return
+
+ asyncio_supports_tls_in_tls = getattr(
+ underlying_transport,
+ "_start_tls_compatible",
+ False,
+ )
+
+ if asyncio_supports_tls_in_tls:
+ return
+
+ warnings.warn(
+ "An HTTPS request is being sent through an HTTPS proxy. "
+ "This support for TLS in TLS is known to be disabled "
+ "in the stdlib asyncio. This is why you'll probably see "
+ "an error in the log below.\n\n"
+ "It is possible to enable it via monkeypatching under "
+ "Python 3.7 or higher. For more details, see:\n"
+ "* https://bugs.python.org/issue37179\n"
+ "* https://github.com/python/cpython/pull/28073\n\n"
+ "You can temporarily patch this as follows:\n"
+ "* https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support\n"
+ "* https://github.com/aio-libs/aiohttp/discussions/6044\n",
+ RuntimeWarning,
+ source=self,
+ # Why `4`? At least 3 of the calls in the stack originate
+ # from the methods in this class.
+ stacklevel=3,
+ )
+
+ async def _start_tls_connection(
+ self,
+ underlying_transport: asyncio.Transport,
+ req: "ClientRequest",
+ timeout: "ClientTimeout",
+ client_error: Type[Exception] = ClientConnectorError,
+ ) -> Tuple[asyncio.BaseTransport, ResponseHandler]:
+ """Wrap the raw TCP transport with TLS."""
+ tls_proto = self._factory() # Create a brand new proto for TLS
+
+ # Safety of the `cast()` call here is based on the fact that
+ # internally `_get_ssl_context()` only returns `None` when
+ # `req.is_ssl()` evaluates to `False` which is never gonna happen
+ # in this code path. Of course, it's rather fragile
+ # maintainability-wise but this is to be solved separately.
+ sslcontext = cast(ssl.SSLContext, self._get_ssl_context(req))
+
+ try:
+ async with ceil_timeout(timeout.sock_connect):
+ try:
+ tls_transport = await self._loop.start_tls(
+ underlying_transport,
+ tls_proto,
+ sslcontext,
+ server_hostname=req.host,
+ ssl_handshake_timeout=timeout.total,
+ )
+ except BaseException:
+ # We need to close the underlying transport since
+ # `start_tls()` probably failed before it had a
+ # chance to do this:
+ underlying_transport.close()
+ raise
+ except cert_errors as exc:
+ raise ClientConnectorCertificateError(req.connection_key, exc) from exc
+ except ssl_errors as exc:
+ raise ClientConnectorSSLError(req.connection_key, exc) from exc
+ except OSError as exc:
+ if exc.errno is None and isinstance(exc, asyncio.TimeoutError):
+ raise
+ raise client_error(req.connection_key, exc) from exc
+ except TypeError as type_err:
+ # Example cause looks like this:
+ # TypeError: transport <asyncio.sslproto._SSLProtocolTransport
+ # object at 0x7f760615e460> is not supported by start_tls()
+
+ raise ClientConnectionError(
+ "Cannot initialize a TLS-in-TLS connection to host "
+ f"{req.host!s}:{req.port:d} through an underlying connection "
+ f"to an HTTPS proxy {req.proxy!s} ssl:{req.ssl or 'default'} "
+ f"[{type_err!s}]"
+ ) from type_err
+ else:
+ if tls_transport is None:
+ msg = "Failed to start TLS (possibly caused by closing transport)"
+ raise client_error(req.connection_key, OSError(msg))
+ tls_proto.connection_made(
+ tls_transport
+ ) # Kick the state machine of the new TLS protocol
+
+ return tls_transport, tls_proto
+
+ async def _create_direct_connection(
+ self,
+ req: "ClientRequest",
+ traces: List["Trace"],
+ timeout: "ClientTimeout",
+ *,
+ client_error: Type[Exception] = ClientConnectorError,
+ ) -> Tuple[asyncio.Transport, ResponseHandler]:
+ sslcontext = self._get_ssl_context(req)
+ fingerprint = self._get_fingerprint(req)
+
+ host = req.url.raw_host
+ assert host is not None
+ port = req.port
+ assert port is not None
+ host_resolved = asyncio.ensure_future(
+ self._resolve_host(host, port, traces=traces), loop=self._loop
+ )
+ try:
+ # Cancelling this lookup should not cancel the underlying lookup
+ # or else the cancel event will get broadcast to all the waiters
+ # across all connections.
+ hosts = await asyncio.shield(host_resolved)
+ except asyncio.CancelledError:
+
+ def drop_exception(fut: "asyncio.Future[List[Dict[str, Any]]]") -> None:
+ with suppress(Exception, asyncio.CancelledError):
+ fut.result()
+
+ host_resolved.add_done_callback(drop_exception)
+ raise
+ except OSError as exc:
+ if exc.errno is None and isinstance(exc, asyncio.TimeoutError):
+ raise
+ # in case of proxy it is not ClientProxyConnectionError
+ # it is problem of resolving proxy ip itself
+ raise ClientConnectorError(req.connection_key, exc) from exc
+
+ last_exc: Optional[Exception] = None
+
+ for hinfo in hosts:
+ host = hinfo["host"]
+ port = hinfo["port"]
+
+ try:
+ transp, proto = await self._wrap_create_connection(
+ self._factory,
+ host,
+ port,
+ timeout=timeout,
+ ssl=sslcontext,
+ family=hinfo["family"],
+ proto=hinfo["proto"],
+ flags=hinfo["flags"],
+ server_hostname=hinfo["hostname"] if sslcontext else None,
+ local_addr=self._local_addr,
+ req=req,
+ client_error=client_error,
+ )
+ except ClientConnectorError as exc:
+ last_exc = exc
+ continue
+
+ if req.is_ssl() and fingerprint:
+ try:
+ fingerprint.check(transp)
+ except ServerFingerprintMismatch as exc:
+ transp.close()
+ if not self._cleanup_closed_disabled:
+ self._cleanup_closed_transports.append(transp)
+ last_exc = exc
+ continue
+
+ return transp, proto
+ else:
+ assert last_exc is not None
+ raise last_exc
+
+ async def _create_proxy_connection(
+ self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout"
+ ) -> Tuple[asyncio.BaseTransport, ResponseHandler]:
+ self._fail_on_no_start_tls(req)
+ runtime_has_start_tls = self._loop_supports_start_tls()
+
+ headers: Dict[str, str] = {}
+ if req.proxy_headers is not None:
+ headers = req.proxy_headers # type: ignore[assignment]
+ headers[hdrs.HOST] = req.headers[hdrs.HOST]
+
+ url = req.proxy
+ assert url is not None
+ proxy_req = ClientRequest(
+ hdrs.METH_GET,
+ url,
+ headers=headers,
+ auth=req.proxy_auth,
+ loop=self._loop,
+ ssl=req.ssl,
+ )
+
+ # create connection to proxy server
+ transport, proto = await self._create_direct_connection(
+ proxy_req, [], timeout, client_error=ClientProxyConnectionError
+ )
+
+ # Many HTTP proxies has buggy keepalive support. Let's not
+ # reuse connection but close it after processing every
+ # response.
+ proto.force_close()
+
+ auth = proxy_req.headers.pop(hdrs.AUTHORIZATION, None)
+ if auth is not None:
+ if not req.is_ssl():
+ req.headers[hdrs.PROXY_AUTHORIZATION] = auth
+ else:
+ proxy_req.headers[hdrs.PROXY_AUTHORIZATION] = auth
+
+ if req.is_ssl():
+ if runtime_has_start_tls:
+ self._warn_about_tls_in_tls(transport, req)
+
+ # For HTTPS requests over HTTP proxy
+ # we must notify proxy to tunnel connection
+ # so we send CONNECT command:
+ # CONNECT www.python.org:443 HTTP/1.1
+ # Host: www.python.org
+ #
+ # next we must do TLS handshake and so on
+ # to do this we must wrap raw socket into secure one
+ # asyncio handles this perfectly
+ proxy_req.method = hdrs.METH_CONNECT
+ proxy_req.url = req.url
+ key = attr.evolve(
+ req.connection_key, proxy=None, proxy_auth=None, proxy_headers_hash=None
+ )
+ conn = Connection(self, key, proto, self._loop)
+ proxy_resp = await proxy_req.send(conn)
+ try:
+ protocol = conn._protocol
+ assert protocol is not None
+
+ # read_until_eof=True will ensure the connection isn't closed
+ # once the response is received and processed allowing
+ # START_TLS to work on the connection below.
+ protocol.set_response_params(read_until_eof=runtime_has_start_tls)
+ resp = await proxy_resp.start(conn)
+ except BaseException:
+ proxy_resp.close()
+ conn.close()
+ raise
+ else:
+ conn._protocol = None
+ conn._transport = None
+ try:
+ if resp.status != 200:
+ message = resp.reason
+ if message is None:
+ message = RESPONSES[resp.status][0]
+ raise ClientHttpProxyError(
+ proxy_resp.request_info,
+ resp.history,
+ status=resp.status,
+ message=message,
+ headers=resp.headers,
+ )
+ if not runtime_has_start_tls:
+ rawsock = transport.get_extra_info("socket", default=None)
+ if rawsock is None:
+ raise RuntimeError(
+ "Transport does not expose socket instance"
+ )
+ # Duplicate the socket, so now we can close proxy transport
+ rawsock = rawsock.dup()
+ except BaseException:
+ # It shouldn't be closed in `finally` because it's fed to
+ # `loop.start_tls()` and the docs say not to touch it after
+ # passing there.
+ transport.close()
+ raise
+ finally:
+ if not runtime_has_start_tls:
+ transport.close()
+
+ if not runtime_has_start_tls:
+ # HTTP proxy with support for upgrade to HTTPS
+ sslcontext = self._get_ssl_context(req)
+ return await self._wrap_create_connection(
+ self._factory,
+ timeout=timeout,
+ ssl=sslcontext,
+ sock=rawsock,
+ server_hostname=req.host,
+ req=req,
+ )
+
+ return await self._start_tls_connection(
+ # Access the old transport for the last time before it's
+ # closed and forgotten forever:
+ transport,
+ req=req,
+ timeout=timeout,
+ )
+ finally:
+ proxy_resp.close()
+
+ return transport, proto
+
+
+class UnixConnector(BaseConnector):
+ """Unix socket connector.
+
+ path - Unix socket path.
+ keepalive_timeout - (optional) Keep-alive timeout.
+ force_close - Set to True to force close and do reconnect
+ after each request (and between redirects).
+ limit - The total number of simultaneous connections.
+ limit_per_host - Number of simultaneous connections to one host.
+ loop - Optional event loop.
+ """
+
+ def __init__(
+ self,
+ path: str,
+ force_close: bool = False,
+ keepalive_timeout: Union[object, float, None] = sentinel,
+ limit: int = 100,
+ limit_per_host: int = 0,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ ) -> None:
+ super().__init__(
+ force_close=force_close,
+ keepalive_timeout=keepalive_timeout,
+ limit=limit,
+ limit_per_host=limit_per_host,
+ loop=loop,
+ )
+ self._path = path
+
+ @property
+ def path(self) -> str:
+ """Path to unix socket."""
+ return self._path
+
+ async def _create_connection(
+ self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout"
+ ) -> ResponseHandler:
+ try:
+ async with ceil_timeout(timeout.sock_connect):
+ _, proto = await self._loop.create_unix_connection(
+ self._factory, self._path
+ )
+ except OSError as exc:
+ if exc.errno is None and isinstance(exc, asyncio.TimeoutError):
+ raise
+ raise UnixClientConnectorError(self.path, req.connection_key, exc) from exc
+
+ return cast(ResponseHandler, proto)
+
+
+class NamedPipeConnector(BaseConnector):
+ """Named pipe connector.
+
+ Only supported by the proactor event loop.
+ See also: https://docs.python.org/3.7/library/asyncio-eventloop.html
+
+ path - Windows named pipe path.
+ keepalive_timeout - (optional) Keep-alive timeout.
+ force_close - Set to True to force close and do reconnect
+ after each request (and between redirects).
+ limit - The total number of simultaneous connections.
+ limit_per_host - Number of simultaneous connections to one host.
+ loop - Optional event loop.
+ """
+
+ def __init__(
+ self,
+ path: str,
+ force_close: bool = False,
+ keepalive_timeout: Union[object, float, None] = sentinel,
+ limit: int = 100,
+ limit_per_host: int = 0,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ ) -> None:
+ super().__init__(
+ force_close=force_close,
+ keepalive_timeout=keepalive_timeout,
+ limit=limit,
+ limit_per_host=limit_per_host,
+ loop=loop,
+ )
+ if not isinstance(
+ self._loop, asyncio.ProactorEventLoop # type: ignore[attr-defined]
+ ):
+ raise RuntimeError(
+ "Named Pipes only available in proactor " "loop under windows"
+ )
+ self._path = path
+
+ @property
+ def path(self) -> str:
+ """Path to the named pipe."""
+ return self._path
+
+ async def _create_connection(
+ self, req: "ClientRequest", traces: List["Trace"], timeout: "ClientTimeout"
+ ) -> ResponseHandler:
+ try:
+ async with ceil_timeout(timeout.sock_connect):
+ _, proto = await self._loop.create_pipe_connection( # type: ignore[attr-defined] # noqa: E501
+ self._factory, self._path
+ )
+ # the drain is required so that the connection_made is called
+ # and transport is set otherwise it is not set before the
+ # `assert conn.transport is not None`
+ # in client.py's _request method
+ await asyncio.sleep(0)
+ # other option is to manually set transport like
+ # `proto.transport = trans`
+ except OSError as exc:
+ if exc.errno is None and isinstance(exc, asyncio.TimeoutError):
+ raise
+ raise ClientConnectorError(req.connection_key, exc) from exc
+
+ return cast(ResponseHandler, proto)
diff --git a/third_party/python/aiohttp/aiohttp/cookiejar.py b/third_party/python/aiohttp/aiohttp/cookiejar.py
new file mode 100644
index 0000000000..6c88b47e35
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/cookiejar.py
@@ -0,0 +1,415 @@
+import asyncio
+import contextlib
+import datetime
+import os # noqa
+import pathlib
+import pickle
+import re
+from collections import defaultdict
+from http.cookies import BaseCookie, Morsel, SimpleCookie
+from typing import ( # noqa
+ DefaultDict,
+ Dict,
+ Iterable,
+ Iterator,
+ List,
+ Mapping,
+ Optional,
+ Set,
+ Tuple,
+ Union,
+ cast,
+)
+
+from yarl import URL
+
+from .abc import AbstractCookieJar, ClearCookiePredicate
+from .helpers import is_ip_address, next_whole_second
+from .typedefs import LooseCookies, PathLike, StrOrURL
+
+__all__ = ("CookieJar", "DummyCookieJar")
+
+
+CookieItem = Union[str, "Morsel[str]"]
+
+
+class CookieJar(AbstractCookieJar):
+ """Implements cookie storage adhering to RFC 6265."""
+
+ DATE_TOKENS_RE = re.compile(
+ r"[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]*"
+ r"(?P<token>[\x00-\x08\x0A-\x1F\d:a-zA-Z\x7F-\xFF]+)"
+ )
+
+ DATE_HMS_TIME_RE = re.compile(r"(\d{1,2}):(\d{1,2}):(\d{1,2})")
+
+ DATE_DAY_OF_MONTH_RE = re.compile(r"(\d{1,2})")
+
+ DATE_MONTH_RE = re.compile(
+ "(jan)|(feb)|(mar)|(apr)|(may)|(jun)|(jul)|" "(aug)|(sep)|(oct)|(nov)|(dec)",
+ re.I,
+ )
+
+ DATE_YEAR_RE = re.compile(r"(\d{2,4})")
+
+ MAX_TIME = datetime.datetime.max.replace(tzinfo=datetime.timezone.utc)
+
+ MAX_32BIT_TIME = datetime.datetime.utcfromtimestamp(2**31 - 1)
+
+ def __init__(
+ self,
+ *,
+ unsafe: bool = False,
+ quote_cookie: bool = True,
+ treat_as_secure_origin: Union[StrOrURL, List[StrOrURL], None] = None,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ ) -> None:
+ super().__init__(loop=loop)
+ self._cookies: DefaultDict[Tuple[str, str], SimpleCookie[str]] = defaultdict(
+ SimpleCookie
+ )
+ self._host_only_cookies: Set[Tuple[str, str]] = set()
+ self._unsafe = unsafe
+ self._quote_cookie = quote_cookie
+ if treat_as_secure_origin is None:
+ treat_as_secure_origin = []
+ elif isinstance(treat_as_secure_origin, URL):
+ treat_as_secure_origin = [treat_as_secure_origin.origin()]
+ elif isinstance(treat_as_secure_origin, str):
+ treat_as_secure_origin = [URL(treat_as_secure_origin).origin()]
+ else:
+ treat_as_secure_origin = [
+ URL(url).origin() if isinstance(url, str) else url.origin()
+ for url in treat_as_secure_origin
+ ]
+ self._treat_as_secure_origin = treat_as_secure_origin
+ self._next_expiration = next_whole_second()
+ self._expirations: Dict[Tuple[str, str, str], datetime.datetime] = {}
+ # #4515: datetime.max may not be representable on 32-bit platforms
+ self._max_time = self.MAX_TIME
+ try:
+ self._max_time.timestamp()
+ except OverflowError:
+ self._max_time = self.MAX_32BIT_TIME
+
+ def save(self, file_path: PathLike) -> None:
+ file_path = pathlib.Path(file_path)
+ with file_path.open(mode="wb") as f:
+ pickle.dump(self._cookies, f, pickle.HIGHEST_PROTOCOL)
+
+ def load(self, file_path: PathLike) -> None:
+ file_path = pathlib.Path(file_path)
+ with file_path.open(mode="rb") as f:
+ self._cookies = pickle.load(f)
+
+ def clear(self, predicate: Optional[ClearCookiePredicate] = None) -> None:
+ if predicate is None:
+ self._next_expiration = next_whole_second()
+ self._cookies.clear()
+ self._host_only_cookies.clear()
+ self._expirations.clear()
+ return
+
+ to_del = []
+ now = datetime.datetime.now(datetime.timezone.utc)
+ for (domain, path), cookie in self._cookies.items():
+ for name, morsel in cookie.items():
+ key = (domain, path, name)
+ if (
+ key in self._expirations and self._expirations[key] <= now
+ ) or predicate(morsel):
+ to_del.append(key)
+
+ for domain, path, name in to_del:
+ self._host_only_cookies.discard((domain, name))
+ key = (domain, path, name)
+ if key in self._expirations:
+ del self._expirations[(domain, path, name)]
+ self._cookies[(domain, path)].pop(name, None)
+
+ next_expiration = min(self._expirations.values(), default=self._max_time)
+ try:
+ self._next_expiration = next_expiration.replace(
+ microsecond=0
+ ) + datetime.timedelta(seconds=1)
+ except OverflowError:
+ self._next_expiration = self._max_time
+
+ def clear_domain(self, domain: str) -> None:
+ self.clear(lambda x: self._is_domain_match(domain, x["domain"]))
+
+ def __iter__(self) -> "Iterator[Morsel[str]]":
+ self._do_expiration()
+ for val in self._cookies.values():
+ yield from val.values()
+
+ def __len__(self) -> int:
+ return sum(1 for i in self)
+
+ def _do_expiration(self) -> None:
+ self.clear(lambda x: False)
+
+ def _expire_cookie(
+ self, when: datetime.datetime, domain: str, path: str, name: str
+ ) -> None:
+ self._next_expiration = min(self._next_expiration, when)
+ self._expirations[(domain, path, name)] = when
+
+ def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> None:
+ """Update cookies."""
+ hostname = response_url.raw_host
+
+ if not self._unsafe and is_ip_address(hostname):
+ # Don't accept cookies from IPs
+ return
+
+ if isinstance(cookies, Mapping):
+ cookies = cookies.items()
+
+ for name, cookie in cookies:
+ if not isinstance(cookie, Morsel):
+ tmp: SimpleCookie[str] = SimpleCookie()
+ tmp[name] = cookie # type: ignore[assignment]
+ cookie = tmp[name]
+
+ domain = cookie["domain"]
+
+ # ignore domains with trailing dots
+ if domain.endswith("."):
+ domain = ""
+ del cookie["domain"]
+
+ if not domain and hostname is not None:
+ # Set the cookie's domain to the response hostname
+ # and set its host-only-flag
+ self._host_only_cookies.add((hostname, name))
+ domain = cookie["domain"] = hostname
+
+ if domain.startswith("."):
+ # Remove leading dot
+ domain = domain[1:]
+ cookie["domain"] = domain
+
+ if hostname and not self._is_domain_match(domain, hostname):
+ # Setting cookies for different domains is not allowed
+ continue
+
+ path = cookie["path"]
+ if not path or not path.startswith("/"):
+ # Set the cookie's path to the response path
+ path = response_url.path
+ if not path.startswith("/"):
+ path = "/"
+ else:
+ # Cut everything from the last slash to the end
+ path = "/" + path[1 : path.rfind("/")]
+ cookie["path"] = path
+
+ max_age = cookie["max-age"]
+ if max_age:
+ try:
+ delta_seconds = int(max_age)
+ try:
+ max_age_expiration = datetime.datetime.now(
+ datetime.timezone.utc
+ ) + datetime.timedelta(seconds=delta_seconds)
+ except OverflowError:
+ max_age_expiration = self._max_time
+ self._expire_cookie(max_age_expiration, domain, path, name)
+ except ValueError:
+ cookie["max-age"] = ""
+
+ else:
+ expires = cookie["expires"]
+ if expires:
+ expire_time = self._parse_date(expires)
+ if expire_time:
+ self._expire_cookie(expire_time, domain, path, name)
+ else:
+ cookie["expires"] = ""
+
+ self._cookies[(domain, path)][name] = cookie
+
+ self._do_expiration()
+
+ def filter_cookies(
+ self, request_url: URL = URL()
+ ) -> Union["BaseCookie[str]", "SimpleCookie[str]"]:
+ """Returns this jar's cookies filtered by their attributes."""
+ self._do_expiration()
+ request_url = URL(request_url)
+ filtered: Union["SimpleCookie[str]", "BaseCookie[str]"] = (
+ SimpleCookie() if self._quote_cookie else BaseCookie()
+ )
+ hostname = request_url.raw_host or ""
+ request_origin = URL()
+ with contextlib.suppress(ValueError):
+ request_origin = request_url.origin()
+
+ is_not_secure = (
+ request_url.scheme not in ("https", "wss")
+ and request_origin not in self._treat_as_secure_origin
+ )
+
+ for cookie in self:
+ name = cookie.key
+ domain = cookie["domain"]
+
+ # Send shared cookies
+ if not domain:
+ filtered[name] = cookie.value
+ continue
+
+ if not self._unsafe and is_ip_address(hostname):
+ continue
+
+ if (domain, name) in self._host_only_cookies:
+ if domain != hostname:
+ continue
+ elif not self._is_domain_match(domain, hostname):
+ continue
+
+ if not self._is_path_match(request_url.path, cookie["path"]):
+ continue
+
+ if is_not_secure and cookie["secure"]:
+ continue
+
+ # It's critical we use the Morsel so the coded_value
+ # (based on cookie version) is preserved
+ mrsl_val = cast("Morsel[str]", cookie.get(cookie.key, Morsel()))
+ mrsl_val.set(cookie.key, cookie.value, cookie.coded_value)
+ filtered[name] = mrsl_val
+
+ return filtered
+
+ @staticmethod
+ def _is_domain_match(domain: str, hostname: str) -> bool:
+ """Implements domain matching adhering to RFC 6265."""
+ if hostname == domain:
+ return True
+
+ if not hostname.endswith(domain):
+ return False
+
+ non_matching = hostname[: -len(domain)]
+
+ if not non_matching.endswith("."):
+ return False
+
+ return not is_ip_address(hostname)
+
+ @staticmethod
+ def _is_path_match(req_path: str, cookie_path: str) -> bool:
+ """Implements path matching adhering to RFC 6265."""
+ if not req_path.startswith("/"):
+ req_path = "/"
+
+ if req_path == cookie_path:
+ return True
+
+ if not req_path.startswith(cookie_path):
+ return False
+
+ if cookie_path.endswith("/"):
+ return True
+
+ non_matching = req_path[len(cookie_path) :]
+
+ return non_matching.startswith("/")
+
+ @classmethod
+ def _parse_date(cls, date_str: str) -> Optional[datetime.datetime]:
+ """Implements date string parsing adhering to RFC 6265."""
+ if not date_str:
+ return None
+
+ found_time = False
+ found_day = False
+ found_month = False
+ found_year = False
+
+ hour = minute = second = 0
+ day = 0
+ month = 0
+ year = 0
+
+ for token_match in cls.DATE_TOKENS_RE.finditer(date_str):
+
+ token = token_match.group("token")
+
+ if not found_time:
+ time_match = cls.DATE_HMS_TIME_RE.match(token)
+ if time_match:
+ found_time = True
+ hour, minute, second = (int(s) for s in time_match.groups())
+ continue
+
+ if not found_day:
+ day_match = cls.DATE_DAY_OF_MONTH_RE.match(token)
+ if day_match:
+ found_day = True
+ day = int(day_match.group())
+ continue
+
+ if not found_month:
+ month_match = cls.DATE_MONTH_RE.match(token)
+ if month_match:
+ found_month = True
+ assert month_match.lastindex is not None
+ month = month_match.lastindex
+ continue
+
+ if not found_year:
+ year_match = cls.DATE_YEAR_RE.match(token)
+ if year_match:
+ found_year = True
+ year = int(year_match.group())
+
+ if 70 <= year <= 99:
+ year += 1900
+ elif 0 <= year <= 69:
+ year += 2000
+
+ if False in (found_day, found_month, found_year, found_time):
+ return None
+
+ if not 1 <= day <= 31:
+ return None
+
+ if year < 1601 or hour > 23 or minute > 59 or second > 59:
+ return None
+
+ return datetime.datetime(
+ year, month, day, hour, minute, second, tzinfo=datetime.timezone.utc
+ )
+
+
+class DummyCookieJar(AbstractCookieJar):
+ """Implements a dummy cookie storage.
+
+ It can be used with the ClientSession when no cookie processing is needed.
+
+ """
+
+ def __init__(self, *, loop: Optional[asyncio.AbstractEventLoop] = None) -> None:
+ super().__init__(loop=loop)
+
+ def __iter__(self) -> "Iterator[Morsel[str]]":
+ while False:
+ yield None
+
+ def __len__(self) -> int:
+ return 0
+
+ def clear(self, predicate: Optional[ClearCookiePredicate] = None) -> None:
+ pass
+
+ def clear_domain(self, domain: str) -> None:
+ pass
+
+ def update_cookies(self, cookies: LooseCookies, response_url: URL = URL()) -> None:
+ pass
+
+ def filter_cookies(self, request_url: URL) -> "BaseCookie[str]":
+ return SimpleCookie()
diff --git a/third_party/python/aiohttp/aiohttp/formdata.py b/third_party/python/aiohttp/aiohttp/formdata.py
new file mode 100644
index 0000000000..e7cd24ca9f
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/formdata.py
@@ -0,0 +1,172 @@
+import io
+from typing import Any, Iterable, List, Optional
+from urllib.parse import urlencode
+
+from multidict import MultiDict, MultiDictProxy
+
+from . import hdrs, multipart, payload
+from .helpers import guess_filename
+from .payload import Payload
+
+__all__ = ("FormData",)
+
+
+class FormData:
+ """Helper class for form body generation.
+
+ Supports multipart/form-data and application/x-www-form-urlencoded.
+ """
+
+ def __init__(
+ self,
+ fields: Iterable[Any] = (),
+ quote_fields: bool = True,
+ charset: Optional[str] = None,
+ ) -> None:
+ self._writer = multipart.MultipartWriter("form-data")
+ self._fields: List[Any] = []
+ self._is_multipart = False
+ self._is_processed = False
+ self._quote_fields = quote_fields
+ self._charset = charset
+
+ if isinstance(fields, dict):
+ fields = list(fields.items())
+ elif not isinstance(fields, (list, tuple)):
+ fields = (fields,)
+ self.add_fields(*fields)
+
+ @property
+ def is_multipart(self) -> bool:
+ return self._is_multipart
+
+ def add_field(
+ self,
+ name: str,
+ value: Any,
+ *,
+ content_type: Optional[str] = None,
+ filename: Optional[str] = None,
+ content_transfer_encoding: Optional[str] = None,
+ ) -> None:
+
+ if isinstance(value, io.IOBase):
+ self._is_multipart = True
+ elif isinstance(value, (bytes, bytearray, memoryview)):
+ if filename is None and content_transfer_encoding is None:
+ filename = name
+
+ type_options: MultiDict[str] = MultiDict({"name": name})
+ if filename is not None and not isinstance(filename, str):
+ raise TypeError(
+ "filename must be an instance of str. " "Got: %s" % filename
+ )
+ if filename is None and isinstance(value, io.IOBase):
+ filename = guess_filename(value, name)
+ if filename is not None:
+ type_options["filename"] = filename
+ self._is_multipart = True
+
+ headers = {}
+ if content_type is not None:
+ if not isinstance(content_type, str):
+ raise TypeError(
+ "content_type must be an instance of str. " "Got: %s" % content_type
+ )
+ headers[hdrs.CONTENT_TYPE] = content_type
+ self._is_multipart = True
+ if content_transfer_encoding is not None:
+ if not isinstance(content_transfer_encoding, str):
+ raise TypeError(
+ "content_transfer_encoding must be an instance"
+ " of str. Got: %s" % content_transfer_encoding
+ )
+ headers[hdrs.CONTENT_TRANSFER_ENCODING] = content_transfer_encoding
+ self._is_multipart = True
+
+ self._fields.append((type_options, headers, value))
+
+ def add_fields(self, *fields: Any) -> None:
+ to_add = list(fields)
+
+ while to_add:
+ rec = to_add.pop(0)
+
+ if isinstance(rec, io.IOBase):
+ k = guess_filename(rec, "unknown")
+ self.add_field(k, rec) # type: ignore[arg-type]
+
+ elif isinstance(rec, (MultiDictProxy, MultiDict)):
+ to_add.extend(rec.items())
+
+ elif isinstance(rec, (list, tuple)) and len(rec) == 2:
+ k, fp = rec
+ self.add_field(k, fp) # type: ignore[arg-type]
+
+ else:
+ raise TypeError(
+ "Only io.IOBase, multidict and (name, file) "
+ "pairs allowed, use .add_field() for passing "
+ "more complex parameters, got {!r}".format(rec)
+ )
+
+ def _gen_form_urlencoded(self) -> payload.BytesPayload:
+ # form data (x-www-form-urlencoded)
+ data = []
+ for type_options, _, value in self._fields:
+ data.append((type_options["name"], value))
+
+ charset = self._charset if self._charset is not None else "utf-8"
+
+ if charset == "utf-8":
+ content_type = "application/x-www-form-urlencoded"
+ else:
+ content_type = "application/x-www-form-urlencoded; " "charset=%s" % charset
+
+ return payload.BytesPayload(
+ urlencode(data, doseq=True, encoding=charset).encode(),
+ content_type=content_type,
+ )
+
+ def _gen_form_data(self) -> multipart.MultipartWriter:
+ """Encode a list of fields using the multipart/form-data MIME format"""
+ if self._is_processed:
+ raise RuntimeError("Form data has been processed already")
+ for dispparams, headers, value in self._fields:
+ try:
+ if hdrs.CONTENT_TYPE in headers:
+ part = payload.get_payload(
+ value,
+ content_type=headers[hdrs.CONTENT_TYPE],
+ headers=headers,
+ encoding=self._charset,
+ )
+ else:
+ part = payload.get_payload(
+ value, headers=headers, encoding=self._charset
+ )
+ except Exception as exc:
+ raise TypeError(
+ "Can not serialize value type: %r\n "
+ "headers: %r\n value: %r" % (type(value), headers, value)
+ ) from exc
+
+ if dispparams:
+ part.set_content_disposition(
+ "form-data", quote_fields=self._quote_fields, **dispparams
+ )
+ # FIXME cgi.FieldStorage doesn't likes body parts with
+ # Content-Length which were sent via chunked transfer encoding
+ assert part.headers is not None
+ part.headers.popall(hdrs.CONTENT_LENGTH, None)
+
+ self._writer.append_payload(part)
+
+ self._is_processed = True
+ return self._writer
+
+ def __call__(self) -> Payload:
+ if self._is_multipart:
+ return self._gen_form_data()
+ else:
+ return self._gen_form_urlencoded()
diff --git a/third_party/python/aiohttp/aiohttp/hdrs.py b/third_party/python/aiohttp/aiohttp/hdrs.py
new file mode 100644
index 0000000000..a619f2543e
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/hdrs.py
@@ -0,0 +1,114 @@
+"""HTTP Headers constants."""
+
+# After changing the file content call ./tools/gen.py
+# to regenerate the headers parser
+import sys
+from typing import Set
+
+from multidict import istr
+
+if sys.version_info >= (3, 8):
+ from typing import Final
+else:
+ from typing_extensions import Final
+
+METH_ANY: Final[str] = "*"
+METH_CONNECT: Final[str] = "CONNECT"
+METH_HEAD: Final[str] = "HEAD"
+METH_GET: Final[str] = "GET"
+METH_DELETE: Final[str] = "DELETE"
+METH_OPTIONS: Final[str] = "OPTIONS"
+METH_PATCH: Final[str] = "PATCH"
+METH_POST: Final[str] = "POST"
+METH_PUT: Final[str] = "PUT"
+METH_TRACE: Final[str] = "TRACE"
+
+METH_ALL: Final[Set[str]] = {
+ METH_CONNECT,
+ METH_HEAD,
+ METH_GET,
+ METH_DELETE,
+ METH_OPTIONS,
+ METH_PATCH,
+ METH_POST,
+ METH_PUT,
+ METH_TRACE,
+}
+
+ACCEPT: Final[istr] = istr("Accept")
+ACCEPT_CHARSET: Final[istr] = istr("Accept-Charset")
+ACCEPT_ENCODING: Final[istr] = istr("Accept-Encoding")
+ACCEPT_LANGUAGE: Final[istr] = istr("Accept-Language")
+ACCEPT_RANGES: Final[istr] = istr("Accept-Ranges")
+ACCESS_CONTROL_MAX_AGE: Final[istr] = istr("Access-Control-Max-Age")
+ACCESS_CONTROL_ALLOW_CREDENTIALS: Final[istr] = istr("Access-Control-Allow-Credentials")
+ACCESS_CONTROL_ALLOW_HEADERS: Final[istr] = istr("Access-Control-Allow-Headers")
+ACCESS_CONTROL_ALLOW_METHODS: Final[istr] = istr("Access-Control-Allow-Methods")
+ACCESS_CONTROL_ALLOW_ORIGIN: Final[istr] = istr("Access-Control-Allow-Origin")
+ACCESS_CONTROL_EXPOSE_HEADERS: Final[istr] = istr("Access-Control-Expose-Headers")
+ACCESS_CONTROL_REQUEST_HEADERS: Final[istr] = istr("Access-Control-Request-Headers")
+ACCESS_CONTROL_REQUEST_METHOD: Final[istr] = istr("Access-Control-Request-Method")
+AGE: Final[istr] = istr("Age")
+ALLOW: Final[istr] = istr("Allow")
+AUTHORIZATION: Final[istr] = istr("Authorization")
+CACHE_CONTROL: Final[istr] = istr("Cache-Control")
+CONNECTION: Final[istr] = istr("Connection")
+CONTENT_DISPOSITION: Final[istr] = istr("Content-Disposition")
+CONTENT_ENCODING: Final[istr] = istr("Content-Encoding")
+CONTENT_LANGUAGE: Final[istr] = istr("Content-Language")
+CONTENT_LENGTH: Final[istr] = istr("Content-Length")
+CONTENT_LOCATION: Final[istr] = istr("Content-Location")
+CONTENT_MD5: Final[istr] = istr("Content-MD5")
+CONTENT_RANGE: Final[istr] = istr("Content-Range")
+CONTENT_TRANSFER_ENCODING: Final[istr] = istr("Content-Transfer-Encoding")
+CONTENT_TYPE: Final[istr] = istr("Content-Type")
+COOKIE: Final[istr] = istr("Cookie")
+DATE: Final[istr] = istr("Date")
+DESTINATION: Final[istr] = istr("Destination")
+DIGEST: Final[istr] = istr("Digest")
+ETAG: Final[istr] = istr("Etag")
+EXPECT: Final[istr] = istr("Expect")
+EXPIRES: Final[istr] = istr("Expires")
+FORWARDED: Final[istr] = istr("Forwarded")
+FROM: Final[istr] = istr("From")
+HOST: Final[istr] = istr("Host")
+IF_MATCH: Final[istr] = istr("If-Match")
+IF_MODIFIED_SINCE: Final[istr] = istr("If-Modified-Since")
+IF_NONE_MATCH: Final[istr] = istr("If-None-Match")
+IF_RANGE: Final[istr] = istr("If-Range")
+IF_UNMODIFIED_SINCE: Final[istr] = istr("If-Unmodified-Since")
+KEEP_ALIVE: Final[istr] = istr("Keep-Alive")
+LAST_EVENT_ID: Final[istr] = istr("Last-Event-ID")
+LAST_MODIFIED: Final[istr] = istr("Last-Modified")
+LINK: Final[istr] = istr("Link")
+LOCATION: Final[istr] = istr("Location")
+MAX_FORWARDS: Final[istr] = istr("Max-Forwards")
+ORIGIN: Final[istr] = istr("Origin")
+PRAGMA: Final[istr] = istr("Pragma")
+PROXY_AUTHENTICATE: Final[istr] = istr("Proxy-Authenticate")
+PROXY_AUTHORIZATION: Final[istr] = istr("Proxy-Authorization")
+RANGE: Final[istr] = istr("Range")
+REFERER: Final[istr] = istr("Referer")
+RETRY_AFTER: Final[istr] = istr("Retry-After")
+SEC_WEBSOCKET_ACCEPT: Final[istr] = istr("Sec-WebSocket-Accept")
+SEC_WEBSOCKET_VERSION: Final[istr] = istr("Sec-WebSocket-Version")
+SEC_WEBSOCKET_PROTOCOL: Final[istr] = istr("Sec-WebSocket-Protocol")
+SEC_WEBSOCKET_EXTENSIONS: Final[istr] = istr("Sec-WebSocket-Extensions")
+SEC_WEBSOCKET_KEY: Final[istr] = istr("Sec-WebSocket-Key")
+SEC_WEBSOCKET_KEY1: Final[istr] = istr("Sec-WebSocket-Key1")
+SERVER: Final[istr] = istr("Server")
+SET_COOKIE: Final[istr] = istr("Set-Cookie")
+TE: Final[istr] = istr("TE")
+TRAILER: Final[istr] = istr("Trailer")
+TRANSFER_ENCODING: Final[istr] = istr("Transfer-Encoding")
+UPGRADE: Final[istr] = istr("Upgrade")
+URI: Final[istr] = istr("URI")
+USER_AGENT: Final[istr] = istr("User-Agent")
+VARY: Final[istr] = istr("Vary")
+VIA: Final[istr] = istr("Via")
+WANT_DIGEST: Final[istr] = istr("Want-Digest")
+WARNING: Final[istr] = istr("Warning")
+WWW_AUTHENTICATE: Final[istr] = istr("WWW-Authenticate")
+X_FORWARDED_FOR: Final[istr] = istr("X-Forwarded-For")
+X_FORWARDED_HOST: Final[istr] = istr("X-Forwarded-Host")
+X_FORWARDED_PROTO: Final[istr] = istr("X-Forwarded-Proto")
diff --git a/third_party/python/aiohttp/aiohttp/helpers.py b/third_party/python/aiohttp/aiohttp/helpers.py
new file mode 100644
index 0000000000..874ab1ac07
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/helpers.py
@@ -0,0 +1,878 @@
+"""Various helper functions"""
+
+import asyncio
+import base64
+import binascii
+import datetime
+import functools
+import inspect
+import netrc
+import os
+import platform
+import re
+import sys
+import time
+import warnings
+import weakref
+from collections import namedtuple
+from contextlib import suppress
+from email.parser import HeaderParser
+from email.utils import parsedate
+from math import ceil
+from pathlib import Path
+from types import TracebackType
+from typing import (
+ Any,
+ Callable,
+ ContextManager,
+ Dict,
+ Generator,
+ Generic,
+ Iterable,
+ Iterator,
+ List,
+ Mapping,
+ Optional,
+ Pattern,
+ Set,
+ Tuple,
+ Type,
+ TypeVar,
+ Union,
+ cast,
+)
+from urllib.parse import quote
+from urllib.request import getproxies, proxy_bypass
+
+import async_timeout
+import attr
+from multidict import MultiDict, MultiDictProxy
+from yarl import URL
+
+from . import hdrs
+from .log import client_logger, internal_logger
+from .typedefs import PathLike, Protocol # noqa
+
+__all__ = ("BasicAuth", "ChainMapProxy", "ETag")
+
+IS_MACOS = platform.system() == "Darwin"
+IS_WINDOWS = platform.system() == "Windows"
+
+PY_36 = sys.version_info >= (3, 6)
+PY_37 = sys.version_info >= (3, 7)
+PY_38 = sys.version_info >= (3, 8)
+PY_310 = sys.version_info >= (3, 10)
+PY_311 = sys.version_info >= (3, 11)
+
+if sys.version_info < (3, 7):
+ import idna_ssl
+
+ idna_ssl.patch_match_hostname()
+
+ def all_tasks(
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ ) -> Set["asyncio.Task[Any]"]:
+ tasks = list(asyncio.Task.all_tasks(loop))
+ return {t for t in tasks if not t.done()}
+
+else:
+ all_tasks = asyncio.all_tasks
+
+
+_T = TypeVar("_T")
+_S = TypeVar("_S")
+
+
+sentinel: Any = object()
+NO_EXTENSIONS: bool = bool(os.environ.get("AIOHTTP_NO_EXTENSIONS"))
+
+# N.B. sys.flags.dev_mode is available on Python 3.7+, use getattr
+# for compatibility with older versions
+DEBUG: bool = getattr(sys.flags, "dev_mode", False) or (
+ not sys.flags.ignore_environment and bool(os.environ.get("PYTHONASYNCIODEBUG"))
+)
+
+
+CHAR = {chr(i) for i in range(0, 128)}
+CTL = {chr(i) for i in range(0, 32)} | {
+ chr(127),
+}
+SEPARATORS = {
+ "(",
+ ")",
+ "<",
+ ">",
+ "@",
+ ",",
+ ";",
+ ":",
+ "\\",
+ '"',
+ "/",
+ "[",
+ "]",
+ "?",
+ "=",
+ "{",
+ "}",
+ " ",
+ chr(9),
+}
+TOKEN = CHAR ^ CTL ^ SEPARATORS
+
+
+class noop:
+ def __await__(self) -> Generator[None, None, None]:
+ yield
+
+
+class BasicAuth(namedtuple("BasicAuth", ["login", "password", "encoding"])):
+ """Http basic authentication helper."""
+
+ def __new__(
+ cls, login: str, password: str = "", encoding: str = "latin1"
+ ) -> "BasicAuth":
+ if login is None:
+ raise ValueError("None is not allowed as login value")
+
+ if password is None:
+ raise ValueError("None is not allowed as password value")
+
+ if ":" in login:
+ raise ValueError('A ":" is not allowed in login (RFC 1945#section-11.1)')
+
+ return super().__new__(cls, login, password, encoding)
+
+ @classmethod
+ def decode(cls, auth_header: str, encoding: str = "latin1") -> "BasicAuth":
+ """Create a BasicAuth object from an Authorization HTTP header."""
+ try:
+ auth_type, encoded_credentials = auth_header.split(" ", 1)
+ except ValueError:
+ raise ValueError("Could not parse authorization header.")
+
+ if auth_type.lower() != "basic":
+ raise ValueError("Unknown authorization method %s" % auth_type)
+
+ try:
+ decoded = base64.b64decode(
+ encoded_credentials.encode("ascii"), validate=True
+ ).decode(encoding)
+ except binascii.Error:
+ raise ValueError("Invalid base64 encoding.")
+
+ try:
+ # RFC 2617 HTTP Authentication
+ # https://www.ietf.org/rfc/rfc2617.txt
+ # the colon must be present, but the username and password may be
+ # otherwise blank.
+ username, password = decoded.split(":", 1)
+ except ValueError:
+ raise ValueError("Invalid credentials.")
+
+ return cls(username, password, encoding=encoding)
+
+ @classmethod
+ def from_url(cls, url: URL, *, encoding: str = "latin1") -> Optional["BasicAuth"]:
+ """Create BasicAuth from url."""
+ if not isinstance(url, URL):
+ raise TypeError("url should be yarl.URL instance")
+ if url.user is None:
+ return None
+ return cls(url.user, url.password or "", encoding=encoding)
+
+ def encode(self) -> str:
+ """Encode credentials."""
+ creds = (f"{self.login}:{self.password}").encode(self.encoding)
+ return "Basic %s" % base64.b64encode(creds).decode(self.encoding)
+
+
+def strip_auth_from_url(url: URL) -> Tuple[URL, Optional[BasicAuth]]:
+ auth = BasicAuth.from_url(url)
+ if auth is None:
+ return url, None
+ else:
+ return url.with_user(None), auth
+
+
+def netrc_from_env() -> Optional[netrc.netrc]:
+ """Load netrc from file.
+
+ Attempt to load it from the path specified by the env-var
+ NETRC or in the default location in the user's home directory.
+
+ Returns None if it couldn't be found or fails to parse.
+ """
+ netrc_env = os.environ.get("NETRC")
+
+ if netrc_env is not None:
+ netrc_path = Path(netrc_env)
+ else:
+ try:
+ home_dir = Path.home()
+ except RuntimeError as e: # pragma: no cover
+ # if pathlib can't resolve home, it may raise a RuntimeError
+ client_logger.debug(
+ "Could not resolve home directory when "
+ "trying to look for .netrc file: %s",
+ e,
+ )
+ return None
+
+ netrc_path = home_dir / ("_netrc" if IS_WINDOWS else ".netrc")
+
+ try:
+ return netrc.netrc(str(netrc_path))
+ except netrc.NetrcParseError as e:
+ client_logger.warning("Could not parse .netrc file: %s", e)
+ except OSError as e:
+ # we couldn't read the file (doesn't exist, permissions, etc.)
+ if netrc_env or netrc_path.is_file():
+ # only warn if the environment wanted us to load it,
+ # or it appears like the default file does actually exist
+ client_logger.warning("Could not read .netrc file: %s", e)
+
+ return None
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class ProxyInfo:
+ proxy: URL
+ proxy_auth: Optional[BasicAuth]
+
+
+def proxies_from_env() -> Dict[str, ProxyInfo]:
+ proxy_urls = {
+ k: URL(v)
+ for k, v in getproxies().items()
+ if k in ("http", "https", "ws", "wss")
+ }
+ netrc_obj = netrc_from_env()
+ stripped = {k: strip_auth_from_url(v) for k, v in proxy_urls.items()}
+ ret = {}
+ for proto, val in stripped.items():
+ proxy, auth = val
+ if proxy.scheme in ("https", "wss"):
+ client_logger.warning(
+ "%s proxies %s are not supported, ignoring", proxy.scheme.upper(), proxy
+ )
+ continue
+ if netrc_obj and auth is None:
+ auth_from_netrc = None
+ if proxy.host is not None:
+ auth_from_netrc = netrc_obj.authenticators(proxy.host)
+ if auth_from_netrc is not None:
+ # auth_from_netrc is a (`user`, `account`, `password`) tuple,
+ # `user` and `account` both can be username,
+ # if `user` is None, use `account`
+ *logins, password = auth_from_netrc
+ login = logins[0] if logins[0] else logins[-1]
+ auth = BasicAuth(cast(str, login), cast(str, password))
+ ret[proto] = ProxyInfo(proxy, auth)
+ return ret
+
+
+def current_task(
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+) -> "Optional[asyncio.Task[Any]]":
+ if sys.version_info >= (3, 7):
+ return asyncio.current_task(loop=loop)
+ else:
+ return asyncio.Task.current_task(loop=loop)
+
+
+def get_running_loop(
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+) -> asyncio.AbstractEventLoop:
+ if loop is None:
+ loop = asyncio.get_event_loop()
+ if not loop.is_running():
+ warnings.warn(
+ "The object should be created within an async function",
+ DeprecationWarning,
+ stacklevel=3,
+ )
+ if loop.get_debug():
+ internal_logger.warning(
+ "The object should be created within an async function", stack_info=True
+ )
+ return loop
+
+
+def isasyncgenfunction(obj: Any) -> bool:
+ func = getattr(inspect, "isasyncgenfunction", None)
+ if func is not None:
+ return func(obj) # type: ignore[no-any-return]
+ else:
+ return False
+
+
+def get_env_proxy_for_url(url: URL) -> Tuple[URL, Optional[BasicAuth]]:
+ """Get a permitted proxy for the given URL from the env."""
+ if url.host is not None and proxy_bypass(url.host):
+ raise LookupError(f"Proxying is disallowed for `{url.host!r}`")
+
+ proxies_in_env = proxies_from_env()
+ try:
+ proxy_info = proxies_in_env[url.scheme]
+ except KeyError:
+ raise LookupError(f"No proxies found for `{url!s}` in the env")
+ else:
+ return proxy_info.proxy, proxy_info.proxy_auth
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class MimeType:
+ type: str
+ subtype: str
+ suffix: str
+ parameters: "MultiDictProxy[str]"
+
+
+@functools.lru_cache(maxsize=56)
+def parse_mimetype(mimetype: str) -> MimeType:
+ """Parses a MIME type into its components.
+
+ mimetype is a MIME type string.
+
+ Returns a MimeType object.
+
+ Example:
+
+ >>> parse_mimetype('text/html; charset=utf-8')
+ MimeType(type='text', subtype='html', suffix='',
+ parameters={'charset': 'utf-8'})
+
+ """
+ if not mimetype:
+ return MimeType(
+ type="", subtype="", suffix="", parameters=MultiDictProxy(MultiDict())
+ )
+
+ parts = mimetype.split(";")
+ params: MultiDict[str] = MultiDict()
+ for item in parts[1:]:
+ if not item:
+ continue
+ key, value = cast(
+ Tuple[str, str], item.split("=", 1) if "=" in item else (item, "")
+ )
+ params.add(key.lower().strip(), value.strip(' "'))
+
+ fulltype = parts[0].strip().lower()
+ if fulltype == "*":
+ fulltype = "*/*"
+
+ mtype, stype = (
+ cast(Tuple[str, str], fulltype.split("/", 1))
+ if "/" in fulltype
+ else (fulltype, "")
+ )
+ stype, suffix = (
+ cast(Tuple[str, str], stype.split("+", 1)) if "+" in stype else (stype, "")
+ )
+
+ return MimeType(
+ type=mtype, subtype=stype, suffix=suffix, parameters=MultiDictProxy(params)
+ )
+
+
+def guess_filename(obj: Any, default: Optional[str] = None) -> Optional[str]:
+ name = getattr(obj, "name", None)
+ if name and isinstance(name, str) and name[0] != "<" and name[-1] != ">":
+ return Path(name).name
+ return default
+
+
+not_qtext_re = re.compile(r"[^\041\043-\133\135-\176]")
+QCONTENT = {chr(i) for i in range(0x20, 0x7F)} | {"\t"}
+
+
+def quoted_string(content: str) -> str:
+ """Return 7-bit content as quoted-string.
+
+ Format content into a quoted-string as defined in RFC5322 for
+ Internet Message Format. Notice that this is not the 8-bit HTTP
+ format, but the 7-bit email format. Content must be in usascii or
+ a ValueError is raised.
+ """
+ if not (QCONTENT > set(content)):
+ raise ValueError(f"bad content for quoted-string {content!r}")
+ return not_qtext_re.sub(lambda x: "\\" + x.group(0), content)
+
+
+def content_disposition_header(
+ disptype: str, quote_fields: bool = True, _charset: str = "utf-8", **params: str
+) -> str:
+ """Sets ``Content-Disposition`` header for MIME.
+
+ This is the MIME payload Content-Disposition header from RFC 2183
+ and RFC 7579 section 4.2, not the HTTP Content-Disposition from
+ RFC 6266.
+
+ disptype is a disposition type: inline, attachment, form-data.
+ Should be valid extension token (see RFC 2183)
+
+ quote_fields performs value quoting to 7-bit MIME headers
+ according to RFC 7578. Set to quote_fields to False if recipient
+ can take 8-bit file names and field values.
+
+ _charset specifies the charset to use when quote_fields is True.
+
+ params is a dict with disposition params.
+ """
+ if not disptype or not (TOKEN > set(disptype)):
+ raise ValueError("bad content disposition type {!r}" "".format(disptype))
+
+ value = disptype
+ if params:
+ lparams = []
+ for key, val in params.items():
+ if not key or not (TOKEN > set(key)):
+ raise ValueError(
+ "bad content disposition parameter" " {!r}={!r}".format(key, val)
+ )
+ if quote_fields:
+ if key.lower() == "filename":
+ qval = quote(val, "", encoding=_charset)
+ lparams.append((key, '"%s"' % qval))
+ else:
+ try:
+ qval = quoted_string(val)
+ except ValueError:
+ qval = "".join(
+ (_charset, "''", quote(val, "", encoding=_charset))
+ )
+ lparams.append((key + "*", qval))
+ else:
+ lparams.append((key, '"%s"' % qval))
+ else:
+ qval = val.replace("\\", "\\\\").replace('"', '\\"')
+ lparams.append((key, '"%s"' % qval))
+ sparams = "; ".join("=".join(pair) for pair in lparams)
+ value = "; ".join((value, sparams))
+ return value
+
+
+class _TSelf(Protocol, Generic[_T]):
+ _cache: Dict[str, _T]
+
+
+class reify(Generic[_T]):
+ """Use as a class method decorator.
+
+ It operates almost exactly like
+ the Python `@property` decorator, but it puts the result of the
+ method it decorates into the instance dict after the first call,
+ effectively replacing the function it decorates with an instance
+ variable. It is, in Python parlance, a data descriptor.
+ """
+
+ def __init__(self, wrapped: Callable[..., _T]) -> None:
+ self.wrapped = wrapped
+ self.__doc__ = wrapped.__doc__
+ self.name = wrapped.__name__
+
+ def __get__(self, inst: _TSelf[_T], owner: Optional[Type[Any]] = None) -> _T:
+ try:
+ try:
+ return inst._cache[self.name]
+ except KeyError:
+ val = self.wrapped(inst)
+ inst._cache[self.name] = val
+ return val
+ except AttributeError:
+ if inst is None:
+ return self
+ raise
+
+ def __set__(self, inst: _TSelf[_T], value: _T) -> None:
+ raise AttributeError("reified property is read-only")
+
+
+reify_py = reify
+
+try:
+ from ._helpers import reify as reify_c
+
+ if not NO_EXTENSIONS:
+ reify = reify_c # type: ignore[misc,assignment]
+except ImportError:
+ pass
+
+_ipv4_pattern = (
+ r"^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}"
+ r"(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$"
+)
+_ipv6_pattern = (
+ r"^(?:(?:(?:[A-F0-9]{1,4}:){6}|(?=(?:[A-F0-9]{0,4}:){0,6}"
+ r"(?:[0-9]{1,3}\.){3}[0-9]{1,3}$)(([0-9A-F]{1,4}:){0,5}|:)"
+ r"((:[0-9A-F]{1,4}){1,5}:|:)|::(?:[A-F0-9]{1,4}:){5})"
+ r"(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}"
+ r"(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])|(?:[A-F0-9]{1,4}:){7}"
+ r"[A-F0-9]{1,4}|(?=(?:[A-F0-9]{0,4}:){0,7}[A-F0-9]{0,4}$)"
+ r"(([0-9A-F]{1,4}:){1,7}|:)((:[0-9A-F]{1,4}){1,7}|:)|(?:[A-F0-9]{1,4}:){7}"
+ r":|:(:[A-F0-9]{1,4}){7})$"
+)
+_ipv4_regex = re.compile(_ipv4_pattern)
+_ipv6_regex = re.compile(_ipv6_pattern, flags=re.IGNORECASE)
+_ipv4_regexb = re.compile(_ipv4_pattern.encode("ascii"))
+_ipv6_regexb = re.compile(_ipv6_pattern.encode("ascii"), flags=re.IGNORECASE)
+
+
+def _is_ip_address(
+ regex: Pattern[str], regexb: Pattern[bytes], host: Optional[Union[str, bytes]]
+) -> bool:
+ if host is None:
+ return False
+ if isinstance(host, str):
+ return bool(regex.match(host))
+ elif isinstance(host, (bytes, bytearray, memoryview)):
+ return bool(regexb.match(host))
+ else:
+ raise TypeError(f"{host} [{type(host)}] is not a str or bytes")
+
+
+is_ipv4_address = functools.partial(_is_ip_address, _ipv4_regex, _ipv4_regexb)
+is_ipv6_address = functools.partial(_is_ip_address, _ipv6_regex, _ipv6_regexb)
+
+
+def is_ip_address(host: Optional[Union[str, bytes, bytearray, memoryview]]) -> bool:
+ return is_ipv4_address(host) or is_ipv6_address(host)
+
+
+def next_whole_second() -> datetime.datetime:
+ """Return current time rounded up to the next whole second."""
+ return datetime.datetime.now(datetime.timezone.utc).replace(
+ microsecond=0
+ ) + datetime.timedelta(seconds=0)
+
+
+_cached_current_datetime: Optional[int] = None
+_cached_formatted_datetime = ""
+
+
+def rfc822_formatted_time() -> str:
+ global _cached_current_datetime
+ global _cached_formatted_datetime
+
+ now = int(time.time())
+ if now != _cached_current_datetime:
+ # Weekday and month names for HTTP date/time formatting;
+ # always English!
+ # Tuples are constants stored in codeobject!
+ _weekdayname = ("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun")
+ _monthname = (
+ "", # Dummy so we can use 1-based month numbers
+ "Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec",
+ )
+
+ year, month, day, hh, mm, ss, wd, *tail = time.gmtime(now)
+ _cached_formatted_datetime = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % (
+ _weekdayname[wd],
+ day,
+ _monthname[month],
+ year,
+ hh,
+ mm,
+ ss,
+ )
+ _cached_current_datetime = now
+ return _cached_formatted_datetime
+
+
+def _weakref_handle(info: "Tuple[weakref.ref[object], str]") -> None:
+ ref, name = info
+ ob = ref()
+ if ob is not None:
+ with suppress(Exception):
+ getattr(ob, name)()
+
+
+def weakref_handle(
+ ob: object, name: str, timeout: float, loop: asyncio.AbstractEventLoop
+) -> Optional[asyncio.TimerHandle]:
+ if timeout is not None and timeout > 0:
+ when = loop.time() + timeout
+ if timeout >= 5:
+ when = ceil(when)
+
+ return loop.call_at(when, _weakref_handle, (weakref.ref(ob), name))
+ return None
+
+
+def call_later(
+ cb: Callable[[], Any], timeout: float, loop: asyncio.AbstractEventLoop
+) -> Optional[asyncio.TimerHandle]:
+ if timeout is not None and timeout > 0:
+ when = loop.time() + timeout
+ if timeout > 5:
+ when = ceil(when)
+ return loop.call_at(when, cb)
+ return None
+
+
+class TimeoutHandle:
+ """Timeout handle"""
+
+ def __init__(
+ self, loop: asyncio.AbstractEventLoop, timeout: Optional[float]
+ ) -> None:
+ self._timeout = timeout
+ self._loop = loop
+ self._callbacks: List[
+ Tuple[Callable[..., None], Tuple[Any, ...], Dict[str, Any]]
+ ] = []
+
+ def register(
+ self, callback: Callable[..., None], *args: Any, **kwargs: Any
+ ) -> None:
+ self._callbacks.append((callback, args, kwargs))
+
+ def close(self) -> None:
+ self._callbacks.clear()
+
+ def start(self) -> Optional[asyncio.Handle]:
+ timeout = self._timeout
+ if timeout is not None and timeout > 0:
+ when = self._loop.time() + timeout
+ if timeout >= 5:
+ when = ceil(when)
+ return self._loop.call_at(when, self.__call__)
+ else:
+ return None
+
+ def timer(self) -> "BaseTimerContext":
+ if self._timeout is not None and self._timeout > 0:
+ timer = TimerContext(self._loop)
+ self.register(timer.timeout)
+ return timer
+ else:
+ return TimerNoop()
+
+ def __call__(self) -> None:
+ for cb, args, kwargs in self._callbacks:
+ with suppress(Exception):
+ cb(*args, **kwargs)
+
+ self._callbacks.clear()
+
+
+class BaseTimerContext(ContextManager["BaseTimerContext"]):
+ pass
+
+
+class TimerNoop(BaseTimerContext):
+ def __enter__(self) -> BaseTimerContext:
+ return self
+
+ def __exit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc_val: Optional[BaseException],
+ exc_tb: Optional[TracebackType],
+ ) -> None:
+ return
+
+
+class TimerContext(BaseTimerContext):
+ """Low resolution timeout context manager"""
+
+ def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
+ self._loop = loop
+ self._tasks: List[asyncio.Task[Any]] = []
+ self._cancelled = False
+
+ def __enter__(self) -> BaseTimerContext:
+ task = current_task(loop=self._loop)
+
+ if task is None:
+ raise RuntimeError(
+ "Timeout context manager should be used " "inside a task"
+ )
+
+ if self._cancelled:
+ raise asyncio.TimeoutError from None
+
+ self._tasks.append(task)
+ return self
+
+ def __exit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc_val: Optional[BaseException],
+ exc_tb: Optional[TracebackType],
+ ) -> Optional[bool]:
+ if self._tasks:
+ self._tasks.pop()
+
+ if exc_type is asyncio.CancelledError and self._cancelled:
+ raise asyncio.TimeoutError from None
+ return None
+
+ def timeout(self) -> None:
+ if not self._cancelled:
+ for task in set(self._tasks):
+ task.cancel()
+
+ self._cancelled = True
+
+
+def ceil_timeout(delay: Optional[float]) -> async_timeout.Timeout:
+ if delay is None or delay <= 0:
+ return async_timeout.timeout(None)
+
+ loop = get_running_loop()
+ now = loop.time()
+ when = now + delay
+ if delay > 5:
+ when = ceil(when)
+ return async_timeout.timeout_at(when)
+
+
+class HeadersMixin:
+
+ ATTRS = frozenset(["_content_type", "_content_dict", "_stored_content_type"])
+
+ _content_type: Optional[str] = None
+ _content_dict: Optional[Dict[str, str]] = None
+ _stored_content_type = sentinel
+
+ def _parse_content_type(self, raw: str) -> None:
+ self._stored_content_type = raw
+ if raw is None:
+ # default value according to RFC 2616
+ self._content_type = "application/octet-stream"
+ self._content_dict = {}
+ else:
+ msg = HeaderParser().parsestr("Content-Type: " + raw)
+ self._content_type = msg.get_content_type()
+ params = msg.get_params()
+ self._content_dict = dict(params[1:]) # First element is content type again
+
+ @property
+ def content_type(self) -> str:
+ """The value of content part for Content-Type HTTP header."""
+ raw = self._headers.get(hdrs.CONTENT_TYPE) # type: ignore[attr-defined]
+ if self._stored_content_type != raw:
+ self._parse_content_type(raw)
+ return self._content_type # type: ignore[return-value]
+
+ @property
+ def charset(self) -> Optional[str]:
+ """The value of charset part for Content-Type HTTP header."""
+ raw = self._headers.get(hdrs.CONTENT_TYPE) # type: ignore[attr-defined]
+ if self._stored_content_type != raw:
+ self._parse_content_type(raw)
+ return self._content_dict.get("charset") # type: ignore[union-attr]
+
+ @property
+ def content_length(self) -> Optional[int]:
+ """The value of Content-Length HTTP header."""
+ content_length = self._headers.get( # type: ignore[attr-defined]
+ hdrs.CONTENT_LENGTH
+ )
+
+ if content_length is not None:
+ return int(content_length)
+ else:
+ return None
+
+
+def set_result(fut: "asyncio.Future[_T]", result: _T) -> None:
+ if not fut.done():
+ fut.set_result(result)
+
+
+def set_exception(fut: "asyncio.Future[_T]", exc: BaseException) -> None:
+ if not fut.done():
+ fut.set_exception(exc)
+
+
+class ChainMapProxy(Mapping[str, Any]):
+ __slots__ = ("_maps",)
+
+ def __init__(self, maps: Iterable[Mapping[str, Any]]) -> None:
+ self._maps = tuple(maps)
+
+ def __init_subclass__(cls) -> None:
+ raise TypeError(
+ "Inheritance class {} from ChainMapProxy "
+ "is forbidden".format(cls.__name__)
+ )
+
+ def __getitem__(self, key: str) -> Any:
+ for mapping in self._maps:
+ try:
+ return mapping[key]
+ except KeyError:
+ pass
+ raise KeyError(key)
+
+ def get(self, key: str, default: Any = None) -> Any:
+ return self[key] if key in self else default
+
+ def __len__(self) -> int:
+ # reuses stored hash values if possible
+ return len(set().union(*self._maps)) # type: ignore[arg-type]
+
+ def __iter__(self) -> Iterator[str]:
+ d: Dict[str, Any] = {}
+ for mapping in reversed(self._maps):
+ # reuses stored hash values if possible
+ d.update(mapping)
+ return iter(d)
+
+ def __contains__(self, key: object) -> bool:
+ return any(key in m for m in self._maps)
+
+ def __bool__(self) -> bool:
+ return any(self._maps)
+
+ def __repr__(self) -> str:
+ content = ", ".join(map(repr, self._maps))
+ return f"ChainMapProxy({content})"
+
+
+# https://tools.ietf.org/html/rfc7232#section-2.3
+_ETAGC = r"[!#-}\x80-\xff]+"
+_ETAGC_RE = re.compile(_ETAGC)
+_QUOTED_ETAG = rf'(W/)?"({_ETAGC})"'
+QUOTED_ETAG_RE = re.compile(_QUOTED_ETAG)
+LIST_QUOTED_ETAG_RE = re.compile(rf"({_QUOTED_ETAG})(?:\s*,\s*|$)|(.)")
+
+ETAG_ANY = "*"
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class ETag:
+ value: str
+ is_weak: bool = False
+
+
+def validate_etag_value(value: str) -> None:
+ if value != ETAG_ANY and not _ETAGC_RE.fullmatch(value):
+ raise ValueError(
+ f"Value {value!r} is not a valid etag. Maybe it contains '\"'?"
+ )
+
+
+def parse_http_date(date_str: Optional[str]) -> Optional[datetime.datetime]:
+ """Process a date string, return a datetime object"""
+ if date_str is not None:
+ timetuple = parsedate(date_str)
+ if timetuple is not None:
+ with suppress(ValueError):
+ return datetime.datetime(*timetuple[:6], tzinfo=datetime.timezone.utc)
+ return None
diff --git a/third_party/python/aiohttp/aiohttp/http.py b/third_party/python/aiohttp/aiohttp/http.py
new file mode 100644
index 0000000000..ca9dc54b21
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/http.py
@@ -0,0 +1,70 @@
+import http.server
+import sys
+from typing import Mapping, Tuple
+
+from . import __version__
+from .http_exceptions import HttpProcessingError as HttpProcessingError
+from .http_parser import (
+ HeadersParser as HeadersParser,
+ HttpParser as HttpParser,
+ HttpRequestParser as HttpRequestParser,
+ HttpResponseParser as HttpResponseParser,
+ RawRequestMessage as RawRequestMessage,
+ RawResponseMessage as RawResponseMessage,
+)
+from .http_websocket import (
+ WS_CLOSED_MESSAGE as WS_CLOSED_MESSAGE,
+ WS_CLOSING_MESSAGE as WS_CLOSING_MESSAGE,
+ WS_KEY as WS_KEY,
+ WebSocketError as WebSocketError,
+ WebSocketReader as WebSocketReader,
+ WebSocketWriter as WebSocketWriter,
+ WSCloseCode as WSCloseCode,
+ WSMessage as WSMessage,
+ WSMsgType as WSMsgType,
+ ws_ext_gen as ws_ext_gen,
+ ws_ext_parse as ws_ext_parse,
+)
+from .http_writer import (
+ HttpVersion as HttpVersion,
+ HttpVersion10 as HttpVersion10,
+ HttpVersion11 as HttpVersion11,
+ StreamWriter as StreamWriter,
+)
+
+__all__ = (
+ "HttpProcessingError",
+ "RESPONSES",
+ "SERVER_SOFTWARE",
+ # .http_writer
+ "StreamWriter",
+ "HttpVersion",
+ "HttpVersion10",
+ "HttpVersion11",
+ # .http_parser
+ "HeadersParser",
+ "HttpParser",
+ "HttpRequestParser",
+ "HttpResponseParser",
+ "RawRequestMessage",
+ "RawResponseMessage",
+ # .http_websocket
+ "WS_CLOSED_MESSAGE",
+ "WS_CLOSING_MESSAGE",
+ "WS_KEY",
+ "WebSocketReader",
+ "WebSocketWriter",
+ "ws_ext_gen",
+ "ws_ext_parse",
+ "WSMessage",
+ "WebSocketError",
+ "WSMsgType",
+ "WSCloseCode",
+)
+
+
+SERVER_SOFTWARE: str = "Python/{0[0]}.{0[1]} aiohttp/{1}".format(
+ sys.version_info, __version__
+)
+
+RESPONSES: Mapping[int, Tuple[str, str]] = http.server.BaseHTTPRequestHandler.responses
diff --git a/third_party/python/aiohttp/aiohttp/http_exceptions.py b/third_party/python/aiohttp/aiohttp/http_exceptions.py
new file mode 100644
index 0000000000..b5d16ea4ec
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/http_exceptions.py
@@ -0,0 +1,107 @@
+"""Low-level http related exceptions."""
+
+
+from textwrap import indent
+from typing import Optional, Union
+
+from .typedefs import _CIMultiDict
+
+__all__ = ("HttpProcessingError",)
+
+
+class HttpProcessingError(Exception):
+ """HTTP error.
+
+ Shortcut for raising HTTP errors with custom code, message and headers.
+
+ code: HTTP Error code.
+ message: (optional) Error message.
+ headers: (optional) Headers to be sent in response, a list of pairs
+ """
+
+ code = 0
+ message = ""
+ headers = None
+
+ def __init__(
+ self,
+ *,
+ code: Optional[int] = None,
+ message: str = "",
+ headers: Optional[_CIMultiDict] = None,
+ ) -> None:
+ if code is not None:
+ self.code = code
+ self.headers = headers
+ self.message = message
+
+ def __str__(self) -> str:
+ msg = indent(self.message, " ")
+ return f"{self.code}, message:\n{msg}"
+
+ def __repr__(self) -> str:
+ return f"<{self.__class__.__name__}: {self.code}, message={self.message!r}>"
+
+
+class BadHttpMessage(HttpProcessingError):
+
+ code = 400
+ message = "Bad Request"
+
+ def __init__(self, message: str, *, headers: Optional[_CIMultiDict] = None) -> None:
+ super().__init__(message=message, headers=headers)
+ self.args = (message,)
+
+
+class HttpBadRequest(BadHttpMessage):
+
+ code = 400
+ message = "Bad Request"
+
+
+class PayloadEncodingError(BadHttpMessage):
+ """Base class for payload errors"""
+
+
+class ContentEncodingError(PayloadEncodingError):
+ """Content encoding error."""
+
+
+class TransferEncodingError(PayloadEncodingError):
+ """transfer encoding error."""
+
+
+class ContentLengthError(PayloadEncodingError):
+ """Not enough data for satisfy content length header."""
+
+
+class LineTooLong(BadHttpMessage):
+ def __init__(
+ self, line: str, limit: str = "Unknown", actual_size: str = "Unknown"
+ ) -> None:
+ super().__init__(
+ f"Got more than {limit} bytes ({actual_size}) when reading {line}."
+ )
+ self.args = (line, limit, actual_size)
+
+
+class InvalidHeader(BadHttpMessage):
+ def __init__(self, hdr: Union[bytes, str]) -> None:
+ if isinstance(hdr, bytes):
+ hdr = hdr.decode("utf-8", "surrogateescape")
+ super().__init__(f"Invalid HTTP Header: {hdr}")
+ self.hdr = hdr
+ self.args = (hdr,)
+
+
+class BadStatusLine(BadHttpMessage):
+ def __init__(self, line: str = "") -> None:
+ if not isinstance(line, str):
+ line = repr(line)
+ super().__init__(f"Bad status line {line!r}")
+ self.args = (line,)
+ self.line = line
+
+
+class InvalidURLError(BadHttpMessage):
+ pass
diff --git a/third_party/python/aiohttp/aiohttp/http_parser.py b/third_party/python/aiohttp/aiohttp/http_parser.py
new file mode 100644
index 0000000000..5a66ce4b9e
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/http_parser.py
@@ -0,0 +1,969 @@
+import abc
+import asyncio
+import collections
+import re
+import string
+import zlib
+from contextlib import suppress
+from enum import IntEnum
+from typing import (
+ Any,
+ Generic,
+ List,
+ NamedTuple,
+ Optional,
+ Pattern,
+ Set,
+ Tuple,
+ Type,
+ TypeVar,
+ Union,
+ cast,
+)
+
+from multidict import CIMultiDict, CIMultiDictProxy, istr
+from yarl import URL
+
+from . import hdrs
+from .base_protocol import BaseProtocol
+from .helpers import NO_EXTENSIONS, BaseTimerContext
+from .http_exceptions import (
+ BadHttpMessage,
+ BadStatusLine,
+ ContentEncodingError,
+ ContentLengthError,
+ InvalidHeader,
+ LineTooLong,
+ TransferEncodingError,
+)
+from .http_writer import HttpVersion, HttpVersion10
+from .log import internal_logger
+from .streams import EMPTY_PAYLOAD, StreamReader
+from .typedefs import Final, RawHeaders
+
+try:
+ import brotli
+
+ HAS_BROTLI = True
+except ImportError: # pragma: no cover
+ HAS_BROTLI = False
+
+
+__all__ = (
+ "HeadersParser",
+ "HttpParser",
+ "HttpRequestParser",
+ "HttpResponseParser",
+ "RawRequestMessage",
+ "RawResponseMessage",
+)
+
+ASCIISET: Final[Set[str]] = set(string.printable)
+
+# See https://tools.ietf.org/html/rfc7230#section-3.1.1
+# and https://tools.ietf.org/html/rfc7230#appendix-B
+#
+# method = token
+# tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." /
+# "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA
+# token = 1*tchar
+METHRE: Final[Pattern[str]] = re.compile(r"[!#$%&'*+\-.^_`|~0-9A-Za-z]+")
+VERSRE: Final[Pattern[str]] = re.compile(r"HTTP/(\d+).(\d+)")
+HDRRE: Final[Pattern[bytes]] = re.compile(rb"[\x00-\x1F\x7F()<>@,;:\[\]={} \t\\\\\"]")
+
+
+class RawRequestMessage(NamedTuple):
+ method: str
+ path: str
+ version: HttpVersion
+ headers: "CIMultiDictProxy[str]"
+ raw_headers: RawHeaders
+ should_close: bool
+ compression: Optional[str]
+ upgrade: bool
+ chunked: bool
+ url: URL
+
+
+RawResponseMessage = collections.namedtuple(
+ "RawResponseMessage",
+ [
+ "version",
+ "code",
+ "reason",
+ "headers",
+ "raw_headers",
+ "should_close",
+ "compression",
+ "upgrade",
+ "chunked",
+ ],
+)
+
+
+_MsgT = TypeVar("_MsgT", RawRequestMessage, RawResponseMessage)
+
+
+class ParseState(IntEnum):
+
+ PARSE_NONE = 0
+ PARSE_LENGTH = 1
+ PARSE_CHUNKED = 2
+ PARSE_UNTIL_EOF = 3
+
+
+class ChunkState(IntEnum):
+ PARSE_CHUNKED_SIZE = 0
+ PARSE_CHUNKED_CHUNK = 1
+ PARSE_CHUNKED_CHUNK_EOF = 2
+ PARSE_MAYBE_TRAILERS = 3
+ PARSE_TRAILERS = 4
+
+
+class HeadersParser:
+ def __init__(
+ self,
+ max_line_size: int = 8190,
+ max_headers: int = 32768,
+ max_field_size: int = 8190,
+ ) -> None:
+ self.max_line_size = max_line_size
+ self.max_headers = max_headers
+ self.max_field_size = max_field_size
+
+ def parse_headers(
+ self, lines: List[bytes]
+ ) -> Tuple["CIMultiDictProxy[str]", RawHeaders]:
+ headers: CIMultiDict[str] = CIMultiDict()
+ raw_headers = []
+
+ lines_idx = 1
+ line = lines[1]
+ line_count = len(lines)
+
+ while line:
+ # Parse initial header name : value pair.
+ try:
+ bname, bvalue = line.split(b":", 1)
+ except ValueError:
+ raise InvalidHeader(line) from None
+
+ bname = bname.strip(b" \t")
+ bvalue = bvalue.lstrip()
+ if HDRRE.search(bname):
+ raise InvalidHeader(bname)
+ if len(bname) > self.max_field_size:
+ raise LineTooLong(
+ "request header name {}".format(
+ bname.decode("utf8", "xmlcharrefreplace")
+ ),
+ str(self.max_field_size),
+ str(len(bname)),
+ )
+
+ header_length = len(bvalue)
+
+ # next line
+ lines_idx += 1
+ line = lines[lines_idx]
+
+ # consume continuation lines
+ continuation = line and line[0] in (32, 9) # (' ', '\t')
+
+ if continuation:
+ bvalue_lst = [bvalue]
+ while continuation:
+ header_length += len(line)
+ if header_length > self.max_field_size:
+ raise LineTooLong(
+ "request header field {}".format(
+ bname.decode("utf8", "xmlcharrefreplace")
+ ),
+ str(self.max_field_size),
+ str(header_length),
+ )
+ bvalue_lst.append(line)
+
+ # next line
+ lines_idx += 1
+ if lines_idx < line_count:
+ line = lines[lines_idx]
+ if line:
+ continuation = line[0] in (32, 9) # (' ', '\t')
+ else:
+ line = b""
+ break
+ bvalue = b"".join(bvalue_lst)
+ else:
+ if header_length > self.max_field_size:
+ raise LineTooLong(
+ "request header field {}".format(
+ bname.decode("utf8", "xmlcharrefreplace")
+ ),
+ str(self.max_field_size),
+ str(header_length),
+ )
+
+ bvalue = bvalue.strip()
+ name = bname.decode("utf-8", "surrogateescape")
+ value = bvalue.decode("utf-8", "surrogateescape")
+
+ headers.add(name, value)
+ raw_headers.append((bname, bvalue))
+
+ return (CIMultiDictProxy(headers), tuple(raw_headers))
+
+
+class HttpParser(abc.ABC, Generic[_MsgT]):
+ def __init__(
+ self,
+ protocol: Optional[BaseProtocol] = None,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ limit: int = 2**16,
+ max_line_size: int = 8190,
+ max_headers: int = 32768,
+ max_field_size: int = 8190,
+ timer: Optional[BaseTimerContext] = None,
+ code: Optional[int] = None,
+ method: Optional[str] = None,
+ readall: bool = False,
+ payload_exception: Optional[Type[BaseException]] = None,
+ response_with_body: bool = True,
+ read_until_eof: bool = False,
+ auto_decompress: bool = True,
+ ) -> None:
+ self.protocol = protocol
+ self.loop = loop
+ self.max_line_size = max_line_size
+ self.max_headers = max_headers
+ self.max_field_size = max_field_size
+ self.timer = timer
+ self.code = code
+ self.method = method
+ self.readall = readall
+ self.payload_exception = payload_exception
+ self.response_with_body = response_with_body
+ self.read_until_eof = read_until_eof
+
+ self._lines: List[bytes] = []
+ self._tail = b""
+ self._upgraded = False
+ self._payload = None
+ self._payload_parser: Optional[HttpPayloadParser] = None
+ self._auto_decompress = auto_decompress
+ self._limit = limit
+ self._headers_parser = HeadersParser(max_line_size, max_headers, max_field_size)
+
+ @abc.abstractmethod
+ def parse_message(self, lines: List[bytes]) -> _MsgT:
+ pass
+
+ def feed_eof(self) -> Optional[_MsgT]:
+ if self._payload_parser is not None:
+ self._payload_parser.feed_eof()
+ self._payload_parser = None
+ else:
+ # try to extract partial message
+ if self._tail:
+ self._lines.append(self._tail)
+
+ if self._lines:
+ if self._lines[-1] != "\r\n":
+ self._lines.append(b"")
+ with suppress(Exception):
+ return self.parse_message(self._lines)
+ return None
+
+ def feed_data(
+ self,
+ data: bytes,
+ SEP: bytes = b"\r\n",
+ EMPTY: bytes = b"",
+ CONTENT_LENGTH: istr = hdrs.CONTENT_LENGTH,
+ METH_CONNECT: str = hdrs.METH_CONNECT,
+ SEC_WEBSOCKET_KEY1: istr = hdrs.SEC_WEBSOCKET_KEY1,
+ ) -> Tuple[List[Tuple[_MsgT, StreamReader]], bool, bytes]:
+
+ messages = []
+
+ if self._tail:
+ data, self._tail = self._tail + data, b""
+
+ data_len = len(data)
+ start_pos = 0
+ loop = self.loop
+
+ while start_pos < data_len:
+
+ # read HTTP message (request/response line + headers), \r\n\r\n
+ # and split by lines
+ if self._payload_parser is None and not self._upgraded:
+ pos = data.find(SEP, start_pos)
+ # consume \r\n
+ if pos == start_pos and not self._lines:
+ start_pos = pos + 2
+ continue
+
+ if pos >= start_pos:
+ # line found
+ self._lines.append(data[start_pos:pos])
+ start_pos = pos + 2
+
+ # \r\n\r\n found
+ if self._lines[-1] == EMPTY:
+ try:
+ msg: _MsgT = self.parse_message(self._lines)
+ finally:
+ self._lines.clear()
+
+ def get_content_length() -> Optional[int]:
+ # payload length
+ length_hdr = msg.headers.get(CONTENT_LENGTH)
+ if length_hdr is None:
+ return None
+
+ try:
+ length = int(length_hdr)
+ except ValueError:
+ raise InvalidHeader(CONTENT_LENGTH)
+
+ if length < 0:
+ raise InvalidHeader(CONTENT_LENGTH)
+
+ return length
+
+ length = get_content_length()
+ # do not support old websocket spec
+ if SEC_WEBSOCKET_KEY1 in msg.headers:
+ raise InvalidHeader(SEC_WEBSOCKET_KEY1)
+
+ self._upgraded = msg.upgrade
+
+ method = getattr(msg, "method", self.method)
+
+ assert self.protocol is not None
+ # calculate payload
+ if (
+ (length is not None and length > 0)
+ or msg.chunked
+ and not msg.upgrade
+ ):
+ payload = StreamReader(
+ self.protocol,
+ timer=self.timer,
+ loop=loop,
+ limit=self._limit,
+ )
+ payload_parser = HttpPayloadParser(
+ payload,
+ length=length,
+ chunked=msg.chunked,
+ method=method,
+ compression=msg.compression,
+ code=self.code,
+ readall=self.readall,
+ response_with_body=self.response_with_body,
+ auto_decompress=self._auto_decompress,
+ )
+ if not payload_parser.done:
+ self._payload_parser = payload_parser
+ elif method == METH_CONNECT:
+ assert isinstance(msg, RawRequestMessage)
+ payload = StreamReader(
+ self.protocol,
+ timer=self.timer,
+ loop=loop,
+ limit=self._limit,
+ )
+ self._upgraded = True
+ self._payload_parser = HttpPayloadParser(
+ payload,
+ method=msg.method,
+ compression=msg.compression,
+ readall=True,
+ auto_decompress=self._auto_decompress,
+ )
+ else:
+ if (
+ getattr(msg, "code", 100) >= 199
+ and length is None
+ and self.read_until_eof
+ ):
+ payload = StreamReader(
+ self.protocol,
+ timer=self.timer,
+ loop=loop,
+ limit=self._limit,
+ )
+ payload_parser = HttpPayloadParser(
+ payload,
+ length=length,
+ chunked=msg.chunked,
+ method=method,
+ compression=msg.compression,
+ code=self.code,
+ readall=True,
+ response_with_body=self.response_with_body,
+ auto_decompress=self._auto_decompress,
+ )
+ if not payload_parser.done:
+ self._payload_parser = payload_parser
+ else:
+ payload = EMPTY_PAYLOAD
+
+ messages.append((msg, payload))
+ else:
+ self._tail = data[start_pos:]
+ data = EMPTY
+ break
+
+ # no parser, just store
+ elif self._payload_parser is None and self._upgraded:
+ assert not self._lines
+ break
+
+ # feed payload
+ elif data and start_pos < data_len:
+ assert not self._lines
+ assert self._payload_parser is not None
+ try:
+ eof, data = self._payload_parser.feed_data(data[start_pos:])
+ except BaseException as exc:
+ if self.payload_exception is not None:
+ self._payload_parser.payload.set_exception(
+ self.payload_exception(str(exc))
+ )
+ else:
+ self._payload_parser.payload.set_exception(exc)
+
+ eof = True
+ data = b""
+
+ if eof:
+ start_pos = 0
+ data_len = len(data)
+ self._payload_parser = None
+ continue
+ else:
+ break
+
+ if data and start_pos < data_len:
+ data = data[start_pos:]
+ else:
+ data = EMPTY
+
+ return messages, self._upgraded, data
+
+ def parse_headers(
+ self, lines: List[bytes]
+ ) -> Tuple[
+ "CIMultiDictProxy[str]", RawHeaders, Optional[bool], Optional[str], bool, bool
+ ]:
+ """Parses RFC 5322 headers from a stream.
+
+ Line continuations are supported. Returns list of header name
+ and value pairs. Header name is in upper case.
+ """
+ headers, raw_headers = self._headers_parser.parse_headers(lines)
+ close_conn = None
+ encoding = None
+ upgrade = False
+ chunked = False
+
+ # keep-alive
+ conn = headers.get(hdrs.CONNECTION)
+ if conn:
+ v = conn.lower()
+ if v == "close":
+ close_conn = True
+ elif v == "keep-alive":
+ close_conn = False
+ elif v == "upgrade":
+ upgrade = True
+
+ # encoding
+ enc = headers.get(hdrs.CONTENT_ENCODING)
+ if enc:
+ enc = enc.lower()
+ if enc in ("gzip", "deflate", "br"):
+ encoding = enc
+
+ # chunking
+ te = headers.get(hdrs.TRANSFER_ENCODING)
+ if te is not None:
+ if "chunked" == te.lower():
+ chunked = True
+ else:
+ raise BadHttpMessage("Request has invalid `Transfer-Encoding`")
+
+ if hdrs.CONTENT_LENGTH in headers:
+ raise BadHttpMessage(
+ "Content-Length can't be present with Transfer-Encoding",
+ )
+
+ return (headers, raw_headers, close_conn, encoding, upgrade, chunked)
+
+ def set_upgraded(self, val: bool) -> None:
+ """Set connection upgraded (to websocket) mode.
+
+ :param bool val: new state.
+ """
+ self._upgraded = val
+
+
+class HttpRequestParser(HttpParser[RawRequestMessage]):
+ """Read request status line.
+
+ Exception .http_exceptions.BadStatusLine
+ could be raised in case of any errors in status line.
+ Returns RawRequestMessage.
+ """
+
+ def parse_message(self, lines: List[bytes]) -> RawRequestMessage:
+ # request line
+ line = lines[0].decode("utf-8", "surrogateescape")
+ try:
+ method, path, version = line.split(None, 2)
+ except ValueError:
+ raise BadStatusLine(line) from None
+
+ if len(path) > self.max_line_size:
+ raise LineTooLong(
+ "Status line is too long", str(self.max_line_size), str(len(path))
+ )
+
+ # method
+ if not METHRE.match(method):
+ raise BadStatusLine(method)
+
+ # version
+ try:
+ if version.startswith("HTTP/"):
+ n1, n2 = version[5:].split(".", 1)
+ version_o = HttpVersion(int(n1), int(n2))
+ else:
+ raise BadStatusLine(version)
+ except Exception:
+ raise BadStatusLine(version)
+
+ if method == "CONNECT":
+ # authority-form,
+ # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.3
+ url = URL.build(authority=path, encoded=True)
+ elif path.startswith("/"):
+ # origin-form,
+ # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.1
+ path_part, _hash_separator, url_fragment = path.partition("#")
+ path_part, _question_mark_separator, qs_part = path_part.partition("?")
+
+ # NOTE: `yarl.URL.build()` is used to mimic what the Cython-based
+ # NOTE: parser does, otherwise it results into the same
+ # NOTE: HTTP Request-Line input producing different
+ # NOTE: `yarl.URL()` objects
+ url = URL.build(
+ path=path_part,
+ query_string=qs_part,
+ fragment=url_fragment,
+ encoded=True,
+ )
+ else:
+ # absolute-form for proxy maybe,
+ # https://datatracker.ietf.org/doc/html/rfc7230#section-5.3.2
+ url = URL(path, encoded=True)
+
+ # read headers
+ (
+ headers,
+ raw_headers,
+ close,
+ compression,
+ upgrade,
+ chunked,
+ ) = self.parse_headers(lines)
+
+ if close is None: # then the headers weren't set in the request
+ if version_o <= HttpVersion10: # HTTP 1.0 must asks to not close
+ close = True
+ else: # HTTP 1.1 must ask to close.
+ close = False
+
+ return RawRequestMessage(
+ method,
+ path,
+ version_o,
+ headers,
+ raw_headers,
+ close,
+ compression,
+ upgrade,
+ chunked,
+ url,
+ )
+
+
+class HttpResponseParser(HttpParser[RawResponseMessage]):
+ """Read response status line and headers.
+
+ BadStatusLine could be raised in case of any errors in status line.
+ Returns RawResponseMessage.
+ """
+
+ def parse_message(self, lines: List[bytes]) -> RawResponseMessage:
+ line = lines[0].decode("utf-8", "surrogateescape")
+ try:
+ version, status = line.split(None, 1)
+ except ValueError:
+ raise BadStatusLine(line) from None
+
+ try:
+ status, reason = status.split(None, 1)
+ except ValueError:
+ reason = ""
+
+ if len(reason) > self.max_line_size:
+ raise LineTooLong(
+ "Status line is too long", str(self.max_line_size), str(len(reason))
+ )
+
+ # version
+ match = VERSRE.match(version)
+ if match is None:
+ raise BadStatusLine(line)
+ version_o = HttpVersion(int(match.group(1)), int(match.group(2)))
+
+ # The status code is a three-digit number
+ try:
+ status_i = int(status)
+ except ValueError:
+ raise BadStatusLine(line) from None
+
+ if status_i > 999:
+ raise BadStatusLine(line)
+
+ # read headers
+ (
+ headers,
+ raw_headers,
+ close,
+ compression,
+ upgrade,
+ chunked,
+ ) = self.parse_headers(lines)
+
+ if close is None:
+ close = version_o <= HttpVersion10
+
+ return RawResponseMessage(
+ version_o,
+ status_i,
+ reason.strip(),
+ headers,
+ raw_headers,
+ close,
+ compression,
+ upgrade,
+ chunked,
+ )
+
+
+class HttpPayloadParser:
+ def __init__(
+ self,
+ payload: StreamReader,
+ length: Optional[int] = None,
+ chunked: bool = False,
+ compression: Optional[str] = None,
+ code: Optional[int] = None,
+ method: Optional[str] = None,
+ readall: bool = False,
+ response_with_body: bool = True,
+ auto_decompress: bool = True,
+ ) -> None:
+ self._length = 0
+ self._type = ParseState.PARSE_NONE
+ self._chunk = ChunkState.PARSE_CHUNKED_SIZE
+ self._chunk_size = 0
+ self._chunk_tail = b""
+ self._auto_decompress = auto_decompress
+ self.done = False
+
+ # payload decompression wrapper
+ if response_with_body and compression and self._auto_decompress:
+ real_payload: Union[StreamReader, DeflateBuffer] = DeflateBuffer(
+ payload, compression
+ )
+ else:
+ real_payload = payload
+
+ # payload parser
+ if not response_with_body:
+ # don't parse payload if it's not expected to be received
+ self._type = ParseState.PARSE_NONE
+ real_payload.feed_eof()
+ self.done = True
+
+ elif chunked:
+ self._type = ParseState.PARSE_CHUNKED
+ elif length is not None:
+ self._type = ParseState.PARSE_LENGTH
+ self._length = length
+ if self._length == 0:
+ real_payload.feed_eof()
+ self.done = True
+ else:
+ if readall and code != 204:
+ self._type = ParseState.PARSE_UNTIL_EOF
+ elif method in ("PUT", "POST"):
+ internal_logger.warning( # pragma: no cover
+ "Content-Length or Transfer-Encoding header is required"
+ )
+ self._type = ParseState.PARSE_NONE
+ real_payload.feed_eof()
+ self.done = True
+
+ self.payload = real_payload
+
+ def feed_eof(self) -> None:
+ if self._type == ParseState.PARSE_UNTIL_EOF:
+ self.payload.feed_eof()
+ elif self._type == ParseState.PARSE_LENGTH:
+ raise ContentLengthError(
+ "Not enough data for satisfy content length header."
+ )
+ elif self._type == ParseState.PARSE_CHUNKED:
+ raise TransferEncodingError(
+ "Not enough data for satisfy transfer length header."
+ )
+
+ def feed_data(
+ self, chunk: bytes, SEP: bytes = b"\r\n", CHUNK_EXT: bytes = b";"
+ ) -> Tuple[bool, bytes]:
+ # Read specified amount of bytes
+ if self._type == ParseState.PARSE_LENGTH:
+ required = self._length
+ chunk_len = len(chunk)
+
+ if required >= chunk_len:
+ self._length = required - chunk_len
+ self.payload.feed_data(chunk, chunk_len)
+ if self._length == 0:
+ self.payload.feed_eof()
+ return True, b""
+ else:
+ self._length = 0
+ self.payload.feed_data(chunk[:required], required)
+ self.payload.feed_eof()
+ return True, chunk[required:]
+
+ # Chunked transfer encoding parser
+ elif self._type == ParseState.PARSE_CHUNKED:
+ if self._chunk_tail:
+ chunk = self._chunk_tail + chunk
+ self._chunk_tail = b""
+
+ while chunk:
+
+ # read next chunk size
+ if self._chunk == ChunkState.PARSE_CHUNKED_SIZE:
+ pos = chunk.find(SEP)
+ if pos >= 0:
+ i = chunk.find(CHUNK_EXT, 0, pos)
+ if i >= 0:
+ size_b = chunk[:i] # strip chunk-extensions
+ else:
+ size_b = chunk[:pos]
+
+ try:
+ size = int(bytes(size_b), 16)
+ except ValueError:
+ exc = TransferEncodingError(
+ chunk[:pos].decode("ascii", "surrogateescape")
+ )
+ self.payload.set_exception(exc)
+ raise exc from None
+
+ chunk = chunk[pos + 2 :]
+ if size == 0: # eof marker
+ self._chunk = ChunkState.PARSE_MAYBE_TRAILERS
+ else:
+ self._chunk = ChunkState.PARSE_CHUNKED_CHUNK
+ self._chunk_size = size
+ self.payload.begin_http_chunk_receiving()
+ else:
+ self._chunk_tail = chunk
+ return False, b""
+
+ # read chunk and feed buffer
+ if self._chunk == ChunkState.PARSE_CHUNKED_CHUNK:
+ required = self._chunk_size
+ chunk_len = len(chunk)
+
+ if required > chunk_len:
+ self._chunk_size = required - chunk_len
+ self.payload.feed_data(chunk, chunk_len)
+ return False, b""
+ else:
+ self._chunk_size = 0
+ self.payload.feed_data(chunk[:required], required)
+ chunk = chunk[required:]
+ self._chunk = ChunkState.PARSE_CHUNKED_CHUNK_EOF
+ self.payload.end_http_chunk_receiving()
+
+ # toss the CRLF at the end of the chunk
+ if self._chunk == ChunkState.PARSE_CHUNKED_CHUNK_EOF:
+ if chunk[:2] == SEP:
+ chunk = chunk[2:]
+ self._chunk = ChunkState.PARSE_CHUNKED_SIZE
+ else:
+ self._chunk_tail = chunk
+ return False, b""
+
+ # if stream does not contain trailer, after 0\r\n
+ # we should get another \r\n otherwise
+ # trailers needs to be skiped until \r\n\r\n
+ if self._chunk == ChunkState.PARSE_MAYBE_TRAILERS:
+ head = chunk[:2]
+ if head == SEP:
+ # end of stream
+ self.payload.feed_eof()
+ return True, chunk[2:]
+ # Both CR and LF, or only LF may not be received yet. It is
+ # expected that CRLF or LF will be shown at the very first
+ # byte next time, otherwise trailers should come. The last
+ # CRLF which marks the end of response might not be
+ # contained in the same TCP segment which delivered the
+ # size indicator.
+ if not head:
+ return False, b""
+ if head == SEP[:1]:
+ self._chunk_tail = head
+ return False, b""
+ self._chunk = ChunkState.PARSE_TRAILERS
+
+ # read and discard trailer up to the CRLF terminator
+ if self._chunk == ChunkState.PARSE_TRAILERS:
+ pos = chunk.find(SEP)
+ if pos >= 0:
+ chunk = chunk[pos + 2 :]
+ self._chunk = ChunkState.PARSE_MAYBE_TRAILERS
+ else:
+ self._chunk_tail = chunk
+ return False, b""
+
+ # Read all bytes until eof
+ elif self._type == ParseState.PARSE_UNTIL_EOF:
+ self.payload.feed_data(chunk, len(chunk))
+
+ return False, b""
+
+
+class DeflateBuffer:
+ """DeflateStream decompress stream and feed data into specified stream."""
+
+ decompressor: Any
+
+ def __init__(self, out: StreamReader, encoding: Optional[str]) -> None:
+ self.out = out
+ self.size = 0
+ self.encoding = encoding
+ self._started_decoding = False
+
+ if encoding == "br":
+ if not HAS_BROTLI: # pragma: no cover
+ raise ContentEncodingError(
+ "Can not decode content-encoding: brotli (br). "
+ "Please install `Brotli`"
+ )
+
+ class BrotliDecoder:
+ # Supports both 'brotlipy' and 'Brotli' packages
+ # since they share an import name. The top branches
+ # are for 'brotlipy' and bottom branches for 'Brotli'
+ def __init__(self) -> None:
+ self._obj = brotli.Decompressor()
+
+ def decompress(self, data: bytes) -> bytes:
+ if hasattr(self._obj, "decompress"):
+ return cast(bytes, self._obj.decompress(data))
+ return cast(bytes, self._obj.process(data))
+
+ def flush(self) -> bytes:
+ if hasattr(self._obj, "flush"):
+ return cast(bytes, self._obj.flush())
+ return b""
+
+ self.decompressor = BrotliDecoder()
+ else:
+ zlib_mode = 16 + zlib.MAX_WBITS if encoding == "gzip" else zlib.MAX_WBITS
+ self.decompressor = zlib.decompressobj(wbits=zlib_mode)
+
+ def set_exception(self, exc: BaseException) -> None:
+ self.out.set_exception(exc)
+
+ def feed_data(self, chunk: bytes, size: int) -> None:
+ if not size:
+ return
+
+ self.size += size
+
+ # RFC1950
+ # bits 0..3 = CM = 0b1000 = 8 = "deflate"
+ # bits 4..7 = CINFO = 1..7 = windows size.
+ if (
+ not self._started_decoding
+ and self.encoding == "deflate"
+ and chunk[0] & 0xF != 8
+ ):
+ # Change the decoder to decompress incorrectly compressed data
+ # Actually we should issue a warning about non-RFC-compliant data.
+ self.decompressor = zlib.decompressobj(wbits=-zlib.MAX_WBITS)
+
+ try:
+ chunk = self.decompressor.decompress(chunk)
+ except Exception:
+ raise ContentEncodingError(
+ "Can not decode content-encoding: %s" % self.encoding
+ )
+
+ self._started_decoding = True
+
+ if chunk:
+ self.out.feed_data(chunk, len(chunk))
+
+ def feed_eof(self) -> None:
+ chunk = self.decompressor.flush()
+
+ if chunk or self.size > 0:
+ self.out.feed_data(chunk, len(chunk))
+ if self.encoding == "deflate" and not self.decompressor.eof:
+ raise ContentEncodingError("deflate")
+
+ self.out.feed_eof()
+
+ def begin_http_chunk_receiving(self) -> None:
+ self.out.begin_http_chunk_receiving()
+
+ def end_http_chunk_receiving(self) -> None:
+ self.out.end_http_chunk_receiving()
+
+
+HttpRequestParserPy = HttpRequestParser
+HttpResponseParserPy = HttpResponseParser
+RawRequestMessagePy = RawRequestMessage
+RawResponseMessagePy = RawResponseMessage
+
+try:
+ if not NO_EXTENSIONS:
+ from ._http_parser import ( # type: ignore[import,no-redef]
+ HttpRequestParser,
+ HttpResponseParser,
+ RawRequestMessage,
+ RawResponseMessage,
+ )
+
+ HttpRequestParserC = HttpRequestParser
+ HttpResponseParserC = HttpResponseParser
+ RawRequestMessageC = RawRequestMessage
+ RawResponseMessageC = RawResponseMessage
+except ImportError: # pragma: no cover
+ pass
diff --git a/third_party/python/aiohttp/aiohttp/http_websocket.py b/third_party/python/aiohttp/aiohttp/http_websocket.py
new file mode 100644
index 0000000000..2cfc519309
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/http_websocket.py
@@ -0,0 +1,701 @@
+"""WebSocket protocol versions 13 and 8."""
+
+import asyncio
+import collections
+import json
+import random
+import re
+import sys
+import zlib
+from enum import IntEnum
+from struct import Struct
+from typing import Any, Callable, List, Optional, Pattern, Set, Tuple, Union, cast
+
+from .base_protocol import BaseProtocol
+from .helpers import NO_EXTENSIONS
+from .streams import DataQueue
+from .typedefs import Final
+
+__all__ = (
+ "WS_CLOSED_MESSAGE",
+ "WS_CLOSING_MESSAGE",
+ "WS_KEY",
+ "WebSocketReader",
+ "WebSocketWriter",
+ "WSMessage",
+ "WebSocketError",
+ "WSMsgType",
+ "WSCloseCode",
+)
+
+
+class WSCloseCode(IntEnum):
+ OK = 1000
+ GOING_AWAY = 1001
+ PROTOCOL_ERROR = 1002
+ UNSUPPORTED_DATA = 1003
+ ABNORMAL_CLOSURE = 1006
+ INVALID_TEXT = 1007
+ POLICY_VIOLATION = 1008
+ MESSAGE_TOO_BIG = 1009
+ MANDATORY_EXTENSION = 1010
+ INTERNAL_ERROR = 1011
+ SERVICE_RESTART = 1012
+ TRY_AGAIN_LATER = 1013
+ BAD_GATEWAY = 1014
+
+
+ALLOWED_CLOSE_CODES: Final[Set[int]] = {int(i) for i in WSCloseCode}
+
+
+class WSMsgType(IntEnum):
+ # websocket spec types
+ CONTINUATION = 0x0
+ TEXT = 0x1
+ BINARY = 0x2
+ PING = 0x9
+ PONG = 0xA
+ CLOSE = 0x8
+
+ # aiohttp specific types
+ CLOSING = 0x100
+ CLOSED = 0x101
+ ERROR = 0x102
+
+ text = TEXT
+ binary = BINARY
+ ping = PING
+ pong = PONG
+ close = CLOSE
+ closing = CLOSING
+ closed = CLOSED
+ error = ERROR
+
+
+WS_KEY: Final[bytes] = b"258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
+
+
+UNPACK_LEN2 = Struct("!H").unpack_from
+UNPACK_LEN3 = Struct("!Q").unpack_from
+UNPACK_CLOSE_CODE = Struct("!H").unpack
+PACK_LEN1 = Struct("!BB").pack
+PACK_LEN2 = Struct("!BBH").pack
+PACK_LEN3 = Struct("!BBQ").pack
+PACK_CLOSE_CODE = Struct("!H").pack
+MSG_SIZE: Final[int] = 2**14
+DEFAULT_LIMIT: Final[int] = 2**16
+
+
+_WSMessageBase = collections.namedtuple("_WSMessageBase", ["type", "data", "extra"])
+
+
+class WSMessage(_WSMessageBase):
+ def json(self, *, loads: Callable[[Any], Any] = json.loads) -> Any:
+ """Return parsed JSON data.
+
+ .. versionadded:: 0.22
+ """
+ return loads(self.data)
+
+
+WS_CLOSED_MESSAGE = WSMessage(WSMsgType.CLOSED, None, None)
+WS_CLOSING_MESSAGE = WSMessage(WSMsgType.CLOSING, None, None)
+
+
+class WebSocketError(Exception):
+ """WebSocket protocol parser error."""
+
+ def __init__(self, code: int, message: str) -> None:
+ self.code = code
+ super().__init__(code, message)
+
+ def __str__(self) -> str:
+ return cast(str, self.args[1])
+
+
+class WSHandshakeError(Exception):
+ """WebSocket protocol handshake error."""
+
+
+native_byteorder: Final[str] = sys.byteorder
+
+
+# Used by _websocket_mask_python
+_XOR_TABLE: Final[List[bytes]] = [bytes(a ^ b for a in range(256)) for b in range(256)]
+
+
+def _websocket_mask_python(mask: bytes, data: bytearray) -> None:
+ """Websocket masking function.
+
+ `mask` is a `bytes` object of length 4; `data` is a `bytearray`
+ object of any length. The contents of `data` are masked with `mask`,
+ as specified in section 5.3 of RFC 6455.
+
+ Note that this function mutates the `data` argument.
+
+ This pure-python implementation may be replaced by an optimized
+ version when available.
+
+ """
+ assert isinstance(data, bytearray), data
+ assert len(mask) == 4, mask
+
+ if data:
+ a, b, c, d = (_XOR_TABLE[n] for n in mask)
+ data[::4] = data[::4].translate(a)
+ data[1::4] = data[1::4].translate(b)
+ data[2::4] = data[2::4].translate(c)
+ data[3::4] = data[3::4].translate(d)
+
+
+if NO_EXTENSIONS: # pragma: no cover
+ _websocket_mask = _websocket_mask_python
+else:
+ try:
+ from ._websocket import _websocket_mask_cython # type: ignore[import]
+
+ _websocket_mask = _websocket_mask_cython
+ except ImportError: # pragma: no cover
+ _websocket_mask = _websocket_mask_python
+
+_WS_DEFLATE_TRAILING: Final[bytes] = bytes([0x00, 0x00, 0xFF, 0xFF])
+
+
+_WS_EXT_RE: Final[Pattern[str]] = re.compile(
+ r"^(?:;\s*(?:"
+ r"(server_no_context_takeover)|"
+ r"(client_no_context_takeover)|"
+ r"(server_max_window_bits(?:=(\d+))?)|"
+ r"(client_max_window_bits(?:=(\d+))?)))*$"
+)
+
+_WS_EXT_RE_SPLIT: Final[Pattern[str]] = re.compile(r"permessage-deflate([^,]+)?")
+
+
+def ws_ext_parse(extstr: Optional[str], isserver: bool = False) -> Tuple[int, bool]:
+ if not extstr:
+ return 0, False
+
+ compress = 0
+ notakeover = False
+ for ext in _WS_EXT_RE_SPLIT.finditer(extstr):
+ defext = ext.group(1)
+ # Return compress = 15 when get `permessage-deflate`
+ if not defext:
+ compress = 15
+ break
+ match = _WS_EXT_RE.match(defext)
+ if match:
+ compress = 15
+ if isserver:
+ # Server never fail to detect compress handshake.
+ # Server does not need to send max wbit to client
+ if match.group(4):
+ compress = int(match.group(4))
+ # Group3 must match if group4 matches
+ # Compress wbit 8 does not support in zlib
+ # If compress level not support,
+ # CONTINUE to next extension
+ if compress > 15 or compress < 9:
+ compress = 0
+ continue
+ if match.group(1):
+ notakeover = True
+ # Ignore regex group 5 & 6 for client_max_window_bits
+ break
+ else:
+ if match.group(6):
+ compress = int(match.group(6))
+ # Group5 must match if group6 matches
+ # Compress wbit 8 does not support in zlib
+ # If compress level not support,
+ # FAIL the parse progress
+ if compress > 15 or compress < 9:
+ raise WSHandshakeError("Invalid window size")
+ if match.group(2):
+ notakeover = True
+ # Ignore regex group 5 & 6 for client_max_window_bits
+ break
+ # Return Fail if client side and not match
+ elif not isserver:
+ raise WSHandshakeError("Extension for deflate not supported" + ext.group(1))
+
+ return compress, notakeover
+
+
+def ws_ext_gen(
+ compress: int = 15, isserver: bool = False, server_notakeover: bool = False
+) -> str:
+ # client_notakeover=False not used for server
+ # compress wbit 8 does not support in zlib
+ if compress < 9 or compress > 15:
+ raise ValueError(
+ "Compress wbits must between 9 and 15, " "zlib does not support wbits=8"
+ )
+ enabledext = ["permessage-deflate"]
+ if not isserver:
+ enabledext.append("client_max_window_bits")
+
+ if compress < 15:
+ enabledext.append("server_max_window_bits=" + str(compress))
+ if server_notakeover:
+ enabledext.append("server_no_context_takeover")
+ # if client_notakeover:
+ # enabledext.append('client_no_context_takeover')
+ return "; ".join(enabledext)
+
+
+class WSParserState(IntEnum):
+ READ_HEADER = 1
+ READ_PAYLOAD_LENGTH = 2
+ READ_PAYLOAD_MASK = 3
+ READ_PAYLOAD = 4
+
+
+class WebSocketReader:
+ def __init__(
+ self, queue: DataQueue[WSMessage], max_msg_size: int, compress: bool = True
+ ) -> None:
+ self.queue = queue
+ self._max_msg_size = max_msg_size
+
+ self._exc: Optional[BaseException] = None
+ self._partial = bytearray()
+ self._state = WSParserState.READ_HEADER
+
+ self._opcode: Optional[int] = None
+ self._frame_fin = False
+ self._frame_opcode: Optional[int] = None
+ self._frame_payload = bytearray()
+
+ self._tail = b""
+ self._has_mask = False
+ self._frame_mask: Optional[bytes] = None
+ self._payload_length = 0
+ self._payload_length_flag = 0
+ self._compressed: Optional[bool] = None
+ self._decompressobj: Any = None # zlib.decompressobj actually
+ self._compress = compress
+
+ def feed_eof(self) -> None:
+ self.queue.feed_eof()
+
+ def feed_data(self, data: bytes) -> Tuple[bool, bytes]:
+ if self._exc:
+ return True, data
+
+ try:
+ return self._feed_data(data)
+ except Exception as exc:
+ self._exc = exc
+ self.queue.set_exception(exc)
+ return True, b""
+
+ def _feed_data(self, data: bytes) -> Tuple[bool, bytes]:
+ for fin, opcode, payload, compressed in self.parse_frame(data):
+ if compressed and not self._decompressobj:
+ self._decompressobj = zlib.decompressobj(wbits=-zlib.MAX_WBITS)
+ if opcode == WSMsgType.CLOSE:
+ if len(payload) >= 2:
+ close_code = UNPACK_CLOSE_CODE(payload[:2])[0]
+ if close_code < 3000 and close_code not in ALLOWED_CLOSE_CODES:
+ raise WebSocketError(
+ WSCloseCode.PROTOCOL_ERROR,
+ f"Invalid close code: {close_code}",
+ )
+ try:
+ close_message = payload[2:].decode("utf-8")
+ except UnicodeDecodeError as exc:
+ raise WebSocketError(
+ WSCloseCode.INVALID_TEXT, "Invalid UTF-8 text message"
+ ) from exc
+ msg = WSMessage(WSMsgType.CLOSE, close_code, close_message)
+ elif payload:
+ raise WebSocketError(
+ WSCloseCode.PROTOCOL_ERROR,
+ f"Invalid close frame: {fin} {opcode} {payload!r}",
+ )
+ else:
+ msg = WSMessage(WSMsgType.CLOSE, 0, "")
+
+ self.queue.feed_data(msg, 0)
+
+ elif opcode == WSMsgType.PING:
+ self.queue.feed_data(
+ WSMessage(WSMsgType.PING, payload, ""), len(payload)
+ )
+
+ elif opcode == WSMsgType.PONG:
+ self.queue.feed_data(
+ WSMessage(WSMsgType.PONG, payload, ""), len(payload)
+ )
+
+ elif (
+ opcode not in (WSMsgType.TEXT, WSMsgType.BINARY)
+ and self._opcode is None
+ ):
+ raise WebSocketError(
+ WSCloseCode.PROTOCOL_ERROR, f"Unexpected opcode={opcode!r}"
+ )
+ else:
+ # load text/binary
+ if not fin:
+ # got partial frame payload
+ if opcode != WSMsgType.CONTINUATION:
+ self._opcode = opcode
+ self._partial.extend(payload)
+ if self._max_msg_size and len(self._partial) >= self._max_msg_size:
+ raise WebSocketError(
+ WSCloseCode.MESSAGE_TOO_BIG,
+ "Message size {} exceeds limit {}".format(
+ len(self._partial), self._max_msg_size
+ ),
+ )
+ else:
+ # previous frame was non finished
+ # we should get continuation opcode
+ if self._partial:
+ if opcode != WSMsgType.CONTINUATION:
+ raise WebSocketError(
+ WSCloseCode.PROTOCOL_ERROR,
+ "The opcode in non-fin frame is expected "
+ "to be zero, got {!r}".format(opcode),
+ )
+
+ if opcode == WSMsgType.CONTINUATION:
+ assert self._opcode is not None
+ opcode = self._opcode
+ self._opcode = None
+
+ self._partial.extend(payload)
+ if self._max_msg_size and len(self._partial) >= self._max_msg_size:
+ raise WebSocketError(
+ WSCloseCode.MESSAGE_TOO_BIG,
+ "Message size {} exceeds limit {}".format(
+ len(self._partial), self._max_msg_size
+ ),
+ )
+
+ # Decompress process must to be done after all packets
+ # received.
+ if compressed:
+ self._partial.extend(_WS_DEFLATE_TRAILING)
+ payload_merged = self._decompressobj.decompress(
+ self._partial, self._max_msg_size
+ )
+ if self._decompressobj.unconsumed_tail:
+ left = len(self._decompressobj.unconsumed_tail)
+ raise WebSocketError(
+ WSCloseCode.MESSAGE_TOO_BIG,
+ "Decompressed message size {} exceeds limit {}".format(
+ self._max_msg_size + left, self._max_msg_size
+ ),
+ )
+ else:
+ payload_merged = bytes(self._partial)
+
+ self._partial.clear()
+
+ if opcode == WSMsgType.TEXT:
+ try:
+ text = payload_merged.decode("utf-8")
+ self.queue.feed_data(
+ WSMessage(WSMsgType.TEXT, text, ""), len(text)
+ )
+ except UnicodeDecodeError as exc:
+ raise WebSocketError(
+ WSCloseCode.INVALID_TEXT, "Invalid UTF-8 text message"
+ ) from exc
+ else:
+ self.queue.feed_data(
+ WSMessage(WSMsgType.BINARY, payload_merged, ""),
+ len(payload_merged),
+ )
+
+ return False, b""
+
+ def parse_frame(
+ self, buf: bytes
+ ) -> List[Tuple[bool, Optional[int], bytearray, Optional[bool]]]:
+ """Return the next frame from the socket."""
+ frames = []
+ if self._tail:
+ buf, self._tail = self._tail + buf, b""
+
+ start_pos = 0
+ buf_length = len(buf)
+
+ while True:
+ # read header
+ if self._state == WSParserState.READ_HEADER:
+ if buf_length - start_pos >= 2:
+ data = buf[start_pos : start_pos + 2]
+ start_pos += 2
+ first_byte, second_byte = data
+
+ fin = (first_byte >> 7) & 1
+ rsv1 = (first_byte >> 6) & 1
+ rsv2 = (first_byte >> 5) & 1
+ rsv3 = (first_byte >> 4) & 1
+ opcode = first_byte & 0xF
+
+ # frame-fin = %x0 ; more frames of this message follow
+ # / %x1 ; final frame of this message
+ # frame-rsv1 = %x0 ;
+ # 1 bit, MUST be 0 unless negotiated otherwise
+ # frame-rsv2 = %x0 ;
+ # 1 bit, MUST be 0 unless negotiated otherwise
+ # frame-rsv3 = %x0 ;
+ # 1 bit, MUST be 0 unless negotiated otherwise
+ #
+ # Remove rsv1 from this test for deflate development
+ if rsv2 or rsv3 or (rsv1 and not self._compress):
+ raise WebSocketError(
+ WSCloseCode.PROTOCOL_ERROR,
+ "Received frame with non-zero reserved bits",
+ )
+
+ if opcode > 0x7 and fin == 0:
+ raise WebSocketError(
+ WSCloseCode.PROTOCOL_ERROR,
+ "Received fragmented control frame",
+ )
+
+ has_mask = (second_byte >> 7) & 1
+ length = second_byte & 0x7F
+
+ # Control frames MUST have a payload
+ # length of 125 bytes or less
+ if opcode > 0x7 and length > 125:
+ raise WebSocketError(
+ WSCloseCode.PROTOCOL_ERROR,
+ "Control frame payload cannot be " "larger than 125 bytes",
+ )
+
+ # Set compress status if last package is FIN
+ # OR set compress status if this is first fragment
+ # Raise error if not first fragment with rsv1 = 0x1
+ if self._frame_fin or self._compressed is None:
+ self._compressed = True if rsv1 else False
+ elif rsv1:
+ raise WebSocketError(
+ WSCloseCode.PROTOCOL_ERROR,
+ "Received frame with non-zero reserved bits",
+ )
+
+ self._frame_fin = bool(fin)
+ self._frame_opcode = opcode
+ self._has_mask = bool(has_mask)
+ self._payload_length_flag = length
+ self._state = WSParserState.READ_PAYLOAD_LENGTH
+ else:
+ break
+
+ # read payload length
+ if self._state == WSParserState.READ_PAYLOAD_LENGTH:
+ length = self._payload_length_flag
+ if length == 126:
+ if buf_length - start_pos >= 2:
+ data = buf[start_pos : start_pos + 2]
+ start_pos += 2
+ length = UNPACK_LEN2(data)[0]
+ self._payload_length = length
+ self._state = (
+ WSParserState.READ_PAYLOAD_MASK
+ if self._has_mask
+ else WSParserState.READ_PAYLOAD
+ )
+ else:
+ break
+ elif length > 126:
+ if buf_length - start_pos >= 8:
+ data = buf[start_pos : start_pos + 8]
+ start_pos += 8
+ length = UNPACK_LEN3(data)[0]
+ self._payload_length = length
+ self._state = (
+ WSParserState.READ_PAYLOAD_MASK
+ if self._has_mask
+ else WSParserState.READ_PAYLOAD
+ )
+ else:
+ break
+ else:
+ self._payload_length = length
+ self._state = (
+ WSParserState.READ_PAYLOAD_MASK
+ if self._has_mask
+ else WSParserState.READ_PAYLOAD
+ )
+
+ # read payload mask
+ if self._state == WSParserState.READ_PAYLOAD_MASK:
+ if buf_length - start_pos >= 4:
+ self._frame_mask = buf[start_pos : start_pos + 4]
+ start_pos += 4
+ self._state = WSParserState.READ_PAYLOAD
+ else:
+ break
+
+ if self._state == WSParserState.READ_PAYLOAD:
+ length = self._payload_length
+ payload = self._frame_payload
+
+ chunk_len = buf_length - start_pos
+ if length >= chunk_len:
+ self._payload_length = length - chunk_len
+ payload.extend(buf[start_pos:])
+ start_pos = buf_length
+ else:
+ self._payload_length = 0
+ payload.extend(buf[start_pos : start_pos + length])
+ start_pos = start_pos + length
+
+ if self._payload_length == 0:
+ if self._has_mask:
+ assert self._frame_mask is not None
+ _websocket_mask(self._frame_mask, payload)
+
+ frames.append(
+ (self._frame_fin, self._frame_opcode, payload, self._compressed)
+ )
+
+ self._frame_payload = bytearray()
+ self._state = WSParserState.READ_HEADER
+ else:
+ break
+
+ self._tail = buf[start_pos:]
+
+ return frames
+
+
+class WebSocketWriter:
+ def __init__(
+ self,
+ protocol: BaseProtocol,
+ transport: asyncio.Transport,
+ *,
+ use_mask: bool = False,
+ limit: int = DEFAULT_LIMIT,
+ random: Any = random.Random(),
+ compress: int = 0,
+ notakeover: bool = False,
+ ) -> None:
+ self.protocol = protocol
+ self.transport = transport
+ self.use_mask = use_mask
+ self.randrange = random.randrange
+ self.compress = compress
+ self.notakeover = notakeover
+ self._closing = False
+ self._limit = limit
+ self._output_size = 0
+ self._compressobj: Any = None # actually compressobj
+
+ async def _send_frame(
+ self, message: bytes, opcode: int, compress: Optional[int] = None
+ ) -> None:
+ """Send a frame over the websocket with message as its payload."""
+ if self._closing and not (opcode & WSMsgType.CLOSE):
+ raise ConnectionResetError("Cannot write to closing transport")
+
+ rsv = 0
+
+ # Only compress larger packets (disabled)
+ # Does small packet needs to be compressed?
+ # if self.compress and opcode < 8 and len(message) > 124:
+ if (compress or self.compress) and opcode < 8:
+ if compress:
+ # Do not set self._compress if compressing is for this frame
+ compressobj = zlib.compressobj(level=zlib.Z_BEST_SPEED, wbits=-compress)
+ else: # self.compress
+ if not self._compressobj:
+ self._compressobj = zlib.compressobj(
+ level=zlib.Z_BEST_SPEED, wbits=-self.compress
+ )
+ compressobj = self._compressobj
+
+ message = compressobj.compress(message)
+ message = message + compressobj.flush(
+ zlib.Z_FULL_FLUSH if self.notakeover else zlib.Z_SYNC_FLUSH
+ )
+ if message.endswith(_WS_DEFLATE_TRAILING):
+ message = message[:-4]
+ rsv = rsv | 0x40
+
+ msg_length = len(message)
+
+ use_mask = self.use_mask
+ if use_mask:
+ mask_bit = 0x80
+ else:
+ mask_bit = 0
+
+ if msg_length < 126:
+ header = PACK_LEN1(0x80 | rsv | opcode, msg_length | mask_bit)
+ elif msg_length < (1 << 16):
+ header = PACK_LEN2(0x80 | rsv | opcode, 126 | mask_bit, msg_length)
+ else:
+ header = PACK_LEN3(0x80 | rsv | opcode, 127 | mask_bit, msg_length)
+ if use_mask:
+ mask = self.randrange(0, 0xFFFFFFFF)
+ mask = mask.to_bytes(4, "big")
+ message = bytearray(message)
+ _websocket_mask(mask, message)
+ self._write(header + mask + message)
+ self._output_size += len(header) + len(mask) + len(message)
+ else:
+ if len(message) > MSG_SIZE:
+ self._write(header)
+ self._write(message)
+ else:
+ self._write(header + message)
+
+ self._output_size += len(header) + len(message)
+
+ if self._output_size > self._limit:
+ self._output_size = 0
+ await self.protocol._drain_helper()
+
+ def _write(self, data: bytes) -> None:
+ if self.transport is None or self.transport.is_closing():
+ raise ConnectionResetError("Cannot write to closing transport")
+ self.transport.write(data)
+
+ async def pong(self, message: bytes = b"") -> None:
+ """Send pong message."""
+ if isinstance(message, str):
+ message = message.encode("utf-8")
+ await self._send_frame(message, WSMsgType.PONG)
+
+ async def ping(self, message: bytes = b"") -> None:
+ """Send ping message."""
+ if isinstance(message, str):
+ message = message.encode("utf-8")
+ await self._send_frame(message, WSMsgType.PING)
+
+ async def send(
+ self,
+ message: Union[str, bytes],
+ binary: bool = False,
+ compress: Optional[int] = None,
+ ) -> None:
+ """Send a frame over the websocket with message as its payload."""
+ if isinstance(message, str):
+ message = message.encode("utf-8")
+ if binary:
+ await self._send_frame(message, WSMsgType.BINARY, compress)
+ else:
+ await self._send_frame(message, WSMsgType.TEXT, compress)
+
+ async def close(self, code: int = 1000, message: bytes = b"") -> None:
+ """Close the websocket, sending the specified code and message."""
+ if isinstance(message, str):
+ message = message.encode("utf-8")
+ try:
+ await self._send_frame(
+ PACK_CLOSE_CODE(code) + message, opcode=WSMsgType.CLOSE
+ )
+ finally:
+ self._closing = True
diff --git a/third_party/python/aiohttp/aiohttp/http_writer.py b/third_party/python/aiohttp/aiohttp/http_writer.py
new file mode 100644
index 0000000000..73f0f96f0a
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/http_writer.py
@@ -0,0 +1,198 @@
+"""Http related parsers and protocol."""
+
+import asyncio
+import zlib
+from typing import Any, Awaitable, Callable, NamedTuple, Optional, Union # noqa
+
+from multidict import CIMultiDict
+
+from .abc import AbstractStreamWriter
+from .base_protocol import BaseProtocol
+from .helpers import NO_EXTENSIONS
+
+__all__ = ("StreamWriter", "HttpVersion", "HttpVersion10", "HttpVersion11")
+
+
+class HttpVersion(NamedTuple):
+ major: int
+ minor: int
+
+
+HttpVersion10 = HttpVersion(1, 0)
+HttpVersion11 = HttpVersion(1, 1)
+
+
+_T_OnChunkSent = Optional[Callable[[bytes], Awaitable[None]]]
+_T_OnHeadersSent = Optional[Callable[["CIMultiDict[str]"], Awaitable[None]]]
+
+
+class StreamWriter(AbstractStreamWriter):
+ def __init__(
+ self,
+ protocol: BaseProtocol,
+ loop: asyncio.AbstractEventLoop,
+ on_chunk_sent: _T_OnChunkSent = None,
+ on_headers_sent: _T_OnHeadersSent = None,
+ ) -> None:
+ self._protocol = protocol
+
+ self.loop = loop
+ self.length = None
+ self.chunked = False
+ self.buffer_size = 0
+ self.output_size = 0
+
+ self._eof = False
+ self._compress: Any = None
+ self._drain_waiter = None
+
+ self._on_chunk_sent: _T_OnChunkSent = on_chunk_sent
+ self._on_headers_sent: _T_OnHeadersSent = on_headers_sent
+
+ @property
+ def transport(self) -> Optional[asyncio.Transport]:
+ return self._protocol.transport
+
+ @property
+ def protocol(self) -> BaseProtocol:
+ return self._protocol
+
+ def enable_chunking(self) -> None:
+ self.chunked = True
+
+ def enable_compression(
+ self, encoding: str = "deflate", strategy: int = zlib.Z_DEFAULT_STRATEGY
+ ) -> None:
+ zlib_mode = 16 + zlib.MAX_WBITS if encoding == "gzip" else zlib.MAX_WBITS
+ self._compress = zlib.compressobj(wbits=zlib_mode, strategy=strategy)
+
+ def _write(self, chunk: bytes) -> None:
+ size = len(chunk)
+ self.buffer_size += size
+ self.output_size += size
+ transport = self.transport
+ if not self._protocol.connected or transport is None or transport.is_closing():
+ raise ConnectionResetError("Cannot write to closing transport")
+ transport.write(chunk)
+
+ async def write(
+ self, chunk: bytes, *, drain: bool = True, LIMIT: int = 0x10000
+ ) -> None:
+ """Writes chunk of data to a stream.
+
+ write_eof() indicates end of stream.
+ writer can't be used after write_eof() method being called.
+ write() return drain future.
+ """
+ if self._on_chunk_sent is not None:
+ await self._on_chunk_sent(chunk)
+
+ if isinstance(chunk, memoryview):
+ if chunk.nbytes != len(chunk):
+ # just reshape it
+ chunk = chunk.cast("c")
+
+ if self._compress is not None:
+ chunk = self._compress.compress(chunk)
+ if not chunk:
+ return
+
+ if self.length is not None:
+ chunk_len = len(chunk)
+ if self.length >= chunk_len:
+ self.length = self.length - chunk_len
+ else:
+ chunk = chunk[: self.length]
+ self.length = 0
+ if not chunk:
+ return
+
+ if chunk:
+ if self.chunked:
+ chunk_len_pre = ("%x\r\n" % len(chunk)).encode("ascii")
+ chunk = chunk_len_pre + chunk + b"\r\n"
+
+ self._write(chunk)
+
+ if self.buffer_size > LIMIT and drain:
+ self.buffer_size = 0
+ await self.drain()
+
+ async def write_headers(
+ self, status_line: str, headers: "CIMultiDict[str]"
+ ) -> None:
+ """Write request/response status and headers."""
+ if self._on_headers_sent is not None:
+ await self._on_headers_sent(headers)
+
+ # status + headers
+ buf = _serialize_headers(status_line, headers)
+ self._write(buf)
+
+ async def write_eof(self, chunk: bytes = b"") -> None:
+ if self._eof:
+ return
+
+ if chunk and self._on_chunk_sent is not None:
+ await self._on_chunk_sent(chunk)
+
+ if self._compress:
+ if chunk:
+ chunk = self._compress.compress(chunk)
+
+ chunk = chunk + self._compress.flush()
+ if chunk and self.chunked:
+ chunk_len = ("%x\r\n" % len(chunk)).encode("ascii")
+ chunk = chunk_len + chunk + b"\r\n0\r\n\r\n"
+ else:
+ if self.chunked:
+ if chunk:
+ chunk_len = ("%x\r\n" % len(chunk)).encode("ascii")
+ chunk = chunk_len + chunk + b"\r\n0\r\n\r\n"
+ else:
+ chunk = b"0\r\n\r\n"
+
+ if chunk:
+ self._write(chunk)
+
+ await self.drain()
+
+ self._eof = True
+
+ async def drain(self) -> None:
+ """Flush the write buffer.
+
+ The intended use is to write
+
+ await w.write(data)
+ await w.drain()
+ """
+ if self._protocol.transport is not None:
+ await self._protocol._drain_helper()
+
+
+def _safe_header(string: str) -> str:
+ if "\r" in string or "\n" in string:
+ raise ValueError(
+ "Newline or carriage return detected in headers. "
+ "Potential header injection attack."
+ )
+ return string
+
+
+def _py_serialize_headers(status_line: str, headers: "CIMultiDict[str]") -> bytes:
+ headers_gen = (_safe_header(k) + ": " + _safe_header(v) for k, v in headers.items())
+ line = status_line + "\r\n" + "\r\n".join(headers_gen) + "\r\n\r\n"
+ return line.encode("utf-8")
+
+
+_serialize_headers = _py_serialize_headers
+
+try:
+ import aiohttp._http_writer as _http_writer # type: ignore[import]
+
+ _c_serialize_headers = _http_writer._serialize_headers
+ if not NO_EXTENSIONS:
+ _serialize_headers = _c_serialize_headers
+except ImportError:
+ pass
diff --git a/third_party/python/aiohttp/aiohttp/locks.py b/third_party/python/aiohttp/aiohttp/locks.py
new file mode 100644
index 0000000000..de2dc83d09
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/locks.py
@@ -0,0 +1,41 @@
+import asyncio
+import collections
+from typing import Any, Deque, Optional
+
+
+class EventResultOrError:
+ """Event asyncio lock helper class.
+
+ Wraps the Event asyncio lock allowing either to awake the
+ locked Tasks without any error or raising an exception.
+
+ thanks to @vorpalsmith for the simple design.
+ """
+
+ def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
+ self._loop = loop
+ self._exc: Optional[BaseException] = None
+ self._event = asyncio.Event()
+ self._waiters: Deque[asyncio.Future[Any]] = collections.deque()
+
+ def set(self, exc: Optional[BaseException] = None) -> None:
+ self._exc = exc
+ self._event.set()
+
+ async def wait(self) -> Any:
+ waiter = self._loop.create_task(self._event.wait())
+ self._waiters.append(waiter)
+ try:
+ val = await waiter
+ finally:
+ self._waiters.remove(waiter)
+
+ if self._exc is not None:
+ raise self._exc
+
+ return val
+
+ def cancel(self) -> None:
+ """Cancel all waiters"""
+ for waiter in self._waiters:
+ waiter.cancel()
diff --git a/third_party/python/aiohttp/aiohttp/log.py b/third_party/python/aiohttp/aiohttp/log.py
new file mode 100644
index 0000000000..3cecea2bac
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/log.py
@@ -0,0 +1,8 @@
+import logging
+
+access_logger = logging.getLogger("aiohttp.access")
+client_logger = logging.getLogger("aiohttp.client")
+internal_logger = logging.getLogger("aiohttp.internal")
+server_logger = logging.getLogger("aiohttp.server")
+web_logger = logging.getLogger("aiohttp.web")
+ws_logger = logging.getLogger("aiohttp.websocket")
diff --git a/third_party/python/aiohttp/aiohttp/multipart.py b/third_party/python/aiohttp/aiohttp/multipart.py
new file mode 100644
index 0000000000..73801f459a
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/multipart.py
@@ -0,0 +1,961 @@
+import base64
+import binascii
+import json
+import re
+import uuid
+import warnings
+import zlib
+from collections import deque
+from types import TracebackType
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ AsyncIterator,
+ Deque,
+ Dict,
+ Iterator,
+ List,
+ Mapping,
+ Optional,
+ Sequence,
+ Tuple,
+ Type,
+ Union,
+ cast,
+)
+from urllib.parse import parse_qsl, unquote, urlencode
+
+from multidict import CIMultiDict, CIMultiDictProxy, MultiMapping
+
+from .hdrs import (
+ CONTENT_DISPOSITION,
+ CONTENT_ENCODING,
+ CONTENT_LENGTH,
+ CONTENT_TRANSFER_ENCODING,
+ CONTENT_TYPE,
+)
+from .helpers import CHAR, TOKEN, parse_mimetype, reify
+from .http import HeadersParser
+from .payload import (
+ JsonPayload,
+ LookupError,
+ Order,
+ Payload,
+ StringPayload,
+ get_payload,
+ payload_type,
+)
+from .streams import StreamReader
+
+__all__ = (
+ "MultipartReader",
+ "MultipartWriter",
+ "BodyPartReader",
+ "BadContentDispositionHeader",
+ "BadContentDispositionParam",
+ "parse_content_disposition",
+ "content_disposition_filename",
+)
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from .client_reqrep import ClientResponse
+
+
+class BadContentDispositionHeader(RuntimeWarning):
+ pass
+
+
+class BadContentDispositionParam(RuntimeWarning):
+ pass
+
+
+def parse_content_disposition(
+ header: Optional[str],
+) -> Tuple[Optional[str], Dict[str, str]]:
+ def is_token(string: str) -> bool:
+ return bool(string) and TOKEN >= set(string)
+
+ def is_quoted(string: str) -> bool:
+ return string[0] == string[-1] == '"'
+
+ def is_rfc5987(string: str) -> bool:
+ return is_token(string) and string.count("'") == 2
+
+ def is_extended_param(string: str) -> bool:
+ return string.endswith("*")
+
+ def is_continuous_param(string: str) -> bool:
+ pos = string.find("*") + 1
+ if not pos:
+ return False
+ substring = string[pos:-1] if string.endswith("*") else string[pos:]
+ return substring.isdigit()
+
+ def unescape(text: str, *, chars: str = "".join(map(re.escape, CHAR))) -> str:
+ return re.sub(f"\\\\([{chars}])", "\\1", text)
+
+ if not header:
+ return None, {}
+
+ disptype, *parts = header.split(";")
+ if not is_token(disptype):
+ warnings.warn(BadContentDispositionHeader(header))
+ return None, {}
+
+ params: Dict[str, str] = {}
+ while parts:
+ item = parts.pop(0)
+
+ if "=" not in item:
+ warnings.warn(BadContentDispositionHeader(header))
+ return None, {}
+
+ key, value = item.split("=", 1)
+ key = key.lower().strip()
+ value = value.lstrip()
+
+ if key in params:
+ warnings.warn(BadContentDispositionHeader(header))
+ return None, {}
+
+ if not is_token(key):
+ warnings.warn(BadContentDispositionParam(item))
+ continue
+
+ elif is_continuous_param(key):
+ if is_quoted(value):
+ value = unescape(value[1:-1])
+ elif not is_token(value):
+ warnings.warn(BadContentDispositionParam(item))
+ continue
+
+ elif is_extended_param(key):
+ if is_rfc5987(value):
+ encoding, _, value = value.split("'", 2)
+ encoding = encoding or "utf-8"
+ else:
+ warnings.warn(BadContentDispositionParam(item))
+ continue
+
+ try:
+ value = unquote(value, encoding, "strict")
+ except UnicodeDecodeError: # pragma: nocover
+ warnings.warn(BadContentDispositionParam(item))
+ continue
+
+ else:
+ failed = True
+ if is_quoted(value):
+ failed = False
+ value = unescape(value[1:-1].lstrip("\\/"))
+ elif is_token(value):
+ failed = False
+ elif parts:
+ # maybe just ; in filename, in any case this is just
+ # one case fix, for proper fix we need to redesign parser
+ _value = f"{value};{parts[0]}"
+ if is_quoted(_value):
+ parts.pop(0)
+ value = unescape(_value[1:-1].lstrip("\\/"))
+ failed = False
+
+ if failed:
+ warnings.warn(BadContentDispositionHeader(header))
+ return None, {}
+
+ params[key] = value
+
+ return disptype.lower(), params
+
+
+def content_disposition_filename(
+ params: Mapping[str, str], name: str = "filename"
+) -> Optional[str]:
+ name_suf = "%s*" % name
+ if not params:
+ return None
+ elif name_suf in params:
+ return params[name_suf]
+ elif name in params:
+ return params[name]
+ else:
+ parts = []
+ fnparams = sorted(
+ (key, value) for key, value in params.items() if key.startswith(name_suf)
+ )
+ for num, (key, value) in enumerate(fnparams):
+ _, tail = key.split("*", 1)
+ if tail.endswith("*"):
+ tail = tail[:-1]
+ if tail == str(num):
+ parts.append(value)
+ else:
+ break
+ if not parts:
+ return None
+ value = "".join(parts)
+ if "'" in value:
+ encoding, _, value = value.split("'", 2)
+ encoding = encoding or "utf-8"
+ return unquote(value, encoding, "strict")
+ return value
+
+
+class MultipartResponseWrapper:
+ """Wrapper around the MultipartReader.
+
+ It takes care about
+ underlying connection and close it when it needs in.
+ """
+
+ def __init__(
+ self,
+ resp: "ClientResponse",
+ stream: "MultipartReader",
+ ) -> None:
+ self.resp = resp
+ self.stream = stream
+
+ def __aiter__(self) -> "MultipartResponseWrapper":
+ return self
+
+ async def __anext__(
+ self,
+ ) -> Union["MultipartReader", "BodyPartReader"]:
+ part = await self.next()
+ if part is None:
+ raise StopAsyncIteration
+ return part
+
+ def at_eof(self) -> bool:
+ """Returns True when all response data had been read."""
+ return self.resp.content.at_eof()
+
+ async def next(
+ self,
+ ) -> Optional[Union["MultipartReader", "BodyPartReader"]]:
+ """Emits next multipart reader object."""
+ item = await self.stream.next()
+ if self.stream.at_eof():
+ await self.release()
+ return item
+
+ async def release(self) -> None:
+ """Release the connection gracefully.
+
+ All remaining content is read to the void.
+ """
+ await self.resp.release()
+
+
+class BodyPartReader:
+ """Multipart reader for single body part."""
+
+ chunk_size = 8192
+
+ def __init__(
+ self, boundary: bytes, headers: "CIMultiDictProxy[str]", content: StreamReader
+ ) -> None:
+ self.headers = headers
+ self._boundary = boundary
+ self._content = content
+ self._at_eof = False
+ length = self.headers.get(CONTENT_LENGTH, None)
+ self._length = int(length) if length is not None else None
+ self._read_bytes = 0
+ # TODO: typeing.Deque is not supported by Python 3.5
+ self._unread: Deque[bytes] = deque()
+ self._prev_chunk: Optional[bytes] = None
+ self._content_eof = 0
+ self._cache: Dict[str, Any] = {}
+
+ def __aiter__(self) -> AsyncIterator["BodyPartReader"]:
+ return self # type: ignore[return-value]
+
+ async def __anext__(self) -> bytes:
+ part = await self.next()
+ if part is None:
+ raise StopAsyncIteration
+ return part
+
+ async def next(self) -> Optional[bytes]:
+ item = await self.read()
+ if not item:
+ return None
+ return item
+
+ async def read(self, *, decode: bool = False) -> bytes:
+ """Reads body part data.
+
+ decode: Decodes data following by encoding
+ method from Content-Encoding header. If it missed
+ data remains untouched
+ """
+ if self._at_eof:
+ return b""
+ data = bytearray()
+ while not self._at_eof:
+ data.extend(await self.read_chunk(self.chunk_size))
+ if decode:
+ return self.decode(data)
+ return data
+
+ async def read_chunk(self, size: int = chunk_size) -> bytes:
+ """Reads body part content chunk of the specified size.
+
+ size: chunk size
+ """
+ if self._at_eof:
+ return b""
+ if self._length:
+ chunk = await self._read_chunk_from_length(size)
+ else:
+ chunk = await self._read_chunk_from_stream(size)
+
+ self._read_bytes += len(chunk)
+ if self._read_bytes == self._length:
+ self._at_eof = True
+ if self._at_eof:
+ clrf = await self._content.readline()
+ assert (
+ b"\r\n" == clrf
+ ), "reader did not read all the data or it is malformed"
+ return chunk
+
+ async def _read_chunk_from_length(self, size: int) -> bytes:
+ # Reads body part content chunk of the specified size.
+ # The body part must has Content-Length header with proper value.
+ assert self._length is not None, "Content-Length required for chunked read"
+ chunk_size = min(size, self._length - self._read_bytes)
+ chunk = await self._content.read(chunk_size)
+ return chunk
+
+ async def _read_chunk_from_stream(self, size: int) -> bytes:
+ # Reads content chunk of body part with unknown length.
+ # The Content-Length header for body part is not necessary.
+ assert (
+ size >= len(self._boundary) + 2
+ ), "Chunk size must be greater or equal than boundary length + 2"
+ first_chunk = self._prev_chunk is None
+ if first_chunk:
+ self._prev_chunk = await self._content.read(size)
+
+ chunk = await self._content.read(size)
+ self._content_eof += int(self._content.at_eof())
+ assert self._content_eof < 3, "Reading after EOF"
+ assert self._prev_chunk is not None
+ window = self._prev_chunk + chunk
+ sub = b"\r\n" + self._boundary
+ if first_chunk:
+ idx = window.find(sub)
+ else:
+ idx = window.find(sub, max(0, len(self._prev_chunk) - len(sub)))
+ if idx >= 0:
+ # pushing boundary back to content
+ with warnings.catch_warnings():
+ warnings.filterwarnings("ignore", category=DeprecationWarning)
+ self._content.unread_data(window[idx:])
+ if size > idx:
+ self._prev_chunk = self._prev_chunk[:idx]
+ chunk = window[len(self._prev_chunk) : idx]
+ if not chunk:
+ self._at_eof = True
+ result = self._prev_chunk
+ self._prev_chunk = chunk
+ return result
+
+ async def readline(self) -> bytes:
+ """Reads body part by line by line."""
+ if self._at_eof:
+ return b""
+
+ if self._unread:
+ line = self._unread.popleft()
+ else:
+ line = await self._content.readline()
+
+ if line.startswith(self._boundary):
+ # the very last boundary may not come with \r\n,
+ # so set single rules for everyone
+ sline = line.rstrip(b"\r\n")
+ boundary = self._boundary
+ last_boundary = self._boundary + b"--"
+ # ensure that we read exactly the boundary, not something alike
+ if sline == boundary or sline == last_boundary:
+ self._at_eof = True
+ self._unread.append(line)
+ return b""
+ else:
+ next_line = await self._content.readline()
+ if next_line.startswith(self._boundary):
+ line = line[:-2] # strip CRLF but only once
+ self._unread.append(next_line)
+
+ return line
+
+ async def release(self) -> None:
+ """Like read(), but reads all the data to the void."""
+ if self._at_eof:
+ return
+ while not self._at_eof:
+ await self.read_chunk(self.chunk_size)
+
+ async def text(self, *, encoding: Optional[str] = None) -> str:
+ """Like read(), but assumes that body part contains text data."""
+ data = await self.read(decode=True)
+ # see https://www.w3.org/TR/html5/forms.html#multipart/form-data-encoding-algorithm # NOQA
+ # and https://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#dom-xmlhttprequest-send # NOQA
+ encoding = encoding or self.get_charset(default="utf-8")
+ return data.decode(encoding)
+
+ async def json(self, *, encoding: Optional[str] = None) -> Optional[Dict[str, Any]]:
+ """Like read(), but assumes that body parts contains JSON data."""
+ data = await self.read(decode=True)
+ if not data:
+ return None
+ encoding = encoding or self.get_charset(default="utf-8")
+ return cast(Dict[str, Any], json.loads(data.decode(encoding)))
+
+ async def form(self, *, encoding: Optional[str] = None) -> List[Tuple[str, str]]:
+ """Like read(), but assumes that body parts contain form urlencoded data."""
+ data = await self.read(decode=True)
+ if not data:
+ return []
+ if encoding is not None:
+ real_encoding = encoding
+ else:
+ real_encoding = self.get_charset(default="utf-8")
+ return parse_qsl(
+ data.rstrip().decode(real_encoding),
+ keep_blank_values=True,
+ encoding=real_encoding,
+ )
+
+ def at_eof(self) -> bool:
+ """Returns True if the boundary was reached or False otherwise."""
+ return self._at_eof
+
+ def decode(self, data: bytes) -> bytes:
+ """Decodes data.
+
+ Decoding is done according the specified Content-Encoding
+ or Content-Transfer-Encoding headers value.
+ """
+ if CONTENT_TRANSFER_ENCODING in self.headers:
+ data = self._decode_content_transfer(data)
+ if CONTENT_ENCODING in self.headers:
+ return self._decode_content(data)
+ return data
+
+ def _decode_content(self, data: bytes) -> bytes:
+ encoding = self.headers.get(CONTENT_ENCODING, "").lower()
+
+ if encoding == "deflate":
+ return zlib.decompress(data, -zlib.MAX_WBITS)
+ elif encoding == "gzip":
+ return zlib.decompress(data, 16 + zlib.MAX_WBITS)
+ elif encoding == "identity":
+ return data
+ else:
+ raise RuntimeError(f"unknown content encoding: {encoding}")
+
+ def _decode_content_transfer(self, data: bytes) -> bytes:
+ encoding = self.headers.get(CONTENT_TRANSFER_ENCODING, "").lower()
+
+ if encoding == "base64":
+ return base64.b64decode(data)
+ elif encoding == "quoted-printable":
+ return binascii.a2b_qp(data)
+ elif encoding in ("binary", "8bit", "7bit"):
+ return data
+ else:
+ raise RuntimeError(
+ "unknown content transfer encoding: {}" "".format(encoding)
+ )
+
+ def get_charset(self, default: str) -> str:
+ """Returns charset parameter from Content-Type header or default."""
+ ctype = self.headers.get(CONTENT_TYPE, "")
+ mimetype = parse_mimetype(ctype)
+ return mimetype.parameters.get("charset", default)
+
+ @reify
+ def name(self) -> Optional[str]:
+ """Returns name specified in Content-Disposition header.
+
+ If the header is missing or malformed, returns None.
+ """
+ _, params = parse_content_disposition(self.headers.get(CONTENT_DISPOSITION))
+ return content_disposition_filename(params, "name")
+
+ @reify
+ def filename(self) -> Optional[str]:
+ """Returns filename specified in Content-Disposition header.
+
+ Returns None if the header is missing or malformed.
+ """
+ _, params = parse_content_disposition(self.headers.get(CONTENT_DISPOSITION))
+ return content_disposition_filename(params, "filename")
+
+
+@payload_type(BodyPartReader, order=Order.try_first)
+class BodyPartReaderPayload(Payload):
+ def __init__(self, value: BodyPartReader, *args: Any, **kwargs: Any) -> None:
+ super().__init__(value, *args, **kwargs)
+
+ params: Dict[str, str] = {}
+ if value.name is not None:
+ params["name"] = value.name
+ if value.filename is not None:
+ params["filename"] = value.filename
+
+ if params:
+ self.set_content_disposition("attachment", True, **params)
+
+ async def write(self, writer: Any) -> None:
+ field = self._value
+ chunk = await field.read_chunk(size=2**16)
+ while chunk:
+ await writer.write(field.decode(chunk))
+ chunk = await field.read_chunk(size=2**16)
+
+
+class MultipartReader:
+ """Multipart body reader."""
+
+ #: Response wrapper, used when multipart readers constructs from response.
+ response_wrapper_cls = MultipartResponseWrapper
+ #: Multipart reader class, used to handle multipart/* body parts.
+ #: None points to type(self)
+ multipart_reader_cls = None
+ #: Body part reader class for non multipart/* content types.
+ part_reader_cls = BodyPartReader
+
+ def __init__(self, headers: Mapping[str, str], content: StreamReader) -> None:
+ self.headers = headers
+ self._boundary = ("--" + self._get_boundary()).encode()
+ self._content = content
+ self._last_part: Optional[Union["MultipartReader", BodyPartReader]] = None
+ self._at_eof = False
+ self._at_bof = True
+ self._unread: List[bytes] = []
+
+ def __aiter__(
+ self,
+ ) -> AsyncIterator["BodyPartReader"]:
+ return self # type: ignore[return-value]
+
+ async def __anext__(
+ self,
+ ) -> Optional[Union["MultipartReader", BodyPartReader]]:
+ part = await self.next()
+ if part is None:
+ raise StopAsyncIteration
+ return part
+
+ @classmethod
+ def from_response(
+ cls,
+ response: "ClientResponse",
+ ) -> MultipartResponseWrapper:
+ """Constructs reader instance from HTTP response.
+
+ :param response: :class:`~aiohttp.client.ClientResponse` instance
+ """
+ obj = cls.response_wrapper_cls(
+ response, cls(response.headers, response.content)
+ )
+ return obj
+
+ def at_eof(self) -> bool:
+ """Returns True if the final boundary was reached, false otherwise."""
+ return self._at_eof
+
+ async def next(
+ self,
+ ) -> Optional[Union["MultipartReader", BodyPartReader]]:
+ """Emits the next multipart body part."""
+ # So, if we're at BOF, we need to skip till the boundary.
+ if self._at_eof:
+ return None
+ await self._maybe_release_last_part()
+ if self._at_bof:
+ await self._read_until_first_boundary()
+ self._at_bof = False
+ else:
+ await self._read_boundary()
+ if self._at_eof: # we just read the last boundary, nothing to do there
+ return None
+ self._last_part = await self.fetch_next_part()
+ return self._last_part
+
+ async def release(self) -> None:
+ """Reads all the body parts to the void till the final boundary."""
+ while not self._at_eof:
+ item = await self.next()
+ if item is None:
+ break
+ await item.release()
+
+ async def fetch_next_part(
+ self,
+ ) -> Union["MultipartReader", BodyPartReader]:
+ """Returns the next body part reader."""
+ headers = await self._read_headers()
+ return self._get_part_reader(headers)
+
+ def _get_part_reader(
+ self,
+ headers: "CIMultiDictProxy[str]",
+ ) -> Union["MultipartReader", BodyPartReader]:
+ """Dispatches the response by the `Content-Type` header.
+
+ Returns a suitable reader instance.
+
+ :param dict headers: Response headers
+ """
+ ctype = headers.get(CONTENT_TYPE, "")
+ mimetype = parse_mimetype(ctype)
+
+ if mimetype.type == "multipart":
+ if self.multipart_reader_cls is None:
+ return type(self)(headers, self._content)
+ return self.multipart_reader_cls(headers, self._content)
+ else:
+ return self.part_reader_cls(self._boundary, headers, self._content)
+
+ def _get_boundary(self) -> str:
+ mimetype = parse_mimetype(self.headers[CONTENT_TYPE])
+
+ assert mimetype.type == "multipart", "multipart/* content type expected"
+
+ if "boundary" not in mimetype.parameters:
+ raise ValueError(
+ "boundary missed for Content-Type: %s" % self.headers[CONTENT_TYPE]
+ )
+
+ boundary = mimetype.parameters["boundary"]
+ if len(boundary) > 70:
+ raise ValueError("boundary %r is too long (70 chars max)" % boundary)
+
+ return boundary
+
+ async def _readline(self) -> bytes:
+ if self._unread:
+ return self._unread.pop()
+ return await self._content.readline()
+
+ async def _read_until_first_boundary(self) -> None:
+ while True:
+ chunk = await self._readline()
+ if chunk == b"":
+ raise ValueError(
+ "Could not find starting boundary %r" % (self._boundary)
+ )
+ chunk = chunk.rstrip()
+ if chunk == self._boundary:
+ return
+ elif chunk == self._boundary + b"--":
+ self._at_eof = True
+ return
+
+ async def _read_boundary(self) -> None:
+ chunk = (await self._readline()).rstrip()
+ if chunk == self._boundary:
+ pass
+ elif chunk == self._boundary + b"--":
+ self._at_eof = True
+ epilogue = await self._readline()
+ next_line = await self._readline()
+
+ # the epilogue is expected and then either the end of input or the
+ # parent multipart boundary, if the parent boundary is found then
+ # it should be marked as unread and handed to the parent for
+ # processing
+ if next_line[:2] == b"--":
+ self._unread.append(next_line)
+ # otherwise the request is likely missing an epilogue and both
+ # lines should be passed to the parent for processing
+ # (this handles the old behavior gracefully)
+ else:
+ self._unread.extend([next_line, epilogue])
+ else:
+ raise ValueError(f"Invalid boundary {chunk!r}, expected {self._boundary!r}")
+
+ async def _read_headers(self) -> "CIMultiDictProxy[str]":
+ lines = [b""]
+ while True:
+ chunk = await self._content.readline()
+ chunk = chunk.strip()
+ lines.append(chunk)
+ if not chunk:
+ break
+ parser = HeadersParser()
+ headers, raw_headers = parser.parse_headers(lines)
+ return headers
+
+ async def _maybe_release_last_part(self) -> None:
+ """Ensures that the last read body part is read completely."""
+ if self._last_part is not None:
+ if not self._last_part.at_eof():
+ await self._last_part.release()
+ self._unread.extend(self._last_part._unread)
+ self._last_part = None
+
+
+_Part = Tuple[Payload, str, str]
+
+
+class MultipartWriter(Payload):
+ """Multipart body writer."""
+
+ def __init__(self, subtype: str = "mixed", boundary: Optional[str] = None) -> None:
+ boundary = boundary if boundary is not None else uuid.uuid4().hex
+ # The underlying Payload API demands a str (utf-8), not bytes,
+ # so we need to ensure we don't lose anything during conversion.
+ # As a result, require the boundary to be ASCII only.
+ # In both situations.
+
+ try:
+ self._boundary = boundary.encode("ascii")
+ except UnicodeEncodeError:
+ raise ValueError("boundary should contain ASCII only chars") from None
+ ctype = f"multipart/{subtype}; boundary={self._boundary_value}"
+
+ super().__init__(None, content_type=ctype)
+
+ self._parts: List[_Part] = []
+
+ def __enter__(self) -> "MultipartWriter":
+ return self
+
+ def __exit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc_val: Optional[BaseException],
+ exc_tb: Optional[TracebackType],
+ ) -> None:
+ pass
+
+ def __iter__(self) -> Iterator[_Part]:
+ return iter(self._parts)
+
+ def __len__(self) -> int:
+ return len(self._parts)
+
+ def __bool__(self) -> bool:
+ return True
+
+ _valid_tchar_regex = re.compile(rb"\A[!#$%&'*+\-.^_`|~\w]+\Z")
+ _invalid_qdtext_char_regex = re.compile(rb"[\x00-\x08\x0A-\x1F\x7F]")
+
+ @property
+ def _boundary_value(self) -> str:
+ """Wrap boundary parameter value in quotes, if necessary.
+
+ Reads self.boundary and returns a unicode sting.
+ """
+ # Refer to RFCs 7231, 7230, 5234.
+ #
+ # parameter = token "=" ( token / quoted-string )
+ # token = 1*tchar
+ # quoted-string = DQUOTE *( qdtext / quoted-pair ) DQUOTE
+ # qdtext = HTAB / SP / %x21 / %x23-5B / %x5D-7E / obs-text
+ # obs-text = %x80-FF
+ # quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
+ # tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
+ # / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
+ # / DIGIT / ALPHA
+ # ; any VCHAR, except delimiters
+ # VCHAR = %x21-7E
+ value = self._boundary
+ if re.match(self._valid_tchar_regex, value):
+ return value.decode("ascii") # cannot fail
+
+ if re.search(self._invalid_qdtext_char_regex, value):
+ raise ValueError("boundary value contains invalid characters")
+
+ # escape %x5C and %x22
+ quoted_value_content = value.replace(b"\\", b"\\\\")
+ quoted_value_content = quoted_value_content.replace(b'"', b'\\"')
+
+ return '"' + quoted_value_content.decode("ascii") + '"'
+
+ @property
+ def boundary(self) -> str:
+ return self._boundary.decode("ascii")
+
+ def append(self, obj: Any, headers: Optional[MultiMapping[str]] = None) -> Payload:
+ if headers is None:
+ headers = CIMultiDict()
+
+ if isinstance(obj, Payload):
+ obj.headers.update(headers)
+ return self.append_payload(obj)
+ else:
+ try:
+ payload = get_payload(obj, headers=headers)
+ except LookupError:
+ raise TypeError("Cannot create payload from %r" % obj)
+ else:
+ return self.append_payload(payload)
+
+ def append_payload(self, payload: Payload) -> Payload:
+ """Adds a new body part to multipart writer."""
+ # compression
+ encoding: Optional[str] = payload.headers.get(
+ CONTENT_ENCODING,
+ "",
+ ).lower()
+ if encoding and encoding not in ("deflate", "gzip", "identity"):
+ raise RuntimeError(f"unknown content encoding: {encoding}")
+ if encoding == "identity":
+ encoding = None
+
+ # te encoding
+ te_encoding: Optional[str] = payload.headers.get(
+ CONTENT_TRANSFER_ENCODING,
+ "",
+ ).lower()
+ if te_encoding not in ("", "base64", "quoted-printable", "binary"):
+ raise RuntimeError(
+ "unknown content transfer encoding: {}" "".format(te_encoding)
+ )
+ if te_encoding == "binary":
+ te_encoding = None
+
+ # size
+ size = payload.size
+ if size is not None and not (encoding or te_encoding):
+ payload.headers[CONTENT_LENGTH] = str(size)
+
+ self._parts.append((payload, encoding, te_encoding)) # type: ignore[arg-type]
+ return payload
+
+ def append_json(
+ self, obj: Any, headers: Optional[MultiMapping[str]] = None
+ ) -> Payload:
+ """Helper to append JSON part."""
+ if headers is None:
+ headers = CIMultiDict()
+
+ return self.append_payload(JsonPayload(obj, headers=headers))
+
+ def append_form(
+ self,
+ obj: Union[Sequence[Tuple[str, str]], Mapping[str, str]],
+ headers: Optional[MultiMapping[str]] = None,
+ ) -> Payload:
+ """Helper to append form urlencoded part."""
+ assert isinstance(obj, (Sequence, Mapping))
+
+ if headers is None:
+ headers = CIMultiDict()
+
+ if isinstance(obj, Mapping):
+ obj = list(obj.items())
+ data = urlencode(obj, doseq=True)
+
+ return self.append_payload(
+ StringPayload(
+ data, headers=headers, content_type="application/x-www-form-urlencoded"
+ )
+ )
+
+ @property
+ def size(self) -> Optional[int]:
+ """Size of the payload."""
+ total = 0
+ for part, encoding, te_encoding in self._parts:
+ if encoding or te_encoding or part.size is None:
+ return None
+
+ total += int(
+ 2
+ + len(self._boundary)
+ + 2
+ + part.size # b'--'+self._boundary+b'\r\n'
+ + len(part._binary_headers)
+ + 2 # b'\r\n'
+ )
+
+ total += 2 + len(self._boundary) + 4 # b'--'+self._boundary+b'--\r\n'
+ return total
+
+ async def write(self, writer: Any, close_boundary: bool = True) -> None:
+ """Write body."""
+ for part, encoding, te_encoding in self._parts:
+ await writer.write(b"--" + self._boundary + b"\r\n")
+ await writer.write(part._binary_headers)
+
+ if encoding or te_encoding:
+ w = MultipartPayloadWriter(writer)
+ if encoding:
+ w.enable_compression(encoding)
+ if te_encoding:
+ w.enable_encoding(te_encoding)
+ await part.write(w) # type: ignore[arg-type]
+ await w.write_eof()
+ else:
+ await part.write(writer)
+
+ await writer.write(b"\r\n")
+
+ if close_boundary:
+ await writer.write(b"--" + self._boundary + b"--\r\n")
+
+
+class MultipartPayloadWriter:
+ def __init__(self, writer: Any) -> None:
+ self._writer = writer
+ self._encoding: Optional[str] = None
+ self._compress: Any = None
+ self._encoding_buffer: Optional[bytearray] = None
+
+ def enable_encoding(self, encoding: str) -> None:
+ if encoding == "base64":
+ self._encoding = encoding
+ self._encoding_buffer = bytearray()
+ elif encoding == "quoted-printable":
+ self._encoding = "quoted-printable"
+
+ def enable_compression(
+ self, encoding: str = "deflate", strategy: int = zlib.Z_DEFAULT_STRATEGY
+ ) -> None:
+ zlib_mode = 16 + zlib.MAX_WBITS if encoding == "gzip" else -zlib.MAX_WBITS
+ self._compress = zlib.compressobj(wbits=zlib_mode, strategy=strategy)
+
+ async def write_eof(self) -> None:
+ if self._compress is not None:
+ chunk = self._compress.flush()
+ if chunk:
+ self._compress = None
+ await self.write(chunk)
+
+ if self._encoding == "base64":
+ if self._encoding_buffer:
+ await self._writer.write(base64.b64encode(self._encoding_buffer))
+
+ async def write(self, chunk: bytes) -> None:
+ if self._compress is not None:
+ if chunk:
+ chunk = self._compress.compress(chunk)
+ if not chunk:
+ return
+
+ if self._encoding == "base64":
+ buf = self._encoding_buffer
+ assert buf is not None
+ buf.extend(chunk)
+
+ if buf:
+ div, mod = divmod(len(buf), 3)
+ enc_chunk, self._encoding_buffer = (buf[: div * 3], buf[div * 3 :])
+ if enc_chunk:
+ b64chunk = base64.b64encode(enc_chunk)
+ await self._writer.write(b64chunk)
+ elif self._encoding == "quoted-printable":
+ await self._writer.write(binascii.b2a_qp(chunk))
+ else:
+ await self._writer.write(chunk)
diff --git a/third_party/python/aiohttp/aiohttp/payload.py b/third_party/python/aiohttp/aiohttp/payload.py
new file mode 100644
index 0000000000..a2340e2945
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/payload.py
@@ -0,0 +1,465 @@
+import asyncio
+import enum
+import io
+import json
+import mimetypes
+import os
+import warnings
+from abc import ABC, abstractmethod
+from itertools import chain
+from typing import (
+ IO,
+ TYPE_CHECKING,
+ Any,
+ ByteString,
+ Dict,
+ Iterable,
+ Optional,
+ TextIO,
+ Tuple,
+ Type,
+ Union,
+)
+
+from multidict import CIMultiDict
+
+from . import hdrs
+from .abc import AbstractStreamWriter
+from .helpers import (
+ PY_36,
+ content_disposition_header,
+ guess_filename,
+ parse_mimetype,
+ sentinel,
+)
+from .streams import StreamReader
+from .typedefs import Final, JSONEncoder, _CIMultiDict
+
+__all__ = (
+ "PAYLOAD_REGISTRY",
+ "get_payload",
+ "payload_type",
+ "Payload",
+ "BytesPayload",
+ "StringPayload",
+ "IOBasePayload",
+ "BytesIOPayload",
+ "BufferedReaderPayload",
+ "TextIOPayload",
+ "StringIOPayload",
+ "JsonPayload",
+ "AsyncIterablePayload",
+)
+
+TOO_LARGE_BYTES_BODY: Final[int] = 2**20 # 1 MB
+
+if TYPE_CHECKING: # pragma: no cover
+ from typing import List
+
+
+class LookupError(Exception):
+ pass
+
+
+class Order(str, enum.Enum):
+ normal = "normal"
+ try_first = "try_first"
+ try_last = "try_last"
+
+
+def get_payload(data: Any, *args: Any, **kwargs: Any) -> "Payload":
+ return PAYLOAD_REGISTRY.get(data, *args, **kwargs)
+
+
+def register_payload(
+ factory: Type["Payload"], type: Any, *, order: Order = Order.normal
+) -> None:
+ PAYLOAD_REGISTRY.register(factory, type, order=order)
+
+
+class payload_type:
+ def __init__(self, type: Any, *, order: Order = Order.normal) -> None:
+ self.type = type
+ self.order = order
+
+ def __call__(self, factory: Type["Payload"]) -> Type["Payload"]:
+ register_payload(factory, self.type, order=self.order)
+ return factory
+
+
+PayloadType = Type["Payload"]
+_PayloadRegistryItem = Tuple[PayloadType, Any]
+
+
+class PayloadRegistry:
+ """Payload registry.
+
+ note: we need zope.interface for more efficient adapter search
+ """
+
+ def __init__(self) -> None:
+ self._first: List[_PayloadRegistryItem] = []
+ self._normal: List[_PayloadRegistryItem] = []
+ self._last: List[_PayloadRegistryItem] = []
+
+ def get(
+ self,
+ data: Any,
+ *args: Any,
+ _CHAIN: "Type[chain[_PayloadRegistryItem]]" = chain,
+ **kwargs: Any,
+ ) -> "Payload":
+ if isinstance(data, Payload):
+ return data
+ for factory, type in _CHAIN(self._first, self._normal, self._last):
+ if isinstance(data, type):
+ return factory(data, *args, **kwargs)
+
+ raise LookupError()
+
+ def register(
+ self, factory: PayloadType, type: Any, *, order: Order = Order.normal
+ ) -> None:
+ if order is Order.try_first:
+ self._first.append((factory, type))
+ elif order is Order.normal:
+ self._normal.append((factory, type))
+ elif order is Order.try_last:
+ self._last.append((factory, type))
+ else:
+ raise ValueError(f"Unsupported order {order!r}")
+
+
+class Payload(ABC):
+
+ _default_content_type: str = "application/octet-stream"
+ _size: Optional[int] = None
+
+ def __init__(
+ self,
+ value: Any,
+ headers: Optional[
+ Union[_CIMultiDict, Dict[str, str], Iterable[Tuple[str, str]]]
+ ] = None,
+ content_type: Optional[str] = sentinel,
+ filename: Optional[str] = None,
+ encoding: Optional[str] = None,
+ **kwargs: Any,
+ ) -> None:
+ self._encoding = encoding
+ self._filename = filename
+ self._headers: _CIMultiDict = CIMultiDict()
+ self._value = value
+ if content_type is not sentinel and content_type is not None:
+ self._headers[hdrs.CONTENT_TYPE] = content_type
+ elif self._filename is not None:
+ content_type = mimetypes.guess_type(self._filename)[0]
+ if content_type is None:
+ content_type = self._default_content_type
+ self._headers[hdrs.CONTENT_TYPE] = content_type
+ else:
+ self._headers[hdrs.CONTENT_TYPE] = self._default_content_type
+ self._headers.update(headers or {})
+
+ @property
+ def size(self) -> Optional[int]:
+ """Size of the payload."""
+ return self._size
+
+ @property
+ def filename(self) -> Optional[str]:
+ """Filename of the payload."""
+ return self._filename
+
+ @property
+ def headers(self) -> _CIMultiDict:
+ """Custom item headers"""
+ return self._headers
+
+ @property
+ def _binary_headers(self) -> bytes:
+ return (
+ "".join([k + ": " + v + "\r\n" for k, v in self.headers.items()]).encode(
+ "utf-8"
+ )
+ + b"\r\n"
+ )
+
+ @property
+ def encoding(self) -> Optional[str]:
+ """Payload encoding"""
+ return self._encoding
+
+ @property
+ def content_type(self) -> str:
+ """Content type"""
+ return self._headers[hdrs.CONTENT_TYPE]
+
+ def set_content_disposition(
+ self,
+ disptype: str,
+ quote_fields: bool = True,
+ _charset: str = "utf-8",
+ **params: Any,
+ ) -> None:
+ """Sets ``Content-Disposition`` header."""
+ self._headers[hdrs.CONTENT_DISPOSITION] = content_disposition_header(
+ disptype, quote_fields=quote_fields, _charset=_charset, **params
+ )
+
+ @abstractmethod
+ async def write(self, writer: AbstractStreamWriter) -> None:
+ """Write payload.
+
+ writer is an AbstractStreamWriter instance:
+ """
+
+
+class BytesPayload(Payload):
+ def __init__(self, value: ByteString, *args: Any, **kwargs: Any) -> None:
+ if not isinstance(value, (bytes, bytearray, memoryview)):
+ raise TypeError(f"value argument must be byte-ish, not {type(value)!r}")
+
+ if "content_type" not in kwargs:
+ kwargs["content_type"] = "application/octet-stream"
+
+ super().__init__(value, *args, **kwargs)
+
+ if isinstance(value, memoryview):
+ self._size = value.nbytes
+ else:
+ self._size = len(value)
+
+ if self._size > TOO_LARGE_BYTES_BODY:
+ if PY_36:
+ kwargs = {"source": self}
+ else:
+ kwargs = {}
+ warnings.warn(
+ "Sending a large body directly with raw bytes might"
+ " lock the event loop. You should probably pass an "
+ "io.BytesIO object instead",
+ ResourceWarning,
+ **kwargs,
+ )
+
+ async def write(self, writer: AbstractStreamWriter) -> None:
+ await writer.write(self._value)
+
+
+class StringPayload(BytesPayload):
+ def __init__(
+ self,
+ value: str,
+ *args: Any,
+ encoding: Optional[str] = None,
+ content_type: Optional[str] = None,
+ **kwargs: Any,
+ ) -> None:
+
+ if encoding is None:
+ if content_type is None:
+ real_encoding = "utf-8"
+ content_type = "text/plain; charset=utf-8"
+ else:
+ mimetype = parse_mimetype(content_type)
+ real_encoding = mimetype.parameters.get("charset", "utf-8")
+ else:
+ if content_type is None:
+ content_type = "text/plain; charset=%s" % encoding
+ real_encoding = encoding
+
+ super().__init__(
+ value.encode(real_encoding),
+ encoding=real_encoding,
+ content_type=content_type,
+ *args,
+ **kwargs,
+ )
+
+
+class StringIOPayload(StringPayload):
+ def __init__(self, value: IO[str], *args: Any, **kwargs: Any) -> None:
+ super().__init__(value.read(), *args, **kwargs)
+
+
+class IOBasePayload(Payload):
+ _value: IO[Any]
+
+ def __init__(
+ self, value: IO[Any], disposition: str = "attachment", *args: Any, **kwargs: Any
+ ) -> None:
+ if "filename" not in kwargs:
+ kwargs["filename"] = guess_filename(value)
+
+ super().__init__(value, *args, **kwargs)
+
+ if self._filename is not None and disposition is not None:
+ if hdrs.CONTENT_DISPOSITION not in self.headers:
+ self.set_content_disposition(disposition, filename=self._filename)
+
+ async def write(self, writer: AbstractStreamWriter) -> None:
+ loop = asyncio.get_event_loop()
+ try:
+ chunk = await loop.run_in_executor(None, self._value.read, 2**16)
+ while chunk:
+ await writer.write(chunk)
+ chunk = await loop.run_in_executor(None, self._value.read, 2**16)
+ finally:
+ await loop.run_in_executor(None, self._value.close)
+
+
+class TextIOPayload(IOBasePayload):
+ _value: TextIO
+
+ def __init__(
+ self,
+ value: TextIO,
+ *args: Any,
+ encoding: Optional[str] = None,
+ content_type: Optional[str] = None,
+ **kwargs: Any,
+ ) -> None:
+
+ if encoding is None:
+ if content_type is None:
+ encoding = "utf-8"
+ content_type = "text/plain; charset=utf-8"
+ else:
+ mimetype = parse_mimetype(content_type)
+ encoding = mimetype.parameters.get("charset", "utf-8")
+ else:
+ if content_type is None:
+ content_type = "text/plain; charset=%s" % encoding
+
+ super().__init__(
+ value,
+ content_type=content_type,
+ encoding=encoding,
+ *args,
+ **kwargs,
+ )
+
+ @property
+ def size(self) -> Optional[int]:
+ try:
+ return os.fstat(self._value.fileno()).st_size - self._value.tell()
+ except OSError:
+ return None
+
+ async def write(self, writer: AbstractStreamWriter) -> None:
+ loop = asyncio.get_event_loop()
+ try:
+ chunk = await loop.run_in_executor(None, self._value.read, 2**16)
+ while chunk:
+ data = (
+ chunk.encode(encoding=self._encoding)
+ if self._encoding
+ else chunk.encode()
+ )
+ await writer.write(data)
+ chunk = await loop.run_in_executor(None, self._value.read, 2**16)
+ finally:
+ await loop.run_in_executor(None, self._value.close)
+
+
+class BytesIOPayload(IOBasePayload):
+ @property
+ def size(self) -> int:
+ position = self._value.tell()
+ end = self._value.seek(0, os.SEEK_END)
+ self._value.seek(position)
+ return end - position
+
+
+class BufferedReaderPayload(IOBasePayload):
+ @property
+ def size(self) -> Optional[int]:
+ try:
+ return os.fstat(self._value.fileno()).st_size - self._value.tell()
+ except OSError:
+ # data.fileno() is not supported, e.g.
+ # io.BufferedReader(io.BytesIO(b'data'))
+ return None
+
+
+class JsonPayload(BytesPayload):
+ def __init__(
+ self,
+ value: Any,
+ encoding: str = "utf-8",
+ content_type: str = "application/json",
+ dumps: JSONEncoder = json.dumps,
+ *args: Any,
+ **kwargs: Any,
+ ) -> None:
+
+ super().__init__(
+ dumps(value).encode(encoding),
+ content_type=content_type,
+ encoding=encoding,
+ *args,
+ **kwargs,
+ )
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from typing import AsyncIterable, AsyncIterator
+
+ _AsyncIterator = AsyncIterator[bytes]
+ _AsyncIterable = AsyncIterable[bytes]
+else:
+ from collections.abc import AsyncIterable, AsyncIterator
+
+ _AsyncIterator = AsyncIterator
+ _AsyncIterable = AsyncIterable
+
+
+class AsyncIterablePayload(Payload):
+
+ _iter: Optional[_AsyncIterator] = None
+
+ def __init__(self, value: _AsyncIterable, *args: Any, **kwargs: Any) -> None:
+ if not isinstance(value, AsyncIterable):
+ raise TypeError(
+ "value argument must support "
+ "collections.abc.AsyncIterable interface, "
+ "got {!r}".format(type(value))
+ )
+
+ if "content_type" not in kwargs:
+ kwargs["content_type"] = "application/octet-stream"
+
+ super().__init__(value, *args, **kwargs)
+
+ self._iter = value.__aiter__()
+
+ async def write(self, writer: AbstractStreamWriter) -> None:
+ if self._iter:
+ try:
+ # iter is not None check prevents rare cases
+ # when the case iterable is used twice
+ while True:
+ chunk = await self._iter.__anext__()
+ await writer.write(chunk)
+ except StopAsyncIteration:
+ self._iter = None
+
+
+class StreamReaderPayload(AsyncIterablePayload):
+ def __init__(self, value: StreamReader, *args: Any, **kwargs: Any) -> None:
+ super().__init__(value.iter_any(), *args, **kwargs)
+
+
+PAYLOAD_REGISTRY = PayloadRegistry()
+PAYLOAD_REGISTRY.register(BytesPayload, (bytes, bytearray, memoryview))
+PAYLOAD_REGISTRY.register(StringPayload, str)
+PAYLOAD_REGISTRY.register(StringIOPayload, io.StringIO)
+PAYLOAD_REGISTRY.register(TextIOPayload, io.TextIOBase)
+PAYLOAD_REGISTRY.register(BytesIOPayload, io.BytesIO)
+PAYLOAD_REGISTRY.register(BufferedReaderPayload, (io.BufferedReader, io.BufferedRandom))
+PAYLOAD_REGISTRY.register(IOBasePayload, io.IOBase)
+PAYLOAD_REGISTRY.register(StreamReaderPayload, StreamReader)
+# try_last for giving a chance to more specialized async interables like
+# multidict.BodyPartReaderPayload override the default
+PAYLOAD_REGISTRY.register(AsyncIterablePayload, AsyncIterable, order=Order.try_last)
diff --git a/third_party/python/aiohttp/aiohttp/payload_streamer.py b/third_party/python/aiohttp/aiohttp/payload_streamer.py
new file mode 100644
index 0000000000..9f8b8bc57c
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/payload_streamer.py
@@ -0,0 +1,75 @@
+"""
+Payload implemenation for coroutines as data provider.
+
+As a simple case, you can upload data from file::
+
+ @aiohttp.streamer
+ async def file_sender(writer, file_name=None):
+ with open(file_name, 'rb') as f:
+ chunk = f.read(2**16)
+ while chunk:
+ await writer.write(chunk)
+
+ chunk = f.read(2**16)
+
+Then you can use `file_sender` like this:
+
+ async with session.post('http://httpbin.org/post',
+ data=file_sender(file_name='huge_file')) as resp:
+ print(await resp.text())
+
+..note:: Coroutine must accept `writer` as first argument
+
+"""
+
+import types
+import warnings
+from typing import Any, Awaitable, Callable, Dict, Tuple
+
+from .abc import AbstractStreamWriter
+from .payload import Payload, payload_type
+
+__all__ = ("streamer",)
+
+
+class _stream_wrapper:
+ def __init__(
+ self,
+ coro: Callable[..., Awaitable[None]],
+ args: Tuple[Any, ...],
+ kwargs: Dict[str, Any],
+ ) -> None:
+ self.coro = types.coroutine(coro)
+ self.args = args
+ self.kwargs = kwargs
+
+ async def __call__(self, writer: AbstractStreamWriter) -> None:
+ await self.coro(writer, *self.args, **self.kwargs) # type: ignore[operator]
+
+
+class streamer:
+ def __init__(self, coro: Callable[..., Awaitable[None]]) -> None:
+ warnings.warn(
+ "@streamer is deprecated, use async generators instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ self.coro = coro
+
+ def __call__(self, *args: Any, **kwargs: Any) -> _stream_wrapper:
+ return _stream_wrapper(self.coro, args, kwargs)
+
+
+@payload_type(_stream_wrapper)
+class StreamWrapperPayload(Payload):
+ async def write(self, writer: AbstractStreamWriter) -> None:
+ await self._value(writer)
+
+
+@payload_type(streamer)
+class StreamPayload(StreamWrapperPayload):
+ def __init__(self, value: Any, *args: Any, **kwargs: Any) -> None:
+ super().__init__(value(), *args, **kwargs)
+
+ async def write(self, writer: AbstractStreamWriter) -> None:
+ await self._value(writer)
diff --git a/third_party/python/aiohttp/aiohttp/py.typed b/third_party/python/aiohttp/aiohttp/py.typed
new file mode 100644
index 0000000000..f5642f79f2
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/py.typed
@@ -0,0 +1 @@
+Marker
diff --git a/third_party/python/aiohttp/aiohttp/pytest_plugin.py b/third_party/python/aiohttp/aiohttp/pytest_plugin.py
new file mode 100644
index 0000000000..dd9a9f6179
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/pytest_plugin.py
@@ -0,0 +1,391 @@
+import asyncio
+import contextlib
+import warnings
+from collections.abc import Callable
+from typing import Any, Awaitable, Callable, Dict, Generator, Optional, Union
+
+import pytest
+
+from aiohttp.helpers import PY_37, isasyncgenfunction
+from aiohttp.web import Application
+
+from .test_utils import (
+ BaseTestServer,
+ RawTestServer,
+ TestClient,
+ TestServer,
+ loop_context,
+ setup_test_loop,
+ teardown_test_loop,
+ unused_port as _unused_port,
+)
+
+try:
+ import uvloop
+except ImportError: # pragma: no cover
+ uvloop = None
+
+try:
+ import tokio
+except ImportError: # pragma: no cover
+ tokio = None
+
+AiohttpClient = Callable[[Union[Application, BaseTestServer]], Awaitable[TestClient]]
+
+
+def pytest_addoption(parser): # type: ignore[no-untyped-def]
+ parser.addoption(
+ "--aiohttp-fast",
+ action="store_true",
+ default=False,
+ help="run tests faster by disabling extra checks",
+ )
+ parser.addoption(
+ "--aiohttp-loop",
+ action="store",
+ default="pyloop",
+ help="run tests with specific loop: pyloop, uvloop, tokio or all",
+ )
+ parser.addoption(
+ "--aiohttp-enable-loop-debug",
+ action="store_true",
+ default=False,
+ help="enable event loop debug mode",
+ )
+
+
+def pytest_fixture_setup(fixturedef): # type: ignore[no-untyped-def]
+ """Set up pytest fixture.
+
+ Allow fixtures to be coroutines. Run coroutine fixtures in an event loop.
+ """
+ func = fixturedef.func
+
+ if isasyncgenfunction(func):
+ # async generator fixture
+ is_async_gen = True
+ elif asyncio.iscoroutinefunction(func):
+ # regular async fixture
+ is_async_gen = False
+ else:
+ # not an async fixture, nothing to do
+ return
+
+ strip_request = False
+ if "request" not in fixturedef.argnames:
+ fixturedef.argnames += ("request",)
+ strip_request = True
+
+ def wrapper(*args, **kwargs): # type: ignore[no-untyped-def]
+ request = kwargs["request"]
+ if strip_request:
+ del kwargs["request"]
+
+ # if neither the fixture nor the test use the 'loop' fixture,
+ # 'getfixturevalue' will fail because the test is not parameterized
+ # (this can be removed someday if 'loop' is no longer parameterized)
+ if "loop" not in request.fixturenames:
+ raise Exception(
+ "Asynchronous fixtures must depend on the 'loop' fixture or "
+ "be used in tests depending from it."
+ )
+
+ _loop = request.getfixturevalue("loop")
+
+ if is_async_gen:
+ # for async generators, we need to advance the generator once,
+ # then advance it again in a finalizer
+ gen = func(*args, **kwargs)
+
+ def finalizer(): # type: ignore[no-untyped-def]
+ try:
+ return _loop.run_until_complete(gen.__anext__())
+ except StopAsyncIteration:
+ pass
+
+ request.addfinalizer(finalizer)
+ return _loop.run_until_complete(gen.__anext__())
+ else:
+ return _loop.run_until_complete(func(*args, **kwargs))
+
+ fixturedef.func = wrapper
+
+
+@pytest.fixture
+def fast(request): # type: ignore[no-untyped-def]
+ """--fast config option"""
+ return request.config.getoption("--aiohttp-fast")
+
+
+@pytest.fixture
+def loop_debug(request): # type: ignore[no-untyped-def]
+ """--enable-loop-debug config option"""
+ return request.config.getoption("--aiohttp-enable-loop-debug")
+
+
+@contextlib.contextmanager
+def _runtime_warning_context(): # type: ignore[no-untyped-def]
+ """Context manager which checks for RuntimeWarnings.
+
+ This exists specifically to
+ avoid "coroutine 'X' was never awaited" warnings being missed.
+
+ If RuntimeWarnings occur in the context a RuntimeError is raised.
+ """
+ with warnings.catch_warnings(record=True) as _warnings:
+ yield
+ rw = [
+ "{w.filename}:{w.lineno}:{w.message}".format(w=w)
+ for w in _warnings
+ if w.category == RuntimeWarning
+ ]
+ if rw:
+ raise RuntimeError(
+ "{} Runtime Warning{},\n{}".format(
+ len(rw), "" if len(rw) == 1 else "s", "\n".join(rw)
+ )
+ )
+
+
+@contextlib.contextmanager
+def _passthrough_loop_context(loop, fast=False): # type: ignore[no-untyped-def]
+ """Passthrough loop context.
+
+ Sets up and tears down a loop unless one is passed in via the loop
+ argument when it's passed straight through.
+ """
+ if loop:
+ # loop already exists, pass it straight through
+ yield loop
+ else:
+ # this shadows loop_context's standard behavior
+ loop = setup_test_loop()
+ yield loop
+ teardown_test_loop(loop, fast=fast)
+
+
+def pytest_pycollect_makeitem(collector, name, obj): # type: ignore[no-untyped-def]
+ """Fix pytest collecting for coroutines."""
+ if collector.funcnamefilter(name) and asyncio.iscoroutinefunction(obj):
+ return list(collector._genfunctions(name, obj))
+
+
+def pytest_pyfunc_call(pyfuncitem): # type: ignore[no-untyped-def]
+ """Run coroutines in an event loop instead of a normal function call."""
+ fast = pyfuncitem.config.getoption("--aiohttp-fast")
+ if asyncio.iscoroutinefunction(pyfuncitem.function):
+ existing_loop = pyfuncitem.funcargs.get(
+ "proactor_loop"
+ ) or pyfuncitem.funcargs.get("loop", None)
+ with _runtime_warning_context():
+ with _passthrough_loop_context(existing_loop, fast=fast) as _loop:
+ testargs = {
+ arg: pyfuncitem.funcargs[arg]
+ for arg in pyfuncitem._fixtureinfo.argnames
+ }
+ _loop.run_until_complete(pyfuncitem.obj(**testargs))
+
+ return True
+
+
+def pytest_generate_tests(metafunc): # type: ignore[no-untyped-def]
+ if "loop_factory" not in metafunc.fixturenames:
+ return
+
+ loops = metafunc.config.option.aiohttp_loop
+ avail_factories = {"pyloop": asyncio.DefaultEventLoopPolicy}
+
+ if uvloop is not None: # pragma: no cover
+ avail_factories["uvloop"] = uvloop.EventLoopPolicy
+
+ if tokio is not None: # pragma: no cover
+ avail_factories["tokio"] = tokio.EventLoopPolicy
+
+ if loops == "all":
+ loops = "pyloop,uvloop?,tokio?"
+
+ factories = {} # type: ignore[var-annotated]
+ for name in loops.split(","):
+ required = not name.endswith("?")
+ name = name.strip(" ?")
+ if name not in avail_factories: # pragma: no cover
+ if required:
+ raise ValueError(
+ "Unknown loop '%s', available loops: %s"
+ % (name, list(factories.keys()))
+ )
+ else:
+ continue
+ factories[name] = avail_factories[name]
+ metafunc.parametrize(
+ "loop_factory", list(factories.values()), ids=list(factories.keys())
+ )
+
+
+@pytest.fixture
+def loop(loop_factory, fast, loop_debug): # type: ignore[no-untyped-def]
+ """Return an instance of the event loop."""
+ policy = loop_factory()
+ asyncio.set_event_loop_policy(policy)
+ with loop_context(fast=fast) as _loop:
+ if loop_debug:
+ _loop.set_debug(True) # pragma: no cover
+ asyncio.set_event_loop(_loop)
+ yield _loop
+
+
+@pytest.fixture
+def proactor_loop(): # type: ignore[no-untyped-def]
+ if not PY_37:
+ policy = asyncio.get_event_loop_policy()
+ policy._loop_factory = asyncio.ProactorEventLoop # type: ignore[attr-defined]
+ else:
+ policy = asyncio.WindowsProactorEventLoopPolicy() # type: ignore[attr-defined]
+ asyncio.set_event_loop_policy(policy)
+
+ with loop_context(policy.new_event_loop) as _loop:
+ asyncio.set_event_loop(_loop)
+ yield _loop
+
+
+@pytest.fixture
+def unused_port(aiohttp_unused_port): # type: ignore[no-untyped-def] # pragma: no cover
+ warnings.warn(
+ "Deprecated, use aiohttp_unused_port fixture instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ return aiohttp_unused_port
+
+
+@pytest.fixture
+def aiohttp_unused_port(): # type: ignore[no-untyped-def]
+ """Return a port that is unused on the current host."""
+ return _unused_port
+
+
+@pytest.fixture
+def aiohttp_server(loop): # type: ignore[no-untyped-def]
+ """Factory to create a TestServer instance, given an app.
+
+ aiohttp_server(app, **kwargs)
+ """
+ servers = []
+
+ async def go(app, *, port=None, **kwargs): # type: ignore[no-untyped-def]
+ server = TestServer(app, port=port)
+ await server.start_server(loop=loop, **kwargs)
+ servers.append(server)
+ return server
+
+ yield go
+
+ async def finalize() -> None:
+ while servers:
+ await servers.pop().close()
+
+ loop.run_until_complete(finalize())
+
+
+@pytest.fixture
+def test_server(aiohttp_server): # type: ignore[no-untyped-def] # pragma: no cover
+ warnings.warn(
+ "Deprecated, use aiohttp_server fixture instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ return aiohttp_server
+
+
+@pytest.fixture
+def aiohttp_raw_server(loop): # type: ignore[no-untyped-def]
+ """Factory to create a RawTestServer instance, given a web handler.
+
+ aiohttp_raw_server(handler, **kwargs)
+ """
+ servers = []
+
+ async def go(handler, *, port=None, **kwargs): # type: ignore[no-untyped-def]
+ server = RawTestServer(handler, port=port)
+ await server.start_server(loop=loop, **kwargs)
+ servers.append(server)
+ return server
+
+ yield go
+
+ async def finalize() -> None:
+ while servers:
+ await servers.pop().close()
+
+ loop.run_until_complete(finalize())
+
+
+@pytest.fixture
+def raw_test_server( # type: ignore[no-untyped-def] # pragma: no cover
+ aiohttp_raw_server,
+):
+ warnings.warn(
+ "Deprecated, use aiohttp_raw_server fixture instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ return aiohttp_raw_server
+
+
+@pytest.fixture
+def aiohttp_client(
+ loop: asyncio.AbstractEventLoop,
+) -> Generator[AiohttpClient, None, None]:
+ """Factory to create a TestClient instance.
+
+ aiohttp_client(app, **kwargs)
+ aiohttp_client(server, **kwargs)
+ aiohttp_client(raw_server, **kwargs)
+ """
+ clients = []
+
+ async def go(
+ __param: Union[Application, BaseTestServer],
+ *args: Any,
+ server_kwargs: Optional[Dict[str, Any]] = None,
+ **kwargs: Any
+ ) -> TestClient:
+
+ if isinstance(__param, Callable) and not isinstance( # type: ignore[arg-type]
+ __param, (Application, BaseTestServer)
+ ):
+ __param = __param(loop, *args, **kwargs)
+ kwargs = {}
+ else:
+ assert not args, "args should be empty"
+
+ if isinstance(__param, Application):
+ server_kwargs = server_kwargs or {}
+ server = TestServer(__param, loop=loop, **server_kwargs)
+ client = TestClient(server, loop=loop, **kwargs)
+ elif isinstance(__param, BaseTestServer):
+ client = TestClient(__param, loop=loop, **kwargs)
+ else:
+ raise ValueError("Unknown argument type: %r" % type(__param))
+
+ await client.start_server()
+ clients.append(client)
+ return client
+
+ yield go
+
+ async def finalize() -> None:
+ while clients:
+ await clients.pop().close()
+
+ loop.run_until_complete(finalize())
+
+
+@pytest.fixture
+def test_client(aiohttp_client): # type: ignore[no-untyped-def] # pragma: no cover
+ warnings.warn(
+ "Deprecated, use aiohttp_client fixture instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ return aiohttp_client
diff --git a/third_party/python/aiohttp/aiohttp/resolver.py b/third_party/python/aiohttp/aiohttp/resolver.py
new file mode 100644
index 0000000000..531ce93fcc
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/resolver.py
@@ -0,0 +1,160 @@
+import asyncio
+import socket
+from typing import Any, Dict, List, Optional, Type, Union
+
+from .abc import AbstractResolver
+from .helpers import get_running_loop
+
+__all__ = ("ThreadedResolver", "AsyncResolver", "DefaultResolver")
+
+try:
+ import aiodns
+
+ # aiodns_default = hasattr(aiodns.DNSResolver, 'gethostbyname')
+except ImportError: # pragma: no cover
+ aiodns = None
+
+aiodns_default = False
+
+
+class ThreadedResolver(AbstractResolver):
+ """Threaded resolver.
+
+ Uses an Executor for synchronous getaddrinfo() calls.
+ concurrent.futures.ThreadPoolExecutor is used by default.
+ """
+
+ def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None) -> None:
+ self._loop = get_running_loop(loop)
+
+ async def resolve(
+ self, hostname: str, port: int = 0, family: int = socket.AF_INET
+ ) -> List[Dict[str, Any]]:
+ infos = await self._loop.getaddrinfo(
+ hostname,
+ port,
+ type=socket.SOCK_STREAM,
+ family=family,
+ flags=socket.AI_ADDRCONFIG,
+ )
+
+ hosts = []
+ for family, _, proto, _, address in infos:
+ if family == socket.AF_INET6:
+ if len(address) < 3:
+ # IPv6 is not supported by Python build,
+ # or IPv6 is not enabled in the host
+ continue
+ if address[3]: # type: ignore[misc]
+ # This is essential for link-local IPv6 addresses.
+ # LL IPv6 is a VERY rare case. Strictly speaking, we should use
+ # getnameinfo() unconditionally, but performance makes sense.
+ host, _port = socket.getnameinfo(
+ address, socket.NI_NUMERICHOST | socket.NI_NUMERICSERV
+ )
+ port = int(_port)
+ else:
+ host, port = address[:2]
+ else: # IPv4
+ assert family == socket.AF_INET
+ host, port = address # type: ignore[misc]
+ hosts.append(
+ {
+ "hostname": hostname,
+ "host": host,
+ "port": port,
+ "family": family,
+ "proto": proto,
+ "flags": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV,
+ }
+ )
+
+ return hosts
+
+ async def close(self) -> None:
+ pass
+
+
+class AsyncResolver(AbstractResolver):
+ """Use the `aiodns` package to make asynchronous DNS lookups"""
+
+ def __init__(
+ self,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ *args: Any,
+ **kwargs: Any
+ ) -> None:
+ if aiodns is None:
+ raise RuntimeError("Resolver requires aiodns library")
+
+ self._loop = get_running_loop(loop)
+ self._resolver = aiodns.DNSResolver(*args, loop=loop, **kwargs)
+
+ if not hasattr(self._resolver, "gethostbyname"):
+ # aiodns 1.1 is not available, fallback to DNSResolver.query
+ self.resolve = self._resolve_with_query # type: ignore
+
+ async def resolve(
+ self, host: str, port: int = 0, family: int = socket.AF_INET
+ ) -> List[Dict[str, Any]]:
+ try:
+ resp = await self._resolver.gethostbyname(host, family)
+ except aiodns.error.DNSError as exc:
+ msg = exc.args[1] if len(exc.args) >= 1 else "DNS lookup failed"
+ raise OSError(msg) from exc
+ hosts = []
+ for address in resp.addresses:
+ hosts.append(
+ {
+ "hostname": host,
+ "host": address,
+ "port": port,
+ "family": family,
+ "proto": 0,
+ "flags": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV,
+ }
+ )
+
+ if not hosts:
+ raise OSError("DNS lookup failed")
+
+ return hosts
+
+ async def _resolve_with_query(
+ self, host: str, port: int = 0, family: int = socket.AF_INET
+ ) -> List[Dict[str, Any]]:
+ if family == socket.AF_INET6:
+ qtype = "AAAA"
+ else:
+ qtype = "A"
+
+ try:
+ resp = await self._resolver.query(host, qtype)
+ except aiodns.error.DNSError as exc:
+ msg = exc.args[1] if len(exc.args) >= 1 else "DNS lookup failed"
+ raise OSError(msg) from exc
+
+ hosts = []
+ for rr in resp:
+ hosts.append(
+ {
+ "hostname": host,
+ "host": rr.host,
+ "port": port,
+ "family": family,
+ "proto": 0,
+ "flags": socket.AI_NUMERICHOST,
+ }
+ )
+
+ if not hosts:
+ raise OSError("DNS lookup failed")
+
+ return hosts
+
+ async def close(self) -> None:
+ self._resolver.cancel()
+
+
+_DefaultType = Type[Union[AsyncResolver, ThreadedResolver]]
+DefaultResolver: _DefaultType = AsyncResolver if aiodns_default else ThreadedResolver
diff --git a/third_party/python/aiohttp/aiohttp/streams.py b/third_party/python/aiohttp/aiohttp/streams.py
new file mode 100644
index 0000000000..726b02326f
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/streams.py
@@ -0,0 +1,660 @@
+import asyncio
+import collections
+import warnings
+from typing import Awaitable, Callable, Deque, Generic, List, Optional, Tuple, TypeVar
+
+from .base_protocol import BaseProtocol
+from .helpers import BaseTimerContext, set_exception, set_result
+from .log import internal_logger
+from .typedefs import Final
+
+__all__ = (
+ "EMPTY_PAYLOAD",
+ "EofStream",
+ "StreamReader",
+ "DataQueue",
+ "FlowControlDataQueue",
+)
+
+_T = TypeVar("_T")
+
+
+class EofStream(Exception):
+ """eof stream indication."""
+
+
+class AsyncStreamIterator(Generic[_T]):
+ def __init__(self, read_func: Callable[[], Awaitable[_T]]) -> None:
+ self.read_func = read_func
+
+ def __aiter__(self) -> "AsyncStreamIterator[_T]":
+ return self
+
+ async def __anext__(self) -> _T:
+ try:
+ rv = await self.read_func()
+ except EofStream:
+ raise StopAsyncIteration
+ if rv == b"":
+ raise StopAsyncIteration
+ return rv
+
+
+class ChunkTupleAsyncStreamIterator:
+ def __init__(self, stream: "StreamReader") -> None:
+ self._stream = stream
+
+ def __aiter__(self) -> "ChunkTupleAsyncStreamIterator":
+ return self
+
+ async def __anext__(self) -> Tuple[bytes, bool]:
+ rv = await self._stream.readchunk()
+ if rv == (b"", False):
+ raise StopAsyncIteration
+ return rv
+
+
+class AsyncStreamReaderMixin:
+ def __aiter__(self) -> AsyncStreamIterator[bytes]:
+ return AsyncStreamIterator(self.readline) # type: ignore[attr-defined]
+
+ def iter_chunked(self, n: int) -> AsyncStreamIterator[bytes]:
+ """Returns an asynchronous iterator that yields chunks of size n.
+
+ Python-3.5 available for Python 3.5+ only
+ """
+ return AsyncStreamIterator(
+ lambda: self.read(n) # type: ignore[attr-defined,no-any-return]
+ )
+
+ def iter_any(self) -> AsyncStreamIterator[bytes]:
+ """Yield all available data as soon as it is received.
+
+ Python-3.5 available for Python 3.5+ only
+ """
+ return AsyncStreamIterator(self.readany) # type: ignore[attr-defined]
+
+ def iter_chunks(self) -> ChunkTupleAsyncStreamIterator:
+ """Yield chunks of data as they are received by the server.
+
+ The yielded objects are tuples
+ of (bytes, bool) as returned by the StreamReader.readchunk method.
+
+ Python-3.5 available for Python 3.5+ only
+ """
+ return ChunkTupleAsyncStreamIterator(self) # type: ignore[arg-type]
+
+
+class StreamReader(AsyncStreamReaderMixin):
+ """An enhancement of asyncio.StreamReader.
+
+ Supports asynchronous iteration by line, chunk or as available::
+
+ async for line in reader:
+ ...
+ async for chunk in reader.iter_chunked(1024):
+ ...
+ async for slice in reader.iter_any():
+ ...
+
+ """
+
+ total_bytes = 0
+
+ def __init__(
+ self,
+ protocol: BaseProtocol,
+ limit: int,
+ *,
+ timer: Optional[BaseTimerContext] = None,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ ) -> None:
+ self._protocol = protocol
+ self._low_water = limit
+ self._high_water = limit * 2
+ if loop is None:
+ loop = asyncio.get_event_loop()
+ self._loop = loop
+ self._size = 0
+ self._cursor = 0
+ self._http_chunk_splits: Optional[List[int]] = None
+ self._buffer: Deque[bytes] = collections.deque()
+ self._buffer_offset = 0
+ self._eof = False
+ self._waiter: Optional[asyncio.Future[None]] = None
+ self._eof_waiter: Optional[asyncio.Future[None]] = None
+ self._exception: Optional[BaseException] = None
+ self._timer = timer
+ self._eof_callbacks: List[Callable[[], None]] = []
+
+ def __repr__(self) -> str:
+ info = [self.__class__.__name__]
+ if self._size:
+ info.append("%d bytes" % self._size)
+ if self._eof:
+ info.append("eof")
+ if self._low_water != 2**16: # default limit
+ info.append("low=%d high=%d" % (self._low_water, self._high_water))
+ if self._waiter:
+ info.append("w=%r" % self._waiter)
+ if self._exception:
+ info.append("e=%r" % self._exception)
+ return "<%s>" % " ".join(info)
+
+ def get_read_buffer_limits(self) -> Tuple[int, int]:
+ return (self._low_water, self._high_water)
+
+ def exception(self) -> Optional[BaseException]:
+ return self._exception
+
+ def set_exception(self, exc: BaseException) -> None:
+ self._exception = exc
+ self._eof_callbacks.clear()
+
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ set_exception(waiter, exc)
+
+ waiter = self._eof_waiter
+ if waiter is not None:
+ self._eof_waiter = None
+ set_exception(waiter, exc)
+
+ def on_eof(self, callback: Callable[[], None]) -> None:
+ if self._eof:
+ try:
+ callback()
+ except Exception:
+ internal_logger.exception("Exception in eof callback")
+ else:
+ self._eof_callbacks.append(callback)
+
+ def feed_eof(self) -> None:
+ self._eof = True
+
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ set_result(waiter, None)
+
+ waiter = self._eof_waiter
+ if waiter is not None:
+ self._eof_waiter = None
+ set_result(waiter, None)
+
+ for cb in self._eof_callbacks:
+ try:
+ cb()
+ except Exception:
+ internal_logger.exception("Exception in eof callback")
+
+ self._eof_callbacks.clear()
+
+ def is_eof(self) -> bool:
+ """Return True if 'feed_eof' was called."""
+ return self._eof
+
+ def at_eof(self) -> bool:
+ """Return True if the buffer is empty and 'feed_eof' was called."""
+ return self._eof and not self._buffer
+
+ async def wait_eof(self) -> None:
+ if self._eof:
+ return
+
+ assert self._eof_waiter is None
+ self._eof_waiter = self._loop.create_future()
+ try:
+ await self._eof_waiter
+ finally:
+ self._eof_waiter = None
+
+ def unread_data(self, data: bytes) -> None:
+ """rollback reading some data from stream, inserting it to buffer head."""
+ warnings.warn(
+ "unread_data() is deprecated "
+ "and will be removed in future releases (#3260)",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ if not data:
+ return
+
+ if self._buffer_offset:
+ self._buffer[0] = self._buffer[0][self._buffer_offset :]
+ self._buffer_offset = 0
+ self._size += len(data)
+ self._cursor -= len(data)
+ self._buffer.appendleft(data)
+ self._eof_counter = 0
+
+ # TODO: size is ignored, remove the param later
+ def feed_data(self, data: bytes, size: int = 0) -> None:
+ assert not self._eof, "feed_data after feed_eof"
+
+ if not data:
+ return
+
+ self._size += len(data)
+ self._buffer.append(data)
+ self.total_bytes += len(data)
+
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ set_result(waiter, None)
+
+ if self._size > self._high_water and not self._protocol._reading_paused:
+ self._protocol.pause_reading()
+
+ def begin_http_chunk_receiving(self) -> None:
+ if self._http_chunk_splits is None:
+ if self.total_bytes:
+ raise RuntimeError(
+ "Called begin_http_chunk_receiving when" "some data was already fed"
+ )
+ self._http_chunk_splits = []
+
+ def end_http_chunk_receiving(self) -> None:
+ if self._http_chunk_splits is None:
+ raise RuntimeError(
+ "Called end_chunk_receiving without calling "
+ "begin_chunk_receiving first"
+ )
+
+ # self._http_chunk_splits contains logical byte offsets from start of
+ # the body transfer. Each offset is the offset of the end of a chunk.
+ # "Logical" means bytes, accessible for a user.
+ # If no chunks containig logical data were received, current position
+ # is difinitely zero.
+ pos = self._http_chunk_splits[-1] if self._http_chunk_splits else 0
+
+ if self.total_bytes == pos:
+ # We should not add empty chunks here. So we check for that.
+ # Note, when chunked + gzip is used, we can receive a chunk
+ # of compressed data, but that data may not be enough for gzip FSM
+ # to yield any uncompressed data. That's why current position may
+ # not change after receiving a chunk.
+ return
+
+ self._http_chunk_splits.append(self.total_bytes)
+
+ # wake up readchunk when end of http chunk received
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ set_result(waiter, None)
+
+ async def _wait(self, func_name: str) -> None:
+ # StreamReader uses a future to link the protocol feed_data() method
+ # to a read coroutine. Running two read coroutines at the same time
+ # would have an unexpected behaviour. It would not possible to know
+ # which coroutine would get the next data.
+ if self._waiter is not None:
+ raise RuntimeError(
+ "%s() called while another coroutine is "
+ "already waiting for incoming data" % func_name
+ )
+
+ waiter = self._waiter = self._loop.create_future()
+ try:
+ if self._timer:
+ with self._timer:
+ await waiter
+ else:
+ await waiter
+ finally:
+ self._waiter = None
+
+ async def readline(self) -> bytes:
+ return await self.readuntil()
+
+ async def readuntil(self, separator: bytes = b"\n") -> bytes:
+ seplen = len(separator)
+ if seplen == 0:
+ raise ValueError("Separator should be at least one-byte string")
+
+ if self._exception is not None:
+ raise self._exception
+
+ chunk = b""
+ chunk_size = 0
+ not_enough = True
+
+ while not_enough:
+ while self._buffer and not_enough:
+ offset = self._buffer_offset
+ ichar = self._buffer[0].find(separator, offset) + 1
+ # Read from current offset to found separator or to the end.
+ data = self._read_nowait_chunk(ichar - offset if ichar else -1)
+ chunk += data
+ chunk_size += len(data)
+ if ichar:
+ not_enough = False
+
+ if chunk_size > self._high_water:
+ raise ValueError("Chunk too big")
+
+ if self._eof:
+ break
+
+ if not_enough:
+ await self._wait("readuntil")
+
+ return chunk
+
+ async def read(self, n: int = -1) -> bytes:
+ if self._exception is not None:
+ raise self._exception
+
+ # migration problem; with DataQueue you have to catch
+ # EofStream exception, so common way is to run payload.read() inside
+ # infinite loop. what can cause real infinite loop with StreamReader
+ # lets keep this code one major release.
+ if __debug__:
+ if self._eof and not self._buffer:
+ self._eof_counter = getattr(self, "_eof_counter", 0) + 1
+ if self._eof_counter > 5:
+ internal_logger.warning(
+ "Multiple access to StreamReader in eof state, "
+ "might be infinite loop.",
+ stack_info=True,
+ )
+
+ if not n:
+ return b""
+
+ if n < 0:
+ # This used to just loop creating a new waiter hoping to
+ # collect everything in self._buffer, but that would
+ # deadlock if the subprocess sends more than self.limit
+ # bytes. So just call self.readany() until EOF.
+ blocks = []
+ while True:
+ block = await self.readany()
+ if not block:
+ break
+ blocks.append(block)
+ return b"".join(blocks)
+
+ # TODO: should be `if` instead of `while`
+ # because waiter maybe triggered on chunk end,
+ # without feeding any data
+ while not self._buffer and not self._eof:
+ await self._wait("read")
+
+ return self._read_nowait(n)
+
+ async def readany(self) -> bytes:
+ if self._exception is not None:
+ raise self._exception
+
+ # TODO: should be `if` instead of `while`
+ # because waiter maybe triggered on chunk end,
+ # without feeding any data
+ while not self._buffer and not self._eof:
+ await self._wait("readany")
+
+ return self._read_nowait(-1)
+
+ async def readchunk(self) -> Tuple[bytes, bool]:
+ """Returns a tuple of (data, end_of_http_chunk).
+
+ When chunked transfer
+ encoding is used, end_of_http_chunk is a boolean indicating if the end
+ of the data corresponds to the end of a HTTP chunk , otherwise it is
+ always False.
+ """
+ while True:
+ if self._exception is not None:
+ raise self._exception
+
+ while self._http_chunk_splits:
+ pos = self._http_chunk_splits.pop(0)
+ if pos == self._cursor:
+ return (b"", True)
+ if pos > self._cursor:
+ return (self._read_nowait(pos - self._cursor), True)
+ internal_logger.warning(
+ "Skipping HTTP chunk end due to data "
+ "consumption beyond chunk boundary"
+ )
+
+ if self._buffer:
+ return (self._read_nowait_chunk(-1), False)
+ # return (self._read_nowait(-1), False)
+
+ if self._eof:
+ # Special case for signifying EOF.
+ # (b'', True) is not a final return value actually.
+ return (b"", False)
+
+ await self._wait("readchunk")
+
+ async def readexactly(self, n: int) -> bytes:
+ if self._exception is not None:
+ raise self._exception
+
+ blocks: List[bytes] = []
+ while n > 0:
+ block = await self.read(n)
+ if not block:
+ partial = b"".join(blocks)
+ raise asyncio.IncompleteReadError(partial, len(partial) + n)
+ blocks.append(block)
+ n -= len(block)
+
+ return b"".join(blocks)
+
+ def read_nowait(self, n: int = -1) -> bytes:
+ # default was changed to be consistent with .read(-1)
+ #
+ # I believe the most users don't know about the method and
+ # they are not affected.
+ if self._exception is not None:
+ raise self._exception
+
+ if self._waiter and not self._waiter.done():
+ raise RuntimeError(
+ "Called while some coroutine is waiting for incoming data."
+ )
+
+ return self._read_nowait(n)
+
+ def _read_nowait_chunk(self, n: int) -> bytes:
+ first_buffer = self._buffer[0]
+ offset = self._buffer_offset
+ if n != -1 and len(first_buffer) - offset > n:
+ data = first_buffer[offset : offset + n]
+ self._buffer_offset += n
+
+ elif offset:
+ self._buffer.popleft()
+ data = first_buffer[offset:]
+ self._buffer_offset = 0
+
+ else:
+ data = self._buffer.popleft()
+
+ self._size -= len(data)
+ self._cursor += len(data)
+
+ chunk_splits = self._http_chunk_splits
+ # Prevent memory leak: drop useless chunk splits
+ while chunk_splits and chunk_splits[0] < self._cursor:
+ chunk_splits.pop(0)
+
+ if self._size < self._low_water and self._protocol._reading_paused:
+ self._protocol.resume_reading()
+ return data
+
+ def _read_nowait(self, n: int) -> bytes:
+ """Read not more than n bytes, or whole buffer if n == -1"""
+ chunks = []
+
+ while self._buffer:
+ chunk = self._read_nowait_chunk(n)
+ chunks.append(chunk)
+ if n != -1:
+ n -= len(chunk)
+ if n == 0:
+ break
+
+ return b"".join(chunks) if chunks else b""
+
+
+class EmptyStreamReader(StreamReader): # lgtm [py/missing-call-to-init]
+ def __init__(self) -> None:
+ pass
+
+ def exception(self) -> Optional[BaseException]:
+ return None
+
+ def set_exception(self, exc: BaseException) -> None:
+ pass
+
+ def on_eof(self, callback: Callable[[], None]) -> None:
+ try:
+ callback()
+ except Exception:
+ internal_logger.exception("Exception in eof callback")
+
+ def feed_eof(self) -> None:
+ pass
+
+ def is_eof(self) -> bool:
+ return True
+
+ def at_eof(self) -> bool:
+ return True
+
+ async def wait_eof(self) -> None:
+ return
+
+ def feed_data(self, data: bytes, n: int = 0) -> None:
+ pass
+
+ async def readline(self) -> bytes:
+ return b""
+
+ async def read(self, n: int = -1) -> bytes:
+ return b""
+
+ # TODO add async def readuntil
+
+ async def readany(self) -> bytes:
+ return b""
+
+ async def readchunk(self) -> Tuple[bytes, bool]:
+ return (b"", True)
+
+ async def readexactly(self, n: int) -> bytes:
+ raise asyncio.IncompleteReadError(b"", n)
+
+ def read_nowait(self, n: int = -1) -> bytes:
+ return b""
+
+
+EMPTY_PAYLOAD: Final[StreamReader] = EmptyStreamReader()
+
+
+class DataQueue(Generic[_T]):
+ """DataQueue is a general-purpose blocking queue with one reader."""
+
+ def __init__(self, loop: asyncio.AbstractEventLoop) -> None:
+ self._loop = loop
+ self._eof = False
+ self._waiter: Optional[asyncio.Future[None]] = None
+ self._exception: Optional[BaseException] = None
+ self._size = 0
+ self._buffer: Deque[Tuple[_T, int]] = collections.deque()
+
+ def __len__(self) -> int:
+ return len(self._buffer)
+
+ def is_eof(self) -> bool:
+ return self._eof
+
+ def at_eof(self) -> bool:
+ return self._eof and not self._buffer
+
+ def exception(self) -> Optional[BaseException]:
+ return self._exception
+
+ def set_exception(self, exc: BaseException) -> None:
+ self._eof = True
+ self._exception = exc
+
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ set_exception(waiter, exc)
+
+ def feed_data(self, data: _T, size: int = 0) -> None:
+ self._size += size
+ self._buffer.append((data, size))
+
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ set_result(waiter, None)
+
+ def feed_eof(self) -> None:
+ self._eof = True
+
+ waiter = self._waiter
+ if waiter is not None:
+ self._waiter = None
+ set_result(waiter, None)
+
+ async def read(self) -> _T:
+ if not self._buffer and not self._eof:
+ assert not self._waiter
+ self._waiter = self._loop.create_future()
+ try:
+ await self._waiter
+ except (asyncio.CancelledError, asyncio.TimeoutError):
+ self._waiter = None
+ raise
+
+ if self._buffer:
+ data, size = self._buffer.popleft()
+ self._size -= size
+ return data
+ else:
+ if self._exception is not None:
+ raise self._exception
+ else:
+ raise EofStream
+
+ def __aiter__(self) -> AsyncStreamIterator[_T]:
+ return AsyncStreamIterator(self.read)
+
+
+class FlowControlDataQueue(DataQueue[_T]):
+ """FlowControlDataQueue resumes and pauses an underlying stream.
+
+ It is a destination for parsed data.
+ """
+
+ def __init__(
+ self, protocol: BaseProtocol, limit: int, *, loop: asyncio.AbstractEventLoop
+ ) -> None:
+ super().__init__(loop=loop)
+
+ self._protocol = protocol
+ self._limit = limit * 2
+
+ def feed_data(self, data: _T, size: int = 0) -> None:
+ super().feed_data(data, size)
+
+ if self._size > self._limit and not self._protocol._reading_paused:
+ self._protocol.pause_reading()
+
+ async def read(self) -> _T:
+ try:
+ return await super().read()
+ finally:
+ if self._size < self._limit and self._protocol._reading_paused:
+ self._protocol.resume_reading()
diff --git a/third_party/python/aiohttp/aiohttp/tcp_helpers.py b/third_party/python/aiohttp/aiohttp/tcp_helpers.py
new file mode 100644
index 0000000000..88b2442237
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/tcp_helpers.py
@@ -0,0 +1,37 @@
+"""Helper methods to tune a TCP connection"""
+
+import asyncio
+import socket
+from contextlib import suppress
+from typing import Optional # noqa
+
+__all__ = ("tcp_keepalive", "tcp_nodelay")
+
+
+if hasattr(socket, "SO_KEEPALIVE"):
+
+ def tcp_keepalive(transport: asyncio.Transport) -> None:
+ sock = transport.get_extra_info("socket")
+ if sock is not None:
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
+
+else:
+
+ def tcp_keepalive(transport: asyncio.Transport) -> None: # pragma: no cover
+ pass
+
+
+def tcp_nodelay(transport: asyncio.Transport, value: bool) -> None:
+ sock = transport.get_extra_info("socket")
+
+ if sock is None:
+ return
+
+ if sock.family not in (socket.AF_INET, socket.AF_INET6):
+ return
+
+ value = bool(value)
+
+ # socket may be closed already, on windows OSError get raised
+ with suppress(OSError):
+ sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, value)
diff --git a/third_party/python/aiohttp/aiohttp/test_utils.py b/third_party/python/aiohttp/aiohttp/test_utils.py
new file mode 100644
index 0000000000..fcda2f3ddc
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/test_utils.py
@@ -0,0 +1,706 @@
+"""Utilities shared by tests."""
+
+import asyncio
+import contextlib
+import gc
+import inspect
+import ipaddress
+import os
+import socket
+import sys
+import warnings
+from abc import ABC, abstractmethod
+from types import TracebackType
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Callable,
+ Iterator,
+ List,
+ Optional,
+ Type,
+ Union,
+ cast,
+)
+from unittest import mock
+
+from aiosignal import Signal
+from multidict import CIMultiDict, CIMultiDictProxy
+from yarl import URL
+
+import aiohttp
+from aiohttp.client import _RequestContextManager, _WSRequestContextManager
+
+from . import ClientSession, hdrs
+from .abc import AbstractCookieJar
+from .client_reqrep import ClientResponse
+from .client_ws import ClientWebSocketResponse
+from .helpers import PY_38, sentinel
+from .http import HttpVersion, RawRequestMessage
+from .web import (
+ Application,
+ AppRunner,
+ BaseRunner,
+ Request,
+ Server,
+ ServerRunner,
+ SockSite,
+ UrlMappingMatchInfo,
+)
+from .web_protocol import _RequestHandler
+
+if TYPE_CHECKING: # pragma: no cover
+ from ssl import SSLContext
+else:
+ SSLContext = None
+
+if PY_38:
+ from unittest import IsolatedAsyncioTestCase as TestCase
+else:
+ from asynctest import TestCase # type: ignore[no-redef]
+
+REUSE_ADDRESS = os.name == "posix" and sys.platform != "cygwin"
+
+
+def get_unused_port_socket(
+ host: str, family: socket.AddressFamily = socket.AF_INET
+) -> socket.socket:
+ return get_port_socket(host, 0, family)
+
+
+def get_port_socket(
+ host: str, port: int, family: socket.AddressFamily
+) -> socket.socket:
+ s = socket.socket(family, socket.SOCK_STREAM)
+ if REUSE_ADDRESS:
+ # Windows has different semantics for SO_REUSEADDR,
+ # so don't set it. Ref:
+ # https://docs.microsoft.com/en-us/windows/win32/winsock/using-so-reuseaddr-and-so-exclusiveaddruse
+ s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ s.bind((host, port))
+ return s
+
+
+def unused_port() -> int:
+ """Return a port that is unused on the current host."""
+ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
+ s.bind(("127.0.0.1", 0))
+ return cast(int, s.getsockname()[1])
+
+
+class BaseTestServer(ABC):
+ __test__ = False
+
+ def __init__(
+ self,
+ *,
+ scheme: Union[str, object] = sentinel,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ host: str = "127.0.0.1",
+ port: Optional[int] = None,
+ skip_url_asserts: bool = False,
+ socket_factory: Callable[
+ [str, int, socket.AddressFamily], socket.socket
+ ] = get_port_socket,
+ **kwargs: Any,
+ ) -> None:
+ self._loop = loop
+ self.runner: Optional[BaseRunner] = None
+ self._root: Optional[URL] = None
+ self.host = host
+ self.port = port
+ self._closed = False
+ self.scheme = scheme
+ self.skip_url_asserts = skip_url_asserts
+ self.socket_factory = socket_factory
+
+ async def start_server(
+ self, loop: Optional[asyncio.AbstractEventLoop] = None, **kwargs: Any
+ ) -> None:
+ if self.runner:
+ return
+ self._loop = loop
+ self._ssl = kwargs.pop("ssl", None)
+ self.runner = await self._make_runner(**kwargs)
+ await self.runner.setup()
+ if not self.port:
+ self.port = 0
+ try:
+ version = ipaddress.ip_address(self.host).version
+ except ValueError:
+ version = 4
+ family = socket.AF_INET6 if version == 6 else socket.AF_INET
+ _sock = self.socket_factory(self.host, self.port, family)
+ self.host, self.port = _sock.getsockname()[:2]
+ site = SockSite(self.runner, sock=_sock, ssl_context=self._ssl)
+ await site.start()
+ server = site._server
+ assert server is not None
+ sockets = server.sockets
+ assert sockets is not None
+ self.port = sockets[0].getsockname()[1]
+ if self.scheme is sentinel:
+ if self._ssl:
+ scheme = "https"
+ else:
+ scheme = "http"
+ self.scheme = scheme
+ self._root = URL(f"{self.scheme}://{self.host}:{self.port}")
+
+ @abstractmethod # pragma: no cover
+ async def _make_runner(self, **kwargs: Any) -> BaseRunner:
+ pass
+
+ def make_url(self, path: str) -> URL:
+ assert self._root is not None
+ url = URL(path)
+ if not self.skip_url_asserts:
+ assert not url.is_absolute()
+ return self._root.join(url)
+ else:
+ return URL(str(self._root) + path)
+
+ @property
+ def started(self) -> bool:
+ return self.runner is not None
+
+ @property
+ def closed(self) -> bool:
+ return self._closed
+
+ @property
+ def handler(self) -> Server:
+ # for backward compatibility
+ # web.Server instance
+ runner = self.runner
+ assert runner is not None
+ assert runner.server is not None
+ return runner.server
+
+ async def close(self) -> None:
+ """Close all fixtures created by the test client.
+
+ After that point, the TestClient is no longer usable.
+
+ This is an idempotent function: running close multiple times
+ will not have any additional effects.
+
+ close is also run when the object is garbage collected, and on
+ exit when used as a context manager.
+
+ """
+ if self.started and not self.closed:
+ assert self.runner is not None
+ await self.runner.cleanup()
+ self._root = None
+ self.port = None
+ self._closed = True
+
+ def __enter__(self) -> None:
+ raise TypeError("Use async with instead")
+
+ def __exit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc_value: Optional[BaseException],
+ traceback: Optional[TracebackType],
+ ) -> None:
+ # __exit__ should exist in pair with __enter__ but never executed
+ pass # pragma: no cover
+
+ async def __aenter__(self) -> "BaseTestServer":
+ await self.start_server(loop=self._loop)
+ return self
+
+ async def __aexit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc_value: Optional[BaseException],
+ traceback: Optional[TracebackType],
+ ) -> None:
+ await self.close()
+
+
+class TestServer(BaseTestServer):
+ def __init__(
+ self,
+ app: Application,
+ *,
+ scheme: Union[str, object] = sentinel,
+ host: str = "127.0.0.1",
+ port: Optional[int] = None,
+ **kwargs: Any,
+ ):
+ self.app = app
+ super().__init__(scheme=scheme, host=host, port=port, **kwargs)
+
+ async def _make_runner(self, **kwargs: Any) -> BaseRunner:
+ return AppRunner(self.app, **kwargs)
+
+
+class RawTestServer(BaseTestServer):
+ def __init__(
+ self,
+ handler: _RequestHandler,
+ *,
+ scheme: Union[str, object] = sentinel,
+ host: str = "127.0.0.1",
+ port: Optional[int] = None,
+ **kwargs: Any,
+ ) -> None:
+ self._handler = handler
+ super().__init__(scheme=scheme, host=host, port=port, **kwargs)
+
+ async def _make_runner(self, debug: bool = True, **kwargs: Any) -> ServerRunner:
+ srv = Server(self._handler, loop=self._loop, debug=debug, **kwargs)
+ return ServerRunner(srv, debug=debug, **kwargs)
+
+
+class TestClient:
+ """
+ A test client implementation.
+
+ To write functional tests for aiohttp based servers.
+
+ """
+
+ __test__ = False
+
+ def __init__(
+ self,
+ server: BaseTestServer,
+ *,
+ cookie_jar: Optional[AbstractCookieJar] = None,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ **kwargs: Any,
+ ) -> None:
+ if not isinstance(server, BaseTestServer):
+ raise TypeError(
+ "server must be TestServer " "instance, found type: %r" % type(server)
+ )
+ self._server = server
+ self._loop = loop
+ if cookie_jar is None:
+ cookie_jar = aiohttp.CookieJar(unsafe=True, loop=loop)
+ self._session = ClientSession(loop=loop, cookie_jar=cookie_jar, **kwargs)
+ self._closed = False
+ self._responses: List[ClientResponse] = []
+ self._websockets: List[ClientWebSocketResponse] = []
+
+ async def start_server(self) -> None:
+ await self._server.start_server(loop=self._loop)
+
+ @property
+ def host(self) -> str:
+ return self._server.host
+
+ @property
+ def port(self) -> Optional[int]:
+ return self._server.port
+
+ @property
+ def server(self) -> BaseTestServer:
+ return self._server
+
+ @property
+ def app(self) -> Optional[Application]:
+ return cast(Optional[Application], getattr(self._server, "app", None))
+
+ @property
+ def session(self) -> ClientSession:
+ """An internal aiohttp.ClientSession.
+
+ Unlike the methods on the TestClient, client session requests
+ do not automatically include the host in the url queried, and
+ will require an absolute path to the resource.
+
+ """
+ return self._session
+
+ def make_url(self, path: str) -> URL:
+ return self._server.make_url(path)
+
+ async def _request(self, method: str, path: str, **kwargs: Any) -> ClientResponse:
+ resp = await self._session.request(method, self.make_url(path), **kwargs)
+ # save it to close later
+ self._responses.append(resp)
+ return resp
+
+ def request(self, method: str, path: str, **kwargs: Any) -> _RequestContextManager:
+ """Routes a request to tested http server.
+
+ The interface is identical to aiohttp.ClientSession.request,
+ except the loop kwarg is overridden by the instance used by the
+ test server.
+
+ """
+ return _RequestContextManager(self._request(method, path, **kwargs))
+
+ def get(self, path: str, **kwargs: Any) -> _RequestContextManager:
+ """Perform an HTTP GET request."""
+ return _RequestContextManager(self._request(hdrs.METH_GET, path, **kwargs))
+
+ def post(self, path: str, **kwargs: Any) -> _RequestContextManager:
+ """Perform an HTTP POST request."""
+ return _RequestContextManager(self._request(hdrs.METH_POST, path, **kwargs))
+
+ def options(self, path: str, **kwargs: Any) -> _RequestContextManager:
+ """Perform an HTTP OPTIONS request."""
+ return _RequestContextManager(self._request(hdrs.METH_OPTIONS, path, **kwargs))
+
+ def head(self, path: str, **kwargs: Any) -> _RequestContextManager:
+ """Perform an HTTP HEAD request."""
+ return _RequestContextManager(self._request(hdrs.METH_HEAD, path, **kwargs))
+
+ def put(self, path: str, **kwargs: Any) -> _RequestContextManager:
+ """Perform an HTTP PUT request."""
+ return _RequestContextManager(self._request(hdrs.METH_PUT, path, **kwargs))
+
+ def patch(self, path: str, **kwargs: Any) -> _RequestContextManager:
+ """Perform an HTTP PATCH request."""
+ return _RequestContextManager(self._request(hdrs.METH_PATCH, path, **kwargs))
+
+ def delete(self, path: str, **kwargs: Any) -> _RequestContextManager:
+ """Perform an HTTP PATCH request."""
+ return _RequestContextManager(self._request(hdrs.METH_DELETE, path, **kwargs))
+
+ def ws_connect(self, path: str, **kwargs: Any) -> _WSRequestContextManager:
+ """Initiate websocket connection.
+
+ The api corresponds to aiohttp.ClientSession.ws_connect.
+
+ """
+ return _WSRequestContextManager(self._ws_connect(path, **kwargs))
+
+ async def _ws_connect(self, path: str, **kwargs: Any) -> ClientWebSocketResponse:
+ ws = await self._session.ws_connect(self.make_url(path), **kwargs)
+ self._websockets.append(ws)
+ return ws
+
+ async def close(self) -> None:
+ """Close all fixtures created by the test client.
+
+ After that point, the TestClient is no longer usable.
+
+ This is an idempotent function: running close multiple times
+ will not have any additional effects.
+
+ close is also run on exit when used as a(n) (asynchronous)
+ context manager.
+
+ """
+ if not self._closed:
+ for resp in self._responses:
+ resp.close()
+ for ws in self._websockets:
+ await ws.close()
+ await self._session.close()
+ await self._server.close()
+ self._closed = True
+
+ def __enter__(self) -> None:
+ raise TypeError("Use async with instead")
+
+ def __exit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc: Optional[BaseException],
+ tb: Optional[TracebackType],
+ ) -> None:
+ # __exit__ should exist in pair with __enter__ but never executed
+ pass # pragma: no cover
+
+ async def __aenter__(self) -> "TestClient":
+ await self.start_server()
+ return self
+
+ async def __aexit__(
+ self,
+ exc_type: Optional[Type[BaseException]],
+ exc: Optional[BaseException],
+ tb: Optional[TracebackType],
+ ) -> None:
+ await self.close()
+
+
+class AioHTTPTestCase(TestCase):
+ """A base class to allow for unittest web applications using aiohttp.
+
+ Provides the following:
+
+ * self.client (aiohttp.test_utils.TestClient): an aiohttp test client.
+ * self.loop (asyncio.BaseEventLoop): the event loop in which the
+ application and server are running.
+ * self.app (aiohttp.web.Application): the application returned by
+ self.get_application()
+
+ Note that the TestClient's methods are asynchronous: you have to
+ execute function on the test client using asynchronous methods.
+ """
+
+ async def get_application(self) -> Application:
+ """Get application.
+
+ This method should be overridden
+ to return the aiohttp.web.Application
+ object to test.
+ """
+ return self.get_app()
+
+ def get_app(self) -> Application:
+ """Obsolete method used to constructing web application.
+
+ Use .get_application() coroutine instead.
+ """
+ raise RuntimeError("Did you forget to define get_application()?")
+
+ def setUp(self) -> None:
+ if not PY_38:
+ asyncio.get_event_loop().run_until_complete(self.asyncSetUp())
+
+ async def asyncSetUp(self) -> None:
+ try:
+ self.loop = asyncio.get_running_loop()
+ except (AttributeError, RuntimeError): # AttributeError->py36
+ self.loop = asyncio.get_event_loop_policy().get_event_loop()
+
+ return await self.setUpAsync()
+
+ async def setUpAsync(self) -> None:
+ self.app = await self.get_application()
+ self.server = await self.get_server(self.app)
+ self.client = await self.get_client(self.server)
+
+ await self.client.start_server()
+
+ def tearDown(self) -> None:
+ if not PY_38:
+ self.loop.run_until_complete(self.asyncTearDown())
+
+ async def asyncTearDown(self) -> None:
+ return await self.tearDownAsync()
+
+ async def tearDownAsync(self) -> None:
+ await self.client.close()
+
+ async def get_server(self, app: Application) -> TestServer:
+ """Return a TestServer instance."""
+ return TestServer(app, loop=self.loop)
+
+ async def get_client(self, server: TestServer) -> TestClient:
+ """Return a TestClient instance."""
+ return TestClient(server, loop=self.loop)
+
+
+def unittest_run_loop(func: Any, *args: Any, **kwargs: Any) -> Any:
+ """
+ A decorator dedicated to use with asynchronous AioHTTPTestCase test methods.
+
+ In 3.8+, this does nothing.
+ """
+ warnings.warn(
+ "Decorator `@unittest_run_loop` is no longer needed in aiohttp 3.8+",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ return func
+
+
+_LOOP_FACTORY = Callable[[], asyncio.AbstractEventLoop]
+
+
+@contextlib.contextmanager
+def loop_context(
+ loop_factory: _LOOP_FACTORY = asyncio.new_event_loop, fast: bool = False
+) -> Iterator[asyncio.AbstractEventLoop]:
+ """A contextmanager that creates an event_loop, for test purposes.
+
+ Handles the creation and cleanup of a test loop.
+ """
+ loop = setup_test_loop(loop_factory)
+ yield loop
+ teardown_test_loop(loop, fast=fast)
+
+
+def setup_test_loop(
+ loop_factory: _LOOP_FACTORY = asyncio.new_event_loop,
+) -> asyncio.AbstractEventLoop:
+ """Create and return an asyncio.BaseEventLoop instance.
+
+ The caller should also call teardown_test_loop,
+ once they are done with the loop.
+ """
+ loop = loop_factory()
+ try:
+ module = loop.__class__.__module__
+ skip_watcher = "uvloop" in module
+ except AttributeError: # pragma: no cover
+ # Just in case
+ skip_watcher = True
+ asyncio.set_event_loop(loop)
+ if sys.platform != "win32" and not skip_watcher:
+ policy = asyncio.get_event_loop_policy()
+ watcher: asyncio.AbstractChildWatcher
+ try: # Python >= 3.8
+ # Refs:
+ # * https://github.com/pytest-dev/pytest-xdist/issues/620
+ # * https://stackoverflow.com/a/58614689/595220
+ # * https://bugs.python.org/issue35621
+ # * https://github.com/python/cpython/pull/14344
+ watcher = asyncio.ThreadedChildWatcher()
+ except AttributeError: # Python < 3.8
+ watcher = asyncio.SafeChildWatcher()
+ watcher.attach_loop(loop)
+ with contextlib.suppress(NotImplementedError):
+ policy.set_child_watcher(watcher)
+ return loop
+
+
+def teardown_test_loop(loop: asyncio.AbstractEventLoop, fast: bool = False) -> None:
+ """Teardown and cleanup an event_loop created by setup_test_loop."""
+ closed = loop.is_closed()
+ if not closed:
+ loop.call_soon(loop.stop)
+ loop.run_forever()
+ loop.close()
+
+ if not fast:
+ gc.collect()
+
+ asyncio.set_event_loop(None)
+
+
+def _create_app_mock() -> mock.MagicMock:
+ def get_dict(app: Any, key: str) -> Any:
+ return app.__app_dict[key]
+
+ def set_dict(app: Any, key: str, value: Any) -> None:
+ app.__app_dict[key] = value
+
+ app = mock.MagicMock(spec=Application)
+ app.__app_dict = {}
+ app.__getitem__ = get_dict
+ app.__setitem__ = set_dict
+
+ app._debug = False
+ app.on_response_prepare = Signal(app)
+ app.on_response_prepare.freeze()
+ return app
+
+
+def _create_transport(sslcontext: Optional[SSLContext] = None) -> mock.Mock:
+ transport = mock.Mock()
+
+ def get_extra_info(key: str) -> Optional[SSLContext]:
+ if key == "sslcontext":
+ return sslcontext
+ else:
+ return None
+
+ transport.get_extra_info.side_effect = get_extra_info
+ return transport
+
+
+def make_mocked_request(
+ method: str,
+ path: str,
+ headers: Any = None,
+ *,
+ match_info: Any = sentinel,
+ version: HttpVersion = HttpVersion(1, 1),
+ closing: bool = False,
+ app: Any = None,
+ writer: Any = sentinel,
+ protocol: Any = sentinel,
+ transport: Any = sentinel,
+ payload: Any = sentinel,
+ sslcontext: Optional[SSLContext] = None,
+ client_max_size: int = 1024**2,
+ loop: Any = ...,
+) -> Request:
+ """Creates mocked web.Request testing purposes.
+
+ Useful in unit tests, when spinning full web server is overkill or
+ specific conditions and errors are hard to trigger.
+ """
+ task = mock.Mock()
+ if loop is ...:
+ loop = mock.Mock()
+ loop.create_future.return_value = ()
+
+ if version < HttpVersion(1, 1):
+ closing = True
+
+ if headers:
+ headers = CIMultiDictProxy(CIMultiDict(headers))
+ raw_hdrs = tuple(
+ (k.encode("utf-8"), v.encode("utf-8")) for k, v in headers.items()
+ )
+ else:
+ headers = CIMultiDictProxy(CIMultiDict())
+ raw_hdrs = ()
+
+ chunked = "chunked" in headers.get(hdrs.TRANSFER_ENCODING, "").lower()
+
+ message = RawRequestMessage(
+ method,
+ path,
+ version,
+ headers,
+ raw_hdrs,
+ closing,
+ None,
+ False,
+ chunked,
+ URL(path),
+ )
+ if app is None:
+ app = _create_app_mock()
+
+ if transport is sentinel:
+ transport = _create_transport(sslcontext)
+
+ if protocol is sentinel:
+ protocol = mock.Mock()
+ protocol.transport = transport
+
+ if writer is sentinel:
+ writer = mock.Mock()
+ writer.write_headers = make_mocked_coro(None)
+ writer.write = make_mocked_coro(None)
+ writer.write_eof = make_mocked_coro(None)
+ writer.drain = make_mocked_coro(None)
+ writer.transport = transport
+
+ protocol.transport = transport
+ protocol.writer = writer
+
+ if payload is sentinel:
+ payload = mock.Mock()
+
+ req = Request(
+ message, payload, protocol, writer, task, loop, client_max_size=client_max_size
+ )
+
+ match_info = UrlMappingMatchInfo(
+ {} if match_info is sentinel else match_info, mock.Mock()
+ )
+ match_info.add_app(app)
+ req._match_info = match_info
+
+ return req
+
+
+def make_mocked_coro(
+ return_value: Any = sentinel, raise_exception: Any = sentinel
+) -> Any:
+ """Creates a coroutine mock."""
+
+ async def mock_coro(*args: Any, **kwargs: Any) -> Any:
+ if raise_exception is not sentinel:
+ raise raise_exception
+ if not inspect.isawaitable(return_value):
+ return return_value
+ await return_value
+
+ return mock.Mock(wraps=mock_coro)
diff --git a/third_party/python/aiohttp/aiohttp/tracing.py b/third_party/python/aiohttp/aiohttp/tracing.py
new file mode 100644
index 0000000000..d5596a4cea
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/tracing.py
@@ -0,0 +1,472 @@
+from types import SimpleNamespace
+from typing import TYPE_CHECKING, Awaitable, Optional, Type, TypeVar
+
+import attr
+from aiosignal import Signal
+from multidict import CIMultiDict
+from yarl import URL
+
+from .client_reqrep import ClientResponse
+
+if TYPE_CHECKING: # pragma: no cover
+ from .client import ClientSession
+ from .typedefs import Protocol
+
+ _ParamT_contra = TypeVar("_ParamT_contra", contravariant=True)
+
+ class _SignalCallback(Protocol[_ParamT_contra]):
+ def __call__(
+ self,
+ __client_session: ClientSession,
+ __trace_config_ctx: SimpleNamespace,
+ __params: _ParamT_contra,
+ ) -> Awaitable[None]:
+ ...
+
+
+__all__ = (
+ "TraceConfig",
+ "TraceRequestStartParams",
+ "TraceRequestEndParams",
+ "TraceRequestExceptionParams",
+ "TraceConnectionQueuedStartParams",
+ "TraceConnectionQueuedEndParams",
+ "TraceConnectionCreateStartParams",
+ "TraceConnectionCreateEndParams",
+ "TraceConnectionReuseconnParams",
+ "TraceDnsResolveHostStartParams",
+ "TraceDnsResolveHostEndParams",
+ "TraceDnsCacheHitParams",
+ "TraceDnsCacheMissParams",
+ "TraceRequestRedirectParams",
+ "TraceRequestChunkSentParams",
+ "TraceResponseChunkReceivedParams",
+ "TraceRequestHeadersSentParams",
+)
+
+
+class TraceConfig:
+ """First-class used to trace requests launched via ClientSession objects."""
+
+ def __init__(
+ self, trace_config_ctx_factory: Type[SimpleNamespace] = SimpleNamespace
+ ) -> None:
+ self._on_request_start: Signal[
+ _SignalCallback[TraceRequestStartParams]
+ ] = Signal(self)
+ self._on_request_chunk_sent: Signal[
+ _SignalCallback[TraceRequestChunkSentParams]
+ ] = Signal(self)
+ self._on_response_chunk_received: Signal[
+ _SignalCallback[TraceResponseChunkReceivedParams]
+ ] = Signal(self)
+ self._on_request_end: Signal[_SignalCallback[TraceRequestEndParams]] = Signal(
+ self
+ )
+ self._on_request_exception: Signal[
+ _SignalCallback[TraceRequestExceptionParams]
+ ] = Signal(self)
+ self._on_request_redirect: Signal[
+ _SignalCallback[TraceRequestRedirectParams]
+ ] = Signal(self)
+ self._on_connection_queued_start: Signal[
+ _SignalCallback[TraceConnectionQueuedStartParams]
+ ] = Signal(self)
+ self._on_connection_queued_end: Signal[
+ _SignalCallback[TraceConnectionQueuedEndParams]
+ ] = Signal(self)
+ self._on_connection_create_start: Signal[
+ _SignalCallback[TraceConnectionCreateStartParams]
+ ] = Signal(self)
+ self._on_connection_create_end: Signal[
+ _SignalCallback[TraceConnectionCreateEndParams]
+ ] = Signal(self)
+ self._on_connection_reuseconn: Signal[
+ _SignalCallback[TraceConnectionReuseconnParams]
+ ] = Signal(self)
+ self._on_dns_resolvehost_start: Signal[
+ _SignalCallback[TraceDnsResolveHostStartParams]
+ ] = Signal(self)
+ self._on_dns_resolvehost_end: Signal[
+ _SignalCallback[TraceDnsResolveHostEndParams]
+ ] = Signal(self)
+ self._on_dns_cache_hit: Signal[
+ _SignalCallback[TraceDnsCacheHitParams]
+ ] = Signal(self)
+ self._on_dns_cache_miss: Signal[
+ _SignalCallback[TraceDnsCacheMissParams]
+ ] = Signal(self)
+ self._on_request_headers_sent: Signal[
+ _SignalCallback[TraceRequestHeadersSentParams]
+ ] = Signal(self)
+
+ self._trace_config_ctx_factory = trace_config_ctx_factory
+
+ def trace_config_ctx(
+ self, trace_request_ctx: Optional[SimpleNamespace] = None
+ ) -> SimpleNamespace:
+ """Return a new trace_config_ctx instance"""
+ return self._trace_config_ctx_factory(trace_request_ctx=trace_request_ctx)
+
+ def freeze(self) -> None:
+ self._on_request_start.freeze()
+ self._on_request_chunk_sent.freeze()
+ self._on_response_chunk_received.freeze()
+ self._on_request_end.freeze()
+ self._on_request_exception.freeze()
+ self._on_request_redirect.freeze()
+ self._on_connection_queued_start.freeze()
+ self._on_connection_queued_end.freeze()
+ self._on_connection_create_start.freeze()
+ self._on_connection_create_end.freeze()
+ self._on_connection_reuseconn.freeze()
+ self._on_dns_resolvehost_start.freeze()
+ self._on_dns_resolvehost_end.freeze()
+ self._on_dns_cache_hit.freeze()
+ self._on_dns_cache_miss.freeze()
+ self._on_request_headers_sent.freeze()
+
+ @property
+ def on_request_start(self) -> "Signal[_SignalCallback[TraceRequestStartParams]]":
+ return self._on_request_start
+
+ @property
+ def on_request_chunk_sent(
+ self,
+ ) -> "Signal[_SignalCallback[TraceRequestChunkSentParams]]":
+ return self._on_request_chunk_sent
+
+ @property
+ def on_response_chunk_received(
+ self,
+ ) -> "Signal[_SignalCallback[TraceResponseChunkReceivedParams]]":
+ return self._on_response_chunk_received
+
+ @property
+ def on_request_end(self) -> "Signal[_SignalCallback[TraceRequestEndParams]]":
+ return self._on_request_end
+
+ @property
+ def on_request_exception(
+ self,
+ ) -> "Signal[_SignalCallback[TraceRequestExceptionParams]]":
+ return self._on_request_exception
+
+ @property
+ def on_request_redirect(
+ self,
+ ) -> "Signal[_SignalCallback[TraceRequestRedirectParams]]":
+ return self._on_request_redirect
+
+ @property
+ def on_connection_queued_start(
+ self,
+ ) -> "Signal[_SignalCallback[TraceConnectionQueuedStartParams]]":
+ return self._on_connection_queued_start
+
+ @property
+ def on_connection_queued_end(
+ self,
+ ) -> "Signal[_SignalCallback[TraceConnectionQueuedEndParams]]":
+ return self._on_connection_queued_end
+
+ @property
+ def on_connection_create_start(
+ self,
+ ) -> "Signal[_SignalCallback[TraceConnectionCreateStartParams]]":
+ return self._on_connection_create_start
+
+ @property
+ def on_connection_create_end(
+ self,
+ ) -> "Signal[_SignalCallback[TraceConnectionCreateEndParams]]":
+ return self._on_connection_create_end
+
+ @property
+ def on_connection_reuseconn(
+ self,
+ ) -> "Signal[_SignalCallback[TraceConnectionReuseconnParams]]":
+ return self._on_connection_reuseconn
+
+ @property
+ def on_dns_resolvehost_start(
+ self,
+ ) -> "Signal[_SignalCallback[TraceDnsResolveHostStartParams]]":
+ return self._on_dns_resolvehost_start
+
+ @property
+ def on_dns_resolvehost_end(
+ self,
+ ) -> "Signal[_SignalCallback[TraceDnsResolveHostEndParams]]":
+ return self._on_dns_resolvehost_end
+
+ @property
+ def on_dns_cache_hit(self) -> "Signal[_SignalCallback[TraceDnsCacheHitParams]]":
+ return self._on_dns_cache_hit
+
+ @property
+ def on_dns_cache_miss(self) -> "Signal[_SignalCallback[TraceDnsCacheMissParams]]":
+ return self._on_dns_cache_miss
+
+ @property
+ def on_request_headers_sent(
+ self,
+ ) -> "Signal[_SignalCallback[TraceRequestHeadersSentParams]]":
+ return self._on_request_headers_sent
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceRequestStartParams:
+ """Parameters sent by the `on_request_start` signal"""
+
+ method: str
+ url: URL
+ headers: "CIMultiDict[str]"
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceRequestChunkSentParams:
+ """Parameters sent by the `on_request_chunk_sent` signal"""
+
+ method: str
+ url: URL
+ chunk: bytes
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceResponseChunkReceivedParams:
+ """Parameters sent by the `on_response_chunk_received` signal"""
+
+ method: str
+ url: URL
+ chunk: bytes
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceRequestEndParams:
+ """Parameters sent by the `on_request_end` signal"""
+
+ method: str
+ url: URL
+ headers: "CIMultiDict[str]"
+ response: ClientResponse
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceRequestExceptionParams:
+ """Parameters sent by the `on_request_exception` signal"""
+
+ method: str
+ url: URL
+ headers: "CIMultiDict[str]"
+ exception: BaseException
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceRequestRedirectParams:
+ """Parameters sent by the `on_request_redirect` signal"""
+
+ method: str
+ url: URL
+ headers: "CIMultiDict[str]"
+ response: ClientResponse
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceConnectionQueuedStartParams:
+ """Parameters sent by the `on_connection_queued_start` signal"""
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceConnectionQueuedEndParams:
+ """Parameters sent by the `on_connection_queued_end` signal"""
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceConnectionCreateStartParams:
+ """Parameters sent by the `on_connection_create_start` signal"""
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceConnectionCreateEndParams:
+ """Parameters sent by the `on_connection_create_end` signal"""
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceConnectionReuseconnParams:
+ """Parameters sent by the `on_connection_reuseconn` signal"""
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceDnsResolveHostStartParams:
+ """Parameters sent by the `on_dns_resolvehost_start` signal"""
+
+ host: str
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceDnsResolveHostEndParams:
+ """Parameters sent by the `on_dns_resolvehost_end` signal"""
+
+ host: str
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceDnsCacheHitParams:
+ """Parameters sent by the `on_dns_cache_hit` signal"""
+
+ host: str
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceDnsCacheMissParams:
+ """Parameters sent by the `on_dns_cache_miss` signal"""
+
+ host: str
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class TraceRequestHeadersSentParams:
+ """Parameters sent by the `on_request_headers_sent` signal"""
+
+ method: str
+ url: URL
+ headers: "CIMultiDict[str]"
+
+
+class Trace:
+ """Internal dependency holder class.
+
+ Used to keep together the main dependencies used
+ at the moment of send a signal.
+ """
+
+ def __init__(
+ self,
+ session: "ClientSession",
+ trace_config: TraceConfig,
+ trace_config_ctx: SimpleNamespace,
+ ) -> None:
+ self._trace_config = trace_config
+ self._trace_config_ctx = trace_config_ctx
+ self._session = session
+
+ async def send_request_start(
+ self, method: str, url: URL, headers: "CIMultiDict[str]"
+ ) -> None:
+ return await self._trace_config.on_request_start.send(
+ self._session,
+ self._trace_config_ctx,
+ TraceRequestStartParams(method, url, headers),
+ )
+
+ async def send_request_chunk_sent(
+ self, method: str, url: URL, chunk: bytes
+ ) -> None:
+ return await self._trace_config.on_request_chunk_sent.send(
+ self._session,
+ self._trace_config_ctx,
+ TraceRequestChunkSentParams(method, url, chunk),
+ )
+
+ async def send_response_chunk_received(
+ self, method: str, url: URL, chunk: bytes
+ ) -> None:
+ return await self._trace_config.on_response_chunk_received.send(
+ self._session,
+ self._trace_config_ctx,
+ TraceResponseChunkReceivedParams(method, url, chunk),
+ )
+
+ async def send_request_end(
+ self,
+ method: str,
+ url: URL,
+ headers: "CIMultiDict[str]",
+ response: ClientResponse,
+ ) -> None:
+ return await self._trace_config.on_request_end.send(
+ self._session,
+ self._trace_config_ctx,
+ TraceRequestEndParams(method, url, headers, response),
+ )
+
+ async def send_request_exception(
+ self,
+ method: str,
+ url: URL,
+ headers: "CIMultiDict[str]",
+ exception: BaseException,
+ ) -> None:
+ return await self._trace_config.on_request_exception.send(
+ self._session,
+ self._trace_config_ctx,
+ TraceRequestExceptionParams(method, url, headers, exception),
+ )
+
+ async def send_request_redirect(
+ self,
+ method: str,
+ url: URL,
+ headers: "CIMultiDict[str]",
+ response: ClientResponse,
+ ) -> None:
+ return await self._trace_config._on_request_redirect.send(
+ self._session,
+ self._trace_config_ctx,
+ TraceRequestRedirectParams(method, url, headers, response),
+ )
+
+ async def send_connection_queued_start(self) -> None:
+ return await self._trace_config.on_connection_queued_start.send(
+ self._session, self._trace_config_ctx, TraceConnectionQueuedStartParams()
+ )
+
+ async def send_connection_queued_end(self) -> None:
+ return await self._trace_config.on_connection_queued_end.send(
+ self._session, self._trace_config_ctx, TraceConnectionQueuedEndParams()
+ )
+
+ async def send_connection_create_start(self) -> None:
+ return await self._trace_config.on_connection_create_start.send(
+ self._session, self._trace_config_ctx, TraceConnectionCreateStartParams()
+ )
+
+ async def send_connection_create_end(self) -> None:
+ return await self._trace_config.on_connection_create_end.send(
+ self._session, self._trace_config_ctx, TraceConnectionCreateEndParams()
+ )
+
+ async def send_connection_reuseconn(self) -> None:
+ return await self._trace_config.on_connection_reuseconn.send(
+ self._session, self._trace_config_ctx, TraceConnectionReuseconnParams()
+ )
+
+ async def send_dns_resolvehost_start(self, host: str) -> None:
+ return await self._trace_config.on_dns_resolvehost_start.send(
+ self._session, self._trace_config_ctx, TraceDnsResolveHostStartParams(host)
+ )
+
+ async def send_dns_resolvehost_end(self, host: str) -> None:
+ return await self._trace_config.on_dns_resolvehost_end.send(
+ self._session, self._trace_config_ctx, TraceDnsResolveHostEndParams(host)
+ )
+
+ async def send_dns_cache_hit(self, host: str) -> None:
+ return await self._trace_config.on_dns_cache_hit.send(
+ self._session, self._trace_config_ctx, TraceDnsCacheHitParams(host)
+ )
+
+ async def send_dns_cache_miss(self, host: str) -> None:
+ return await self._trace_config.on_dns_cache_miss.send(
+ self._session, self._trace_config_ctx, TraceDnsCacheMissParams(host)
+ )
+
+ async def send_request_headers(
+ self, method: str, url: URL, headers: "CIMultiDict[str]"
+ ) -> None:
+ return await self._trace_config._on_request_headers_sent.send(
+ self._session,
+ self._trace_config_ctx,
+ TraceRequestHeadersSentParams(method, url, headers),
+ )
diff --git a/third_party/python/aiohttp/aiohttp/typedefs.py b/third_party/python/aiohttp/aiohttp/typedefs.py
new file mode 100644
index 0000000000..84283d9a46
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/typedefs.py
@@ -0,0 +1,64 @@
+import json
+import os
+import sys
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Awaitable,
+ Callable,
+ Iterable,
+ Mapping,
+ Tuple,
+ Union,
+)
+
+from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy, istr
+from yarl import URL
+
+# These are for other modules to use (to avoid repeating the conditional import).
+if sys.version_info >= (3, 8):
+ from typing import Final as Final, Protocol as Protocol, TypedDict as TypedDict
+else:
+ from typing_extensions import ( # noqa: F401
+ Final,
+ Protocol as Protocol,
+ TypedDict as TypedDict,
+ )
+
+DEFAULT_JSON_ENCODER = json.dumps
+DEFAULT_JSON_DECODER = json.loads
+
+if TYPE_CHECKING: # pragma: no cover
+ _CIMultiDict = CIMultiDict[str]
+ _CIMultiDictProxy = CIMultiDictProxy[str]
+ _MultiDict = MultiDict[str]
+ _MultiDictProxy = MultiDictProxy[str]
+ from http.cookies import BaseCookie, Morsel
+
+ from .web import Request, StreamResponse
+else:
+ _CIMultiDict = CIMultiDict
+ _CIMultiDictProxy = CIMultiDictProxy
+ _MultiDict = MultiDict
+ _MultiDictProxy = MultiDictProxy
+
+Byteish = Union[bytes, bytearray, memoryview]
+JSONEncoder = Callable[[Any], str]
+JSONDecoder = Callable[[str], Any]
+LooseHeaders = Union[Mapping[Union[str, istr], str], _CIMultiDict, _CIMultiDictProxy]
+RawHeaders = Tuple[Tuple[bytes, bytes], ...]
+StrOrURL = Union[str, URL]
+
+LooseCookiesMappings = Mapping[str, Union[str, "BaseCookie[str]", "Morsel[Any]"]]
+LooseCookiesIterables = Iterable[
+ Tuple[str, Union[str, "BaseCookie[str]", "Morsel[Any]"]]
+]
+LooseCookies = Union[
+ LooseCookiesMappings,
+ LooseCookiesIterables,
+ "BaseCookie[str]",
+]
+
+Handler = Callable[["Request"], Awaitable["StreamResponse"]]
+
+PathLike = Union[str, "os.PathLike[str]"]
diff --git a/third_party/python/aiohttp/aiohttp/web.py b/third_party/python/aiohttp/aiohttp/web.py
new file mode 100644
index 0000000000..cefae2b9ae
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web.py
@@ -0,0 +1,588 @@
+import asyncio
+import logging
+import socket
+import sys
+from argparse import ArgumentParser
+from collections.abc import Iterable
+from importlib import import_module
+from typing import (
+ Any,
+ Awaitable,
+ Callable,
+ Iterable as TypingIterable,
+ List,
+ Optional,
+ Set,
+ Type,
+ Union,
+ cast,
+)
+
+from .abc import AbstractAccessLogger
+from .helpers import all_tasks
+from .log import access_logger
+from .web_app import Application as Application, CleanupError as CleanupError
+from .web_exceptions import (
+ HTTPAccepted as HTTPAccepted,
+ HTTPBadGateway as HTTPBadGateway,
+ HTTPBadRequest as HTTPBadRequest,
+ HTTPClientError as HTTPClientError,
+ HTTPConflict as HTTPConflict,
+ HTTPCreated as HTTPCreated,
+ HTTPError as HTTPError,
+ HTTPException as HTTPException,
+ HTTPExpectationFailed as HTTPExpectationFailed,
+ HTTPFailedDependency as HTTPFailedDependency,
+ HTTPForbidden as HTTPForbidden,
+ HTTPFound as HTTPFound,
+ HTTPGatewayTimeout as HTTPGatewayTimeout,
+ HTTPGone as HTTPGone,
+ HTTPInsufficientStorage as HTTPInsufficientStorage,
+ HTTPInternalServerError as HTTPInternalServerError,
+ HTTPLengthRequired as HTTPLengthRequired,
+ HTTPMethodNotAllowed as HTTPMethodNotAllowed,
+ HTTPMisdirectedRequest as HTTPMisdirectedRequest,
+ HTTPMovedPermanently as HTTPMovedPermanently,
+ HTTPMultipleChoices as HTTPMultipleChoices,
+ HTTPNetworkAuthenticationRequired as HTTPNetworkAuthenticationRequired,
+ HTTPNoContent as HTTPNoContent,
+ HTTPNonAuthoritativeInformation as HTTPNonAuthoritativeInformation,
+ HTTPNotAcceptable as HTTPNotAcceptable,
+ HTTPNotExtended as HTTPNotExtended,
+ HTTPNotFound as HTTPNotFound,
+ HTTPNotImplemented as HTTPNotImplemented,
+ HTTPNotModified as HTTPNotModified,
+ HTTPOk as HTTPOk,
+ HTTPPartialContent as HTTPPartialContent,
+ HTTPPaymentRequired as HTTPPaymentRequired,
+ HTTPPermanentRedirect as HTTPPermanentRedirect,
+ HTTPPreconditionFailed as HTTPPreconditionFailed,
+ HTTPPreconditionRequired as HTTPPreconditionRequired,
+ HTTPProxyAuthenticationRequired as HTTPProxyAuthenticationRequired,
+ HTTPRedirection as HTTPRedirection,
+ HTTPRequestEntityTooLarge as HTTPRequestEntityTooLarge,
+ HTTPRequestHeaderFieldsTooLarge as HTTPRequestHeaderFieldsTooLarge,
+ HTTPRequestRangeNotSatisfiable as HTTPRequestRangeNotSatisfiable,
+ HTTPRequestTimeout as HTTPRequestTimeout,
+ HTTPRequestURITooLong as HTTPRequestURITooLong,
+ HTTPResetContent as HTTPResetContent,
+ HTTPSeeOther as HTTPSeeOther,
+ HTTPServerError as HTTPServerError,
+ HTTPServiceUnavailable as HTTPServiceUnavailable,
+ HTTPSuccessful as HTTPSuccessful,
+ HTTPTemporaryRedirect as HTTPTemporaryRedirect,
+ HTTPTooManyRequests as HTTPTooManyRequests,
+ HTTPUnauthorized as HTTPUnauthorized,
+ HTTPUnavailableForLegalReasons as HTTPUnavailableForLegalReasons,
+ HTTPUnprocessableEntity as HTTPUnprocessableEntity,
+ HTTPUnsupportedMediaType as HTTPUnsupportedMediaType,
+ HTTPUpgradeRequired as HTTPUpgradeRequired,
+ HTTPUseProxy as HTTPUseProxy,
+ HTTPVariantAlsoNegotiates as HTTPVariantAlsoNegotiates,
+ HTTPVersionNotSupported as HTTPVersionNotSupported,
+)
+from .web_fileresponse import FileResponse as FileResponse
+from .web_log import AccessLogger
+from .web_middlewares import (
+ middleware as middleware,
+ normalize_path_middleware as normalize_path_middleware,
+)
+from .web_protocol import (
+ PayloadAccessError as PayloadAccessError,
+ RequestHandler as RequestHandler,
+ RequestPayloadError as RequestPayloadError,
+)
+from .web_request import (
+ BaseRequest as BaseRequest,
+ FileField as FileField,
+ Request as Request,
+)
+from .web_response import (
+ ContentCoding as ContentCoding,
+ Response as Response,
+ StreamResponse as StreamResponse,
+ json_response as json_response,
+)
+from .web_routedef import (
+ AbstractRouteDef as AbstractRouteDef,
+ RouteDef as RouteDef,
+ RouteTableDef as RouteTableDef,
+ StaticDef as StaticDef,
+ delete as delete,
+ get as get,
+ head as head,
+ options as options,
+ patch as patch,
+ post as post,
+ put as put,
+ route as route,
+ static as static,
+ view as view,
+)
+from .web_runner import (
+ AppRunner as AppRunner,
+ BaseRunner as BaseRunner,
+ BaseSite as BaseSite,
+ GracefulExit as GracefulExit,
+ NamedPipeSite as NamedPipeSite,
+ ServerRunner as ServerRunner,
+ SockSite as SockSite,
+ TCPSite as TCPSite,
+ UnixSite as UnixSite,
+)
+from .web_server import Server as Server
+from .web_urldispatcher import (
+ AbstractResource as AbstractResource,
+ AbstractRoute as AbstractRoute,
+ DynamicResource as DynamicResource,
+ PlainResource as PlainResource,
+ PrefixedSubAppResource as PrefixedSubAppResource,
+ Resource as Resource,
+ ResourceRoute as ResourceRoute,
+ StaticResource as StaticResource,
+ UrlDispatcher as UrlDispatcher,
+ UrlMappingMatchInfo as UrlMappingMatchInfo,
+ View as View,
+)
+from .web_ws import (
+ WebSocketReady as WebSocketReady,
+ WebSocketResponse as WebSocketResponse,
+ WSMsgType as WSMsgType,
+)
+
+__all__ = (
+ # web_app
+ "Application",
+ "CleanupError",
+ # web_exceptions
+ "HTTPAccepted",
+ "HTTPBadGateway",
+ "HTTPBadRequest",
+ "HTTPClientError",
+ "HTTPConflict",
+ "HTTPCreated",
+ "HTTPError",
+ "HTTPException",
+ "HTTPExpectationFailed",
+ "HTTPFailedDependency",
+ "HTTPForbidden",
+ "HTTPFound",
+ "HTTPGatewayTimeout",
+ "HTTPGone",
+ "HTTPInsufficientStorage",
+ "HTTPInternalServerError",
+ "HTTPLengthRequired",
+ "HTTPMethodNotAllowed",
+ "HTTPMisdirectedRequest",
+ "HTTPMovedPermanently",
+ "HTTPMultipleChoices",
+ "HTTPNetworkAuthenticationRequired",
+ "HTTPNoContent",
+ "HTTPNonAuthoritativeInformation",
+ "HTTPNotAcceptable",
+ "HTTPNotExtended",
+ "HTTPNotFound",
+ "HTTPNotImplemented",
+ "HTTPNotModified",
+ "HTTPOk",
+ "HTTPPartialContent",
+ "HTTPPaymentRequired",
+ "HTTPPermanentRedirect",
+ "HTTPPreconditionFailed",
+ "HTTPPreconditionRequired",
+ "HTTPProxyAuthenticationRequired",
+ "HTTPRedirection",
+ "HTTPRequestEntityTooLarge",
+ "HTTPRequestHeaderFieldsTooLarge",
+ "HTTPRequestRangeNotSatisfiable",
+ "HTTPRequestTimeout",
+ "HTTPRequestURITooLong",
+ "HTTPResetContent",
+ "HTTPSeeOther",
+ "HTTPServerError",
+ "HTTPServiceUnavailable",
+ "HTTPSuccessful",
+ "HTTPTemporaryRedirect",
+ "HTTPTooManyRequests",
+ "HTTPUnauthorized",
+ "HTTPUnavailableForLegalReasons",
+ "HTTPUnprocessableEntity",
+ "HTTPUnsupportedMediaType",
+ "HTTPUpgradeRequired",
+ "HTTPUseProxy",
+ "HTTPVariantAlsoNegotiates",
+ "HTTPVersionNotSupported",
+ # web_fileresponse
+ "FileResponse",
+ # web_middlewares
+ "middleware",
+ "normalize_path_middleware",
+ # web_protocol
+ "PayloadAccessError",
+ "RequestHandler",
+ "RequestPayloadError",
+ # web_request
+ "BaseRequest",
+ "FileField",
+ "Request",
+ # web_response
+ "ContentCoding",
+ "Response",
+ "StreamResponse",
+ "json_response",
+ # web_routedef
+ "AbstractRouteDef",
+ "RouteDef",
+ "RouteTableDef",
+ "StaticDef",
+ "delete",
+ "get",
+ "head",
+ "options",
+ "patch",
+ "post",
+ "put",
+ "route",
+ "static",
+ "view",
+ # web_runner
+ "AppRunner",
+ "BaseRunner",
+ "BaseSite",
+ "GracefulExit",
+ "ServerRunner",
+ "SockSite",
+ "TCPSite",
+ "UnixSite",
+ "NamedPipeSite",
+ # web_server
+ "Server",
+ # web_urldispatcher
+ "AbstractResource",
+ "AbstractRoute",
+ "DynamicResource",
+ "PlainResource",
+ "PrefixedSubAppResource",
+ "Resource",
+ "ResourceRoute",
+ "StaticResource",
+ "UrlDispatcher",
+ "UrlMappingMatchInfo",
+ "View",
+ # web_ws
+ "WebSocketReady",
+ "WebSocketResponse",
+ "WSMsgType",
+ # web
+ "run_app",
+)
+
+
+try:
+ from ssl import SSLContext
+except ImportError: # pragma: no cover
+ SSLContext = Any # type: ignore[misc,assignment]
+
+HostSequence = TypingIterable[str]
+
+
+async def _run_app(
+ app: Union[Application, Awaitable[Application]],
+ *,
+ host: Optional[Union[str, HostSequence]] = None,
+ port: Optional[int] = None,
+ path: Optional[str] = None,
+ sock: Optional[Union[socket.socket, TypingIterable[socket.socket]]] = None,
+ shutdown_timeout: float = 60.0,
+ keepalive_timeout: float = 75.0,
+ ssl_context: Optional[SSLContext] = None,
+ print: Callable[..., None] = print,
+ backlog: int = 128,
+ access_log_class: Type[AbstractAccessLogger] = AccessLogger,
+ access_log_format: str = AccessLogger.LOG_FORMAT,
+ access_log: Optional[logging.Logger] = access_logger,
+ handle_signals: bool = True,
+ reuse_address: Optional[bool] = None,
+ reuse_port: Optional[bool] = None,
+) -> None:
+ # A internal functio to actually do all dirty job for application running
+ if asyncio.iscoroutine(app):
+ app = await app # type: ignore[misc]
+
+ app = cast(Application, app)
+
+ runner = AppRunner(
+ app,
+ handle_signals=handle_signals,
+ access_log_class=access_log_class,
+ access_log_format=access_log_format,
+ access_log=access_log,
+ keepalive_timeout=keepalive_timeout,
+ )
+
+ await runner.setup()
+
+ sites: List[BaseSite] = []
+
+ try:
+ if host is not None:
+ if isinstance(host, (str, bytes, bytearray, memoryview)):
+ sites.append(
+ TCPSite(
+ runner,
+ host,
+ port,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ reuse_address=reuse_address,
+ reuse_port=reuse_port,
+ )
+ )
+ else:
+ for h in host:
+ sites.append(
+ TCPSite(
+ runner,
+ h,
+ port,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ reuse_address=reuse_address,
+ reuse_port=reuse_port,
+ )
+ )
+ elif path is None and sock is None or port is not None:
+ sites.append(
+ TCPSite(
+ runner,
+ port=port,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ reuse_address=reuse_address,
+ reuse_port=reuse_port,
+ )
+ )
+
+ if path is not None:
+ if isinstance(path, (str, bytes, bytearray, memoryview)):
+ sites.append(
+ UnixSite(
+ runner,
+ path,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ )
+ )
+ else:
+ for p in path:
+ sites.append(
+ UnixSite(
+ runner,
+ p,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ )
+ )
+
+ if sock is not None:
+ if not isinstance(sock, Iterable):
+ sites.append(
+ SockSite(
+ runner,
+ sock,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ )
+ )
+ else:
+ for s in sock:
+ sites.append(
+ SockSite(
+ runner,
+ s,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ )
+ )
+ for site in sites:
+ await site.start()
+
+ if print: # pragma: no branch
+ names = sorted(str(s.name) for s in runner.sites)
+ print(
+ "======== Running on {} ========\n"
+ "(Press CTRL+C to quit)".format(", ".join(names))
+ )
+
+ # sleep forever by 1 hour intervals,
+ # on Windows before Python 3.8 wake up every 1 second to handle
+ # Ctrl+C smoothly
+ if sys.platform == "win32" and sys.version_info < (3, 8):
+ delay = 1
+ else:
+ delay = 3600
+
+ while True:
+ await asyncio.sleep(delay)
+ finally:
+ await runner.cleanup()
+
+
+def _cancel_tasks(
+ to_cancel: Set["asyncio.Task[Any]"], loop: asyncio.AbstractEventLoop
+) -> None:
+ if not to_cancel:
+ return
+
+ for task in to_cancel:
+ task.cancel()
+
+ loop.run_until_complete(asyncio.gather(*to_cancel, return_exceptions=True))
+
+ for task in to_cancel:
+ if task.cancelled():
+ continue
+ if task.exception() is not None:
+ loop.call_exception_handler(
+ {
+ "message": "unhandled exception during asyncio.run() shutdown",
+ "exception": task.exception(),
+ "task": task,
+ }
+ )
+
+
+def run_app(
+ app: Union[Application, Awaitable[Application]],
+ *,
+ host: Optional[Union[str, HostSequence]] = None,
+ port: Optional[int] = None,
+ path: Optional[str] = None,
+ sock: Optional[Union[socket.socket, TypingIterable[socket.socket]]] = None,
+ shutdown_timeout: float = 60.0,
+ keepalive_timeout: float = 75.0,
+ ssl_context: Optional[SSLContext] = None,
+ print: Callable[..., None] = print,
+ backlog: int = 128,
+ access_log_class: Type[AbstractAccessLogger] = AccessLogger,
+ access_log_format: str = AccessLogger.LOG_FORMAT,
+ access_log: Optional[logging.Logger] = access_logger,
+ handle_signals: bool = True,
+ reuse_address: Optional[bool] = None,
+ reuse_port: Optional[bool] = None,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+) -> None:
+ """Run an app locally"""
+ if loop is None:
+ loop = asyncio.new_event_loop()
+
+ # Configure if and only if in debugging mode and using the default logger
+ if loop.get_debug() and access_log and access_log.name == "aiohttp.access":
+ if access_log.level == logging.NOTSET:
+ access_log.setLevel(logging.DEBUG)
+ if not access_log.hasHandlers():
+ access_log.addHandler(logging.StreamHandler())
+
+ main_task = loop.create_task(
+ _run_app(
+ app,
+ host=host,
+ port=port,
+ path=path,
+ sock=sock,
+ shutdown_timeout=shutdown_timeout,
+ keepalive_timeout=keepalive_timeout,
+ ssl_context=ssl_context,
+ print=print,
+ backlog=backlog,
+ access_log_class=access_log_class,
+ access_log_format=access_log_format,
+ access_log=access_log,
+ handle_signals=handle_signals,
+ reuse_address=reuse_address,
+ reuse_port=reuse_port,
+ )
+ )
+
+ try:
+ asyncio.set_event_loop(loop)
+ loop.run_until_complete(main_task)
+ except (GracefulExit, KeyboardInterrupt): # pragma: no cover
+ pass
+ finally:
+ _cancel_tasks({main_task}, loop)
+ _cancel_tasks(all_tasks(loop), loop)
+ loop.run_until_complete(loop.shutdown_asyncgens())
+ loop.close()
+
+
+def main(argv: List[str]) -> None:
+ arg_parser = ArgumentParser(
+ description="aiohttp.web Application server", prog="aiohttp.web"
+ )
+ arg_parser.add_argument(
+ "entry_func",
+ help=(
+ "Callable returning the `aiohttp.web.Application` instance to "
+ "run. Should be specified in the 'module:function' syntax."
+ ),
+ metavar="entry-func",
+ )
+ arg_parser.add_argument(
+ "-H",
+ "--hostname",
+ help="TCP/IP hostname to serve on (default: %(default)r)",
+ default="localhost",
+ )
+ arg_parser.add_argument(
+ "-P",
+ "--port",
+ help="TCP/IP port to serve on (default: %(default)r)",
+ type=int,
+ default="8080",
+ )
+ arg_parser.add_argument(
+ "-U",
+ "--path",
+ help="Unix file system path to serve on. Specifying a path will cause "
+ "hostname and port arguments to be ignored.",
+ )
+ args, extra_argv = arg_parser.parse_known_args(argv)
+
+ # Import logic
+ mod_str, _, func_str = args.entry_func.partition(":")
+ if not func_str or not mod_str:
+ arg_parser.error("'entry-func' not in 'module:function' syntax")
+ if mod_str.startswith("."):
+ arg_parser.error("relative module names not supported")
+ try:
+ module = import_module(mod_str)
+ except ImportError as ex:
+ arg_parser.error(f"unable to import {mod_str}: {ex}")
+ try:
+ func = getattr(module, func_str)
+ except AttributeError:
+ arg_parser.error(f"module {mod_str!r} has no attribute {func_str!r}")
+
+ # Compatibility logic
+ if args.path is not None and not hasattr(socket, "AF_UNIX"):
+ arg_parser.error(
+ "file system paths not supported by your operating" " environment"
+ )
+
+ logging.basicConfig(level=logging.DEBUG)
+
+ app = func(extra_argv)
+ run_app(app, host=args.hostname, port=args.port, path=args.path)
+ arg_parser.exit(message="Stopped\n")
+
+
+if __name__ == "__main__": # pragma: no branch
+ main(sys.argv[1:]) # pragma: no cover
diff --git a/third_party/python/aiohttp/aiohttp/web_app.py b/third_party/python/aiohttp/aiohttp/web_app.py
new file mode 100644
index 0000000000..8fd4471d3a
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_app.py
@@ -0,0 +1,557 @@
+import asyncio
+import logging
+import warnings
+from functools import partial, update_wrapper
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ AsyncIterator,
+ Awaitable,
+ Callable,
+ Dict,
+ Iterable,
+ Iterator,
+ List,
+ Mapping,
+ MutableMapping,
+ Optional,
+ Sequence,
+ Tuple,
+ Type,
+ Union,
+ cast,
+)
+
+from aiosignal import Signal
+from frozenlist import FrozenList
+
+from . import hdrs
+from .abc import (
+ AbstractAccessLogger,
+ AbstractMatchInfo,
+ AbstractRouter,
+ AbstractStreamWriter,
+)
+from .helpers import DEBUG
+from .http_parser import RawRequestMessage
+from .log import web_logger
+from .streams import StreamReader
+from .web_log import AccessLogger
+from .web_middlewares import _fix_request_current_app
+from .web_protocol import RequestHandler
+from .web_request import Request
+from .web_response import StreamResponse
+from .web_routedef import AbstractRouteDef
+from .web_server import Server
+from .web_urldispatcher import (
+ AbstractResource,
+ AbstractRoute,
+ Domain,
+ MaskDomain,
+ MatchedSubAppResource,
+ PrefixedSubAppResource,
+ UrlDispatcher,
+)
+
+__all__ = ("Application", "CleanupError")
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from .typedefs import Handler
+
+ _AppSignal = Signal[Callable[["Application"], Awaitable[None]]]
+ _RespPrepareSignal = Signal[Callable[[Request, StreamResponse], Awaitable[None]]]
+ _Middleware = Union[
+ Callable[[Request, Handler], Awaitable[StreamResponse]],
+ Callable[["Application", Handler], Awaitable[Handler]], # old-style
+ ]
+ _Middlewares = FrozenList[_Middleware]
+ _MiddlewaresHandlers = Optional[Sequence[Tuple[_Middleware, bool]]]
+ _Subapps = List["Application"]
+else:
+ # No type checker mode, skip types
+ _AppSignal = Signal
+ _RespPrepareSignal = Signal
+ _Middleware = Callable
+ _Middlewares = FrozenList
+ _MiddlewaresHandlers = Optional[Sequence]
+ _Subapps = List
+
+
+class Application(MutableMapping[str, Any]):
+ ATTRS = frozenset(
+ [
+ "logger",
+ "_debug",
+ "_router",
+ "_loop",
+ "_handler_args",
+ "_middlewares",
+ "_middlewares_handlers",
+ "_run_middlewares",
+ "_state",
+ "_frozen",
+ "_pre_frozen",
+ "_subapps",
+ "_on_response_prepare",
+ "_on_startup",
+ "_on_shutdown",
+ "_on_cleanup",
+ "_client_max_size",
+ "_cleanup_ctx",
+ ]
+ )
+
+ def __init__(
+ self,
+ *,
+ logger: logging.Logger = web_logger,
+ router: Optional[UrlDispatcher] = None,
+ middlewares: Iterable[_Middleware] = (),
+ handler_args: Optional[Mapping[str, Any]] = None,
+ client_max_size: int = 1024**2,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ debug: Any = ..., # mypy doesn't support ellipsis
+ ) -> None:
+ if router is None:
+ router = UrlDispatcher()
+ else:
+ warnings.warn(
+ "router argument is deprecated", DeprecationWarning, stacklevel=2
+ )
+ assert isinstance(router, AbstractRouter), router
+
+ if loop is not None:
+ warnings.warn(
+ "loop argument is deprecated", DeprecationWarning, stacklevel=2
+ )
+
+ if debug is not ...:
+ warnings.warn(
+ "debug argument is deprecated", DeprecationWarning, stacklevel=2
+ )
+ self._debug = debug
+ self._router: UrlDispatcher = router
+ self._loop = loop
+ self._handler_args = handler_args
+ self.logger = logger
+
+ self._middlewares: _Middlewares = FrozenList(middlewares)
+
+ # initialized on freezing
+ self._middlewares_handlers: _MiddlewaresHandlers = None
+ # initialized on freezing
+ self._run_middlewares: Optional[bool] = None
+
+ self._state: Dict[str, Any] = {}
+ self._frozen = False
+ self._pre_frozen = False
+ self._subapps: _Subapps = []
+
+ self._on_response_prepare: _RespPrepareSignal = Signal(self)
+ self._on_startup: _AppSignal = Signal(self)
+ self._on_shutdown: _AppSignal = Signal(self)
+ self._on_cleanup: _AppSignal = Signal(self)
+ self._cleanup_ctx = CleanupContext()
+ self._on_startup.append(self._cleanup_ctx._on_startup)
+ self._on_cleanup.append(self._cleanup_ctx._on_cleanup)
+ self._client_max_size = client_max_size
+
+ def __init_subclass__(cls: Type["Application"]) -> None:
+ warnings.warn(
+ "Inheritance class {} from web.Application "
+ "is discouraged".format(cls.__name__),
+ DeprecationWarning,
+ stacklevel=2,
+ )
+
+ if DEBUG: # pragma: no cover
+
+ def __setattr__(self, name: str, val: Any) -> None:
+ if name not in self.ATTRS:
+ warnings.warn(
+ "Setting custom web.Application.{} attribute "
+ "is discouraged".format(name),
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ super().__setattr__(name, val)
+
+ # MutableMapping API
+
+ def __eq__(self, other: object) -> bool:
+ return self is other
+
+ def __getitem__(self, key: str) -> Any:
+ return self._state[key]
+
+ def _check_frozen(self) -> None:
+ if self._frozen:
+ warnings.warn(
+ "Changing state of started or joined " "application is deprecated",
+ DeprecationWarning,
+ stacklevel=3,
+ )
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self._check_frozen()
+ self._state[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ self._check_frozen()
+ del self._state[key]
+
+ def __len__(self) -> int:
+ return len(self._state)
+
+ def __iter__(self) -> Iterator[str]:
+ return iter(self._state)
+
+ ########
+ @property
+ def loop(self) -> asyncio.AbstractEventLoop:
+ # Technically the loop can be None
+ # but we mask it by explicit type cast
+ # to provide more convinient type annotation
+ warnings.warn("loop property is deprecated", DeprecationWarning, stacklevel=2)
+ return cast(asyncio.AbstractEventLoop, self._loop)
+
+ def _set_loop(self, loop: Optional[asyncio.AbstractEventLoop]) -> None:
+ if loop is None:
+ loop = asyncio.get_event_loop()
+ if self._loop is not None and self._loop is not loop:
+ raise RuntimeError(
+ "web.Application instance initialized with different loop"
+ )
+
+ self._loop = loop
+
+ # set loop debug
+ if self._debug is ...:
+ self._debug = loop.get_debug()
+
+ # set loop to sub applications
+ for subapp in self._subapps:
+ subapp._set_loop(loop)
+
+ @property
+ def pre_frozen(self) -> bool:
+ return self._pre_frozen
+
+ def pre_freeze(self) -> None:
+ if self._pre_frozen:
+ return
+
+ self._pre_frozen = True
+ self._middlewares.freeze()
+ self._router.freeze()
+ self._on_response_prepare.freeze()
+ self._cleanup_ctx.freeze()
+ self._on_startup.freeze()
+ self._on_shutdown.freeze()
+ self._on_cleanup.freeze()
+ self._middlewares_handlers = tuple(self._prepare_middleware())
+
+ # If current app and any subapp do not have middlewares avoid run all
+ # of the code footprint that it implies, which have a middleware
+ # hardcoded per app that sets up the current_app attribute. If no
+ # middlewares are configured the handler will receive the proper
+ # current_app without needing all of this code.
+ self._run_middlewares = True if self.middlewares else False
+
+ for subapp in self._subapps:
+ subapp.pre_freeze()
+ self._run_middlewares = self._run_middlewares or subapp._run_middlewares
+
+ @property
+ def frozen(self) -> bool:
+ return self._frozen
+
+ def freeze(self) -> None:
+ if self._frozen:
+ return
+
+ self.pre_freeze()
+ self._frozen = True
+ for subapp in self._subapps:
+ subapp.freeze()
+
+ @property
+ def debug(self) -> bool:
+ warnings.warn("debug property is deprecated", DeprecationWarning, stacklevel=2)
+ return self._debug # type: ignore[no-any-return]
+
+ def _reg_subapp_signals(self, subapp: "Application") -> None:
+ def reg_handler(signame: str) -> None:
+ subsig = getattr(subapp, signame)
+
+ async def handler(app: "Application") -> None:
+ await subsig.send(subapp)
+
+ appsig = getattr(self, signame)
+ appsig.append(handler)
+
+ reg_handler("on_startup")
+ reg_handler("on_shutdown")
+ reg_handler("on_cleanup")
+
+ def add_subapp(self, prefix: str, subapp: "Application") -> AbstractResource:
+ if not isinstance(prefix, str):
+ raise TypeError("Prefix must be str")
+ prefix = prefix.rstrip("/")
+ if not prefix:
+ raise ValueError("Prefix cannot be empty")
+ factory = partial(PrefixedSubAppResource, prefix, subapp)
+ return self._add_subapp(factory, subapp)
+
+ def _add_subapp(
+ self, resource_factory: Callable[[], AbstractResource], subapp: "Application"
+ ) -> AbstractResource:
+ if self.frozen:
+ raise RuntimeError("Cannot add sub application to frozen application")
+ if subapp.frozen:
+ raise RuntimeError("Cannot add frozen application")
+ resource = resource_factory()
+ self.router.register_resource(resource)
+ self._reg_subapp_signals(subapp)
+ self._subapps.append(subapp)
+ subapp.pre_freeze()
+ if self._loop is not None:
+ subapp._set_loop(self._loop)
+ return resource
+
+ def add_domain(self, domain: str, subapp: "Application") -> AbstractResource:
+ if not isinstance(domain, str):
+ raise TypeError("Domain must be str")
+ elif "*" in domain:
+ rule: Domain = MaskDomain(domain)
+ else:
+ rule = Domain(domain)
+ factory = partial(MatchedSubAppResource, rule, subapp)
+ return self._add_subapp(factory, subapp)
+
+ def add_routes(self, routes: Iterable[AbstractRouteDef]) -> List[AbstractRoute]:
+ return self.router.add_routes(routes)
+
+ @property
+ def on_response_prepare(self) -> _RespPrepareSignal:
+ return self._on_response_prepare
+
+ @property
+ def on_startup(self) -> _AppSignal:
+ return self._on_startup
+
+ @property
+ def on_shutdown(self) -> _AppSignal:
+ return self._on_shutdown
+
+ @property
+ def on_cleanup(self) -> _AppSignal:
+ return self._on_cleanup
+
+ @property
+ def cleanup_ctx(self) -> "CleanupContext":
+ return self._cleanup_ctx
+
+ @property
+ def router(self) -> UrlDispatcher:
+ return self._router
+
+ @property
+ def middlewares(self) -> _Middlewares:
+ return self._middlewares
+
+ def _make_handler(
+ self,
+ *,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ access_log_class: Type[AbstractAccessLogger] = AccessLogger,
+ **kwargs: Any,
+ ) -> Server:
+
+ if not issubclass(access_log_class, AbstractAccessLogger):
+ raise TypeError(
+ "access_log_class must be subclass of "
+ "aiohttp.abc.AbstractAccessLogger, got {}".format(access_log_class)
+ )
+
+ self._set_loop(loop)
+ self.freeze()
+
+ kwargs["debug"] = self._debug
+ kwargs["access_log_class"] = access_log_class
+ if self._handler_args:
+ for k, v in self._handler_args.items():
+ kwargs[k] = v
+
+ return Server(
+ self._handle, # type: ignore[arg-type]
+ request_factory=self._make_request,
+ loop=self._loop,
+ **kwargs,
+ )
+
+ def make_handler(
+ self,
+ *,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ access_log_class: Type[AbstractAccessLogger] = AccessLogger,
+ **kwargs: Any,
+ ) -> Server:
+
+ warnings.warn(
+ "Application.make_handler(...) is deprecated, " "use AppRunner API instead",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+
+ return self._make_handler(
+ loop=loop, access_log_class=access_log_class, **kwargs
+ )
+
+ async def startup(self) -> None:
+ """Causes on_startup signal
+
+ Should be called in the event loop along with the request handler.
+ """
+ await self.on_startup.send(self)
+
+ async def shutdown(self) -> None:
+ """Causes on_shutdown signal
+
+ Should be called before cleanup()
+ """
+ await self.on_shutdown.send(self)
+
+ async def cleanup(self) -> None:
+ """Causes on_cleanup signal
+
+ Should be called after shutdown()
+ """
+ if self.on_cleanup.frozen:
+ await self.on_cleanup.send(self)
+ else:
+ # If an exception occurs in startup, ensure cleanup contexts are completed.
+ await self._cleanup_ctx._on_cleanup(self)
+
+ def _make_request(
+ self,
+ message: RawRequestMessage,
+ payload: StreamReader,
+ protocol: RequestHandler,
+ writer: AbstractStreamWriter,
+ task: "asyncio.Task[None]",
+ _cls: Type[Request] = Request,
+ ) -> Request:
+ return _cls(
+ message,
+ payload,
+ protocol,
+ writer,
+ task,
+ self._loop,
+ client_max_size=self._client_max_size,
+ )
+
+ def _prepare_middleware(self) -> Iterator[Tuple[_Middleware, bool]]:
+ for m in reversed(self._middlewares):
+ if getattr(m, "__middleware_version__", None) == 1:
+ yield m, True
+ else:
+ warnings.warn(
+ 'old-style middleware "{!r}" deprecated, ' "see #2252".format(m),
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ yield m, False
+
+ yield _fix_request_current_app(self), True
+
+ async def _handle(self, request: Request) -> StreamResponse:
+ loop = asyncio.get_event_loop()
+ debug = loop.get_debug()
+ match_info = await self._router.resolve(request)
+ if debug: # pragma: no cover
+ if not isinstance(match_info, AbstractMatchInfo):
+ raise TypeError(
+ "match_info should be AbstractMatchInfo "
+ "instance, not {!r}".format(match_info)
+ )
+ match_info.add_app(self)
+
+ match_info.freeze()
+
+ resp = None
+ request._match_info = match_info
+ expect = request.headers.get(hdrs.EXPECT)
+ if expect:
+ resp = await match_info.expect_handler(request)
+ await request.writer.drain()
+
+ if resp is None:
+ handler = match_info.handler
+
+ if self._run_middlewares:
+ for app in match_info.apps[::-1]:
+ for m, new_style in app._middlewares_handlers: # type: ignore[union-attr] # noqa
+ if new_style:
+ handler = update_wrapper(
+ partial(m, handler=handler), handler
+ )
+ else:
+ handler = await m(app, handler) # type: ignore[arg-type]
+
+ resp = await handler(request)
+
+ return resp
+
+ def __call__(self) -> "Application":
+ """gunicorn compatibility"""
+ return self
+
+ def __repr__(self) -> str:
+ return f"<Application 0x{id(self):x}>"
+
+ def __bool__(self) -> bool:
+ return True
+
+
+class CleanupError(RuntimeError):
+ @property
+ def exceptions(self) -> List[BaseException]:
+ return cast(List[BaseException], self.args[1])
+
+
+if TYPE_CHECKING: # pragma: no cover
+ _CleanupContextBase = FrozenList[Callable[[Application], AsyncIterator[None]]]
+else:
+ _CleanupContextBase = FrozenList
+
+
+class CleanupContext(_CleanupContextBase):
+ def __init__(self) -> None:
+ super().__init__()
+ self._exits: List[AsyncIterator[None]] = []
+
+ async def _on_startup(self, app: Application) -> None:
+ for cb in self:
+ it = cb(app).__aiter__()
+ await it.__anext__()
+ self._exits.append(it)
+
+ async def _on_cleanup(self, app: Application) -> None:
+ errors = []
+ for it in reversed(self._exits):
+ try:
+ await it.__anext__()
+ except StopAsyncIteration:
+ pass
+ except Exception as exc:
+ errors.append(exc)
+ else:
+ errors.append(RuntimeError(f"{it!r} has more than one 'yield'"))
+ if errors:
+ if len(errors) == 1:
+ raise errors[0]
+ else:
+ raise CleanupError("Multiple errors on cleanup stage", errors)
diff --git a/third_party/python/aiohttp/aiohttp/web_exceptions.py b/third_party/python/aiohttp/aiohttp/web_exceptions.py
new file mode 100644
index 0000000000..ae706a1806
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_exceptions.py
@@ -0,0 +1,441 @@
+import warnings
+from typing import Any, Dict, Iterable, List, Optional, Set # noqa
+
+from yarl import URL
+
+from .typedefs import LooseHeaders, StrOrURL
+from .web_response import Response
+
+__all__ = (
+ "HTTPException",
+ "HTTPError",
+ "HTTPRedirection",
+ "HTTPSuccessful",
+ "HTTPOk",
+ "HTTPCreated",
+ "HTTPAccepted",
+ "HTTPNonAuthoritativeInformation",
+ "HTTPNoContent",
+ "HTTPResetContent",
+ "HTTPPartialContent",
+ "HTTPMultipleChoices",
+ "HTTPMovedPermanently",
+ "HTTPFound",
+ "HTTPSeeOther",
+ "HTTPNotModified",
+ "HTTPUseProxy",
+ "HTTPTemporaryRedirect",
+ "HTTPPermanentRedirect",
+ "HTTPClientError",
+ "HTTPBadRequest",
+ "HTTPUnauthorized",
+ "HTTPPaymentRequired",
+ "HTTPForbidden",
+ "HTTPNotFound",
+ "HTTPMethodNotAllowed",
+ "HTTPNotAcceptable",
+ "HTTPProxyAuthenticationRequired",
+ "HTTPRequestTimeout",
+ "HTTPConflict",
+ "HTTPGone",
+ "HTTPLengthRequired",
+ "HTTPPreconditionFailed",
+ "HTTPRequestEntityTooLarge",
+ "HTTPRequestURITooLong",
+ "HTTPUnsupportedMediaType",
+ "HTTPRequestRangeNotSatisfiable",
+ "HTTPExpectationFailed",
+ "HTTPMisdirectedRequest",
+ "HTTPUnprocessableEntity",
+ "HTTPFailedDependency",
+ "HTTPUpgradeRequired",
+ "HTTPPreconditionRequired",
+ "HTTPTooManyRequests",
+ "HTTPRequestHeaderFieldsTooLarge",
+ "HTTPUnavailableForLegalReasons",
+ "HTTPServerError",
+ "HTTPInternalServerError",
+ "HTTPNotImplemented",
+ "HTTPBadGateway",
+ "HTTPServiceUnavailable",
+ "HTTPGatewayTimeout",
+ "HTTPVersionNotSupported",
+ "HTTPVariantAlsoNegotiates",
+ "HTTPInsufficientStorage",
+ "HTTPNotExtended",
+ "HTTPNetworkAuthenticationRequired",
+)
+
+
+############################################################
+# HTTP Exceptions
+############################################################
+
+
+class HTTPException(Response, Exception):
+
+ # You should set in subclasses:
+ # status = 200
+
+ status_code = -1
+ empty_body = False
+
+ __http_exception__ = True
+
+ def __init__(
+ self,
+ *,
+ headers: Optional[LooseHeaders] = None,
+ reason: Optional[str] = None,
+ body: Any = None,
+ text: Optional[str] = None,
+ content_type: Optional[str] = None,
+ ) -> None:
+ if body is not None:
+ warnings.warn(
+ "body argument is deprecated for http web exceptions",
+ DeprecationWarning,
+ )
+ Response.__init__(
+ self,
+ status=self.status_code,
+ headers=headers,
+ reason=reason,
+ body=body,
+ text=text,
+ content_type=content_type,
+ )
+ Exception.__init__(self, self.reason)
+ if self.body is None and not self.empty_body:
+ self.text = f"{self.status}: {self.reason}"
+
+ def __bool__(self) -> bool:
+ return True
+
+
+class HTTPError(HTTPException):
+ """Base class for exceptions with status codes in the 400s and 500s."""
+
+
+class HTTPRedirection(HTTPException):
+ """Base class for exceptions with status codes in the 300s."""
+
+
+class HTTPSuccessful(HTTPException):
+ """Base class for exceptions with status codes in the 200s."""
+
+
+class HTTPOk(HTTPSuccessful):
+ status_code = 200
+
+
+class HTTPCreated(HTTPSuccessful):
+ status_code = 201
+
+
+class HTTPAccepted(HTTPSuccessful):
+ status_code = 202
+
+
+class HTTPNonAuthoritativeInformation(HTTPSuccessful):
+ status_code = 203
+
+
+class HTTPNoContent(HTTPSuccessful):
+ status_code = 204
+ empty_body = True
+
+
+class HTTPResetContent(HTTPSuccessful):
+ status_code = 205
+ empty_body = True
+
+
+class HTTPPartialContent(HTTPSuccessful):
+ status_code = 206
+
+
+############################################################
+# 3xx redirection
+############################################################
+
+
+class _HTTPMove(HTTPRedirection):
+ def __init__(
+ self,
+ location: StrOrURL,
+ *,
+ headers: Optional[LooseHeaders] = None,
+ reason: Optional[str] = None,
+ body: Any = None,
+ text: Optional[str] = None,
+ content_type: Optional[str] = None,
+ ) -> None:
+ if not location:
+ raise ValueError("HTTP redirects need a location to redirect to.")
+ super().__init__(
+ headers=headers,
+ reason=reason,
+ body=body,
+ text=text,
+ content_type=content_type,
+ )
+ self.headers["Location"] = str(URL(location))
+ self.location = location
+
+
+class HTTPMultipleChoices(_HTTPMove):
+ status_code = 300
+
+
+class HTTPMovedPermanently(_HTTPMove):
+ status_code = 301
+
+
+class HTTPFound(_HTTPMove):
+ status_code = 302
+
+
+# This one is safe after a POST (the redirected location will be
+# retrieved with GET):
+class HTTPSeeOther(_HTTPMove):
+ status_code = 303
+
+
+class HTTPNotModified(HTTPRedirection):
+ # FIXME: this should include a date or etag header
+ status_code = 304
+ empty_body = True
+
+
+class HTTPUseProxy(_HTTPMove):
+ # Not a move, but looks a little like one
+ status_code = 305
+
+
+class HTTPTemporaryRedirect(_HTTPMove):
+ status_code = 307
+
+
+class HTTPPermanentRedirect(_HTTPMove):
+ status_code = 308
+
+
+############################################################
+# 4xx client error
+############################################################
+
+
+class HTTPClientError(HTTPError):
+ pass
+
+
+class HTTPBadRequest(HTTPClientError):
+ status_code = 400
+
+
+class HTTPUnauthorized(HTTPClientError):
+ status_code = 401
+
+
+class HTTPPaymentRequired(HTTPClientError):
+ status_code = 402
+
+
+class HTTPForbidden(HTTPClientError):
+ status_code = 403
+
+
+class HTTPNotFound(HTTPClientError):
+ status_code = 404
+
+
+class HTTPMethodNotAllowed(HTTPClientError):
+ status_code = 405
+
+ def __init__(
+ self,
+ method: str,
+ allowed_methods: Iterable[str],
+ *,
+ headers: Optional[LooseHeaders] = None,
+ reason: Optional[str] = None,
+ body: Any = None,
+ text: Optional[str] = None,
+ content_type: Optional[str] = None,
+ ) -> None:
+ allow = ",".join(sorted(allowed_methods))
+ super().__init__(
+ headers=headers,
+ reason=reason,
+ body=body,
+ text=text,
+ content_type=content_type,
+ )
+ self.headers["Allow"] = allow
+ self.allowed_methods: Set[str] = set(allowed_methods)
+ self.method = method.upper()
+
+
+class HTTPNotAcceptable(HTTPClientError):
+ status_code = 406
+
+
+class HTTPProxyAuthenticationRequired(HTTPClientError):
+ status_code = 407
+
+
+class HTTPRequestTimeout(HTTPClientError):
+ status_code = 408
+
+
+class HTTPConflict(HTTPClientError):
+ status_code = 409
+
+
+class HTTPGone(HTTPClientError):
+ status_code = 410
+
+
+class HTTPLengthRequired(HTTPClientError):
+ status_code = 411
+
+
+class HTTPPreconditionFailed(HTTPClientError):
+ status_code = 412
+
+
+class HTTPRequestEntityTooLarge(HTTPClientError):
+ status_code = 413
+
+ def __init__(self, max_size: float, actual_size: float, **kwargs: Any) -> None:
+ kwargs.setdefault(
+ "text",
+ "Maximum request body size {} exceeded, "
+ "actual body size {}".format(max_size, actual_size),
+ )
+ super().__init__(**kwargs)
+
+
+class HTTPRequestURITooLong(HTTPClientError):
+ status_code = 414
+
+
+class HTTPUnsupportedMediaType(HTTPClientError):
+ status_code = 415
+
+
+class HTTPRequestRangeNotSatisfiable(HTTPClientError):
+ status_code = 416
+
+
+class HTTPExpectationFailed(HTTPClientError):
+ status_code = 417
+
+
+class HTTPMisdirectedRequest(HTTPClientError):
+ status_code = 421
+
+
+class HTTPUnprocessableEntity(HTTPClientError):
+ status_code = 422
+
+
+class HTTPFailedDependency(HTTPClientError):
+ status_code = 424
+
+
+class HTTPUpgradeRequired(HTTPClientError):
+ status_code = 426
+
+
+class HTTPPreconditionRequired(HTTPClientError):
+ status_code = 428
+
+
+class HTTPTooManyRequests(HTTPClientError):
+ status_code = 429
+
+
+class HTTPRequestHeaderFieldsTooLarge(HTTPClientError):
+ status_code = 431
+
+
+class HTTPUnavailableForLegalReasons(HTTPClientError):
+ status_code = 451
+
+ def __init__(
+ self,
+ link: str,
+ *,
+ headers: Optional[LooseHeaders] = None,
+ reason: Optional[str] = None,
+ body: Any = None,
+ text: Optional[str] = None,
+ content_type: Optional[str] = None,
+ ) -> None:
+ super().__init__(
+ headers=headers,
+ reason=reason,
+ body=body,
+ text=text,
+ content_type=content_type,
+ )
+ self.headers["Link"] = '<%s>; rel="blocked-by"' % link
+ self.link = link
+
+
+############################################################
+# 5xx Server Error
+############################################################
+# Response status codes beginning with the digit "5" indicate cases in
+# which the server is aware that it has erred or is incapable of
+# performing the request. Except when responding to a HEAD request, the
+# server SHOULD include an entity containing an explanation of the error
+# situation, and whether it is a temporary or permanent condition. User
+# agents SHOULD display any included entity to the user. These response
+# codes are applicable to any request method.
+
+
+class HTTPServerError(HTTPError):
+ pass
+
+
+class HTTPInternalServerError(HTTPServerError):
+ status_code = 500
+
+
+class HTTPNotImplemented(HTTPServerError):
+ status_code = 501
+
+
+class HTTPBadGateway(HTTPServerError):
+ status_code = 502
+
+
+class HTTPServiceUnavailable(HTTPServerError):
+ status_code = 503
+
+
+class HTTPGatewayTimeout(HTTPServerError):
+ status_code = 504
+
+
+class HTTPVersionNotSupported(HTTPServerError):
+ status_code = 505
+
+
+class HTTPVariantAlsoNegotiates(HTTPServerError):
+ status_code = 506
+
+
+class HTTPInsufficientStorage(HTTPServerError):
+ status_code = 507
+
+
+class HTTPNotExtended(HTTPServerError):
+ status_code = 510
+
+
+class HTTPNetworkAuthenticationRequired(HTTPServerError):
+ status_code = 511
diff --git a/third_party/python/aiohttp/aiohttp/web_fileresponse.py b/third_party/python/aiohttp/aiohttp/web_fileresponse.py
new file mode 100644
index 0000000000..f41ed3fd0a
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_fileresponse.py
@@ -0,0 +1,288 @@
+import asyncio
+import mimetypes
+import os
+import pathlib
+import sys
+from typing import ( # noqa
+ IO,
+ TYPE_CHECKING,
+ Any,
+ Awaitable,
+ Callable,
+ Iterator,
+ List,
+ Optional,
+ Tuple,
+ Union,
+ cast,
+)
+
+from . import hdrs
+from .abc import AbstractStreamWriter
+from .helpers import ETAG_ANY, ETag
+from .typedefs import Final, LooseHeaders
+from .web_exceptions import (
+ HTTPNotModified,
+ HTTPPartialContent,
+ HTTPPreconditionFailed,
+ HTTPRequestRangeNotSatisfiable,
+)
+from .web_response import StreamResponse
+
+__all__ = ("FileResponse",)
+
+if TYPE_CHECKING: # pragma: no cover
+ from .web_request import BaseRequest
+
+
+_T_OnChunkSent = Optional[Callable[[bytes], Awaitable[None]]]
+
+
+NOSENDFILE: Final[bool] = bool(os.environ.get("AIOHTTP_NOSENDFILE"))
+
+
+class FileResponse(StreamResponse):
+ """A response object can be used to send files."""
+
+ def __init__(
+ self,
+ path: Union[str, pathlib.Path],
+ chunk_size: int = 256 * 1024,
+ status: int = 200,
+ reason: Optional[str] = None,
+ headers: Optional[LooseHeaders] = None,
+ ) -> None:
+ super().__init__(status=status, reason=reason, headers=headers)
+
+ if isinstance(path, str):
+ path = pathlib.Path(path)
+
+ self._path = path
+ self._chunk_size = chunk_size
+
+ async def _sendfile_fallback(
+ self, writer: AbstractStreamWriter, fobj: IO[Any], offset: int, count: int
+ ) -> AbstractStreamWriter:
+ # To keep memory usage low,fobj is transferred in chunks
+ # controlled by the constructor's chunk_size argument.
+
+ chunk_size = self._chunk_size
+ loop = asyncio.get_event_loop()
+
+ await loop.run_in_executor(None, fobj.seek, offset)
+
+ chunk = await loop.run_in_executor(None, fobj.read, chunk_size)
+ while chunk:
+ await writer.write(chunk)
+ count = count - chunk_size
+ if count <= 0:
+ break
+ chunk = await loop.run_in_executor(None, fobj.read, min(chunk_size, count))
+
+ await writer.drain()
+ return writer
+
+ async def _sendfile(
+ self, request: "BaseRequest", fobj: IO[Any], offset: int, count: int
+ ) -> AbstractStreamWriter:
+ writer = await super().prepare(request)
+ assert writer is not None
+
+ if NOSENDFILE or sys.version_info < (3, 7) or self.compression:
+ return await self._sendfile_fallback(writer, fobj, offset, count)
+
+ loop = request._loop
+ transport = request.transport
+ assert transport is not None
+
+ try:
+ await loop.sendfile(transport, fobj, offset, count)
+ except NotImplementedError:
+ return await self._sendfile_fallback(writer, fobj, offset, count)
+
+ await super().write_eof()
+ return writer
+
+ @staticmethod
+ def _strong_etag_match(etag_value: str, etags: Tuple[ETag, ...]) -> bool:
+ if len(etags) == 1 and etags[0].value == ETAG_ANY:
+ return True
+ return any(etag.value == etag_value for etag in etags if not etag.is_weak)
+
+ async def _not_modified(
+ self, request: "BaseRequest", etag_value: str, last_modified: float
+ ) -> Optional[AbstractStreamWriter]:
+ self.set_status(HTTPNotModified.status_code)
+ self._length_check = False
+ self.etag = etag_value # type: ignore[assignment]
+ self.last_modified = last_modified # type: ignore[assignment]
+ # Delete any Content-Length headers provided by user. HTTP 304
+ # should always have empty response body
+ return await super().prepare(request)
+
+ async def _precondition_failed(
+ self, request: "BaseRequest"
+ ) -> Optional[AbstractStreamWriter]:
+ self.set_status(HTTPPreconditionFailed.status_code)
+ self.content_length = 0
+ return await super().prepare(request)
+
+ async def prepare(self, request: "BaseRequest") -> Optional[AbstractStreamWriter]:
+ filepath = self._path
+
+ gzip = False
+ if "gzip" in request.headers.get(hdrs.ACCEPT_ENCODING, ""):
+ gzip_path = filepath.with_name(filepath.name + ".gz")
+
+ if gzip_path.is_file():
+ filepath = gzip_path
+ gzip = True
+
+ loop = asyncio.get_event_loop()
+ st: os.stat_result = await loop.run_in_executor(None, filepath.stat)
+
+ etag_value = f"{st.st_mtime_ns:x}-{st.st_size:x}"
+ last_modified = st.st_mtime
+
+ # https://tools.ietf.org/html/rfc7232#section-6
+ ifmatch = request.if_match
+ if ifmatch is not None and not self._strong_etag_match(etag_value, ifmatch):
+ return await self._precondition_failed(request)
+
+ unmodsince = request.if_unmodified_since
+ if (
+ unmodsince is not None
+ and ifmatch is None
+ and st.st_mtime > unmodsince.timestamp()
+ ):
+ return await self._precondition_failed(request)
+
+ ifnonematch = request.if_none_match
+ if ifnonematch is not None and self._strong_etag_match(etag_value, ifnonematch):
+ return await self._not_modified(request, etag_value, last_modified)
+
+ modsince = request.if_modified_since
+ if (
+ modsince is not None
+ and ifnonematch is None
+ and st.st_mtime <= modsince.timestamp()
+ ):
+ return await self._not_modified(request, etag_value, last_modified)
+
+ if hdrs.CONTENT_TYPE not in self.headers:
+ ct, encoding = mimetypes.guess_type(str(filepath))
+ if not ct:
+ ct = "application/octet-stream"
+ should_set_ct = True
+ else:
+ encoding = "gzip" if gzip else None
+ should_set_ct = False
+
+ status = self._status
+ file_size = st.st_size
+ count = file_size
+
+ start = None
+
+ ifrange = request.if_range
+ if ifrange is None or st.st_mtime <= ifrange.timestamp():
+ # If-Range header check:
+ # condition = cached date >= last modification date
+ # return 206 if True else 200.
+ # if False:
+ # Range header would not be processed, return 200
+ # if True but Range header missing
+ # return 200
+ try:
+ rng = request.http_range
+ start = rng.start
+ end = rng.stop
+ except ValueError:
+ # https://tools.ietf.org/html/rfc7233:
+ # A server generating a 416 (Range Not Satisfiable) response to
+ # a byte-range request SHOULD send a Content-Range header field
+ # with an unsatisfied-range value.
+ # The complete-length in a 416 response indicates the current
+ # length of the selected representation.
+ #
+ # Will do the same below. Many servers ignore this and do not
+ # send a Content-Range header with HTTP 416
+ self.headers[hdrs.CONTENT_RANGE] = f"bytes */{file_size}"
+ self.set_status(HTTPRequestRangeNotSatisfiable.status_code)
+ return await super().prepare(request)
+
+ # If a range request has been made, convert start, end slice
+ # notation into file pointer offset and count
+ if start is not None or end is not None:
+ if start < 0 and end is None: # return tail of file
+ start += file_size
+ if start < 0:
+ # if Range:bytes=-1000 in request header but file size
+ # is only 200, there would be trouble without this
+ start = 0
+ count = file_size - start
+ else:
+ # rfc7233:If the last-byte-pos value is
+ # absent, or if the value is greater than or equal to
+ # the current length of the representation data,
+ # the byte range is interpreted as the remainder
+ # of the representation (i.e., the server replaces the
+ # value of last-byte-pos with a value that is one less than
+ # the current length of the selected representation).
+ count = (
+ min(end if end is not None else file_size, file_size) - start
+ )
+
+ if start >= file_size:
+ # HTTP 416 should be returned in this case.
+ #
+ # According to https://tools.ietf.org/html/rfc7233:
+ # If a valid byte-range-set includes at least one
+ # byte-range-spec with a first-byte-pos that is less than
+ # the current length of the representation, or at least one
+ # suffix-byte-range-spec with a non-zero suffix-length,
+ # then the byte-range-set is satisfiable. Otherwise, the
+ # byte-range-set is unsatisfiable.
+ self.headers[hdrs.CONTENT_RANGE] = f"bytes */{file_size}"
+ self.set_status(HTTPRequestRangeNotSatisfiable.status_code)
+ return await super().prepare(request)
+
+ status = HTTPPartialContent.status_code
+ # Even though you are sending the whole file, you should still
+ # return a HTTP 206 for a Range request.
+ self.set_status(status)
+
+ if should_set_ct:
+ self.content_type = ct # type: ignore[assignment]
+ if encoding:
+ self.headers[hdrs.CONTENT_ENCODING] = encoding
+ if gzip:
+ self.headers[hdrs.VARY] = hdrs.ACCEPT_ENCODING
+
+ self.etag = etag_value # type: ignore[assignment]
+ self.last_modified = st.st_mtime # type: ignore[assignment]
+ self.content_length = count
+
+ self.headers[hdrs.ACCEPT_RANGES] = "bytes"
+
+ real_start = cast(int, start)
+
+ if status == HTTPPartialContent.status_code:
+ self.headers[hdrs.CONTENT_RANGE] = "bytes {}-{}/{}".format(
+ real_start, real_start + count - 1, file_size
+ )
+
+ # If we are sending 0 bytes calling sendfile() will throw a ValueError
+ if count == 0 or request.method == hdrs.METH_HEAD or self.status in [204, 304]:
+ return await super().prepare(request)
+
+ fobj = await loop.run_in_executor(None, filepath.open, "rb")
+ if start: # be aware that start could be None or int=0 here.
+ offset = start
+ else:
+ offset = 0
+
+ try:
+ return await self._sendfile(request, fobj, offset, count)
+ finally:
+ await loop.run_in_executor(None, fobj.close)
diff --git a/third_party/python/aiohttp/aiohttp/web_log.py b/third_party/python/aiohttp/aiohttp/web_log.py
new file mode 100644
index 0000000000..bc6e3b5a8a
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_log.py
@@ -0,0 +1,208 @@
+import datetime
+import functools
+import logging
+import os
+import re
+from collections import namedtuple
+from typing import Any, Callable, Dict, Iterable, List, Tuple # noqa
+
+from .abc import AbstractAccessLogger
+from .web_request import BaseRequest
+from .web_response import StreamResponse
+
+KeyMethod = namedtuple("KeyMethod", "key method")
+
+
+class AccessLogger(AbstractAccessLogger):
+ """Helper object to log access.
+
+ Usage:
+ log = logging.getLogger("spam")
+ log_format = "%a %{User-Agent}i"
+ access_logger = AccessLogger(log, log_format)
+ access_logger.log(request, response, time)
+
+ Format:
+ %% The percent sign
+ %a Remote IP-address (IP-address of proxy if using reverse proxy)
+ %t Time when the request was started to process
+ %P The process ID of the child that serviced the request
+ %r First line of request
+ %s Response status code
+ %b Size of response in bytes, including HTTP headers
+ %T Time taken to serve the request, in seconds
+ %Tf Time taken to serve the request, in seconds with floating fraction
+ in .06f format
+ %D Time taken to serve the request, in microseconds
+ %{FOO}i request.headers['FOO']
+ %{FOO}o response.headers['FOO']
+ %{FOO}e os.environ['FOO']
+
+ """
+
+ LOG_FORMAT_MAP = {
+ "a": "remote_address",
+ "t": "request_start_time",
+ "P": "process_id",
+ "r": "first_request_line",
+ "s": "response_status",
+ "b": "response_size",
+ "T": "request_time",
+ "Tf": "request_time_frac",
+ "D": "request_time_micro",
+ "i": "request_header",
+ "o": "response_header",
+ }
+
+ LOG_FORMAT = '%a %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"'
+ FORMAT_RE = re.compile(r"%(\{([A-Za-z0-9\-_]+)\}([ioe])|[atPrsbOD]|Tf?)")
+ CLEANUP_RE = re.compile(r"(%[^s])")
+ _FORMAT_CACHE: Dict[str, Tuple[str, List[KeyMethod]]] = {}
+
+ def __init__(self, logger: logging.Logger, log_format: str = LOG_FORMAT) -> None:
+ """Initialise the logger.
+
+ logger is a logger object to be used for logging.
+ log_format is a string with apache compatible log format description.
+
+ """
+ super().__init__(logger, log_format=log_format)
+
+ _compiled_format = AccessLogger._FORMAT_CACHE.get(log_format)
+ if not _compiled_format:
+ _compiled_format = self.compile_format(log_format)
+ AccessLogger._FORMAT_CACHE[log_format] = _compiled_format
+
+ self._log_format, self._methods = _compiled_format
+
+ def compile_format(self, log_format: str) -> Tuple[str, List[KeyMethod]]:
+ """Translate log_format into form usable by modulo formatting
+
+ All known atoms will be replaced with %s
+ Also methods for formatting of those atoms will be added to
+ _methods in appropriate order
+
+ For example we have log_format = "%a %t"
+ This format will be translated to "%s %s"
+ Also contents of _methods will be
+ [self._format_a, self._format_t]
+ These method will be called and results will be passed
+ to translated string format.
+
+ Each _format_* method receive 'args' which is list of arguments
+ given to self.log
+
+ Exceptions are _format_e, _format_i and _format_o methods which
+ also receive key name (by functools.partial)
+
+ """
+ # list of (key, method) tuples, we don't use an OrderedDict as users
+ # can repeat the same key more than once
+ methods = list()
+
+ for atom in self.FORMAT_RE.findall(log_format):
+ if atom[1] == "":
+ format_key1 = self.LOG_FORMAT_MAP[atom[0]]
+ m = getattr(AccessLogger, "_format_%s" % atom[0])
+ key_method = KeyMethod(format_key1, m)
+ else:
+ format_key2 = (self.LOG_FORMAT_MAP[atom[2]], atom[1])
+ m = getattr(AccessLogger, "_format_%s" % atom[2])
+ key_method = KeyMethod(format_key2, functools.partial(m, atom[1]))
+
+ methods.append(key_method)
+
+ log_format = self.FORMAT_RE.sub(r"%s", log_format)
+ log_format = self.CLEANUP_RE.sub(r"%\1", log_format)
+ return log_format, methods
+
+ @staticmethod
+ def _format_i(
+ key: str, request: BaseRequest, response: StreamResponse, time: float
+ ) -> str:
+ if request is None:
+ return "(no headers)"
+
+ # suboptimal, make istr(key) once
+ return request.headers.get(key, "-")
+
+ @staticmethod
+ def _format_o(
+ key: str, request: BaseRequest, response: StreamResponse, time: float
+ ) -> str:
+ # suboptimal, make istr(key) once
+ return response.headers.get(key, "-")
+
+ @staticmethod
+ def _format_a(request: BaseRequest, response: StreamResponse, time: float) -> str:
+ if request is None:
+ return "-"
+ ip = request.remote
+ return ip if ip is not None else "-"
+
+ @staticmethod
+ def _format_t(request: BaseRequest, response: StreamResponse, time: float) -> str:
+ now = datetime.datetime.utcnow()
+ start_time = now - datetime.timedelta(seconds=time)
+ return start_time.strftime("[%d/%b/%Y:%H:%M:%S +0000]")
+
+ @staticmethod
+ def _format_P(request: BaseRequest, response: StreamResponse, time: float) -> str:
+ return "<%s>" % os.getpid()
+
+ @staticmethod
+ def _format_r(request: BaseRequest, response: StreamResponse, time: float) -> str:
+ if request is None:
+ return "-"
+ return "{} {} HTTP/{}.{}".format(
+ request.method,
+ request.path_qs,
+ request.version.major,
+ request.version.minor,
+ )
+
+ @staticmethod
+ def _format_s(request: BaseRequest, response: StreamResponse, time: float) -> int:
+ return response.status
+
+ @staticmethod
+ def _format_b(request: BaseRequest, response: StreamResponse, time: float) -> int:
+ return response.body_length
+
+ @staticmethod
+ def _format_T(request: BaseRequest, response: StreamResponse, time: float) -> str:
+ return str(round(time))
+
+ @staticmethod
+ def _format_Tf(request: BaseRequest, response: StreamResponse, time: float) -> str:
+ return "%06f" % time
+
+ @staticmethod
+ def _format_D(request: BaseRequest, response: StreamResponse, time: float) -> str:
+ return str(round(time * 1000000))
+
+ def _format_line(
+ self, request: BaseRequest, response: StreamResponse, time: float
+ ) -> Iterable[Tuple[str, Callable[[BaseRequest, StreamResponse, float], str]]]:
+ return [(key, method(request, response, time)) for key, method in self._methods]
+
+ def log(self, request: BaseRequest, response: StreamResponse, time: float) -> None:
+ try:
+ fmt_info = self._format_line(request, response, time)
+
+ values = list()
+ extra = dict()
+ for key, value in fmt_info:
+ values.append(value)
+
+ if key.__class__ is str:
+ extra[key] = value
+ else:
+ k1, k2 = key # type: ignore[misc]
+ dct = extra.get(k1, {}) # type: ignore[var-annotated,has-type]
+ dct[k2] = value # type: ignore[index,has-type]
+ extra[k1] = dct # type: ignore[has-type,assignment]
+
+ self.logger.info(self._log_format % tuple(values), extra=extra)
+ except Exception:
+ self.logger.exception("Error in logging")
diff --git a/third_party/python/aiohttp/aiohttp/web_middlewares.py b/third_party/python/aiohttp/aiohttp/web_middlewares.py
new file mode 100644
index 0000000000..fabcc449a2
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_middlewares.py
@@ -0,0 +1,119 @@
+import re
+from typing import TYPE_CHECKING, Awaitable, Callable, Tuple, Type, TypeVar
+
+from .typedefs import Handler
+from .web_exceptions import HTTPPermanentRedirect, _HTTPMove
+from .web_request import Request
+from .web_response import StreamResponse
+from .web_urldispatcher import SystemRoute
+
+__all__ = (
+ "middleware",
+ "normalize_path_middleware",
+)
+
+if TYPE_CHECKING: # pragma: no cover
+ from .web_app import Application
+
+_Func = TypeVar("_Func")
+
+
+async def _check_request_resolves(request: Request, path: str) -> Tuple[bool, Request]:
+ alt_request = request.clone(rel_url=path)
+
+ match_info = await request.app.router.resolve(alt_request)
+ alt_request._match_info = match_info
+
+ if match_info.http_exception is None:
+ return True, alt_request
+
+ return False, request
+
+
+def middleware(f: _Func) -> _Func:
+ f.__middleware_version__ = 1 # type: ignore[attr-defined]
+ return f
+
+
+_Middleware = Callable[[Request, Handler], Awaitable[StreamResponse]]
+
+
+def normalize_path_middleware(
+ *,
+ append_slash: bool = True,
+ remove_slash: bool = False,
+ merge_slashes: bool = True,
+ redirect_class: Type[_HTTPMove] = HTTPPermanentRedirect,
+) -> _Middleware:
+ """Factory for producing a middleware that normalizes the path of a request.
+
+ Normalizing means:
+ - Add or remove a trailing slash to the path.
+ - Double slashes are replaced by one.
+
+ The middleware returns as soon as it finds a path that resolves
+ correctly. The order if both merge and append/remove are enabled is
+ 1) merge slashes
+ 2) append/remove slash
+ 3) both merge slashes and append/remove slash.
+ If the path resolves with at least one of those conditions, it will
+ redirect to the new path.
+
+ Only one of `append_slash` and `remove_slash` can be enabled. If both
+ are `True` the factory will raise an assertion error
+
+ If `append_slash` is `True` the middleware will append a slash when
+ needed. If a resource is defined with trailing slash and the request
+ comes without it, it will append it automatically.
+
+ If `remove_slash` is `True`, `append_slash` must be `False`. When enabled
+ the middleware will remove trailing slashes and redirect if the resource
+ is defined
+
+ If merge_slashes is True, merge multiple consecutive slashes in the
+ path into one.
+ """
+ correct_configuration = not (append_slash and remove_slash)
+ assert correct_configuration, "Cannot both remove and append slash"
+
+ @middleware
+ async def impl(request: Request, handler: Handler) -> StreamResponse:
+ if isinstance(request.match_info.route, SystemRoute):
+ paths_to_check = []
+ if "?" in request.raw_path:
+ path, query = request.raw_path.split("?", 1)
+ query = "?" + query
+ else:
+ query = ""
+ path = request.raw_path
+
+ if merge_slashes:
+ paths_to_check.append(re.sub("//+", "/", path))
+ if append_slash and not request.path.endswith("/"):
+ paths_to_check.append(path + "/")
+ if remove_slash and request.path.endswith("/"):
+ paths_to_check.append(path[:-1])
+ if merge_slashes and append_slash:
+ paths_to_check.append(re.sub("//+", "/", path + "/"))
+ if merge_slashes and remove_slash:
+ merged_slashes = re.sub("//+", "/", path)
+ paths_to_check.append(merged_slashes[:-1])
+
+ for path in paths_to_check:
+ path = re.sub("^//+", "/", path) # SECURITY: GHSA-v6wp-4m6f-gcjg
+ resolves, request = await _check_request_resolves(request, path)
+ if resolves:
+ raise redirect_class(request.raw_path + query)
+
+ return await handler(request)
+
+ return impl
+
+
+def _fix_request_current_app(app: "Application") -> _Middleware:
+ @middleware
+ async def impl(request: Request, handler: Handler) -> StreamResponse:
+ with request.match_info.set_current_app(app):
+ return await handler(request)
+
+ return impl
diff --git a/third_party/python/aiohttp/aiohttp/web_protocol.py b/third_party/python/aiohttp/aiohttp/web_protocol.py
new file mode 100644
index 0000000000..10a9608018
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_protocol.py
@@ -0,0 +1,679 @@
+import asyncio
+import asyncio.streams
+import traceback
+import warnings
+from collections import deque
+from contextlib import suppress
+from html import escape as html_escape
+from http import HTTPStatus
+from logging import Logger
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Awaitable,
+ Callable,
+ Deque,
+ Optional,
+ Sequence,
+ Tuple,
+ Type,
+ Union,
+ cast,
+)
+
+import attr
+import yarl
+
+from .abc import AbstractAccessLogger, AbstractStreamWriter
+from .base_protocol import BaseProtocol
+from .helpers import ceil_timeout
+from .http import (
+ HttpProcessingError,
+ HttpRequestParser,
+ HttpVersion10,
+ RawRequestMessage,
+ StreamWriter,
+)
+from .log import access_logger, server_logger
+from .streams import EMPTY_PAYLOAD, StreamReader
+from .tcp_helpers import tcp_keepalive
+from .web_exceptions import HTTPException
+from .web_log import AccessLogger
+from .web_request import BaseRequest
+from .web_response import Response, StreamResponse
+
+__all__ = ("RequestHandler", "RequestPayloadError", "PayloadAccessError")
+
+if TYPE_CHECKING: # pragma: no cover
+ from .web_server import Server
+
+
+_RequestFactory = Callable[
+ [
+ RawRequestMessage,
+ StreamReader,
+ "RequestHandler",
+ AbstractStreamWriter,
+ "asyncio.Task[None]",
+ ],
+ BaseRequest,
+]
+
+_RequestHandler = Callable[[BaseRequest], Awaitable[StreamResponse]]
+
+ERROR = RawRequestMessage(
+ "UNKNOWN",
+ "/",
+ HttpVersion10,
+ {}, # type: ignore[arg-type]
+ {}, # type: ignore[arg-type]
+ True,
+ None,
+ False,
+ False,
+ yarl.URL("/"),
+)
+
+
+class RequestPayloadError(Exception):
+ """Payload parsing error."""
+
+
+class PayloadAccessError(Exception):
+ """Payload was accessed after response was sent."""
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class _ErrInfo:
+ status: int
+ exc: BaseException
+ message: str
+
+
+_MsgType = Tuple[Union[RawRequestMessage, _ErrInfo], StreamReader]
+
+
+class RequestHandler(BaseProtocol):
+ """HTTP protocol implementation.
+
+ RequestHandler handles incoming HTTP request. It reads request line,
+ request headers and request payload and calls handle_request() method.
+ By default it always returns with 404 response.
+
+ RequestHandler handles errors in incoming request, like bad
+ status line, bad headers or incomplete payload. If any error occurs,
+ connection gets closed.
+
+ keepalive_timeout -- number of seconds before closing
+ keep-alive connection
+
+ tcp_keepalive -- TCP keep-alive is on, default is on
+
+ debug -- enable debug mode
+
+ logger -- custom logger object
+
+ access_log_class -- custom class for access_logger
+
+ access_log -- custom logging object
+
+ access_log_format -- access log format string
+
+ loop -- Optional event loop
+
+ max_line_size -- Optional maximum header line size
+
+ max_field_size -- Optional maximum header field size
+
+ max_headers -- Optional maximum header size
+
+ """
+
+ KEEPALIVE_RESCHEDULE_DELAY = 1
+
+ __slots__ = (
+ "_request_count",
+ "_keepalive",
+ "_manager",
+ "_request_handler",
+ "_request_factory",
+ "_tcp_keepalive",
+ "_keepalive_time",
+ "_keepalive_handle",
+ "_keepalive_timeout",
+ "_lingering_time",
+ "_messages",
+ "_message_tail",
+ "_waiter",
+ "_task_handler",
+ "_upgrade",
+ "_payload_parser",
+ "_request_parser",
+ "_reading_paused",
+ "logger",
+ "debug",
+ "access_log",
+ "access_logger",
+ "_close",
+ "_force_close",
+ "_current_request",
+ )
+
+ def __init__(
+ self,
+ manager: "Server",
+ *,
+ loop: asyncio.AbstractEventLoop,
+ keepalive_timeout: float = 75.0, # NGINX default is 75 secs
+ tcp_keepalive: bool = True,
+ logger: Logger = server_logger,
+ access_log_class: Type[AbstractAccessLogger] = AccessLogger,
+ access_log: Logger = access_logger,
+ access_log_format: str = AccessLogger.LOG_FORMAT,
+ debug: bool = False,
+ max_line_size: int = 8190,
+ max_headers: int = 32768,
+ max_field_size: int = 8190,
+ lingering_time: float = 10.0,
+ read_bufsize: int = 2**16,
+ auto_decompress: bool = True,
+ ):
+ super().__init__(loop)
+
+ self._request_count = 0
+ self._keepalive = False
+ self._current_request: Optional[BaseRequest] = None
+ self._manager: Optional[Server] = manager
+ self._request_handler: Optional[_RequestHandler] = manager.request_handler
+ self._request_factory: Optional[_RequestFactory] = manager.request_factory
+
+ self._tcp_keepalive = tcp_keepalive
+ # placeholder to be replaced on keepalive timeout setup
+ self._keepalive_time = 0.0
+ self._keepalive_handle: Optional[asyncio.Handle] = None
+ self._keepalive_timeout = keepalive_timeout
+ self._lingering_time = float(lingering_time)
+
+ self._messages: Deque[_MsgType] = deque()
+ self._message_tail = b""
+
+ self._waiter: Optional[asyncio.Future[None]] = None
+ self._task_handler: Optional[asyncio.Task[None]] = None
+
+ self._upgrade = False
+ self._payload_parser: Any = None
+ self._request_parser: Optional[HttpRequestParser] = HttpRequestParser(
+ self,
+ loop,
+ read_bufsize,
+ max_line_size=max_line_size,
+ max_field_size=max_field_size,
+ max_headers=max_headers,
+ payload_exception=RequestPayloadError,
+ auto_decompress=auto_decompress,
+ )
+
+ self.logger = logger
+ self.debug = debug
+ self.access_log = access_log
+ if access_log:
+ self.access_logger: Optional[AbstractAccessLogger] = access_log_class(
+ access_log, access_log_format
+ )
+ else:
+ self.access_logger = None
+
+ self._close = False
+ self._force_close = False
+
+ def __repr__(self) -> str:
+ return "<{} {}>".format(
+ self.__class__.__name__,
+ "connected" if self.transport is not None else "disconnected",
+ )
+
+ @property
+ def keepalive_timeout(self) -> float:
+ return self._keepalive_timeout
+
+ async def shutdown(self, timeout: Optional[float] = 15.0) -> None:
+ """Do worker process exit preparations.
+
+ We need to clean up everything and stop accepting requests.
+ It is especially important for keep-alive connections.
+ """
+ self._force_close = True
+
+ if self._keepalive_handle is not None:
+ self._keepalive_handle.cancel()
+
+ if self._waiter:
+ self._waiter.cancel()
+
+ # wait for handlers
+ with suppress(asyncio.CancelledError, asyncio.TimeoutError):
+ async with ceil_timeout(timeout):
+ if self._current_request is not None:
+ self._current_request._cancel(asyncio.CancelledError())
+
+ if self._task_handler is not None and not self._task_handler.done():
+ await self._task_handler
+
+ # force-close non-idle handler
+ if self._task_handler is not None:
+ self._task_handler.cancel()
+
+ if self.transport is not None:
+ self.transport.close()
+ self.transport = None
+
+ def connection_made(self, transport: asyncio.BaseTransport) -> None:
+ super().connection_made(transport)
+
+ real_transport = cast(asyncio.Transport, transport)
+ if self._tcp_keepalive:
+ tcp_keepalive(real_transport)
+
+ self._task_handler = self._loop.create_task(self.start())
+ assert self._manager is not None
+ self._manager.connection_made(self, real_transport)
+
+ def connection_lost(self, exc: Optional[BaseException]) -> None:
+ if self._manager is None:
+ return
+ self._manager.connection_lost(self, exc)
+
+ super().connection_lost(exc)
+
+ self._manager = None
+ self._force_close = True
+ self._request_factory = None
+ self._request_handler = None
+ self._request_parser = None
+
+ if self._keepalive_handle is not None:
+ self._keepalive_handle.cancel()
+
+ if self._current_request is not None:
+ if exc is None:
+ exc = ConnectionResetError("Connection lost")
+ self._current_request._cancel(exc)
+
+ if self._waiter is not None:
+ self._waiter.cancel()
+
+ self._task_handler = None
+
+ if self._payload_parser is not None:
+ self._payload_parser.feed_eof()
+ self._payload_parser = None
+
+ def set_parser(self, parser: Any) -> None:
+ # Actual type is WebReader
+ assert self._payload_parser is None
+
+ self._payload_parser = parser
+
+ if self._message_tail:
+ self._payload_parser.feed_data(self._message_tail)
+ self._message_tail = b""
+
+ def eof_received(self) -> None:
+ pass
+
+ def data_received(self, data: bytes) -> None:
+ if self._force_close or self._close:
+ return
+ # parse http messages
+ messages: Sequence[_MsgType]
+ if self._payload_parser is None and not self._upgrade:
+ assert self._request_parser is not None
+ try:
+ messages, upgraded, tail = self._request_parser.feed_data(data)
+ except HttpProcessingError as exc:
+ messages = [
+ (_ErrInfo(status=400, exc=exc, message=exc.message), EMPTY_PAYLOAD)
+ ]
+ upgraded = False
+ tail = b""
+
+ for msg, payload in messages or ():
+ self._request_count += 1
+ self._messages.append((msg, payload))
+
+ waiter = self._waiter
+ if messages and waiter is not None and not waiter.done():
+ # don't set result twice
+ waiter.set_result(None)
+
+ self._upgrade = upgraded
+ if upgraded and tail:
+ self._message_tail = tail
+
+ # no parser, just store
+ elif self._payload_parser is None and self._upgrade and data:
+ self._message_tail += data
+
+ # feed payload
+ elif data:
+ eof, tail = self._payload_parser.feed_data(data)
+ if eof:
+ self.close()
+
+ def keep_alive(self, val: bool) -> None:
+ """Set keep-alive connection mode.
+
+ :param bool val: new state.
+ """
+ self._keepalive = val
+ if self._keepalive_handle:
+ self._keepalive_handle.cancel()
+ self._keepalive_handle = None
+
+ def close(self) -> None:
+ """Close connection.
+
+ Stop accepting new pipelining messages and close
+ connection when handlers done processing messages.
+ """
+ self._close = True
+ if self._waiter:
+ self._waiter.cancel()
+
+ def force_close(self) -> None:
+ """Forcefully close connection."""
+ self._force_close = True
+ if self._waiter:
+ self._waiter.cancel()
+ if self.transport is not None:
+ self.transport.close()
+ self.transport = None
+
+ def log_access(
+ self, request: BaseRequest, response: StreamResponse, time: float
+ ) -> None:
+ if self.access_logger is not None:
+ self.access_logger.log(request, response, self._loop.time() - time)
+
+ def log_debug(self, *args: Any, **kw: Any) -> None:
+ if self.debug:
+ self.logger.debug(*args, **kw)
+
+ def log_exception(self, *args: Any, **kw: Any) -> None:
+ self.logger.exception(*args, **kw)
+
+ def _process_keepalive(self) -> None:
+ if self._force_close or not self._keepalive:
+ return
+
+ next = self._keepalive_time + self._keepalive_timeout
+
+ # handler in idle state
+ if self._waiter:
+ if self._loop.time() > next:
+ self.force_close()
+ return
+
+ # not all request handlers are done,
+ # reschedule itself to next second
+ self._keepalive_handle = self._loop.call_later(
+ self.KEEPALIVE_RESCHEDULE_DELAY, self._process_keepalive
+ )
+
+ async def _handle_request(
+ self,
+ request: BaseRequest,
+ start_time: float,
+ request_handler: Callable[[BaseRequest], Awaitable[StreamResponse]],
+ ) -> Tuple[StreamResponse, bool]:
+ assert self._request_handler is not None
+ try:
+ try:
+ self._current_request = request
+ resp = await request_handler(request)
+ finally:
+ self._current_request = None
+ except HTTPException as exc:
+ resp = exc
+ reset = await self.finish_response(request, resp, start_time)
+ except asyncio.CancelledError:
+ raise
+ except asyncio.TimeoutError as exc:
+ self.log_debug("Request handler timed out.", exc_info=exc)
+ resp = self.handle_error(request, 504)
+ reset = await self.finish_response(request, resp, start_time)
+ except Exception as exc:
+ resp = self.handle_error(request, 500, exc)
+ reset = await self.finish_response(request, resp, start_time)
+ else:
+ # Deprecation warning (See #2415)
+ if getattr(resp, "__http_exception__", False):
+ warnings.warn(
+ "returning HTTPException object is deprecated "
+ "(#2415) and will be removed, "
+ "please raise the exception instead",
+ DeprecationWarning,
+ )
+
+ reset = await self.finish_response(request, resp, start_time)
+
+ return resp, reset
+
+ async def start(self) -> None:
+ """Process incoming request.
+
+ It reads request line, request headers and request payload, then
+ calls handle_request() method. Subclass has to override
+ handle_request(). start() handles various exceptions in request
+ or response handling. Connection is being closed always unless
+ keep_alive(True) specified.
+ """
+ loop = self._loop
+ handler = self._task_handler
+ assert handler is not None
+ manager = self._manager
+ assert manager is not None
+ keepalive_timeout = self._keepalive_timeout
+ resp = None
+ assert self._request_factory is not None
+ assert self._request_handler is not None
+
+ while not self._force_close:
+ if not self._messages:
+ try:
+ # wait for next request
+ self._waiter = loop.create_future()
+ await self._waiter
+ except asyncio.CancelledError:
+ break
+ finally:
+ self._waiter = None
+
+ message, payload = self._messages.popleft()
+
+ start = loop.time()
+
+ manager.requests_count += 1
+ writer = StreamWriter(self, loop)
+ if isinstance(message, _ErrInfo):
+ # make request_factory work
+ request_handler = self._make_error_handler(message)
+ message = ERROR
+ else:
+ request_handler = self._request_handler
+
+ request = self._request_factory(message, payload, self, writer, handler)
+ try:
+ # a new task is used for copy context vars (#3406)
+ task = self._loop.create_task(
+ self._handle_request(request, start, request_handler)
+ )
+ try:
+ resp, reset = await task
+ except (asyncio.CancelledError, ConnectionError):
+ self.log_debug("Ignored premature client disconnection")
+ break
+
+ # Drop the processed task from asyncio.Task.all_tasks() early
+ del task
+ if reset:
+ self.log_debug("Ignored premature client disconnection 2")
+ break
+
+ # notify server about keep-alive
+ self._keepalive = bool(resp.keep_alive)
+
+ # check payload
+ if not payload.is_eof():
+ lingering_time = self._lingering_time
+ if not self._force_close and lingering_time:
+ self.log_debug(
+ "Start lingering close timer for %s sec.", lingering_time
+ )
+
+ now = loop.time()
+ end_t = now + lingering_time
+
+ with suppress(asyncio.TimeoutError, asyncio.CancelledError):
+ while not payload.is_eof() and now < end_t:
+ async with ceil_timeout(end_t - now):
+ # read and ignore
+ await payload.readany()
+ now = loop.time()
+
+ # if payload still uncompleted
+ if not payload.is_eof() and not self._force_close:
+ self.log_debug("Uncompleted request.")
+ self.close()
+
+ payload.set_exception(PayloadAccessError())
+
+ except asyncio.CancelledError:
+ self.log_debug("Ignored premature client disconnection ")
+ break
+ except RuntimeError as exc:
+ if self.debug:
+ self.log_exception("Unhandled runtime exception", exc_info=exc)
+ self.force_close()
+ except Exception as exc:
+ self.log_exception("Unhandled exception", exc_info=exc)
+ self.force_close()
+ finally:
+ if self.transport is None and resp is not None:
+ self.log_debug("Ignored premature client disconnection.")
+ elif not self._force_close:
+ if self._keepalive and not self._close:
+ # start keep-alive timer
+ if keepalive_timeout is not None:
+ now = self._loop.time()
+ self._keepalive_time = now
+ if self._keepalive_handle is None:
+ self._keepalive_handle = loop.call_at(
+ now + keepalive_timeout, self._process_keepalive
+ )
+ else:
+ break
+
+ # remove handler, close transport if no handlers left
+ if not self._force_close:
+ self._task_handler = None
+ if self.transport is not None:
+ self.transport.close()
+
+ async def finish_response(
+ self, request: BaseRequest, resp: StreamResponse, start_time: float
+ ) -> bool:
+ """Prepare the response and write_eof, then log access.
+
+ This has to
+ be called within the context of any exception so the access logger
+ can get exception information. Returns True if the client disconnects
+ prematurely.
+ """
+ if self._request_parser is not None:
+ self._request_parser.set_upgraded(False)
+ self._upgrade = False
+ if self._message_tail:
+ self._request_parser.feed_data(self._message_tail)
+ self._message_tail = b""
+ try:
+ prepare_meth = resp.prepare
+ except AttributeError:
+ if resp is None:
+ raise RuntimeError("Missing return " "statement on request handler")
+ else:
+ raise RuntimeError(
+ "Web-handler should return "
+ "a response instance, "
+ "got {!r}".format(resp)
+ )
+ try:
+ await prepare_meth(request)
+ await resp.write_eof()
+ except ConnectionError:
+ self.log_access(request, resp, start_time)
+ return True
+ else:
+ self.log_access(request, resp, start_time)
+ return False
+
+ def handle_error(
+ self,
+ request: BaseRequest,
+ status: int = 500,
+ exc: Optional[BaseException] = None,
+ message: Optional[str] = None,
+ ) -> StreamResponse:
+ """Handle errors.
+
+ Returns HTTP response with specific status code. Logs additional
+ information. It always closes current connection.
+ """
+ self.log_exception("Error handling request", exc_info=exc)
+
+ # some data already got sent, connection is broken
+ if request.writer.output_size > 0:
+ raise ConnectionError(
+ "Response is sent already, cannot send another response "
+ "with the error message"
+ )
+
+ ct = "text/plain"
+ if status == HTTPStatus.INTERNAL_SERVER_ERROR:
+ title = "{0.value} {0.phrase}".format(HTTPStatus.INTERNAL_SERVER_ERROR)
+ msg = HTTPStatus.INTERNAL_SERVER_ERROR.description
+ tb = None
+ if self.debug:
+ with suppress(Exception):
+ tb = traceback.format_exc()
+
+ if "text/html" in request.headers.get("Accept", ""):
+ if tb:
+ tb = html_escape(tb)
+ msg = f"<h2>Traceback:</h2>\n<pre>{tb}</pre>"
+ message = (
+ "<html><head>"
+ "<title>{title}</title>"
+ "</head><body>\n<h1>{title}</h1>"
+ "\n{msg}\n</body></html>\n"
+ ).format(title=title, msg=msg)
+ ct = "text/html"
+ else:
+ if tb:
+ msg = tb
+ message = title + "\n\n" + msg
+
+ resp = Response(status=status, text=message, content_type=ct)
+ resp.force_close()
+
+ return resp
+
+ def _make_error_handler(
+ self, err_info: _ErrInfo
+ ) -> Callable[[BaseRequest], Awaitable[StreamResponse]]:
+ async def handler(request: BaseRequest) -> StreamResponse:
+ return self.handle_error(
+ request, err_info.status, err_info.exc, err_info.message
+ )
+
+ return handler
diff --git a/third_party/python/aiohttp/aiohttp/web_request.py b/third_party/python/aiohttp/aiohttp/web_request.py
new file mode 100644
index 0000000000..c02ebfcd21
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_request.py
@@ -0,0 +1,882 @@
+import asyncio
+import datetime
+import io
+import re
+import socket
+import string
+import tempfile
+import types
+import warnings
+from http.cookies import SimpleCookie
+from types import MappingProxyType
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Dict,
+ Iterator,
+ Mapping,
+ MutableMapping,
+ Optional,
+ Pattern,
+ Tuple,
+ Union,
+ cast,
+)
+from urllib.parse import parse_qsl
+
+import attr
+from multidict import CIMultiDict, CIMultiDictProxy, MultiDict, MultiDictProxy
+from yarl import URL
+
+from . import hdrs
+from .abc import AbstractStreamWriter
+from .helpers import (
+ DEBUG,
+ ETAG_ANY,
+ LIST_QUOTED_ETAG_RE,
+ ChainMapProxy,
+ ETag,
+ HeadersMixin,
+ parse_http_date,
+ reify,
+ sentinel,
+)
+from .http_parser import RawRequestMessage
+from .http_writer import HttpVersion
+from .multipart import BodyPartReader, MultipartReader
+from .streams import EmptyStreamReader, StreamReader
+from .typedefs import (
+ DEFAULT_JSON_DECODER,
+ Final,
+ JSONDecoder,
+ LooseHeaders,
+ RawHeaders,
+ StrOrURL,
+)
+from .web_exceptions import HTTPRequestEntityTooLarge
+from .web_response import StreamResponse
+
+__all__ = ("BaseRequest", "FileField", "Request")
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from .web_app import Application
+ from .web_protocol import RequestHandler
+ from .web_urldispatcher import UrlMappingMatchInfo
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class FileField:
+ name: str
+ filename: str
+ file: io.BufferedReader
+ content_type: str
+ headers: "CIMultiDictProxy[str]"
+
+
+_TCHAR: Final[str] = string.digits + string.ascii_letters + r"!#$%&'*+.^_`|~-"
+# '-' at the end to prevent interpretation as range in a char class
+
+_TOKEN: Final[str] = rf"[{_TCHAR}]+"
+
+_QDTEXT: Final[str] = r"[{}]".format(
+ r"".join(chr(c) for c in (0x09, 0x20, 0x21) + tuple(range(0x23, 0x7F)))
+)
+# qdtext includes 0x5C to escape 0x5D ('\]')
+# qdtext excludes obs-text (because obsoleted, and encoding not specified)
+
+_QUOTED_PAIR: Final[str] = r"\\[\t !-~]"
+
+_QUOTED_STRING: Final[str] = r'"(?:{quoted_pair}|{qdtext})*"'.format(
+ qdtext=_QDTEXT, quoted_pair=_QUOTED_PAIR
+)
+
+_FORWARDED_PAIR: Final[
+ str
+] = r"({token})=({token}|{quoted_string})(:\d{{1,4}})?".format(
+ token=_TOKEN, quoted_string=_QUOTED_STRING
+)
+
+_QUOTED_PAIR_REPLACE_RE: Final[Pattern[str]] = re.compile(r"\\([\t !-~])")
+# same pattern as _QUOTED_PAIR but contains a capture group
+
+_FORWARDED_PAIR_RE: Final[Pattern[str]] = re.compile(_FORWARDED_PAIR)
+
+############################################################
+# HTTP Request
+############################################################
+
+
+class BaseRequest(MutableMapping[str, Any], HeadersMixin):
+
+ POST_METHODS = {
+ hdrs.METH_PATCH,
+ hdrs.METH_POST,
+ hdrs.METH_PUT,
+ hdrs.METH_TRACE,
+ hdrs.METH_DELETE,
+ }
+
+ ATTRS = HeadersMixin.ATTRS | frozenset(
+ [
+ "_message",
+ "_protocol",
+ "_payload_writer",
+ "_payload",
+ "_headers",
+ "_method",
+ "_version",
+ "_rel_url",
+ "_post",
+ "_read_bytes",
+ "_state",
+ "_cache",
+ "_task",
+ "_client_max_size",
+ "_loop",
+ "_transport_sslcontext",
+ "_transport_peername",
+ ]
+ )
+
+ def __init__(
+ self,
+ message: RawRequestMessage,
+ payload: StreamReader,
+ protocol: "RequestHandler",
+ payload_writer: AbstractStreamWriter,
+ task: "asyncio.Task[None]",
+ loop: asyncio.AbstractEventLoop,
+ *,
+ client_max_size: int = 1024**2,
+ state: Optional[Dict[str, Any]] = None,
+ scheme: Optional[str] = None,
+ host: Optional[str] = None,
+ remote: Optional[str] = None,
+ ) -> None:
+ if state is None:
+ state = {}
+ self._message = message
+ self._protocol = protocol
+ self._payload_writer = payload_writer
+
+ self._payload = payload
+ self._headers = message.headers
+ self._method = message.method
+ self._version = message.version
+ self._cache: Dict[str, Any] = {}
+ url = message.url
+ if url.is_absolute():
+ # absolute URL is given,
+ # override auto-calculating url, host, and scheme
+ # all other properties should be good
+ self._cache["url"] = url
+ self._cache["host"] = url.host
+ self._cache["scheme"] = url.scheme
+ self._rel_url = url.relative()
+ else:
+ self._rel_url = message.url
+ self._post: Optional[MultiDictProxy[Union[str, bytes, FileField]]] = None
+ self._read_bytes: Optional[bytes] = None
+
+ self._state = state
+ self._task = task
+ self._client_max_size = client_max_size
+ self._loop = loop
+
+ transport = self._protocol.transport
+ assert transport is not None
+ self._transport_sslcontext = transport.get_extra_info("sslcontext")
+ self._transport_peername = transport.get_extra_info("peername")
+
+ if scheme is not None:
+ self._cache["scheme"] = scheme
+ if host is not None:
+ self._cache["host"] = host
+ if remote is not None:
+ self._cache["remote"] = remote
+
+ def clone(
+ self,
+ *,
+ method: str = sentinel,
+ rel_url: StrOrURL = sentinel,
+ headers: LooseHeaders = sentinel,
+ scheme: str = sentinel,
+ host: str = sentinel,
+ remote: str = sentinel,
+ ) -> "BaseRequest":
+ """Clone itself with replacement some attributes.
+
+ Creates and returns a new instance of Request object. If no parameters
+ are given, an exact copy is returned. If a parameter is not passed, it
+ will reuse the one from the current request object.
+ """
+ if self._read_bytes:
+ raise RuntimeError("Cannot clone request " "after reading its content")
+
+ dct: Dict[str, Any] = {}
+ if method is not sentinel:
+ dct["method"] = method
+ if rel_url is not sentinel:
+ new_url = URL(rel_url)
+ dct["url"] = new_url
+ dct["path"] = str(new_url)
+ if headers is not sentinel:
+ # a copy semantic
+ dct["headers"] = CIMultiDictProxy(CIMultiDict(headers))
+ dct["raw_headers"] = tuple(
+ (k.encode("utf-8"), v.encode("utf-8")) for k, v in headers.items()
+ )
+
+ message = self._message._replace(**dct)
+
+ kwargs = {}
+ if scheme is not sentinel:
+ kwargs["scheme"] = scheme
+ if host is not sentinel:
+ kwargs["host"] = host
+ if remote is not sentinel:
+ kwargs["remote"] = remote
+
+ return self.__class__(
+ message,
+ self._payload,
+ self._protocol,
+ self._payload_writer,
+ self._task,
+ self._loop,
+ client_max_size=self._client_max_size,
+ state=self._state.copy(),
+ **kwargs,
+ )
+
+ @property
+ def task(self) -> "asyncio.Task[None]":
+ return self._task
+
+ @property
+ def protocol(self) -> "RequestHandler":
+ return self._protocol
+
+ @property
+ def transport(self) -> Optional[asyncio.Transport]:
+ if self._protocol is None:
+ return None
+ return self._protocol.transport
+
+ @property
+ def writer(self) -> AbstractStreamWriter:
+ return self._payload_writer
+
+ @reify
+ def message(self) -> RawRequestMessage:
+ warnings.warn("Request.message is deprecated", DeprecationWarning, stacklevel=3)
+ return self._message
+
+ @reify
+ def rel_url(self) -> URL:
+ return self._rel_url
+
+ @reify
+ def loop(self) -> asyncio.AbstractEventLoop:
+ warnings.warn(
+ "request.loop property is deprecated", DeprecationWarning, stacklevel=2
+ )
+ return self._loop
+
+ # MutableMapping API
+
+ def __getitem__(self, key: str) -> Any:
+ return self._state[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self._state[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self._state[key]
+
+ def __len__(self) -> int:
+ return len(self._state)
+
+ def __iter__(self) -> Iterator[str]:
+ return iter(self._state)
+
+ ########
+
+ @reify
+ def secure(self) -> bool:
+ """A bool indicating if the request is handled with SSL."""
+ return self.scheme == "https"
+
+ @reify
+ def forwarded(self) -> Tuple[Mapping[str, str], ...]:
+ """A tuple containing all parsed Forwarded header(s).
+
+ Makes an effort to parse Forwarded headers as specified by RFC 7239:
+
+ - It adds one (immutable) dictionary per Forwarded 'field-value', ie
+ per proxy. The element corresponds to the data in the Forwarded
+ field-value added by the first proxy encountered by the client. Each
+ subsequent item corresponds to those added by later proxies.
+ - It checks that every value has valid syntax in general as specified
+ in section 4: either a 'token' or a 'quoted-string'.
+ - It un-escapes found escape sequences.
+ - It does NOT validate 'by' and 'for' contents as specified in section
+ 6.
+ - It does NOT validate 'host' contents (Host ABNF).
+ - It does NOT validate 'proto' contents for valid URI scheme names.
+
+ Returns a tuple containing one or more immutable dicts
+ """
+ elems = []
+ for field_value in self._message.headers.getall(hdrs.FORWARDED, ()):
+ length = len(field_value)
+ pos = 0
+ need_separator = False
+ elem: Dict[str, str] = {}
+ elems.append(types.MappingProxyType(elem))
+ while 0 <= pos < length:
+ match = _FORWARDED_PAIR_RE.match(field_value, pos)
+ if match is not None: # got a valid forwarded-pair
+ if need_separator:
+ # bad syntax here, skip to next comma
+ pos = field_value.find(",", pos)
+ else:
+ name, value, port = match.groups()
+ if value[0] == '"':
+ # quoted string: remove quotes and unescape
+ value = _QUOTED_PAIR_REPLACE_RE.sub(r"\1", value[1:-1])
+ if port:
+ value += port
+ elem[name.lower()] = value
+ pos += len(match.group(0))
+ need_separator = True
+ elif field_value[pos] == ",": # next forwarded-element
+ need_separator = False
+ elem = {}
+ elems.append(types.MappingProxyType(elem))
+ pos += 1
+ elif field_value[pos] == ";": # next forwarded-pair
+ need_separator = False
+ pos += 1
+ elif field_value[pos] in " \t":
+ # Allow whitespace even between forwarded-pairs, though
+ # RFC 7239 doesn't. This simplifies code and is in line
+ # with Postel's law.
+ pos += 1
+ else:
+ # bad syntax here, skip to next comma
+ pos = field_value.find(",", pos)
+ return tuple(elems)
+
+ @reify
+ def scheme(self) -> str:
+ """A string representing the scheme of the request.
+
+ Hostname is resolved in this order:
+
+ - overridden value by .clone(scheme=new_scheme) call.
+ - type of connection to peer: HTTPS if socket is SSL, HTTP otherwise.
+
+ 'http' or 'https'.
+ """
+ if self._transport_sslcontext:
+ return "https"
+ else:
+ return "http"
+
+ @reify
+ def method(self) -> str:
+ """Read only property for getting HTTP method.
+
+ The value is upper-cased str like 'GET', 'POST', 'PUT' etc.
+ """
+ return self._method
+
+ @reify
+ def version(self) -> HttpVersion:
+ """Read only property for getting HTTP version of request.
+
+ Returns aiohttp.protocol.HttpVersion instance.
+ """
+ return self._version
+
+ @reify
+ def host(self) -> str:
+ """Hostname of the request.
+
+ Hostname is resolved in this order:
+
+ - overridden value by .clone(host=new_host) call.
+ - HOST HTTP header
+ - socket.getfqdn() value
+ """
+ host = self._message.headers.get(hdrs.HOST)
+ if host is not None:
+ return host
+ return socket.getfqdn()
+
+ @reify
+ def remote(self) -> Optional[str]:
+ """Remote IP of client initiated HTTP request.
+
+ The IP is resolved in this order:
+
+ - overridden value by .clone(remote=new_remote) call.
+ - peername of opened socket
+ """
+ if self._transport_peername is None:
+ return None
+ if isinstance(self._transport_peername, (list, tuple)):
+ return str(self._transport_peername[0])
+ return str(self._transport_peername)
+
+ @reify
+ def url(self) -> URL:
+ url = URL.build(scheme=self.scheme, host=self.host)
+ return url.join(self._rel_url)
+
+ @reify
+ def path(self) -> str:
+ """The URL including *PATH INFO* without the host or scheme.
+
+ E.g., ``/app/blog``
+ """
+ return self._rel_url.path
+
+ @reify
+ def path_qs(self) -> str:
+ """The URL including PATH_INFO and the query string.
+
+ E.g, /app/blog?id=10
+ """
+ return str(self._rel_url)
+
+ @reify
+ def raw_path(self) -> str:
+ """The URL including raw *PATH INFO* without the host or scheme.
+
+ Warning, the path is unquoted and may contains non valid URL characters
+
+ E.g., ``/my%2Fpath%7Cwith%21some%25strange%24characters``
+ """
+ return self._message.path
+
+ @reify
+ def query(self) -> "MultiDictProxy[str]":
+ """A multidict with all the variables in the query string."""
+ return MultiDictProxy(self._rel_url.query)
+
+ @reify
+ def query_string(self) -> str:
+ """The query string in the URL.
+
+ E.g., id=10
+ """
+ return self._rel_url.query_string
+
+ @reify
+ def headers(self) -> "CIMultiDictProxy[str]":
+ """A case-insensitive multidict proxy with all headers."""
+ return self._headers
+
+ @reify
+ def raw_headers(self) -> RawHeaders:
+ """A sequence of pairs for all headers."""
+ return self._message.raw_headers
+
+ @reify
+ def if_modified_since(self) -> Optional[datetime.datetime]:
+ """The value of If-Modified-Since HTTP header, or None.
+
+ This header is represented as a `datetime` object.
+ """
+ return parse_http_date(self.headers.get(hdrs.IF_MODIFIED_SINCE))
+
+ @reify
+ def if_unmodified_since(self) -> Optional[datetime.datetime]:
+ """The value of If-Unmodified-Since HTTP header, or None.
+
+ This header is represented as a `datetime` object.
+ """
+ return parse_http_date(self.headers.get(hdrs.IF_UNMODIFIED_SINCE))
+
+ @staticmethod
+ def _etag_values(etag_header: str) -> Iterator[ETag]:
+ """Extract `ETag` objects from raw header."""
+ if etag_header == ETAG_ANY:
+ yield ETag(
+ is_weak=False,
+ value=ETAG_ANY,
+ )
+ else:
+ for match in LIST_QUOTED_ETAG_RE.finditer(etag_header):
+ is_weak, value, garbage = match.group(2, 3, 4)
+ # Any symbol captured by 4th group means
+ # that the following sequence is invalid.
+ if garbage:
+ break
+
+ yield ETag(
+ is_weak=bool(is_weak),
+ value=value,
+ )
+
+ @classmethod
+ def _if_match_or_none_impl(
+ cls, header_value: Optional[str]
+ ) -> Optional[Tuple[ETag, ...]]:
+ if not header_value:
+ return None
+
+ return tuple(cls._etag_values(header_value))
+
+ @reify
+ def if_match(self) -> Optional[Tuple[ETag, ...]]:
+ """The value of If-Match HTTP header, or None.
+
+ This header is represented as a `tuple` of `ETag` objects.
+ """
+ return self._if_match_or_none_impl(self.headers.get(hdrs.IF_MATCH))
+
+ @reify
+ def if_none_match(self) -> Optional[Tuple[ETag, ...]]:
+ """The value of If-None-Match HTTP header, or None.
+
+ This header is represented as a `tuple` of `ETag` objects.
+ """
+ return self._if_match_or_none_impl(self.headers.get(hdrs.IF_NONE_MATCH))
+
+ @reify
+ def if_range(self) -> Optional[datetime.datetime]:
+ """The value of If-Range HTTP header, or None.
+
+ This header is represented as a `datetime` object.
+ """
+ return parse_http_date(self.headers.get(hdrs.IF_RANGE))
+
+ @reify
+ def keep_alive(self) -> bool:
+ """Is keepalive enabled by client?"""
+ return not self._message.should_close
+
+ @reify
+ def cookies(self) -> Mapping[str, str]:
+ """Return request cookies.
+
+ A read-only dictionary-like object.
+ """
+ raw = self.headers.get(hdrs.COOKIE, "")
+ parsed: SimpleCookie[str] = SimpleCookie(raw)
+ return MappingProxyType({key: val.value for key, val in parsed.items()})
+
+ @reify
+ def http_range(self) -> slice:
+ """The content of Range HTTP header.
+
+ Return a slice instance.
+
+ """
+ rng = self._headers.get(hdrs.RANGE)
+ start, end = None, None
+ if rng is not None:
+ try:
+ pattern = r"^bytes=(\d*)-(\d*)$"
+ start, end = re.findall(pattern, rng)[0]
+ except IndexError: # pattern was not found in header
+ raise ValueError("range not in acceptable format")
+
+ end = int(end) if end else None
+ start = int(start) if start else None
+
+ if start is None and end is not None:
+ # end with no start is to return tail of content
+ start = -end
+ end = None
+
+ if start is not None and end is not None:
+ # end is inclusive in range header, exclusive for slice
+ end += 1
+
+ if start >= end:
+ raise ValueError("start cannot be after end")
+
+ if start is end is None: # No valid range supplied
+ raise ValueError("No start or end of range specified")
+
+ return slice(start, end, 1)
+
+ @reify
+ def content(self) -> StreamReader:
+ """Return raw payload stream."""
+ return self._payload
+
+ @property
+ def has_body(self) -> bool:
+ """Return True if request's HTTP BODY can be read, False otherwise."""
+ warnings.warn(
+ "Deprecated, use .can_read_body #2005", DeprecationWarning, stacklevel=2
+ )
+ return not self._payload.at_eof()
+
+ @property
+ def can_read_body(self) -> bool:
+ """Return True if request's HTTP BODY can be read, False otherwise."""
+ return not self._payload.at_eof()
+
+ @reify
+ def body_exists(self) -> bool:
+ """Return True if request has HTTP BODY, False otherwise."""
+ return type(self._payload) is not EmptyStreamReader
+
+ async def release(self) -> None:
+ """Release request.
+
+ Eat unread part of HTTP BODY if present.
+ """
+ while not self._payload.at_eof():
+ await self._payload.readany()
+
+ async def read(self) -> bytes:
+ """Read request body if present.
+
+ Returns bytes object with full request content.
+ """
+ if self._read_bytes is None:
+ body = bytearray()
+ while True:
+ chunk = await self._payload.readany()
+ body.extend(chunk)
+ if self._client_max_size:
+ body_size = len(body)
+ if body_size >= self._client_max_size:
+ raise HTTPRequestEntityTooLarge(
+ max_size=self._client_max_size, actual_size=body_size
+ )
+ if not chunk:
+ break
+ self._read_bytes = bytes(body)
+ return self._read_bytes
+
+ async def text(self) -> str:
+ """Return BODY as text using encoding from .charset."""
+ bytes_body = await self.read()
+ encoding = self.charset or "utf-8"
+ return bytes_body.decode(encoding)
+
+ async def json(self, *, loads: JSONDecoder = DEFAULT_JSON_DECODER) -> Any:
+ """Return BODY as JSON."""
+ body = await self.text()
+ return loads(body)
+
+ async def multipart(self) -> MultipartReader:
+ """Return async iterator to process BODY as multipart."""
+ return MultipartReader(self._headers, self._payload)
+
+ async def post(self) -> "MultiDictProxy[Union[str, bytes, FileField]]":
+ """Return POST parameters."""
+ if self._post is not None:
+ return self._post
+ if self._method not in self.POST_METHODS:
+ self._post = MultiDictProxy(MultiDict())
+ return self._post
+
+ content_type = self.content_type
+ if content_type not in (
+ "",
+ "application/x-www-form-urlencoded",
+ "multipart/form-data",
+ ):
+ self._post = MultiDictProxy(MultiDict())
+ return self._post
+
+ out: MultiDict[Union[str, bytes, FileField]] = MultiDict()
+
+ if content_type == "multipart/form-data":
+ multipart = await self.multipart()
+ max_size = self._client_max_size
+
+ field = await multipart.next()
+ while field is not None:
+ size = 0
+ field_ct = field.headers.get(hdrs.CONTENT_TYPE)
+
+ if isinstance(field, BodyPartReader):
+ assert field.name is not None
+
+ # Note that according to RFC 7578, the Content-Type header
+ # is optional, even for files, so we can't assume it's
+ # present.
+ # https://tools.ietf.org/html/rfc7578#section-4.4
+ if field.filename:
+ # store file in temp file
+ tmp = tempfile.TemporaryFile()
+ chunk = await field.read_chunk(size=2**16)
+ while chunk:
+ chunk = field.decode(chunk)
+ tmp.write(chunk)
+ size += len(chunk)
+ if 0 < max_size < size:
+ tmp.close()
+ raise HTTPRequestEntityTooLarge(
+ max_size=max_size, actual_size=size
+ )
+ chunk = await field.read_chunk(size=2**16)
+ tmp.seek(0)
+
+ if field_ct is None:
+ field_ct = "application/octet-stream"
+
+ ff = FileField(
+ field.name,
+ field.filename,
+ cast(io.BufferedReader, tmp),
+ field_ct,
+ field.headers,
+ )
+ out.add(field.name, ff)
+ else:
+ # deal with ordinary data
+ value = await field.read(decode=True)
+ if field_ct is None or field_ct.startswith("text/"):
+ charset = field.get_charset(default="utf-8")
+ out.add(field.name, value.decode(charset))
+ else:
+ out.add(field.name, value)
+ size += len(value)
+ if 0 < max_size < size:
+ raise HTTPRequestEntityTooLarge(
+ max_size=max_size, actual_size=size
+ )
+ else:
+ raise ValueError(
+ "To decode nested multipart you need " "to use custom reader",
+ )
+
+ field = await multipart.next()
+ else:
+ data = await self.read()
+ if data:
+ charset = self.charset or "utf-8"
+ out.extend(
+ parse_qsl(
+ data.rstrip().decode(charset),
+ keep_blank_values=True,
+ encoding=charset,
+ )
+ )
+
+ self._post = MultiDictProxy(out)
+ return self._post
+
+ def get_extra_info(self, name: str, default: Any = None) -> Any:
+ """Extra info from protocol transport"""
+ protocol = self._protocol
+ if protocol is None:
+ return default
+
+ transport = protocol.transport
+ if transport is None:
+ return default
+
+ return transport.get_extra_info(name, default)
+
+ def __repr__(self) -> str:
+ ascii_encodable_path = self.path.encode("ascii", "backslashreplace").decode(
+ "ascii"
+ )
+ return "<{} {} {} >".format(
+ self.__class__.__name__, self._method, ascii_encodable_path
+ )
+
+ def __eq__(self, other: object) -> bool:
+ return id(self) == id(other)
+
+ def __bool__(self) -> bool:
+ return True
+
+ async def _prepare_hook(self, response: StreamResponse) -> None:
+ return
+
+ def _cancel(self, exc: BaseException) -> None:
+ self._payload.set_exception(exc)
+
+
+class Request(BaseRequest):
+
+ ATTRS = BaseRequest.ATTRS | frozenset(["_match_info"])
+
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
+ super().__init__(*args, **kwargs)
+
+ # matchdict, route_name, handler
+ # or information about traversal lookup
+
+ # initialized after route resolving
+ self._match_info: Optional[UrlMappingMatchInfo] = None
+
+ if DEBUG:
+
+ def __setattr__(self, name: str, val: Any) -> None:
+ if name not in self.ATTRS:
+ warnings.warn(
+ "Setting custom {}.{} attribute "
+ "is discouraged".format(self.__class__.__name__, name),
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ super().__setattr__(name, val)
+
+ def clone(
+ self,
+ *,
+ method: str = sentinel,
+ rel_url: StrOrURL = sentinel,
+ headers: LooseHeaders = sentinel,
+ scheme: str = sentinel,
+ host: str = sentinel,
+ remote: str = sentinel,
+ ) -> "Request":
+ ret = super().clone(
+ method=method,
+ rel_url=rel_url,
+ headers=headers,
+ scheme=scheme,
+ host=host,
+ remote=remote,
+ )
+ new_ret = cast(Request, ret)
+ new_ret._match_info = self._match_info
+ return new_ret
+
+ @reify
+ def match_info(self) -> "UrlMappingMatchInfo":
+ """Result of route resolving."""
+ match_info = self._match_info
+ assert match_info is not None
+ return match_info
+
+ @property
+ def app(self) -> "Application":
+ """Application instance."""
+ match_info = self._match_info
+ assert match_info is not None
+ return match_info.current_app
+
+ @property
+ def config_dict(self) -> ChainMapProxy:
+ match_info = self._match_info
+ assert match_info is not None
+ lst = match_info.apps
+ app = self.app
+ idx = lst.index(app)
+ sublist = list(reversed(lst[: idx + 1]))
+ return ChainMapProxy(sublist)
+
+ async def _prepare_hook(self, response: StreamResponse) -> None:
+ match_info = self._match_info
+ if match_info is None:
+ return
+ for app in match_info._apps:
+ await app.on_response_prepare.send(self, response)
diff --git a/third_party/python/aiohttp/aiohttp/web_response.py b/third_party/python/aiohttp/aiohttp/web_response.py
new file mode 100644
index 0000000000..ce07f8153d
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_response.py
@@ -0,0 +1,825 @@
+import asyncio
+import collections.abc
+import datetime
+import enum
+import json
+import math
+import time
+import warnings
+import zlib
+from concurrent.futures import Executor
+from http.cookies import Morsel, SimpleCookie
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Dict,
+ Iterator,
+ Mapping,
+ MutableMapping,
+ Optional,
+ Tuple,
+ Union,
+ cast,
+)
+
+from multidict import CIMultiDict, istr
+
+from . import hdrs, payload
+from .abc import AbstractStreamWriter
+from .helpers import (
+ ETAG_ANY,
+ PY_38,
+ QUOTED_ETAG_RE,
+ ETag,
+ HeadersMixin,
+ parse_http_date,
+ rfc822_formatted_time,
+ sentinel,
+ validate_etag_value,
+)
+from .http import RESPONSES, SERVER_SOFTWARE, HttpVersion10, HttpVersion11
+from .payload import Payload
+from .typedefs import JSONEncoder, LooseHeaders
+
+__all__ = ("ContentCoding", "StreamResponse", "Response", "json_response")
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from .web_request import BaseRequest
+
+ BaseClass = MutableMapping[str, Any]
+else:
+ BaseClass = collections.abc.MutableMapping
+
+
+if not PY_38:
+ # allow samesite to be used in python < 3.8
+ # already permitted in python 3.8, see https://bugs.python.org/issue29613
+ Morsel._reserved["samesite"] = "SameSite" # type: ignore[attr-defined]
+
+
+class ContentCoding(enum.Enum):
+ # The content codings that we have support for.
+ #
+ # Additional registered codings are listed at:
+ # https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding
+ deflate = "deflate"
+ gzip = "gzip"
+ identity = "identity"
+
+
+############################################################
+# HTTP Response classes
+############################################################
+
+
+class StreamResponse(BaseClass, HeadersMixin):
+
+ _length_check = True
+
+ def __init__(
+ self,
+ *,
+ status: int = 200,
+ reason: Optional[str] = None,
+ headers: Optional[LooseHeaders] = None,
+ ) -> None:
+ self._body = None
+ self._keep_alive: Optional[bool] = None
+ self._chunked = False
+ self._compression = False
+ self._compression_force: Optional[ContentCoding] = None
+ self._cookies: SimpleCookie[str] = SimpleCookie()
+
+ self._req: Optional[BaseRequest] = None
+ self._payload_writer: Optional[AbstractStreamWriter] = None
+ self._eof_sent = False
+ self._body_length = 0
+ self._state: Dict[str, Any] = {}
+
+ if headers is not None:
+ self._headers: CIMultiDict[str] = CIMultiDict(headers)
+ else:
+ self._headers = CIMultiDict()
+
+ self.set_status(status, reason)
+
+ @property
+ def prepared(self) -> bool:
+ return self._payload_writer is not None
+
+ @property
+ def task(self) -> "Optional[asyncio.Task[None]]":
+ if self._req:
+ return self._req.task
+ else:
+ return None
+
+ @property
+ def status(self) -> int:
+ return self._status
+
+ @property
+ def chunked(self) -> bool:
+ return self._chunked
+
+ @property
+ def compression(self) -> bool:
+ return self._compression
+
+ @property
+ def reason(self) -> str:
+ return self._reason
+
+ def set_status(
+ self,
+ status: int,
+ reason: Optional[str] = None,
+ _RESPONSES: Mapping[int, Tuple[str, str]] = RESPONSES,
+ ) -> None:
+ assert not self.prepared, (
+ "Cannot change the response status code after " "the headers have been sent"
+ )
+ self._status = int(status)
+ if reason is None:
+ try:
+ reason = _RESPONSES[self._status][0]
+ except Exception:
+ reason = ""
+ self._reason = reason
+
+ @property
+ def keep_alive(self) -> Optional[bool]:
+ return self._keep_alive
+
+ def force_close(self) -> None:
+ self._keep_alive = False
+
+ @property
+ def body_length(self) -> int:
+ return self._body_length
+
+ @property
+ def output_length(self) -> int:
+ warnings.warn("output_length is deprecated", DeprecationWarning)
+ assert self._payload_writer
+ return self._payload_writer.buffer_size
+
+ def enable_chunked_encoding(self, chunk_size: Optional[int] = None) -> None:
+ """Enables automatic chunked transfer encoding."""
+ self._chunked = True
+
+ if hdrs.CONTENT_LENGTH in self._headers:
+ raise RuntimeError(
+ "You can't enable chunked encoding when " "a content length is set"
+ )
+ if chunk_size is not None:
+ warnings.warn("Chunk size is deprecated #1615", DeprecationWarning)
+
+ def enable_compression(
+ self, force: Optional[Union[bool, ContentCoding]] = None
+ ) -> None:
+ """Enables response compression encoding."""
+ # Backwards compatibility for when force was a bool <0.17.
+ if type(force) == bool:
+ force = ContentCoding.deflate if force else ContentCoding.identity
+ warnings.warn(
+ "Using boolean for force is deprecated #3318", DeprecationWarning
+ )
+ elif force is not None:
+ assert isinstance(force, ContentCoding), (
+ "force should one of " "None, bool or " "ContentEncoding"
+ )
+
+ self._compression = True
+ self._compression_force = force
+
+ @property
+ def headers(self) -> "CIMultiDict[str]":
+ return self._headers
+
+ @property
+ def cookies(self) -> "SimpleCookie[str]":
+ return self._cookies
+
+ def set_cookie(
+ self,
+ name: str,
+ value: str,
+ *,
+ expires: Optional[str] = None,
+ domain: Optional[str] = None,
+ max_age: Optional[Union[int, str]] = None,
+ path: str = "/",
+ secure: Optional[bool] = None,
+ httponly: Optional[bool] = None,
+ version: Optional[str] = None,
+ samesite: Optional[str] = None,
+ ) -> None:
+ """Set or update response cookie.
+
+ Sets new cookie or updates existent with new value.
+ Also updates only those params which are not None.
+ """
+ old = self._cookies.get(name)
+ if old is not None and old.coded_value == "":
+ # deleted cookie
+ self._cookies.pop(name, None)
+
+ self._cookies[name] = value
+ c = self._cookies[name]
+
+ if expires is not None:
+ c["expires"] = expires
+ elif c.get("expires") == "Thu, 01 Jan 1970 00:00:00 GMT":
+ del c["expires"]
+
+ if domain is not None:
+ c["domain"] = domain
+
+ if max_age is not None:
+ c["max-age"] = str(max_age)
+ elif "max-age" in c:
+ del c["max-age"]
+
+ c["path"] = path
+
+ if secure is not None:
+ c["secure"] = secure
+ if httponly is not None:
+ c["httponly"] = httponly
+ if version is not None:
+ c["version"] = version
+ if samesite is not None:
+ c["samesite"] = samesite
+
+ def del_cookie(
+ self, name: str, *, domain: Optional[str] = None, path: str = "/"
+ ) -> None:
+ """Delete cookie.
+
+ Creates new empty expired cookie.
+ """
+ # TODO: do we need domain/path here?
+ self._cookies.pop(name, None)
+ self.set_cookie(
+ name,
+ "",
+ max_age=0,
+ expires="Thu, 01 Jan 1970 00:00:00 GMT",
+ domain=domain,
+ path=path,
+ )
+
+ @property
+ def content_length(self) -> Optional[int]:
+ # Just a placeholder for adding setter
+ return super().content_length
+
+ @content_length.setter
+ def content_length(self, value: Optional[int]) -> None:
+ if value is not None:
+ value = int(value)
+ if self._chunked:
+ raise RuntimeError(
+ "You can't set content length when " "chunked encoding is enable"
+ )
+ self._headers[hdrs.CONTENT_LENGTH] = str(value)
+ else:
+ self._headers.pop(hdrs.CONTENT_LENGTH, None)
+
+ @property
+ def content_type(self) -> str:
+ # Just a placeholder for adding setter
+ return super().content_type
+
+ @content_type.setter
+ def content_type(self, value: str) -> None:
+ self.content_type # read header values if needed
+ self._content_type = str(value)
+ self._generate_content_type_header()
+
+ @property
+ def charset(self) -> Optional[str]:
+ # Just a placeholder for adding setter
+ return super().charset
+
+ @charset.setter
+ def charset(self, value: Optional[str]) -> None:
+ ctype = self.content_type # read header values if needed
+ if ctype == "application/octet-stream":
+ raise RuntimeError(
+ "Setting charset for application/octet-stream "
+ "doesn't make sense, setup content_type first"
+ )
+ assert self._content_dict is not None
+ if value is None:
+ self._content_dict.pop("charset", None)
+ else:
+ self._content_dict["charset"] = str(value).lower()
+ self._generate_content_type_header()
+
+ @property
+ def last_modified(self) -> Optional[datetime.datetime]:
+ """The value of Last-Modified HTTP header, or None.
+
+ This header is represented as a `datetime` object.
+ """
+ return parse_http_date(self._headers.get(hdrs.LAST_MODIFIED))
+
+ @last_modified.setter
+ def last_modified(
+ self, value: Optional[Union[int, float, datetime.datetime, str]]
+ ) -> None:
+ if value is None:
+ self._headers.pop(hdrs.LAST_MODIFIED, None)
+ elif isinstance(value, (int, float)):
+ self._headers[hdrs.LAST_MODIFIED] = time.strftime(
+ "%a, %d %b %Y %H:%M:%S GMT", time.gmtime(math.ceil(value))
+ )
+ elif isinstance(value, datetime.datetime):
+ self._headers[hdrs.LAST_MODIFIED] = time.strftime(
+ "%a, %d %b %Y %H:%M:%S GMT", value.utctimetuple()
+ )
+ elif isinstance(value, str):
+ self._headers[hdrs.LAST_MODIFIED] = value
+
+ @property
+ def etag(self) -> Optional[ETag]:
+ quoted_value = self._headers.get(hdrs.ETAG)
+ if not quoted_value:
+ return None
+ elif quoted_value == ETAG_ANY:
+ return ETag(value=ETAG_ANY)
+ match = QUOTED_ETAG_RE.fullmatch(quoted_value)
+ if not match:
+ return None
+ is_weak, value = match.group(1, 2)
+ return ETag(
+ is_weak=bool(is_weak),
+ value=value,
+ )
+
+ @etag.setter
+ def etag(self, value: Optional[Union[ETag, str]]) -> None:
+ if value is None:
+ self._headers.pop(hdrs.ETAG, None)
+ elif (isinstance(value, str) and value == ETAG_ANY) or (
+ isinstance(value, ETag) and value.value == ETAG_ANY
+ ):
+ self._headers[hdrs.ETAG] = ETAG_ANY
+ elif isinstance(value, str):
+ validate_etag_value(value)
+ self._headers[hdrs.ETAG] = f'"{value}"'
+ elif isinstance(value, ETag) and isinstance(value.value, str):
+ validate_etag_value(value.value)
+ hdr_value = f'W/"{value.value}"' if value.is_weak else f'"{value.value}"'
+ self._headers[hdrs.ETAG] = hdr_value
+ else:
+ raise ValueError(
+ f"Unsupported etag type: {type(value)}. "
+ f"etag must be str, ETag or None"
+ )
+
+ def _generate_content_type_header(
+ self, CONTENT_TYPE: istr = hdrs.CONTENT_TYPE
+ ) -> None:
+ assert self._content_dict is not None
+ assert self._content_type is not None
+ params = "; ".join(f"{k}={v}" for k, v in self._content_dict.items())
+ if params:
+ ctype = self._content_type + "; " + params
+ else:
+ ctype = self._content_type
+ self._headers[CONTENT_TYPE] = ctype
+
+ async def _do_start_compression(self, coding: ContentCoding) -> None:
+ if coding != ContentCoding.identity:
+ assert self._payload_writer is not None
+ self._headers[hdrs.CONTENT_ENCODING] = coding.value
+ self._payload_writer.enable_compression(coding.value)
+ # Compressed payload may have different content length,
+ # remove the header
+ self._headers.popall(hdrs.CONTENT_LENGTH, None)
+
+ async def _start_compression(self, request: "BaseRequest") -> None:
+ if self._compression_force:
+ await self._do_start_compression(self._compression_force)
+ else:
+ accept_encoding = request.headers.get(hdrs.ACCEPT_ENCODING, "").lower()
+ for coding in ContentCoding:
+ if coding.value in accept_encoding:
+ await self._do_start_compression(coding)
+ return
+
+ async def prepare(self, request: "BaseRequest") -> Optional[AbstractStreamWriter]:
+ if self._eof_sent:
+ return None
+ if self._payload_writer is not None:
+ return self._payload_writer
+
+ return await self._start(request)
+
+ async def _start(self, request: "BaseRequest") -> AbstractStreamWriter:
+ self._req = request
+ writer = self._payload_writer = request._payload_writer
+
+ await self._prepare_headers()
+ await request._prepare_hook(self)
+ await self._write_headers()
+
+ return writer
+
+ async def _prepare_headers(self) -> None:
+ request = self._req
+ assert request is not None
+ writer = self._payload_writer
+ assert writer is not None
+ keep_alive = self._keep_alive
+ if keep_alive is None:
+ keep_alive = request.keep_alive
+ self._keep_alive = keep_alive
+
+ version = request.version
+
+ headers = self._headers
+ for cookie in self._cookies.values():
+ value = cookie.output(header="")[1:]
+ headers.add(hdrs.SET_COOKIE, value)
+
+ if self._compression:
+ await self._start_compression(request)
+
+ if self._chunked:
+ if version != HttpVersion11:
+ raise RuntimeError(
+ "Using chunked encoding is forbidden "
+ "for HTTP/{0.major}.{0.minor}".format(request.version)
+ )
+ writer.enable_chunking()
+ headers[hdrs.TRANSFER_ENCODING] = "chunked"
+ if hdrs.CONTENT_LENGTH in headers:
+ del headers[hdrs.CONTENT_LENGTH]
+ elif self._length_check:
+ writer.length = self.content_length
+ if writer.length is None:
+ if version >= HttpVersion11 and self.status != 204:
+ writer.enable_chunking()
+ headers[hdrs.TRANSFER_ENCODING] = "chunked"
+ if hdrs.CONTENT_LENGTH in headers:
+ del headers[hdrs.CONTENT_LENGTH]
+ else:
+ keep_alive = False
+ # HTTP 1.1: https://tools.ietf.org/html/rfc7230#section-3.3.2
+ # HTTP 1.0: https://tools.ietf.org/html/rfc1945#section-10.4
+ elif version >= HttpVersion11 and self.status in (100, 101, 102, 103, 204):
+ del headers[hdrs.CONTENT_LENGTH]
+
+ if self.status not in (204, 304):
+ headers.setdefault(hdrs.CONTENT_TYPE, "application/octet-stream")
+ headers.setdefault(hdrs.DATE, rfc822_formatted_time())
+ headers.setdefault(hdrs.SERVER, SERVER_SOFTWARE)
+
+ # connection header
+ if hdrs.CONNECTION not in headers:
+ if keep_alive:
+ if version == HttpVersion10:
+ headers[hdrs.CONNECTION] = "keep-alive"
+ else:
+ if version == HttpVersion11:
+ headers[hdrs.CONNECTION] = "close"
+
+ async def _write_headers(self) -> None:
+ request = self._req
+ assert request is not None
+ writer = self._payload_writer
+ assert writer is not None
+ # status line
+ version = request.version
+ status_line = "HTTP/{}.{} {} {}".format(
+ version[0], version[1], self._status, self._reason
+ )
+ await writer.write_headers(status_line, self._headers)
+
+ async def write(self, data: bytes) -> None:
+ assert isinstance(
+ data, (bytes, bytearray, memoryview)
+ ), "data argument must be byte-ish (%r)" % type(data)
+
+ if self._eof_sent:
+ raise RuntimeError("Cannot call write() after write_eof()")
+ if self._payload_writer is None:
+ raise RuntimeError("Cannot call write() before prepare()")
+
+ await self._payload_writer.write(data)
+
+ async def drain(self) -> None:
+ assert not self._eof_sent, "EOF has already been sent"
+ assert self._payload_writer is not None, "Response has not been started"
+ warnings.warn(
+ "drain method is deprecated, use await resp.write()",
+ DeprecationWarning,
+ stacklevel=2,
+ )
+ await self._payload_writer.drain()
+
+ async def write_eof(self, data: bytes = b"") -> None:
+ assert isinstance(
+ data, (bytes, bytearray, memoryview)
+ ), "data argument must be byte-ish (%r)" % type(data)
+
+ if self._eof_sent:
+ return
+
+ assert self._payload_writer is not None, "Response has not been started"
+
+ await self._payload_writer.write_eof(data)
+ self._eof_sent = True
+ self._req = None
+ self._body_length = self._payload_writer.output_size
+ self._payload_writer = None
+
+ def __repr__(self) -> str:
+ if self._eof_sent:
+ info = "eof"
+ elif self.prepared:
+ assert self._req is not None
+ info = f"{self._req.method} {self._req.path} "
+ else:
+ info = "not prepared"
+ return f"<{self.__class__.__name__} {self.reason} {info}>"
+
+ def __getitem__(self, key: str) -> Any:
+ return self._state[key]
+
+ def __setitem__(self, key: str, value: Any) -> None:
+ self._state[key] = value
+
+ def __delitem__(self, key: str) -> None:
+ del self._state[key]
+
+ def __len__(self) -> int:
+ return len(self._state)
+
+ def __iter__(self) -> Iterator[str]:
+ return iter(self._state)
+
+ def __hash__(self) -> int:
+ return hash(id(self))
+
+ def __eq__(self, other: object) -> bool:
+ return self is other
+
+
+class Response(StreamResponse):
+ def __init__(
+ self,
+ *,
+ body: Any = None,
+ status: int = 200,
+ reason: Optional[str] = None,
+ text: Optional[str] = None,
+ headers: Optional[LooseHeaders] = None,
+ content_type: Optional[str] = None,
+ charset: Optional[str] = None,
+ zlib_executor_size: Optional[int] = None,
+ zlib_executor: Optional[Executor] = None,
+ ) -> None:
+ if body is not None and text is not None:
+ raise ValueError("body and text are not allowed together")
+
+ if headers is None:
+ real_headers: CIMultiDict[str] = CIMultiDict()
+ elif not isinstance(headers, CIMultiDict):
+ real_headers = CIMultiDict(headers)
+ else:
+ real_headers = headers # = cast('CIMultiDict[str]', headers)
+
+ if content_type is not None and "charset" in content_type:
+ raise ValueError("charset must not be in content_type " "argument")
+
+ if text is not None:
+ if hdrs.CONTENT_TYPE in real_headers:
+ if content_type or charset:
+ raise ValueError(
+ "passing both Content-Type header and "
+ "content_type or charset params "
+ "is forbidden"
+ )
+ else:
+ # fast path for filling headers
+ if not isinstance(text, str):
+ raise TypeError("text argument must be str (%r)" % type(text))
+ if content_type is None:
+ content_type = "text/plain"
+ if charset is None:
+ charset = "utf-8"
+ real_headers[hdrs.CONTENT_TYPE] = content_type + "; charset=" + charset
+ body = text.encode(charset)
+ text = None
+ else:
+ if hdrs.CONTENT_TYPE in real_headers:
+ if content_type is not None or charset is not None:
+ raise ValueError(
+ "passing both Content-Type header and "
+ "content_type or charset params "
+ "is forbidden"
+ )
+ else:
+ if content_type is not None:
+ if charset is not None:
+ content_type += "; charset=" + charset
+ real_headers[hdrs.CONTENT_TYPE] = content_type
+
+ super().__init__(status=status, reason=reason, headers=real_headers)
+
+ if text is not None:
+ self.text = text
+ else:
+ self.body = body
+
+ self._compressed_body: Optional[bytes] = None
+ self._zlib_executor_size = zlib_executor_size
+ self._zlib_executor = zlib_executor
+
+ @property
+ def body(self) -> Optional[Union[bytes, Payload]]:
+ return self._body
+
+ @body.setter
+ def body(
+ self,
+ body: bytes,
+ CONTENT_TYPE: istr = hdrs.CONTENT_TYPE,
+ CONTENT_LENGTH: istr = hdrs.CONTENT_LENGTH,
+ ) -> None:
+ if body is None:
+ self._body: Optional[bytes] = None
+ self._body_payload: bool = False
+ elif isinstance(body, (bytes, bytearray)):
+ self._body = body
+ self._body_payload = False
+ else:
+ try:
+ self._body = body = payload.PAYLOAD_REGISTRY.get(body)
+ except payload.LookupError:
+ raise ValueError("Unsupported body type %r" % type(body))
+
+ self._body_payload = True
+
+ headers = self._headers
+
+ # set content-length header if needed
+ if not self._chunked and CONTENT_LENGTH not in headers:
+ size = body.size
+ if size is not None:
+ headers[CONTENT_LENGTH] = str(size)
+
+ # set content-type
+ if CONTENT_TYPE not in headers:
+ headers[CONTENT_TYPE] = body.content_type
+
+ # copy payload headers
+ if body.headers:
+ for (key, value) in body.headers.items():
+ if key not in headers:
+ headers[key] = value
+
+ self._compressed_body = None
+
+ @property
+ def text(self) -> Optional[str]:
+ if self._body is None:
+ return None
+ return self._body.decode(self.charset or "utf-8")
+
+ @text.setter
+ def text(self, text: str) -> None:
+ assert text is None or isinstance(
+ text, str
+ ), "text argument must be str (%r)" % type(text)
+
+ if self.content_type == "application/octet-stream":
+ self.content_type = "text/plain"
+ if self.charset is None:
+ self.charset = "utf-8"
+
+ self._body = text.encode(self.charset)
+ self._body_payload = False
+ self._compressed_body = None
+
+ @property
+ def content_length(self) -> Optional[int]:
+ if self._chunked:
+ return None
+
+ if hdrs.CONTENT_LENGTH in self._headers:
+ return super().content_length
+
+ if self._compressed_body is not None:
+ # Return length of the compressed body
+ return len(self._compressed_body)
+ elif self._body_payload:
+ # A payload without content length, or a compressed payload
+ return None
+ elif self._body is not None:
+ return len(self._body)
+ else:
+ return 0
+
+ @content_length.setter
+ def content_length(self, value: Optional[int]) -> None:
+ raise RuntimeError("Content length is set automatically")
+
+ async def write_eof(self, data: bytes = b"") -> None:
+ if self._eof_sent:
+ return
+ if self._compressed_body is None:
+ body: Optional[Union[bytes, Payload]] = self._body
+ else:
+ body = self._compressed_body
+ assert not data, f"data arg is not supported, got {data!r}"
+ assert self._req is not None
+ assert self._payload_writer is not None
+ if body is not None:
+ if self._req._method == hdrs.METH_HEAD or self._status in [204, 304]:
+ await super().write_eof()
+ elif self._body_payload:
+ payload = cast(Payload, body)
+ await payload.write(self._payload_writer)
+ await super().write_eof()
+ else:
+ await super().write_eof(cast(bytes, body))
+ else:
+ await super().write_eof()
+
+ async def _start(self, request: "BaseRequest") -> AbstractStreamWriter:
+ if not self._chunked and hdrs.CONTENT_LENGTH not in self._headers:
+ if not self._body_payload:
+ if self._body is not None:
+ self._headers[hdrs.CONTENT_LENGTH] = str(len(self._body))
+ else:
+ self._headers[hdrs.CONTENT_LENGTH] = "0"
+
+ return await super()._start(request)
+
+ def _compress_body(self, zlib_mode: int) -> None:
+ assert zlib_mode > 0
+ compressobj = zlib.compressobj(wbits=zlib_mode)
+ body_in = self._body
+ assert body_in is not None
+ self._compressed_body = compressobj.compress(body_in) + compressobj.flush()
+
+ async def _do_start_compression(self, coding: ContentCoding) -> None:
+ if self._body_payload or self._chunked:
+ return await super()._do_start_compression(coding)
+
+ if coding != ContentCoding.identity:
+ # Instead of using _payload_writer.enable_compression,
+ # compress the whole body
+ zlib_mode = (
+ 16 + zlib.MAX_WBITS if coding == ContentCoding.gzip else zlib.MAX_WBITS
+ )
+ body_in = self._body
+ assert body_in is not None
+ if (
+ self._zlib_executor_size is not None
+ and len(body_in) > self._zlib_executor_size
+ ):
+ await asyncio.get_event_loop().run_in_executor(
+ self._zlib_executor, self._compress_body, zlib_mode
+ )
+ else:
+ self._compress_body(zlib_mode)
+
+ body_out = self._compressed_body
+ assert body_out is not None
+
+ self._headers[hdrs.CONTENT_ENCODING] = coding.value
+ self._headers[hdrs.CONTENT_LENGTH] = str(len(body_out))
+
+
+def json_response(
+ data: Any = sentinel,
+ *,
+ text: Optional[str] = None,
+ body: Optional[bytes] = None,
+ status: int = 200,
+ reason: Optional[str] = None,
+ headers: Optional[LooseHeaders] = None,
+ content_type: str = "application/json",
+ dumps: JSONEncoder = json.dumps,
+) -> Response:
+ if data is not sentinel:
+ if text or body:
+ raise ValueError("only one of data, text, or body should be specified")
+ else:
+ text = dumps(data)
+ return Response(
+ text=text,
+ body=body,
+ status=status,
+ reason=reason,
+ headers=headers,
+ content_type=content_type,
+ )
diff --git a/third_party/python/aiohttp/aiohttp/web_routedef.py b/third_party/python/aiohttp/aiohttp/web_routedef.py
new file mode 100644
index 0000000000..a1eb0a7654
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_routedef.py
@@ -0,0 +1,216 @@
+import abc
+import os # noqa
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Callable,
+ Dict,
+ Iterator,
+ List,
+ Optional,
+ Sequence,
+ Type,
+ Union,
+ overload,
+)
+
+import attr
+
+from . import hdrs
+from .abc import AbstractView
+from .typedefs import Handler, PathLike
+
+if TYPE_CHECKING: # pragma: no cover
+ from .web_request import Request
+ from .web_response import StreamResponse
+ from .web_urldispatcher import AbstractRoute, UrlDispatcher
+else:
+ Request = StreamResponse = UrlDispatcher = AbstractRoute = None
+
+
+__all__ = (
+ "AbstractRouteDef",
+ "RouteDef",
+ "StaticDef",
+ "RouteTableDef",
+ "head",
+ "options",
+ "get",
+ "post",
+ "patch",
+ "put",
+ "delete",
+ "route",
+ "view",
+ "static",
+)
+
+
+class AbstractRouteDef(abc.ABC):
+ @abc.abstractmethod
+ def register(self, router: UrlDispatcher) -> List[AbstractRoute]:
+ pass # pragma: no cover
+
+
+_HandlerType = Union[Type[AbstractView], Handler]
+
+
+@attr.s(auto_attribs=True, frozen=True, repr=False, slots=True)
+class RouteDef(AbstractRouteDef):
+ method: str
+ path: str
+ handler: _HandlerType
+ kwargs: Dict[str, Any]
+
+ def __repr__(self) -> str:
+ info = []
+ for name, value in sorted(self.kwargs.items()):
+ info.append(f", {name}={value!r}")
+ return "<RouteDef {method} {path} -> {handler.__name__!r}" "{info}>".format(
+ method=self.method, path=self.path, handler=self.handler, info="".join(info)
+ )
+
+ def register(self, router: UrlDispatcher) -> List[AbstractRoute]:
+ if self.method in hdrs.METH_ALL:
+ reg = getattr(router, "add_" + self.method.lower())
+ return [reg(self.path, self.handler, **self.kwargs)]
+ else:
+ return [
+ router.add_route(self.method, self.path, self.handler, **self.kwargs)
+ ]
+
+
+@attr.s(auto_attribs=True, frozen=True, repr=False, slots=True)
+class StaticDef(AbstractRouteDef):
+ prefix: str
+ path: PathLike
+ kwargs: Dict[str, Any]
+
+ def __repr__(self) -> str:
+ info = []
+ for name, value in sorted(self.kwargs.items()):
+ info.append(f", {name}={value!r}")
+ return "<StaticDef {prefix} -> {path}" "{info}>".format(
+ prefix=self.prefix, path=self.path, info="".join(info)
+ )
+
+ def register(self, router: UrlDispatcher) -> List[AbstractRoute]:
+ resource = router.add_static(self.prefix, self.path, **self.kwargs)
+ routes = resource.get_info().get("routes", {})
+ return list(routes.values())
+
+
+def route(method: str, path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef:
+ return RouteDef(method, path, handler, kwargs)
+
+
+def head(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef:
+ return route(hdrs.METH_HEAD, path, handler, **kwargs)
+
+
+def options(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef:
+ return route(hdrs.METH_OPTIONS, path, handler, **kwargs)
+
+
+def get(
+ path: str,
+ handler: _HandlerType,
+ *,
+ name: Optional[str] = None,
+ allow_head: bool = True,
+ **kwargs: Any,
+) -> RouteDef:
+ return route(
+ hdrs.METH_GET, path, handler, name=name, allow_head=allow_head, **kwargs
+ )
+
+
+def post(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef:
+ return route(hdrs.METH_POST, path, handler, **kwargs)
+
+
+def put(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef:
+ return route(hdrs.METH_PUT, path, handler, **kwargs)
+
+
+def patch(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef:
+ return route(hdrs.METH_PATCH, path, handler, **kwargs)
+
+
+def delete(path: str, handler: _HandlerType, **kwargs: Any) -> RouteDef:
+ return route(hdrs.METH_DELETE, path, handler, **kwargs)
+
+
+def view(path: str, handler: Type[AbstractView], **kwargs: Any) -> RouteDef:
+ return route(hdrs.METH_ANY, path, handler, **kwargs)
+
+
+def static(prefix: str, path: PathLike, **kwargs: Any) -> StaticDef:
+ return StaticDef(prefix, path, kwargs)
+
+
+_Deco = Callable[[_HandlerType], _HandlerType]
+
+
+class RouteTableDef(Sequence[AbstractRouteDef]):
+ """Route definition table"""
+
+ def __init__(self) -> None:
+ self._items: List[AbstractRouteDef] = []
+
+ def __repr__(self) -> str:
+ return f"<RouteTableDef count={len(self._items)}>"
+
+ @overload
+ def __getitem__(self, index: int) -> AbstractRouteDef:
+ ...
+
+ @overload
+ def __getitem__(self, index: slice) -> List[AbstractRouteDef]:
+ ...
+
+ def __getitem__(self, index): # type: ignore[no-untyped-def]
+ return self._items[index]
+
+ def __iter__(self) -> Iterator[AbstractRouteDef]:
+ return iter(self._items)
+
+ def __len__(self) -> int:
+ return len(self._items)
+
+ def __contains__(self, item: object) -> bool:
+ return item in self._items
+
+ def route(self, method: str, path: str, **kwargs: Any) -> _Deco:
+ def inner(handler: _HandlerType) -> _HandlerType:
+ self._items.append(RouteDef(method, path, handler, kwargs))
+ return handler
+
+ return inner
+
+ def head(self, path: str, **kwargs: Any) -> _Deco:
+ return self.route(hdrs.METH_HEAD, path, **kwargs)
+
+ def get(self, path: str, **kwargs: Any) -> _Deco:
+ return self.route(hdrs.METH_GET, path, **kwargs)
+
+ def post(self, path: str, **kwargs: Any) -> _Deco:
+ return self.route(hdrs.METH_POST, path, **kwargs)
+
+ def put(self, path: str, **kwargs: Any) -> _Deco:
+ return self.route(hdrs.METH_PUT, path, **kwargs)
+
+ def patch(self, path: str, **kwargs: Any) -> _Deco:
+ return self.route(hdrs.METH_PATCH, path, **kwargs)
+
+ def delete(self, path: str, **kwargs: Any) -> _Deco:
+ return self.route(hdrs.METH_DELETE, path, **kwargs)
+
+ def options(self, path: str, **kwargs: Any) -> _Deco:
+ return self.route(hdrs.METH_OPTIONS, path, **kwargs)
+
+ def view(self, path: str, **kwargs: Any) -> _Deco:
+ return self.route(hdrs.METH_ANY, path, **kwargs)
+
+ def static(self, prefix: str, path: PathLike, **kwargs: Any) -> None:
+ self._items.append(StaticDef(prefix, path, kwargs))
diff --git a/third_party/python/aiohttp/aiohttp/web_runner.py b/third_party/python/aiohttp/aiohttp/web_runner.py
new file mode 100644
index 0000000000..9282bb93d3
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_runner.py
@@ -0,0 +1,381 @@
+import asyncio
+import signal
+import socket
+from abc import ABC, abstractmethod
+from typing import Any, List, Optional, Set
+
+from yarl import URL
+
+from .web_app import Application
+from .web_server import Server
+
+try:
+ from ssl import SSLContext
+except ImportError:
+ SSLContext = object # type: ignore[misc,assignment]
+
+
+__all__ = (
+ "BaseSite",
+ "TCPSite",
+ "UnixSite",
+ "NamedPipeSite",
+ "SockSite",
+ "BaseRunner",
+ "AppRunner",
+ "ServerRunner",
+ "GracefulExit",
+)
+
+
+class GracefulExit(SystemExit):
+ code = 1
+
+
+def _raise_graceful_exit() -> None:
+ raise GracefulExit()
+
+
+class BaseSite(ABC):
+ __slots__ = ("_runner", "_shutdown_timeout", "_ssl_context", "_backlog", "_server")
+
+ def __init__(
+ self,
+ runner: "BaseRunner",
+ *,
+ shutdown_timeout: float = 60.0,
+ ssl_context: Optional[SSLContext] = None,
+ backlog: int = 128,
+ ) -> None:
+ if runner.server is None:
+ raise RuntimeError("Call runner.setup() before making a site")
+ self._runner = runner
+ self._shutdown_timeout = shutdown_timeout
+ self._ssl_context = ssl_context
+ self._backlog = backlog
+ self._server: Optional[asyncio.AbstractServer] = None
+
+ @property
+ @abstractmethod
+ def name(self) -> str:
+ pass # pragma: no cover
+
+ @abstractmethod
+ async def start(self) -> None:
+ self._runner._reg_site(self)
+
+ async def stop(self) -> None:
+ self._runner._check_site(self)
+ if self._server is None:
+ self._runner._unreg_site(self)
+ return # not started yet
+ self._server.close()
+ # named pipes do not have wait_closed property
+ if hasattr(self._server, "wait_closed"):
+ await self._server.wait_closed()
+ await self._runner.shutdown()
+ assert self._runner.server
+ await self._runner.server.shutdown(self._shutdown_timeout)
+ self._runner._unreg_site(self)
+
+
+class TCPSite(BaseSite):
+ __slots__ = ("_host", "_port", "_reuse_address", "_reuse_port")
+
+ def __init__(
+ self,
+ runner: "BaseRunner",
+ host: Optional[str] = None,
+ port: Optional[int] = None,
+ *,
+ shutdown_timeout: float = 60.0,
+ ssl_context: Optional[SSLContext] = None,
+ backlog: int = 128,
+ reuse_address: Optional[bool] = None,
+ reuse_port: Optional[bool] = None,
+ ) -> None:
+ super().__init__(
+ runner,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ )
+ self._host = host
+ if port is None:
+ port = 8443 if self._ssl_context else 8080
+ self._port = port
+ self._reuse_address = reuse_address
+ self._reuse_port = reuse_port
+
+ @property
+ def name(self) -> str:
+ scheme = "https" if self._ssl_context else "http"
+ host = "0.0.0.0" if self._host is None else self._host
+ return str(URL.build(scheme=scheme, host=host, port=self._port))
+
+ async def start(self) -> None:
+ await super().start()
+ loop = asyncio.get_event_loop()
+ server = self._runner.server
+ assert server is not None
+ self._server = await loop.create_server(
+ server,
+ self._host,
+ self._port,
+ ssl=self._ssl_context,
+ backlog=self._backlog,
+ reuse_address=self._reuse_address,
+ reuse_port=self._reuse_port,
+ )
+
+
+class UnixSite(BaseSite):
+ __slots__ = ("_path",)
+
+ def __init__(
+ self,
+ runner: "BaseRunner",
+ path: str,
+ *,
+ shutdown_timeout: float = 60.0,
+ ssl_context: Optional[SSLContext] = None,
+ backlog: int = 128,
+ ) -> None:
+ super().__init__(
+ runner,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ )
+ self._path = path
+
+ @property
+ def name(self) -> str:
+ scheme = "https" if self._ssl_context else "http"
+ return f"{scheme}://unix:{self._path}:"
+
+ async def start(self) -> None:
+ await super().start()
+ loop = asyncio.get_event_loop()
+ server = self._runner.server
+ assert server is not None
+ self._server = await loop.create_unix_server(
+ server, self._path, ssl=self._ssl_context, backlog=self._backlog
+ )
+
+
+class NamedPipeSite(BaseSite):
+ __slots__ = ("_path",)
+
+ def __init__(
+ self, runner: "BaseRunner", path: str, *, shutdown_timeout: float = 60.0
+ ) -> None:
+ loop = asyncio.get_event_loop()
+ if not isinstance(
+ loop, asyncio.ProactorEventLoop # type: ignore[attr-defined]
+ ):
+ raise RuntimeError(
+ "Named Pipes only available in proactor" "loop under windows"
+ )
+ super().__init__(runner, shutdown_timeout=shutdown_timeout)
+ self._path = path
+
+ @property
+ def name(self) -> str:
+ return self._path
+
+ async def start(self) -> None:
+ await super().start()
+ loop = asyncio.get_event_loop()
+ server = self._runner.server
+ assert server is not None
+ _server = await loop.start_serving_pipe( # type: ignore[attr-defined]
+ server, self._path
+ )
+ self._server = _server[0]
+
+
+class SockSite(BaseSite):
+ __slots__ = ("_sock", "_name")
+
+ def __init__(
+ self,
+ runner: "BaseRunner",
+ sock: socket.socket,
+ *,
+ shutdown_timeout: float = 60.0,
+ ssl_context: Optional[SSLContext] = None,
+ backlog: int = 128,
+ ) -> None:
+ super().__init__(
+ runner,
+ shutdown_timeout=shutdown_timeout,
+ ssl_context=ssl_context,
+ backlog=backlog,
+ )
+ self._sock = sock
+ scheme = "https" if self._ssl_context else "http"
+ if hasattr(socket, "AF_UNIX") and sock.family == socket.AF_UNIX:
+ name = f"{scheme}://unix:{sock.getsockname()}:"
+ else:
+ host, port = sock.getsockname()[:2]
+ name = str(URL.build(scheme=scheme, host=host, port=port))
+ self._name = name
+
+ @property
+ def name(self) -> str:
+ return self._name
+
+ async def start(self) -> None:
+ await super().start()
+ loop = asyncio.get_event_loop()
+ server = self._runner.server
+ assert server is not None
+ self._server = await loop.create_server(
+ server, sock=self._sock, ssl=self._ssl_context, backlog=self._backlog
+ )
+
+
+class BaseRunner(ABC):
+ __slots__ = ("_handle_signals", "_kwargs", "_server", "_sites")
+
+ def __init__(self, *, handle_signals: bool = False, **kwargs: Any) -> None:
+ self._handle_signals = handle_signals
+ self._kwargs = kwargs
+ self._server: Optional[Server] = None
+ self._sites: List[BaseSite] = []
+
+ @property
+ def server(self) -> Optional[Server]:
+ return self._server
+
+ @property
+ def addresses(self) -> List[Any]:
+ ret: List[Any] = []
+ for site in self._sites:
+ server = site._server
+ if server is not None:
+ sockets = server.sockets
+ if sockets is not None:
+ for sock in sockets:
+ ret.append(sock.getsockname())
+ return ret
+
+ @property
+ def sites(self) -> Set[BaseSite]:
+ return set(self._sites)
+
+ async def setup(self) -> None:
+ loop = asyncio.get_event_loop()
+
+ if self._handle_signals:
+ try:
+ loop.add_signal_handler(signal.SIGINT, _raise_graceful_exit)
+ loop.add_signal_handler(signal.SIGTERM, _raise_graceful_exit)
+ except NotImplementedError: # pragma: no cover
+ # add_signal_handler is not implemented on Windows
+ pass
+
+ self._server = await self._make_server()
+
+ @abstractmethod
+ async def shutdown(self) -> None:
+ pass # pragma: no cover
+
+ async def cleanup(self) -> None:
+ loop = asyncio.get_event_loop()
+
+ # The loop over sites is intentional, an exception on gather()
+ # leaves self._sites in unpredictable state.
+ # The loop guaranties that a site is either deleted on success or
+ # still present on failure
+ for site in list(self._sites):
+ await site.stop()
+ await self._cleanup_server()
+ self._server = None
+ if self._handle_signals:
+ try:
+ loop.remove_signal_handler(signal.SIGINT)
+ loop.remove_signal_handler(signal.SIGTERM)
+ except NotImplementedError: # pragma: no cover
+ # remove_signal_handler is not implemented on Windows
+ pass
+
+ @abstractmethod
+ async def _make_server(self) -> Server:
+ pass # pragma: no cover
+
+ @abstractmethod
+ async def _cleanup_server(self) -> None:
+ pass # pragma: no cover
+
+ def _reg_site(self, site: BaseSite) -> None:
+ if site in self._sites:
+ raise RuntimeError(f"Site {site} is already registered in runner {self}")
+ self._sites.append(site)
+
+ def _check_site(self, site: BaseSite) -> None:
+ if site not in self._sites:
+ raise RuntimeError(f"Site {site} is not registered in runner {self}")
+
+ def _unreg_site(self, site: BaseSite) -> None:
+ if site not in self._sites:
+ raise RuntimeError(f"Site {site} is not registered in runner {self}")
+ self._sites.remove(site)
+
+
+class ServerRunner(BaseRunner):
+ """Low-level web server runner"""
+
+ __slots__ = ("_web_server",)
+
+ def __init__(
+ self, web_server: Server, *, handle_signals: bool = False, **kwargs: Any
+ ) -> None:
+ super().__init__(handle_signals=handle_signals, **kwargs)
+ self._web_server = web_server
+
+ async def shutdown(self) -> None:
+ pass
+
+ async def _make_server(self) -> Server:
+ return self._web_server
+
+ async def _cleanup_server(self) -> None:
+ pass
+
+
+class AppRunner(BaseRunner):
+ """Web Application runner"""
+
+ __slots__ = ("_app",)
+
+ def __init__(
+ self, app: Application, *, handle_signals: bool = False, **kwargs: Any
+ ) -> None:
+ super().__init__(handle_signals=handle_signals, **kwargs)
+ if not isinstance(app, Application):
+ raise TypeError(
+ "The first argument should be web.Application "
+ "instance, got {!r}".format(app)
+ )
+ self._app = app
+
+ @property
+ def app(self) -> Application:
+ return self._app
+
+ async def shutdown(self) -> None:
+ await self._app.shutdown()
+
+ async def _make_server(self) -> Server:
+ loop = asyncio.get_event_loop()
+ self._app._set_loop(loop)
+ self._app.on_startup.freeze()
+ await self._app.startup()
+ self._app.freeze()
+
+ return self._app._make_handler(loop=loop, **self._kwargs)
+
+ async def _cleanup_server(self) -> None:
+ await self._app.cleanup()
diff --git a/third_party/python/aiohttp/aiohttp/web_server.py b/third_party/python/aiohttp/aiohttp/web_server.py
new file mode 100644
index 0000000000..fa46e905ca
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_server.py
@@ -0,0 +1,62 @@
+"""Low level HTTP server."""
+import asyncio
+from typing import Any, Awaitable, Callable, Dict, List, Optional # noqa
+
+from .abc import AbstractStreamWriter
+from .helpers import get_running_loop
+from .http_parser import RawRequestMessage
+from .streams import StreamReader
+from .web_protocol import RequestHandler, _RequestFactory, _RequestHandler
+from .web_request import BaseRequest
+
+__all__ = ("Server",)
+
+
+class Server:
+ def __init__(
+ self,
+ handler: _RequestHandler,
+ *,
+ request_factory: Optional[_RequestFactory] = None,
+ loop: Optional[asyncio.AbstractEventLoop] = None,
+ **kwargs: Any
+ ) -> None:
+ self._loop = get_running_loop(loop)
+ self._connections: Dict[RequestHandler, asyncio.Transport] = {}
+ self._kwargs = kwargs
+ self.requests_count = 0
+ self.request_handler = handler
+ self.request_factory = request_factory or self._make_request
+
+ @property
+ def connections(self) -> List[RequestHandler]:
+ return list(self._connections.keys())
+
+ def connection_made(
+ self, handler: RequestHandler, transport: asyncio.Transport
+ ) -> None:
+ self._connections[handler] = transport
+
+ def connection_lost(
+ self, handler: RequestHandler, exc: Optional[BaseException] = None
+ ) -> None:
+ if handler in self._connections:
+ del self._connections[handler]
+
+ def _make_request(
+ self,
+ message: RawRequestMessage,
+ payload: StreamReader,
+ protocol: RequestHandler,
+ writer: AbstractStreamWriter,
+ task: "asyncio.Task[None]",
+ ) -> BaseRequest:
+ return BaseRequest(message, payload, protocol, writer, task, self._loop)
+
+ async def shutdown(self, timeout: Optional[float] = None) -> None:
+ coros = [conn.shutdown(timeout) for conn in self._connections]
+ await asyncio.gather(*coros)
+ self._connections.clear()
+
+ def __call__(self) -> RequestHandler:
+ return RequestHandler(self, loop=self._loop, **self._kwargs)
diff --git a/third_party/python/aiohttp/aiohttp/web_urldispatcher.py b/third_party/python/aiohttp/aiohttp/web_urldispatcher.py
new file mode 100644
index 0000000000..5942e355e0
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_urldispatcher.py
@@ -0,0 +1,1220 @@
+import abc
+import asyncio
+import base64
+import hashlib
+import inspect
+import keyword
+import os
+import re
+import warnings
+from contextlib import contextmanager
+from functools import wraps
+from pathlib import Path
+from types import MappingProxyType
+from typing import (
+ TYPE_CHECKING,
+ Any,
+ Awaitable,
+ Callable,
+ Container,
+ Dict,
+ Generator,
+ Iterable,
+ Iterator,
+ List,
+ Mapping,
+ Optional,
+ Pattern,
+ Set,
+ Sized,
+ Tuple,
+ Type,
+ Union,
+ cast,
+)
+
+from yarl import URL, __version__ as yarl_version # type: ignore[attr-defined]
+
+from . import hdrs
+from .abc import AbstractMatchInfo, AbstractRouter, AbstractView
+from .helpers import DEBUG
+from .http import HttpVersion11
+from .typedefs import Final, Handler, PathLike, TypedDict
+from .web_exceptions import (
+ HTTPException,
+ HTTPExpectationFailed,
+ HTTPForbidden,
+ HTTPMethodNotAllowed,
+ HTTPNotFound,
+)
+from .web_fileresponse import FileResponse
+from .web_request import Request
+from .web_response import Response, StreamResponse
+from .web_routedef import AbstractRouteDef
+
+__all__ = (
+ "UrlDispatcher",
+ "UrlMappingMatchInfo",
+ "AbstractResource",
+ "Resource",
+ "PlainResource",
+ "DynamicResource",
+ "AbstractRoute",
+ "ResourceRoute",
+ "StaticResource",
+ "View",
+)
+
+
+if TYPE_CHECKING: # pragma: no cover
+ from .web_app import Application
+
+ BaseDict = Dict[str, str]
+else:
+ BaseDict = dict
+
+YARL_VERSION: Final[Tuple[int, ...]] = tuple(map(int, yarl_version.split(".")[:2]))
+
+HTTP_METHOD_RE: Final[Pattern[str]] = re.compile(
+ r"^[0-9A-Za-z!#\$%&'\*\+\-\.\^_`\|~]+$"
+)
+ROUTE_RE: Final[Pattern[str]] = re.compile(
+ r"(\{[_a-zA-Z][^{}]*(?:\{[^{}]*\}[^{}]*)*\})"
+)
+PATH_SEP: Final[str] = re.escape("/")
+
+
+_ExpectHandler = Callable[[Request], Awaitable[None]]
+_Resolve = Tuple[Optional["UrlMappingMatchInfo"], Set[str]]
+
+
+class _InfoDict(TypedDict, total=False):
+ path: str
+
+ formatter: str
+ pattern: Pattern[str]
+
+ directory: Path
+ prefix: str
+ routes: Mapping[str, "AbstractRoute"]
+
+ app: "Application"
+
+ domain: str
+
+ rule: "AbstractRuleMatching"
+
+ http_exception: HTTPException
+
+
+class AbstractResource(Sized, Iterable["AbstractRoute"]):
+ def __init__(self, *, name: Optional[str] = None) -> None:
+ self._name = name
+
+ @property
+ def name(self) -> Optional[str]:
+ return self._name
+
+ @property
+ @abc.abstractmethod
+ def canonical(self) -> str:
+ """Exposes the resource's canonical path.
+
+ For example '/foo/bar/{name}'
+
+ """
+
+ @abc.abstractmethod # pragma: no branch
+ def url_for(self, **kwargs: str) -> URL:
+ """Construct url for resource with additional params."""
+
+ @abc.abstractmethod # pragma: no branch
+ async def resolve(self, request: Request) -> _Resolve:
+ """Resolve resource.
+
+ Return (UrlMappingMatchInfo, allowed_methods) pair.
+ """
+
+ @abc.abstractmethod
+ def add_prefix(self, prefix: str) -> None:
+ """Add a prefix to processed URLs.
+
+ Required for subapplications support.
+ """
+
+ @abc.abstractmethod
+ def get_info(self) -> _InfoDict:
+ """Return a dict with additional info useful for introspection"""
+
+ def freeze(self) -> None:
+ pass
+
+ @abc.abstractmethod
+ def raw_match(self, path: str) -> bool:
+ """Perform a raw match against path"""
+
+
+class AbstractRoute(abc.ABC):
+ def __init__(
+ self,
+ method: str,
+ handler: Union[Handler, Type[AbstractView]],
+ *,
+ expect_handler: Optional[_ExpectHandler] = None,
+ resource: Optional[AbstractResource] = None,
+ ) -> None:
+
+ if expect_handler is None:
+ expect_handler = _default_expect_handler
+
+ assert asyncio.iscoroutinefunction(
+ expect_handler
+ ), f"Coroutine is expected, got {expect_handler!r}"
+
+ method = method.upper()
+ if not HTTP_METHOD_RE.match(method):
+ raise ValueError(f"{method} is not allowed HTTP method")
+
+ assert callable(handler), handler
+ if asyncio.iscoroutinefunction(handler):
+ pass
+ elif inspect.isgeneratorfunction(handler):
+ warnings.warn(
+ "Bare generators are deprecated, " "use @coroutine wrapper",
+ DeprecationWarning,
+ )
+ elif isinstance(handler, type) and issubclass(handler, AbstractView):
+ pass
+ else:
+ warnings.warn(
+ "Bare functions are deprecated, " "use async ones", DeprecationWarning
+ )
+
+ @wraps(handler)
+ async def handler_wrapper(request: Request) -> StreamResponse:
+ result = old_handler(request)
+ if asyncio.iscoroutine(result):
+ return await result
+ return result # type: ignore[return-value]
+
+ old_handler = handler
+ handler = handler_wrapper
+
+ self._method = method
+ self._handler = handler
+ self._expect_handler = expect_handler
+ self._resource = resource
+
+ @property
+ def method(self) -> str:
+ return self._method
+
+ @property
+ def handler(self) -> Handler:
+ return self._handler
+
+ @property
+ @abc.abstractmethod
+ def name(self) -> Optional[str]:
+ """Optional route's name, always equals to resource's name."""
+
+ @property
+ def resource(self) -> Optional[AbstractResource]:
+ return self._resource
+
+ @abc.abstractmethod
+ def get_info(self) -> _InfoDict:
+ """Return a dict with additional info useful for introspection"""
+
+ @abc.abstractmethod # pragma: no branch
+ def url_for(self, *args: str, **kwargs: str) -> URL:
+ """Construct url for route with additional params."""
+
+ async def handle_expect_header(self, request: Request) -> None:
+ await self._expect_handler(request)
+
+
+class UrlMappingMatchInfo(BaseDict, AbstractMatchInfo):
+ def __init__(self, match_dict: Dict[str, str], route: AbstractRoute):
+ super().__init__(match_dict)
+ self._route = route
+ self._apps: List[Application] = []
+ self._current_app: Optional[Application] = None
+ self._frozen = False
+
+ @property
+ def handler(self) -> Handler:
+ return self._route.handler
+
+ @property
+ def route(self) -> AbstractRoute:
+ return self._route
+
+ @property
+ def expect_handler(self) -> _ExpectHandler:
+ return self._route.handle_expect_header
+
+ @property
+ def http_exception(self) -> Optional[HTTPException]:
+ return None
+
+ def get_info(self) -> _InfoDict: # type: ignore[override]
+ return self._route.get_info()
+
+ @property
+ def apps(self) -> Tuple["Application", ...]:
+ return tuple(self._apps)
+
+ def add_app(self, app: "Application") -> None:
+ if self._frozen:
+ raise RuntimeError("Cannot change apps stack after .freeze() call")
+ if self._current_app is None:
+ self._current_app = app
+ self._apps.insert(0, app)
+
+ @property
+ def current_app(self) -> "Application":
+ app = self._current_app
+ assert app is not None
+ return app
+
+ @contextmanager
+ def set_current_app(self, app: "Application") -> Generator[None, None, None]:
+ if DEBUG: # pragma: no cover
+ if app not in self._apps:
+ raise RuntimeError(
+ "Expected one of the following apps {!r}, got {!r}".format(
+ self._apps, app
+ )
+ )
+ prev = self._current_app
+ self._current_app = app
+ try:
+ yield
+ finally:
+ self._current_app = prev
+
+ def freeze(self) -> None:
+ self._frozen = True
+
+ def __repr__(self) -> str:
+ return f"<MatchInfo {super().__repr__()}: {self._route}>"
+
+
+class MatchInfoError(UrlMappingMatchInfo):
+ def __init__(self, http_exception: HTTPException) -> None:
+ self._exception = http_exception
+ super().__init__({}, SystemRoute(self._exception))
+
+ @property
+ def http_exception(self) -> HTTPException:
+ return self._exception
+
+ def __repr__(self) -> str:
+ return "<MatchInfoError {}: {}>".format(
+ self._exception.status, self._exception.reason
+ )
+
+
+async def _default_expect_handler(request: Request) -> None:
+ """Default handler for Expect header.
+
+ Just send "100 Continue" to client.
+ raise HTTPExpectationFailed if value of header is not "100-continue"
+ """
+ expect = request.headers.get(hdrs.EXPECT, "")
+ if request.version == HttpVersion11:
+ if expect.lower() == "100-continue":
+ await request.writer.write(b"HTTP/1.1 100 Continue\r\n\r\n")
+ else:
+ raise HTTPExpectationFailed(text="Unknown Expect: %s" % expect)
+
+
+class Resource(AbstractResource):
+ def __init__(self, *, name: Optional[str] = None) -> None:
+ super().__init__(name=name)
+ self._routes: List[ResourceRoute] = []
+
+ def add_route(
+ self,
+ method: str,
+ handler: Union[Type[AbstractView], Handler],
+ *,
+ expect_handler: Optional[_ExpectHandler] = None,
+ ) -> "ResourceRoute":
+
+ for route_obj in self._routes:
+ if route_obj.method == method or route_obj.method == hdrs.METH_ANY:
+ raise RuntimeError(
+ "Added route will never be executed, "
+ "method {route.method} is already "
+ "registered".format(route=route_obj)
+ )
+
+ route_obj = ResourceRoute(method, handler, self, expect_handler=expect_handler)
+ self.register_route(route_obj)
+ return route_obj
+
+ def register_route(self, route: "ResourceRoute") -> None:
+ assert isinstance(
+ route, ResourceRoute
+ ), f"Instance of Route class is required, got {route!r}"
+ self._routes.append(route)
+
+ async def resolve(self, request: Request) -> _Resolve:
+ allowed_methods: Set[str] = set()
+
+ match_dict = self._match(request.rel_url.raw_path)
+ if match_dict is None:
+ return None, allowed_methods
+
+ for route_obj in self._routes:
+ route_method = route_obj.method
+ allowed_methods.add(route_method)
+
+ if route_method == request.method or route_method == hdrs.METH_ANY:
+ return (UrlMappingMatchInfo(match_dict, route_obj), allowed_methods)
+ else:
+ return None, allowed_methods
+
+ @abc.abstractmethod
+ def _match(self, path: str) -> Optional[Dict[str, str]]:
+ pass # pragma: no cover
+
+ def __len__(self) -> int:
+ return len(self._routes)
+
+ def __iter__(self) -> Iterator[AbstractRoute]:
+ return iter(self._routes)
+
+ # TODO: implement all abstract methods
+
+
+class PlainResource(Resource):
+ def __init__(self, path: str, *, name: Optional[str] = None) -> None:
+ super().__init__(name=name)
+ assert not path or path.startswith("/")
+ self._path = path
+
+ @property
+ def canonical(self) -> str:
+ return self._path
+
+ def freeze(self) -> None:
+ if not self._path:
+ self._path = "/"
+
+ def add_prefix(self, prefix: str) -> None:
+ assert prefix.startswith("/")
+ assert not prefix.endswith("/")
+ assert len(prefix) > 1
+ self._path = prefix + self._path
+
+ def _match(self, path: str) -> Optional[Dict[str, str]]:
+ # string comparison is about 10 times faster than regexp matching
+ if self._path == path:
+ return {}
+ else:
+ return None
+
+ def raw_match(self, path: str) -> bool:
+ return self._path == path
+
+ def get_info(self) -> _InfoDict:
+ return {"path": self._path}
+
+ def url_for(self) -> URL: # type: ignore[override]
+ return URL.build(path=self._path, encoded=True)
+
+ def __repr__(self) -> str:
+ name = "'" + self.name + "' " if self.name is not None else ""
+ return f"<PlainResource {name} {self._path}>"
+
+
+class DynamicResource(Resource):
+
+ DYN = re.compile(r"\{(?P<var>[_a-zA-Z][_a-zA-Z0-9]*)\}")
+ DYN_WITH_RE = re.compile(r"\{(?P<var>[_a-zA-Z][_a-zA-Z0-9]*):(?P<re>.+)\}")
+ GOOD = r"[^{}/]+"
+
+ def __init__(self, path: str, *, name: Optional[str] = None) -> None:
+ super().__init__(name=name)
+ pattern = ""
+ formatter = ""
+ for part in ROUTE_RE.split(path):
+ match = self.DYN.fullmatch(part)
+ if match:
+ pattern += "(?P<{}>{})".format(match.group("var"), self.GOOD)
+ formatter += "{" + match.group("var") + "}"
+ continue
+
+ match = self.DYN_WITH_RE.fullmatch(part)
+ if match:
+ pattern += "(?P<{var}>{re})".format(**match.groupdict())
+ formatter += "{" + match.group("var") + "}"
+ continue
+
+ if "{" in part or "}" in part:
+ raise ValueError(f"Invalid path '{path}'['{part}']")
+
+ part = _requote_path(part)
+ formatter += part
+ pattern += re.escape(part)
+
+ try:
+ compiled = re.compile(pattern)
+ except re.error as exc:
+ raise ValueError(f"Bad pattern '{pattern}': {exc}") from None
+ assert compiled.pattern.startswith(PATH_SEP)
+ assert formatter.startswith("/")
+ self._pattern = compiled
+ self._formatter = formatter
+
+ @property
+ def canonical(self) -> str:
+ return self._formatter
+
+ def add_prefix(self, prefix: str) -> None:
+ assert prefix.startswith("/")
+ assert not prefix.endswith("/")
+ assert len(prefix) > 1
+ self._pattern = re.compile(re.escape(prefix) + self._pattern.pattern)
+ self._formatter = prefix + self._formatter
+
+ def _match(self, path: str) -> Optional[Dict[str, str]]:
+ match = self._pattern.fullmatch(path)
+ if match is None:
+ return None
+ else:
+ return {
+ key: _unquote_path(value) for key, value in match.groupdict().items()
+ }
+
+ def raw_match(self, path: str) -> bool:
+ return self._formatter == path
+
+ def get_info(self) -> _InfoDict:
+ return {"formatter": self._formatter, "pattern": self._pattern}
+
+ def url_for(self, **parts: str) -> URL:
+ url = self._formatter.format_map({k: _quote_path(v) for k, v in parts.items()})
+ return URL.build(path=url, encoded=True)
+
+ def __repr__(self) -> str:
+ name = "'" + self.name + "' " if self.name is not None else ""
+ return "<DynamicResource {name} {formatter}>".format(
+ name=name, formatter=self._formatter
+ )
+
+
+class PrefixResource(AbstractResource):
+ def __init__(self, prefix: str, *, name: Optional[str] = None) -> None:
+ assert not prefix or prefix.startswith("/"), prefix
+ assert prefix in ("", "/") or not prefix.endswith("/"), prefix
+ super().__init__(name=name)
+ self._prefix = _requote_path(prefix)
+ self._prefix2 = self._prefix + "/"
+
+ @property
+ def canonical(self) -> str:
+ return self._prefix
+
+ def add_prefix(self, prefix: str) -> None:
+ assert prefix.startswith("/")
+ assert not prefix.endswith("/")
+ assert len(prefix) > 1
+ self._prefix = prefix + self._prefix
+ self._prefix2 = self._prefix + "/"
+
+ def raw_match(self, prefix: str) -> bool:
+ return False
+
+ # TODO: impl missing abstract methods
+
+
+class StaticResource(PrefixResource):
+ VERSION_KEY = "v"
+
+ def __init__(
+ self,
+ prefix: str,
+ directory: PathLike,
+ *,
+ name: Optional[str] = None,
+ expect_handler: Optional[_ExpectHandler] = None,
+ chunk_size: int = 256 * 1024,
+ show_index: bool = False,
+ follow_symlinks: bool = False,
+ append_version: bool = False,
+ ) -> None:
+ super().__init__(prefix, name=name)
+ try:
+ directory = Path(directory)
+ if str(directory).startswith("~"):
+ directory = Path(os.path.expanduser(str(directory)))
+ directory = directory.resolve()
+ if not directory.is_dir():
+ raise ValueError("Not a directory")
+ except (FileNotFoundError, ValueError) as error:
+ raise ValueError(f"No directory exists at '{directory}'") from error
+ self._directory = directory
+ self._show_index = show_index
+ self._chunk_size = chunk_size
+ self._follow_symlinks = follow_symlinks
+ self._expect_handler = expect_handler
+ self._append_version = append_version
+
+ self._routes = {
+ "GET": ResourceRoute(
+ "GET", self._handle, self, expect_handler=expect_handler
+ ),
+ "HEAD": ResourceRoute(
+ "HEAD", self._handle, self, expect_handler=expect_handler
+ ),
+ }
+
+ def url_for( # type: ignore[override]
+ self,
+ *,
+ filename: Union[str, Path],
+ append_version: Optional[bool] = None,
+ ) -> URL:
+ if append_version is None:
+ append_version = self._append_version
+ if isinstance(filename, Path):
+ filename = str(filename)
+ filename = filename.lstrip("/")
+
+ url = URL.build(path=self._prefix, encoded=True)
+ # filename is not encoded
+ if YARL_VERSION < (1, 6):
+ url = url / filename.replace("%", "%25")
+ else:
+ url = url / filename
+
+ if append_version:
+ try:
+ filepath = self._directory.joinpath(filename).resolve()
+ if not self._follow_symlinks:
+ filepath.relative_to(self._directory)
+ except (ValueError, FileNotFoundError):
+ # ValueError for case when path point to symlink
+ # with follow_symlinks is False
+ return url # relatively safe
+ if filepath.is_file():
+ # TODO cache file content
+ # with file watcher for cache invalidation
+ with filepath.open("rb") as f:
+ file_bytes = f.read()
+ h = self._get_file_hash(file_bytes)
+ url = url.with_query({self.VERSION_KEY: h})
+ return url
+ return url
+
+ @staticmethod
+ def _get_file_hash(byte_array: bytes) -> str:
+ m = hashlib.sha256() # todo sha256 can be configurable param
+ m.update(byte_array)
+ b64 = base64.urlsafe_b64encode(m.digest())
+ return b64.decode("ascii")
+
+ def get_info(self) -> _InfoDict:
+ return {
+ "directory": self._directory,
+ "prefix": self._prefix,
+ "routes": self._routes,
+ }
+
+ def set_options_route(self, handler: Handler) -> None:
+ if "OPTIONS" in self._routes:
+ raise RuntimeError("OPTIONS route was set already")
+ self._routes["OPTIONS"] = ResourceRoute(
+ "OPTIONS", handler, self, expect_handler=self._expect_handler
+ )
+
+ async def resolve(self, request: Request) -> _Resolve:
+ path = request.rel_url.raw_path
+ method = request.method
+ allowed_methods = set(self._routes)
+ if not path.startswith(self._prefix2) and path != self._prefix:
+ return None, set()
+
+ if method not in allowed_methods:
+ return None, allowed_methods
+
+ match_dict = {"filename": _unquote_path(path[len(self._prefix) + 1 :])}
+ return (UrlMappingMatchInfo(match_dict, self._routes[method]), allowed_methods)
+
+ def __len__(self) -> int:
+ return len(self._routes)
+
+ def __iter__(self) -> Iterator[AbstractRoute]:
+ return iter(self._routes.values())
+
+ async def _handle(self, request: Request) -> StreamResponse:
+ rel_url = request.match_info["filename"]
+ try:
+ filename = Path(rel_url)
+ if filename.anchor:
+ # rel_url is an absolute name like
+ # /static/\\machine_name\c$ or /static/D:\path
+ # where the static dir is totally different
+ raise HTTPForbidden()
+ filepath = self._directory.joinpath(filename).resolve()
+ if not self._follow_symlinks:
+ filepath.relative_to(self._directory)
+ except (ValueError, FileNotFoundError) as error:
+ # relatively safe
+ raise HTTPNotFound() from error
+ except HTTPForbidden:
+ raise
+ except Exception as error:
+ # perm error or other kind!
+ request.app.logger.exception(error)
+ raise HTTPNotFound() from error
+
+ # on opening a dir, load its contents if allowed
+ if filepath.is_dir():
+ if self._show_index:
+ try:
+ return Response(
+ text=self._directory_as_html(filepath), content_type="text/html"
+ )
+ except PermissionError:
+ raise HTTPForbidden()
+ else:
+ raise HTTPForbidden()
+ elif filepath.is_file():
+ return FileResponse(filepath, chunk_size=self._chunk_size)
+ else:
+ raise HTTPNotFound
+
+ def _directory_as_html(self, filepath: Path) -> str:
+ # returns directory's index as html
+
+ # sanity check
+ assert filepath.is_dir()
+
+ relative_path_to_dir = filepath.relative_to(self._directory).as_posix()
+ index_of = f"Index of /{relative_path_to_dir}"
+ h1 = f"<h1>{index_of}</h1>"
+
+ index_list = []
+ dir_index = filepath.iterdir()
+ for _file in sorted(dir_index):
+ # show file url as relative to static path
+ rel_path = _file.relative_to(self._directory).as_posix()
+ file_url = self._prefix + "/" + rel_path
+
+ # if file is a directory, add '/' to the end of the name
+ if _file.is_dir():
+ file_name = f"{_file.name}/"
+ else:
+ file_name = _file.name
+
+ index_list.append(
+ '<li><a href="{url}">{name}</a></li>'.format(
+ url=file_url, name=file_name
+ )
+ )
+ ul = "<ul>\n{}\n</ul>".format("\n".join(index_list))
+ body = f"<body>\n{h1}\n{ul}\n</body>"
+
+ head_str = f"<head>\n<title>{index_of}</title>\n</head>"
+ html = f"<html>\n{head_str}\n{body}\n</html>"
+
+ return html
+
+ def __repr__(self) -> str:
+ name = "'" + self.name + "'" if self.name is not None else ""
+ return "<StaticResource {name} {path} -> {directory!r}>".format(
+ name=name, path=self._prefix, directory=self._directory
+ )
+
+
+class PrefixedSubAppResource(PrefixResource):
+ def __init__(self, prefix: str, app: "Application") -> None:
+ super().__init__(prefix)
+ self._app = app
+ for resource in app.router.resources():
+ resource.add_prefix(prefix)
+
+ def add_prefix(self, prefix: str) -> None:
+ super().add_prefix(prefix)
+ for resource in self._app.router.resources():
+ resource.add_prefix(prefix)
+
+ def url_for(self, *args: str, **kwargs: str) -> URL:
+ raise RuntimeError(".url_for() is not supported " "by sub-application root")
+
+ def get_info(self) -> _InfoDict:
+ return {"app": self._app, "prefix": self._prefix}
+
+ async def resolve(self, request: Request) -> _Resolve:
+ if (
+ not request.url.raw_path.startswith(self._prefix2)
+ and request.url.raw_path != self._prefix
+ ):
+ return None, set()
+ match_info = await self._app.router.resolve(request)
+ match_info.add_app(self._app)
+ if isinstance(match_info.http_exception, HTTPMethodNotAllowed):
+ methods = match_info.http_exception.allowed_methods
+ else:
+ methods = set()
+ return match_info, methods
+
+ def __len__(self) -> int:
+ return len(self._app.router.routes())
+
+ def __iter__(self) -> Iterator[AbstractRoute]:
+ return iter(self._app.router.routes())
+
+ def __repr__(self) -> str:
+ return "<PrefixedSubAppResource {prefix} -> {app!r}>".format(
+ prefix=self._prefix, app=self._app
+ )
+
+
+class AbstractRuleMatching(abc.ABC):
+ @abc.abstractmethod # pragma: no branch
+ async def match(self, request: Request) -> bool:
+ """Return bool if the request satisfies the criteria"""
+
+ @abc.abstractmethod # pragma: no branch
+ def get_info(self) -> _InfoDict:
+ """Return a dict with additional info useful for introspection"""
+
+ @property
+ @abc.abstractmethod # pragma: no branch
+ def canonical(self) -> str:
+ """Return a str"""
+
+
+class Domain(AbstractRuleMatching):
+ re_part = re.compile(r"(?!-)[a-z\d-]{1,63}(?<!-)")
+
+ def __init__(self, domain: str) -> None:
+ super().__init__()
+ self._domain = self.validation(domain)
+
+ @property
+ def canonical(self) -> str:
+ return self._domain
+
+ def validation(self, domain: str) -> str:
+ if not isinstance(domain, str):
+ raise TypeError("Domain must be str")
+ domain = domain.rstrip(".").lower()
+ if not domain:
+ raise ValueError("Domain cannot be empty")
+ elif "://" in domain:
+ raise ValueError("Scheme not supported")
+ url = URL("http://" + domain)
+ assert url.raw_host is not None
+ if not all(self.re_part.fullmatch(x) for x in url.raw_host.split(".")):
+ raise ValueError("Domain not valid")
+ if url.port == 80:
+ return url.raw_host
+ return f"{url.raw_host}:{url.port}"
+
+ async def match(self, request: Request) -> bool:
+ host = request.headers.get(hdrs.HOST)
+ if not host:
+ return False
+ return self.match_domain(host)
+
+ def match_domain(self, host: str) -> bool:
+ return host.lower() == self._domain
+
+ def get_info(self) -> _InfoDict:
+ return {"domain": self._domain}
+
+
+class MaskDomain(Domain):
+ re_part = re.compile(r"(?!-)[a-z\d\*-]{1,63}(?<!-)")
+
+ def __init__(self, domain: str) -> None:
+ super().__init__(domain)
+ mask = self._domain.replace(".", r"\.").replace("*", ".*")
+ self._mask = re.compile(mask)
+
+ @property
+ def canonical(self) -> str:
+ return self._mask.pattern
+
+ def match_domain(self, host: str) -> bool:
+ return self._mask.fullmatch(host) is not None
+
+
+class MatchedSubAppResource(PrefixedSubAppResource):
+ def __init__(self, rule: AbstractRuleMatching, app: "Application") -> None:
+ AbstractResource.__init__(self)
+ self._prefix = ""
+ self._app = app
+ self._rule = rule
+
+ @property
+ def canonical(self) -> str:
+ return self._rule.canonical
+
+ def get_info(self) -> _InfoDict:
+ return {"app": self._app, "rule": self._rule}
+
+ async def resolve(self, request: Request) -> _Resolve:
+ if not await self._rule.match(request):
+ return None, set()
+ match_info = await self._app.router.resolve(request)
+ match_info.add_app(self._app)
+ if isinstance(match_info.http_exception, HTTPMethodNotAllowed):
+ methods = match_info.http_exception.allowed_methods
+ else:
+ methods = set()
+ return match_info, methods
+
+ def __repr__(self) -> str:
+ return "<MatchedSubAppResource -> {app!r}>" "".format(app=self._app)
+
+
+class ResourceRoute(AbstractRoute):
+ """A route with resource"""
+
+ def __init__(
+ self,
+ method: str,
+ handler: Union[Handler, Type[AbstractView]],
+ resource: AbstractResource,
+ *,
+ expect_handler: Optional[_ExpectHandler] = None,
+ ) -> None:
+ super().__init__(
+ method, handler, expect_handler=expect_handler, resource=resource
+ )
+
+ def __repr__(self) -> str:
+ return "<ResourceRoute [{method}] {resource} -> {handler!r}".format(
+ method=self.method, resource=self._resource, handler=self.handler
+ )
+
+ @property
+ def name(self) -> Optional[str]:
+ if self._resource is None:
+ return None
+ return self._resource.name
+
+ def url_for(self, *args: str, **kwargs: str) -> URL:
+ """Construct url for route with additional params."""
+ assert self._resource is not None
+ return self._resource.url_for(*args, **kwargs)
+
+ def get_info(self) -> _InfoDict:
+ assert self._resource is not None
+ return self._resource.get_info()
+
+
+class SystemRoute(AbstractRoute):
+ def __init__(self, http_exception: HTTPException) -> None:
+ super().__init__(hdrs.METH_ANY, self._handle)
+ self._http_exception = http_exception
+
+ def url_for(self, *args: str, **kwargs: str) -> URL:
+ raise RuntimeError(".url_for() is not allowed for SystemRoute")
+
+ @property
+ def name(self) -> Optional[str]:
+ return None
+
+ def get_info(self) -> _InfoDict:
+ return {"http_exception": self._http_exception}
+
+ async def _handle(self, request: Request) -> StreamResponse:
+ raise self._http_exception
+
+ @property
+ def status(self) -> int:
+ return self._http_exception.status
+
+ @property
+ def reason(self) -> str:
+ return self._http_exception.reason
+
+ def __repr__(self) -> str:
+ return "<SystemRoute {self.status}: {self.reason}>".format(self=self)
+
+
+class View(AbstractView):
+ async def _iter(self) -> StreamResponse:
+ if self.request.method not in hdrs.METH_ALL:
+ self._raise_allowed_methods()
+ method: Callable[[], Awaitable[StreamResponse]] = getattr(
+ self, self.request.method.lower(), None
+ )
+ if method is None:
+ self._raise_allowed_methods()
+ resp = await method()
+ return resp
+
+ def __await__(self) -> Generator[Any, None, StreamResponse]:
+ return self._iter().__await__()
+
+ def _raise_allowed_methods(self) -> None:
+ allowed_methods = {m for m in hdrs.METH_ALL if hasattr(self, m.lower())}
+ raise HTTPMethodNotAllowed(self.request.method, allowed_methods)
+
+
+class ResourcesView(Sized, Iterable[AbstractResource], Container[AbstractResource]):
+ def __init__(self, resources: List[AbstractResource]) -> None:
+ self._resources = resources
+
+ def __len__(self) -> int:
+ return len(self._resources)
+
+ def __iter__(self) -> Iterator[AbstractResource]:
+ yield from self._resources
+
+ def __contains__(self, resource: object) -> bool:
+ return resource in self._resources
+
+
+class RoutesView(Sized, Iterable[AbstractRoute], Container[AbstractRoute]):
+ def __init__(self, resources: List[AbstractResource]):
+ self._routes: List[AbstractRoute] = []
+ for resource in resources:
+ for route in resource:
+ self._routes.append(route)
+
+ def __len__(self) -> int:
+ return len(self._routes)
+
+ def __iter__(self) -> Iterator[AbstractRoute]:
+ yield from self._routes
+
+ def __contains__(self, route: object) -> bool:
+ return route in self._routes
+
+
+class UrlDispatcher(AbstractRouter, Mapping[str, AbstractResource]):
+
+ NAME_SPLIT_RE = re.compile(r"[.:-]")
+
+ def __init__(self) -> None:
+ super().__init__()
+ self._resources: List[AbstractResource] = []
+ self._named_resources: Dict[str, AbstractResource] = {}
+
+ async def resolve(self, request: Request) -> UrlMappingMatchInfo:
+ method = request.method
+ allowed_methods: Set[str] = set()
+
+ for resource in self._resources:
+ match_dict, allowed = await resource.resolve(request)
+ if match_dict is not None:
+ return match_dict
+ else:
+ allowed_methods |= allowed
+
+ if allowed_methods:
+ return MatchInfoError(HTTPMethodNotAllowed(method, allowed_methods))
+ else:
+ return MatchInfoError(HTTPNotFound())
+
+ def __iter__(self) -> Iterator[str]:
+ return iter(self._named_resources)
+
+ def __len__(self) -> int:
+ return len(self._named_resources)
+
+ def __contains__(self, resource: object) -> bool:
+ return resource in self._named_resources
+
+ def __getitem__(self, name: str) -> AbstractResource:
+ return self._named_resources[name]
+
+ def resources(self) -> ResourcesView:
+ return ResourcesView(self._resources)
+
+ def routes(self) -> RoutesView:
+ return RoutesView(self._resources)
+
+ def named_resources(self) -> Mapping[str, AbstractResource]:
+ return MappingProxyType(self._named_resources)
+
+ def register_resource(self, resource: AbstractResource) -> None:
+ assert isinstance(
+ resource, AbstractResource
+ ), f"Instance of AbstractResource class is required, got {resource!r}"
+ if self.frozen:
+ raise RuntimeError("Cannot register a resource into frozen router.")
+
+ name = resource.name
+
+ if name is not None:
+ parts = self.NAME_SPLIT_RE.split(name)
+ for part in parts:
+ if keyword.iskeyword(part):
+ raise ValueError(
+ f"Incorrect route name {name!r}, "
+ "python keywords cannot be used "
+ "for route name"
+ )
+ if not part.isidentifier():
+ raise ValueError(
+ "Incorrect route name {!r}, "
+ "the name should be a sequence of "
+ "python identifiers separated "
+ "by dash, dot or column".format(name)
+ )
+ if name in self._named_resources:
+ raise ValueError(
+ "Duplicate {!r}, "
+ "already handled by {!r}".format(name, self._named_resources[name])
+ )
+ self._named_resources[name] = resource
+ self._resources.append(resource)
+
+ def add_resource(self, path: str, *, name: Optional[str] = None) -> Resource:
+ if path and not path.startswith("/"):
+ raise ValueError("path should be started with / or be empty")
+ # Reuse last added resource if path and name are the same
+ if self._resources:
+ resource = self._resources[-1]
+ if resource.name == name and resource.raw_match(path):
+ return cast(Resource, resource)
+ if not ("{" in path or "}" in path or ROUTE_RE.search(path)):
+ resource = PlainResource(_requote_path(path), name=name)
+ self.register_resource(resource)
+ return resource
+ resource = DynamicResource(path, name=name)
+ self.register_resource(resource)
+ return resource
+
+ def add_route(
+ self,
+ method: str,
+ path: str,
+ handler: Union[Handler, Type[AbstractView]],
+ *,
+ name: Optional[str] = None,
+ expect_handler: Optional[_ExpectHandler] = None,
+ ) -> AbstractRoute:
+ resource = self.add_resource(path, name=name)
+ return resource.add_route(method, handler, expect_handler=expect_handler)
+
+ def add_static(
+ self,
+ prefix: str,
+ path: PathLike,
+ *,
+ name: Optional[str] = None,
+ expect_handler: Optional[_ExpectHandler] = None,
+ chunk_size: int = 256 * 1024,
+ show_index: bool = False,
+ follow_symlinks: bool = False,
+ append_version: bool = False,
+ ) -> AbstractResource:
+ """Add static files view.
+
+ prefix - url prefix
+ path - folder with files
+
+ """
+ assert prefix.startswith("/")
+ if prefix.endswith("/"):
+ prefix = prefix[:-1]
+ resource = StaticResource(
+ prefix,
+ path,
+ name=name,
+ expect_handler=expect_handler,
+ chunk_size=chunk_size,
+ show_index=show_index,
+ follow_symlinks=follow_symlinks,
+ append_version=append_version,
+ )
+ self.register_resource(resource)
+ return resource
+
+ def add_head(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute:
+ """Shortcut for add_route with method HEAD."""
+ return self.add_route(hdrs.METH_HEAD, path, handler, **kwargs)
+
+ def add_options(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute:
+ """Shortcut for add_route with method OPTIONS."""
+ return self.add_route(hdrs.METH_OPTIONS, path, handler, **kwargs)
+
+ def add_get(
+ self,
+ path: str,
+ handler: Handler,
+ *,
+ name: Optional[str] = None,
+ allow_head: bool = True,
+ **kwargs: Any,
+ ) -> AbstractRoute:
+ """Shortcut for add_route with method GET.
+
+ If allow_head is true, another
+ route is added allowing head requests to the same endpoint.
+ """
+ resource = self.add_resource(path, name=name)
+ if allow_head:
+ resource.add_route(hdrs.METH_HEAD, handler, **kwargs)
+ return resource.add_route(hdrs.METH_GET, handler, **kwargs)
+
+ def add_post(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute:
+ """Shortcut for add_route with method POST."""
+ return self.add_route(hdrs.METH_POST, path, handler, **kwargs)
+
+ def add_put(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute:
+ """Shortcut for add_route with method PUT."""
+ return self.add_route(hdrs.METH_PUT, path, handler, **kwargs)
+
+ def add_patch(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute:
+ """Shortcut for add_route with method PATCH."""
+ return self.add_route(hdrs.METH_PATCH, path, handler, **kwargs)
+
+ def add_delete(self, path: str, handler: Handler, **kwargs: Any) -> AbstractRoute:
+ """Shortcut for add_route with method DELETE."""
+ return self.add_route(hdrs.METH_DELETE, path, handler, **kwargs)
+
+ def add_view(
+ self, path: str, handler: Type[AbstractView], **kwargs: Any
+ ) -> AbstractRoute:
+ """Shortcut for add_route with ANY methods for a class-based view."""
+ return self.add_route(hdrs.METH_ANY, path, handler, **kwargs)
+
+ def freeze(self) -> None:
+ super().freeze()
+ for resource in self._resources:
+ resource.freeze()
+
+ def add_routes(self, routes: Iterable[AbstractRouteDef]) -> List[AbstractRoute]:
+ """Append routes to route table.
+
+ Parameter should be a sequence of RouteDef objects.
+
+ Returns a list of registered AbstractRoute instances.
+ """
+ registered_routes = []
+ for route_def in routes:
+ registered_routes.extend(route_def.register(self))
+ return registered_routes
+
+
+def _quote_path(value: str) -> str:
+ if YARL_VERSION < (1, 6):
+ value = value.replace("%", "%25")
+ return URL.build(path=value, encoded=False).raw_path
+
+
+def _unquote_path(value: str) -> str:
+ return URL.build(path=value, encoded=True).path
+
+
+def _requote_path(value: str) -> str:
+ # Quote non-ascii characters and other characters which must be quoted,
+ # but preserve existing %-sequences.
+ result = _quote_path(value)
+ if "%" in value:
+ result = result.replace("%25", "%")
+ return result
diff --git a/third_party/python/aiohttp/aiohttp/web_ws.py b/third_party/python/aiohttp/aiohttp/web_ws.py
new file mode 100644
index 0000000000..0d32a218b5
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/web_ws.py
@@ -0,0 +1,487 @@
+import asyncio
+import base64
+import binascii
+import hashlib
+import json
+from typing import Any, Iterable, Optional, Tuple, cast
+
+import async_timeout
+import attr
+from multidict import CIMultiDict
+
+from . import hdrs
+from .abc import AbstractStreamWriter
+from .helpers import call_later, set_result
+from .http import (
+ WS_CLOSED_MESSAGE,
+ WS_CLOSING_MESSAGE,
+ WS_KEY,
+ WebSocketError,
+ WebSocketReader,
+ WebSocketWriter,
+ WSCloseCode,
+ WSMessage,
+ WSMsgType as WSMsgType,
+ ws_ext_gen,
+ ws_ext_parse,
+)
+from .log import ws_logger
+from .streams import EofStream, FlowControlDataQueue
+from .typedefs import Final, JSONDecoder, JSONEncoder
+from .web_exceptions import HTTPBadRequest, HTTPException
+from .web_request import BaseRequest
+from .web_response import StreamResponse
+
+__all__ = (
+ "WebSocketResponse",
+ "WebSocketReady",
+ "WSMsgType",
+)
+
+THRESHOLD_CONNLOST_ACCESS: Final[int] = 5
+
+
+@attr.s(auto_attribs=True, frozen=True, slots=True)
+class WebSocketReady:
+ ok: bool
+ protocol: Optional[str]
+
+ def __bool__(self) -> bool:
+ return self.ok
+
+
+class WebSocketResponse(StreamResponse):
+
+ _length_check = False
+
+ def __init__(
+ self,
+ *,
+ timeout: float = 10.0,
+ receive_timeout: Optional[float] = None,
+ autoclose: bool = True,
+ autoping: bool = True,
+ heartbeat: Optional[float] = None,
+ protocols: Iterable[str] = (),
+ compress: bool = True,
+ max_msg_size: int = 4 * 1024 * 1024,
+ ) -> None:
+ super().__init__(status=101)
+ self._protocols = protocols
+ self._ws_protocol: Optional[str] = None
+ self._writer: Optional[WebSocketWriter] = None
+ self._reader: Optional[FlowControlDataQueue[WSMessage]] = None
+ self._closed = False
+ self._closing = False
+ self._conn_lost = 0
+ self._close_code: Optional[int] = None
+ self._loop: Optional[asyncio.AbstractEventLoop] = None
+ self._waiting: Optional[asyncio.Future[bool]] = None
+ self._exception: Optional[BaseException] = None
+ self._timeout = timeout
+ self._receive_timeout = receive_timeout
+ self._autoclose = autoclose
+ self._autoping = autoping
+ self._heartbeat = heartbeat
+ self._heartbeat_cb: Optional[asyncio.TimerHandle] = None
+ if heartbeat is not None:
+ self._pong_heartbeat = heartbeat / 2.0
+ self._pong_response_cb: Optional[asyncio.TimerHandle] = None
+ self._compress = compress
+ self._max_msg_size = max_msg_size
+
+ def _cancel_heartbeat(self) -> None:
+ if self._pong_response_cb is not None:
+ self._pong_response_cb.cancel()
+ self._pong_response_cb = None
+
+ if self._heartbeat_cb is not None:
+ self._heartbeat_cb.cancel()
+ self._heartbeat_cb = None
+
+ def _reset_heartbeat(self) -> None:
+ self._cancel_heartbeat()
+
+ if self._heartbeat is not None:
+ assert self._loop is not None
+ self._heartbeat_cb = call_later(
+ self._send_heartbeat, self._heartbeat, self._loop
+ )
+
+ def _send_heartbeat(self) -> None:
+ if self._heartbeat is not None and not self._closed:
+ assert self._loop is not None
+ # fire-and-forget a task is not perfect but maybe ok for
+ # sending ping. Otherwise we need a long-living heartbeat
+ # task in the class.
+ self._loop.create_task(self._writer.ping()) # type: ignore[union-attr]
+
+ if self._pong_response_cb is not None:
+ self._pong_response_cb.cancel()
+ self._pong_response_cb = call_later(
+ self._pong_not_received, self._pong_heartbeat, self._loop
+ )
+
+ def _pong_not_received(self) -> None:
+ if self._req is not None and self._req.transport is not None:
+ self._closed = True
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._exception = asyncio.TimeoutError()
+ self._req.transport.close()
+
+ async def prepare(self, request: BaseRequest) -> AbstractStreamWriter:
+ # make pre-check to don't hide it by do_handshake() exceptions
+ if self._payload_writer is not None:
+ return self._payload_writer
+
+ protocol, writer = self._pre_start(request)
+ payload_writer = await super().prepare(request)
+ assert payload_writer is not None
+ self._post_start(request, protocol, writer)
+ await payload_writer.drain()
+ return payload_writer
+
+ def _handshake(
+ self, request: BaseRequest
+ ) -> Tuple["CIMultiDict[str]", str, bool, bool]:
+ headers = request.headers
+ if "websocket" != headers.get(hdrs.UPGRADE, "").lower().strip():
+ raise HTTPBadRequest(
+ text=(
+ "No WebSocket UPGRADE hdr: {}\n Can "
+ '"Upgrade" only to "WebSocket".'
+ ).format(headers.get(hdrs.UPGRADE))
+ )
+
+ if "upgrade" not in headers.get(hdrs.CONNECTION, "").lower():
+ raise HTTPBadRequest(
+ text="No CONNECTION upgrade hdr: {}".format(
+ headers.get(hdrs.CONNECTION)
+ )
+ )
+
+ # find common sub-protocol between client and server
+ protocol = None
+ if hdrs.SEC_WEBSOCKET_PROTOCOL in headers:
+ req_protocols = [
+ str(proto.strip())
+ for proto in headers[hdrs.SEC_WEBSOCKET_PROTOCOL].split(",")
+ ]
+
+ for proto in req_protocols:
+ if proto in self._protocols:
+ protocol = proto
+ break
+ else:
+ # No overlap found: Return no protocol as per spec
+ ws_logger.warning(
+ "Client protocols %r donā€™t overlap server-known ones %r",
+ req_protocols,
+ self._protocols,
+ )
+
+ # check supported version
+ version = headers.get(hdrs.SEC_WEBSOCKET_VERSION, "")
+ if version not in ("13", "8", "7"):
+ raise HTTPBadRequest(text=f"Unsupported version: {version}")
+
+ # check client handshake for validity
+ key = headers.get(hdrs.SEC_WEBSOCKET_KEY)
+ try:
+ if not key or len(base64.b64decode(key)) != 16:
+ raise HTTPBadRequest(text=f"Handshake error: {key!r}")
+ except binascii.Error:
+ raise HTTPBadRequest(text=f"Handshake error: {key!r}") from None
+
+ accept_val = base64.b64encode(
+ hashlib.sha1(key.encode() + WS_KEY).digest()
+ ).decode()
+ response_headers = CIMultiDict(
+ {
+ hdrs.UPGRADE: "websocket",
+ hdrs.CONNECTION: "upgrade",
+ hdrs.SEC_WEBSOCKET_ACCEPT: accept_val,
+ }
+ )
+
+ notakeover = False
+ compress = 0
+ if self._compress:
+ extensions = headers.get(hdrs.SEC_WEBSOCKET_EXTENSIONS)
+ # Server side always get return with no exception.
+ # If something happened, just drop compress extension
+ compress, notakeover = ws_ext_parse(extensions, isserver=True)
+ if compress:
+ enabledext = ws_ext_gen(
+ compress=compress, isserver=True, server_notakeover=notakeover
+ )
+ response_headers[hdrs.SEC_WEBSOCKET_EXTENSIONS] = enabledext
+
+ if protocol:
+ response_headers[hdrs.SEC_WEBSOCKET_PROTOCOL] = protocol
+ return (
+ response_headers,
+ protocol,
+ compress,
+ notakeover,
+ ) # type: ignore[return-value]
+
+ def _pre_start(self, request: BaseRequest) -> Tuple[str, WebSocketWriter]:
+ self._loop = request._loop
+
+ headers, protocol, compress, notakeover = self._handshake(request)
+
+ self.set_status(101)
+ self.headers.update(headers)
+ self.force_close()
+ self._compress = compress
+ transport = request._protocol.transport
+ assert transport is not None
+ writer = WebSocketWriter(
+ request._protocol, transport, compress=compress, notakeover=notakeover
+ )
+
+ return protocol, writer
+
+ def _post_start(
+ self, request: BaseRequest, protocol: str, writer: WebSocketWriter
+ ) -> None:
+ self._ws_protocol = protocol
+ self._writer = writer
+
+ self._reset_heartbeat()
+
+ loop = self._loop
+ assert loop is not None
+ self._reader = FlowControlDataQueue(request._protocol, 2**16, loop=loop)
+ request.protocol.set_parser(
+ WebSocketReader(self._reader, self._max_msg_size, compress=self._compress)
+ )
+ # disable HTTP keepalive for WebSocket
+ request.protocol.keep_alive(False)
+
+ def can_prepare(self, request: BaseRequest) -> WebSocketReady:
+ if self._writer is not None:
+ raise RuntimeError("Already started")
+ try:
+ _, protocol, _, _ = self._handshake(request)
+ except HTTPException:
+ return WebSocketReady(False, None)
+ else:
+ return WebSocketReady(True, protocol)
+
+ @property
+ def closed(self) -> bool:
+ return self._closed
+
+ @property
+ def close_code(self) -> Optional[int]:
+ return self._close_code
+
+ @property
+ def ws_protocol(self) -> Optional[str]:
+ return self._ws_protocol
+
+ @property
+ def compress(self) -> bool:
+ return self._compress
+
+ def exception(self) -> Optional[BaseException]:
+ return self._exception
+
+ async def ping(self, message: bytes = b"") -> None:
+ if self._writer is None:
+ raise RuntimeError("Call .prepare() first")
+ await self._writer.ping(message)
+
+ async def pong(self, message: bytes = b"") -> None:
+ # unsolicited pong
+ if self._writer is None:
+ raise RuntimeError("Call .prepare() first")
+ await self._writer.pong(message)
+
+ async def send_str(self, data: str, compress: Optional[bool] = None) -> None:
+ if self._writer is None:
+ raise RuntimeError("Call .prepare() first")
+ if not isinstance(data, str):
+ raise TypeError("data argument must be str (%r)" % type(data))
+ await self._writer.send(data, binary=False, compress=compress)
+
+ async def send_bytes(self, data: bytes, compress: Optional[bool] = None) -> None:
+ if self._writer is None:
+ raise RuntimeError("Call .prepare() first")
+ if not isinstance(data, (bytes, bytearray, memoryview)):
+ raise TypeError("data argument must be byte-ish (%r)" % type(data))
+ await self._writer.send(data, binary=True, compress=compress)
+
+ async def send_json(
+ self,
+ data: Any,
+ compress: Optional[bool] = None,
+ *,
+ dumps: JSONEncoder = json.dumps,
+ ) -> None:
+ await self.send_str(dumps(data), compress=compress)
+
+ async def write_eof(self) -> None: # type: ignore[override]
+ if self._eof_sent:
+ return
+ if self._payload_writer is None:
+ raise RuntimeError("Response has not been started")
+
+ await self.close()
+ self._eof_sent = True
+
+ async def close(self, *, code: int = WSCloseCode.OK, message: bytes = b"") -> bool:
+ if self._writer is None:
+ raise RuntimeError("Call .prepare() first")
+
+ self._cancel_heartbeat()
+ reader = self._reader
+ assert reader is not None
+
+ # we need to break `receive()` cycle first,
+ # `close()` may be called from different task
+ if self._waiting is not None and not self._closed:
+ reader.feed_data(WS_CLOSING_MESSAGE, 0)
+ await self._waiting
+
+ if not self._closed:
+ self._closed = True
+ try:
+ await self._writer.close(code, message)
+ writer = self._payload_writer
+ assert writer is not None
+ await writer.drain()
+ except (asyncio.CancelledError, asyncio.TimeoutError):
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ raise
+ except Exception as exc:
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._exception = exc
+ return True
+
+ if self._closing:
+ return True
+
+ reader = self._reader
+ assert reader is not None
+ try:
+ async with async_timeout.timeout(self._timeout):
+ msg = await reader.read()
+ except asyncio.CancelledError:
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ raise
+ except Exception as exc:
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._exception = exc
+ return True
+
+ if msg.type == WSMsgType.CLOSE:
+ self._close_code = msg.data
+ return True
+
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ self._exception = asyncio.TimeoutError()
+ return True
+ else:
+ return False
+
+ async def receive(self, timeout: Optional[float] = None) -> WSMessage:
+ if self._reader is None:
+ raise RuntimeError("Call .prepare() first")
+
+ loop = self._loop
+ assert loop is not None
+ while True:
+ if self._waiting is not None:
+ raise RuntimeError("Concurrent call to receive() is not allowed")
+
+ if self._closed:
+ self._conn_lost += 1
+ if self._conn_lost >= THRESHOLD_CONNLOST_ACCESS:
+ raise RuntimeError("WebSocket connection is closed.")
+ return WS_CLOSED_MESSAGE
+ elif self._closing:
+ return WS_CLOSING_MESSAGE
+
+ try:
+ self._waiting = loop.create_future()
+ try:
+ async with async_timeout.timeout(timeout or self._receive_timeout):
+ msg = await self._reader.read()
+ self._reset_heartbeat()
+ finally:
+ waiter = self._waiting
+ set_result(waiter, True)
+ self._waiting = None
+ except (asyncio.CancelledError, asyncio.TimeoutError):
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ raise
+ except EofStream:
+ self._close_code = WSCloseCode.OK
+ await self.close()
+ return WSMessage(WSMsgType.CLOSED, None, None)
+ except WebSocketError as exc:
+ self._close_code = exc.code
+ await self.close(code=exc.code)
+ return WSMessage(WSMsgType.ERROR, exc, None)
+ except Exception as exc:
+ self._exception = exc
+ self._closing = True
+ self._close_code = WSCloseCode.ABNORMAL_CLOSURE
+ await self.close()
+ return WSMessage(WSMsgType.ERROR, exc, None)
+
+ if msg.type == WSMsgType.CLOSE:
+ self._closing = True
+ self._close_code = msg.data
+ if not self._closed and self._autoclose:
+ await self.close()
+ elif msg.type == WSMsgType.CLOSING:
+ self._closing = True
+ elif msg.type == WSMsgType.PING and self._autoping:
+ await self.pong(msg.data)
+ continue
+ elif msg.type == WSMsgType.PONG and self._autoping:
+ continue
+
+ return msg
+
+ async def receive_str(self, *, timeout: Optional[float] = None) -> str:
+ msg = await self.receive(timeout)
+ if msg.type != WSMsgType.TEXT:
+ raise TypeError(
+ "Received message {}:{!r} is not WSMsgType.TEXT".format(
+ msg.type, msg.data
+ )
+ )
+ return cast(str, msg.data)
+
+ async def receive_bytes(self, *, timeout: Optional[float] = None) -> bytes:
+ msg = await self.receive(timeout)
+ if msg.type != WSMsgType.BINARY:
+ raise TypeError(f"Received message {msg.type}:{msg.data!r} is not bytes")
+ return cast(bytes, msg.data)
+
+ async def receive_json(
+ self, *, loads: JSONDecoder = json.loads, timeout: Optional[float] = None
+ ) -> Any:
+ data = await self.receive_str(timeout=timeout)
+ return loads(data)
+
+ async def write(self, data: bytes) -> None:
+ raise RuntimeError("Cannot call .write() for websocket")
+
+ def __aiter__(self) -> "WebSocketResponse":
+ return self
+
+ async def __anext__(self) -> WSMessage:
+ msg = await self.receive()
+ if msg.type in (WSMsgType.CLOSE, WSMsgType.CLOSING, WSMsgType.CLOSED):
+ raise StopAsyncIteration
+ return msg
+
+ def _cancel(self, exc: BaseException) -> None:
+ if self._reader is not None:
+ self._reader.set_exception(exc)
diff --git a/third_party/python/aiohttp/aiohttp/worker.py b/third_party/python/aiohttp/aiohttp/worker.py
new file mode 100644
index 0000000000..f1302899f2
--- /dev/null
+++ b/third_party/python/aiohttp/aiohttp/worker.py
@@ -0,0 +1,269 @@
+"""Async gunicorn worker for aiohttp.web"""
+
+import asyncio
+import os
+import re
+import signal
+import sys
+from types import FrameType
+from typing import Any, Awaitable, Callable, Optional, Union # noqa
+
+from gunicorn.config import AccessLogFormat as GunicornAccessLogFormat
+from gunicorn.workers import base
+
+from aiohttp import web
+
+from .helpers import set_result
+from .web_app import Application
+from .web_log import AccessLogger
+
+try:
+ import ssl
+
+ SSLContext = ssl.SSLContext
+except ImportError: # pragma: no cover
+ ssl = None # type: ignore[assignment]
+ SSLContext = object # type: ignore[misc,assignment]
+
+
+__all__ = ("GunicornWebWorker", "GunicornUVLoopWebWorker", "GunicornTokioWebWorker")
+
+
+class GunicornWebWorker(base.Worker): # type: ignore[misc,no-any-unimported]
+
+ DEFAULT_AIOHTTP_LOG_FORMAT = AccessLogger.LOG_FORMAT
+ DEFAULT_GUNICORN_LOG_FORMAT = GunicornAccessLogFormat.default
+
+ def __init__(self, *args: Any, **kw: Any) -> None: # pragma: no cover
+ super().__init__(*args, **kw)
+
+ self._task: Optional[asyncio.Task[None]] = None
+ self.exit_code = 0
+ self._notify_waiter: Optional[asyncio.Future[bool]] = None
+
+ def init_process(self) -> None:
+ # create new event_loop after fork
+ asyncio.get_event_loop().close()
+
+ self.loop = asyncio.new_event_loop()
+ asyncio.set_event_loop(self.loop)
+
+ super().init_process()
+
+ def run(self) -> None:
+ self._task = self.loop.create_task(self._run())
+
+ try: # ignore all finalization problems
+ self.loop.run_until_complete(self._task)
+ except Exception:
+ self.log.exception("Exception in gunicorn worker")
+ self.loop.run_until_complete(self.loop.shutdown_asyncgens())
+ self.loop.close()
+
+ sys.exit(self.exit_code)
+
+ async def _run(self) -> None:
+ runner = None
+ if isinstance(self.wsgi, Application):
+ app = self.wsgi
+ elif asyncio.iscoroutinefunction(self.wsgi):
+ wsgi = await self.wsgi()
+ if isinstance(wsgi, web.AppRunner):
+ runner = wsgi
+ app = runner.app
+ else:
+ app = wsgi
+ else:
+ raise RuntimeError(
+ "wsgi app should be either Application or "
+ "async function returning Application, got {}".format(self.wsgi)
+ )
+
+ if runner is None:
+ access_log = self.log.access_log if self.cfg.accesslog else None
+ runner = web.AppRunner(
+ app,
+ logger=self.log,
+ keepalive_timeout=self.cfg.keepalive,
+ access_log=access_log,
+ access_log_format=self._get_valid_log_format(
+ self.cfg.access_log_format
+ ),
+ )
+ await runner.setup()
+
+ ctx = self._create_ssl_context(self.cfg) if self.cfg.is_ssl else None
+
+ runner = runner
+ assert runner is not None
+ server = runner.server
+ assert server is not None
+ for sock in self.sockets:
+ site = web.SockSite(
+ runner,
+ sock,
+ ssl_context=ctx,
+ shutdown_timeout=self.cfg.graceful_timeout / 100 * 95,
+ )
+ await site.start()
+
+ # If our parent changed then we shut down.
+ pid = os.getpid()
+ try:
+ while self.alive: # type: ignore[has-type]
+ self.notify()
+
+ cnt = server.requests_count
+ if self.cfg.max_requests and cnt > self.cfg.max_requests:
+ self.alive = False
+ self.log.info("Max requests, shutting down: %s", self)
+
+ elif pid == os.getpid() and self.ppid != os.getppid():
+ self.alive = False
+ self.log.info("Parent changed, shutting down: %s", self)
+ else:
+ await self._wait_next_notify()
+ except BaseException:
+ pass
+
+ await runner.cleanup()
+
+ def _wait_next_notify(self) -> "asyncio.Future[bool]":
+ self._notify_waiter_done()
+
+ loop = self.loop
+ assert loop is not None
+ self._notify_waiter = waiter = loop.create_future()
+ self.loop.call_later(1.0, self._notify_waiter_done, waiter)
+
+ return waiter
+
+ def _notify_waiter_done(
+ self, waiter: Optional["asyncio.Future[bool]"] = None
+ ) -> None:
+ if waiter is None:
+ waiter = self._notify_waiter
+ if waiter is not None:
+ set_result(waiter, True)
+
+ if waiter is self._notify_waiter:
+ self._notify_waiter = None
+
+ def init_signals(self) -> None:
+ # Set up signals through the event loop API.
+
+ self.loop.add_signal_handler(
+ signal.SIGQUIT, self.handle_quit, signal.SIGQUIT, None
+ )
+
+ self.loop.add_signal_handler(
+ signal.SIGTERM, self.handle_exit, signal.SIGTERM, None
+ )
+
+ self.loop.add_signal_handler(
+ signal.SIGINT, self.handle_quit, signal.SIGINT, None
+ )
+
+ self.loop.add_signal_handler(
+ signal.SIGWINCH, self.handle_winch, signal.SIGWINCH, None
+ )
+
+ self.loop.add_signal_handler(
+ signal.SIGUSR1, self.handle_usr1, signal.SIGUSR1, None
+ )
+
+ self.loop.add_signal_handler(
+ signal.SIGABRT, self.handle_abort, signal.SIGABRT, None
+ )
+
+ # Don't let SIGTERM and SIGUSR1 disturb active requests
+ # by interrupting system calls
+ signal.siginterrupt(signal.SIGTERM, False)
+ signal.siginterrupt(signal.SIGUSR1, False)
+ # Reset signals so Gunicorn doesn't swallow subprocess return codes
+ # See: https://github.com/aio-libs/aiohttp/issues/6130
+ if sys.version_info < (3, 8):
+ # Starting from Python 3.8,
+ # the default child watcher is ThreadedChildWatcher.
+ # The watcher doesn't depend on SIGCHLD signal,
+ # there is no need to reset it.
+ signal.signal(signal.SIGCHLD, signal.SIG_DFL)
+
+ def handle_quit(self, sig: int, frame: FrameType) -> None:
+ self.alive = False
+
+ # worker_int callback
+ self.cfg.worker_int(self)
+
+ # wakeup closing process
+ self._notify_waiter_done()
+
+ def handle_abort(self, sig: int, frame: FrameType) -> None:
+ self.alive = False
+ self.exit_code = 1
+ self.cfg.worker_abort(self)
+ sys.exit(1)
+
+ @staticmethod
+ def _create_ssl_context(cfg: Any) -> "SSLContext":
+ """Creates SSLContext instance for usage in asyncio.create_server.
+
+ See ssl.SSLSocket.__init__ for more details.
+ """
+ if ssl is None: # pragma: no cover
+ raise RuntimeError("SSL is not supported.")
+
+ ctx = ssl.SSLContext(cfg.ssl_version)
+ ctx.load_cert_chain(cfg.certfile, cfg.keyfile)
+ ctx.verify_mode = cfg.cert_reqs
+ if cfg.ca_certs:
+ ctx.load_verify_locations(cfg.ca_certs)
+ if cfg.ciphers:
+ ctx.set_ciphers(cfg.ciphers)
+ return ctx
+
+ def _get_valid_log_format(self, source_format: str) -> str:
+ if source_format == self.DEFAULT_GUNICORN_LOG_FORMAT:
+ return self.DEFAULT_AIOHTTP_LOG_FORMAT
+ elif re.search(r"%\([^\)]+\)", source_format):
+ raise ValueError(
+ "Gunicorn's style options in form of `%(name)s` are not "
+ "supported for the log formatting. Please use aiohttp's "
+ "format specification to configure access log formatting: "
+ "http://docs.aiohttp.org/en/stable/logging.html"
+ "#format-specification"
+ )
+ else:
+ return source_format
+
+
+class GunicornUVLoopWebWorker(GunicornWebWorker):
+ def init_process(self) -> None:
+ import uvloop
+
+ # Close any existing event loop before setting a
+ # new policy.
+ asyncio.get_event_loop().close()
+
+ # Setup uvloop policy, so that every
+ # asyncio.get_event_loop() will create an instance
+ # of uvloop event loop.
+ asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
+
+ super().init_process()
+
+
+class GunicornTokioWebWorker(GunicornWebWorker):
+ def init_process(self) -> None: # pragma: no cover
+ import tokio
+
+ # Close any existing event loop before setting a
+ # new policy.
+ asyncio.get_event_loop().close()
+
+ # Setup tokio policy, so that every
+ # asyncio.get_event_loop() will create an instance
+ # of tokio event loop.
+ asyncio.set_event_loop_policy(tokio.EventLoopPolicy())
+
+ super().init_process()
diff --git a/third_party/python/aiohttp/examples/__init__.py b/third_party/python/aiohttp/examples/__init__.py
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/third_party/python/aiohttp/examples/__init__.py
diff --git a/third_party/python/aiohttp/examples/background_tasks.py b/third_party/python/aiohttp/examples/background_tasks.py
new file mode 100755
index 0000000000..8c2bb9ee69
--- /dev/null
+++ b/third_party/python/aiohttp/examples/background_tasks.py
@@ -0,0 +1,66 @@
+#!/usr/bin/env python3
+"""Example of aiohttp.web.Application.on_startup signal handler"""
+import asyncio
+
+import aioredis
+
+from aiohttp import web
+
+
+async def websocket_handler(request):
+ ws = web.WebSocketResponse()
+ await ws.prepare(request)
+ request.app["websockets"].append(ws)
+ try:
+ async for msg in ws:
+ print(msg)
+ await asyncio.sleep(1)
+ finally:
+ request.app["websockets"].remove(ws)
+ return ws
+
+
+async def on_shutdown(app):
+ for ws in app["websockets"]:
+ await ws.close(code=999, message="Server shutdown")
+
+
+async def listen_to_redis(app):
+ try:
+ sub = await aioredis.create_redis(("localhost", 6379), loop=app.loop)
+ ch, *_ = await sub.subscribe("news")
+ async for msg in ch.iter(encoding="utf-8"):
+ # Forward message to all connected websockets:
+ for ws in app["websockets"]:
+ await ws.send_str(f"{ch.name}: {msg}")
+ print(f"message in {ch.name}: {msg}")
+ except asyncio.CancelledError:
+ pass
+ finally:
+ print("Cancel Redis listener: close connection...")
+ await sub.unsubscribe(ch.name)
+ await sub.quit()
+ print("Redis connection closed.")
+
+
+async def start_background_tasks(app: web.Application) -> None:
+ app["redis_listener"] = asyncio.create_task(listen_to_redis(app))
+
+
+async def cleanup_background_tasks(app):
+ print("cleanup background tasks...")
+ app["redis_listener"].cancel()
+ await app["redis_listener"]
+
+
+def init():
+ app = web.Application()
+ app["websockets"] = []
+ app.router.add_get("/news", websocket_handler)
+ app.on_startup.append(start_background_tasks)
+ app.on_cleanup.append(cleanup_background_tasks)
+ app.on_shutdown.append(on_shutdown)
+ return app
+
+
+web.run_app(init())
diff --git a/third_party/python/aiohttp/examples/cli_app.py b/third_party/python/aiohttp/examples/cli_app.py
new file mode 100755
index 0000000000..9fbd3b7604
--- /dev/null
+++ b/third_party/python/aiohttp/examples/cli_app.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python3
+"""
+Example of serving an Application using the `aiohttp.web` CLI.
+
+Serve this app using::
+
+ $ python -m aiohttp.web -H localhost -P 8080 --repeat 10 cli_app:init \
+ > "Hello World"
+
+Here ``--repeat`` & ``"Hello World"`` are application specific command-line
+arguments. `aiohttp.web` only parses & consumes the command-line arguments it
+needs (i.e. ``-H``, ``-P`` & ``entry-func``) and passes on any additional
+arguments to the `cli_app:init` function for processing.
+"""
+
+from argparse import ArgumentParser
+
+from aiohttp import web
+
+
+def display_message(req):
+ args = req.app["args"]
+ text = "\n".join([args.message] * args.repeat)
+ return web.Response(text=text)
+
+
+def init(argv):
+ arg_parser = ArgumentParser(
+ prog="aiohttp.web ...", description="Application CLI", add_help=False
+ )
+
+ # Positional argument
+ arg_parser.add_argument("message", help="message to print")
+
+ # Optional argument
+ arg_parser.add_argument(
+ "--repeat", help="number of times to repeat message", type=int, default="1"
+ )
+
+ # Avoid conflict with -h from `aiohttp.web` CLI parser
+ arg_parser.add_argument(
+ "--app-help", help="show this message and exit", action="help"
+ )
+
+ args = arg_parser.parse_args(argv)
+
+ app = web.Application()
+ app["args"] = args
+ app.router.add_get("/", display_message)
+
+ return app
diff --git a/third_party/python/aiohttp/examples/client_auth.py b/third_party/python/aiohttp/examples/client_auth.py
new file mode 100755
index 0000000000..6513de20e5
--- /dev/null
+++ b/third_party/python/aiohttp/examples/client_auth.py
@@ -0,0 +1,23 @@
+#!/usr/bin/env python3
+import asyncio
+
+import aiohttp
+
+
+async def fetch(session):
+ print("Query http://httpbin.org/basic-auth/andrew/password")
+ async with session.get("http://httpbin.org/basic-auth/andrew/password") as resp:
+ print(resp.status)
+ body = await resp.text()
+ print(body)
+
+
+async def go(loop):
+ async with aiohttp.ClientSession(
+ auth=aiohttp.BasicAuth("andrew", "password"), loop=loop
+ ) as session:
+ await fetch(session)
+
+
+loop = asyncio.get_event_loop()
+loop.run_until_complete(go(loop))
diff --git a/third_party/python/aiohttp/examples/client_json.py b/third_party/python/aiohttp/examples/client_json.py
new file mode 100755
index 0000000000..f57115640c
--- /dev/null
+++ b/third_party/python/aiohttp/examples/client_json.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python3
+import asyncio
+
+import aiohttp
+
+
+async def fetch(session: aiohttp.ClientSession) -> None:
+ print("Query http://httpbin.org/get")
+ async with session.get("http://httpbin.org/get") as resp:
+ print(resp.status)
+ data = await resp.json()
+ print(data)
+
+
+async def go(loop):
+ async with aiohttp.ClientSession(loop=loop) as session:
+ await fetch(session)
+
+
+loop = asyncio.get_event_loop()
+loop.run_until_complete(go(loop))
+loop.close()
diff --git a/third_party/python/aiohttp/examples/client_ws.py b/third_party/python/aiohttp/examples/client_ws.py
new file mode 100755
index 0000000000..38d8300362
--- /dev/null
+++ b/third_party/python/aiohttp/examples/client_ws.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python3
+"""websocket cmd client for wssrv.py example."""
+import argparse
+import asyncio
+import signal
+import sys
+
+import aiohttp
+
+
+async def start_client(loop, url):
+ name = input("Please enter your name: ")
+
+ # input reader
+ def stdin_callback():
+ line = sys.stdin.buffer.readline().decode("utf-8")
+ if not line:
+ loop.stop()
+ else:
+ ws.send_str(name + ": " + line)
+
+ loop.add_reader(sys.stdin.fileno(), stdin_callback)
+
+ async def dispatch():
+ while True:
+ msg = await ws.receive()
+
+ if msg.type == aiohttp.WSMsgType.TEXT:
+ print("Text: ", msg.data.strip())
+ elif msg.type == aiohttp.WSMsgType.BINARY:
+ print("Binary: ", msg.data)
+ elif msg.type == aiohttp.WSMsgType.PING:
+ ws.pong()
+ elif msg.type == aiohttp.WSMsgType.PONG:
+ print("Pong received")
+ else:
+ if msg.type == aiohttp.WSMsgType.CLOSE:
+ await ws.close()
+ elif msg.type == aiohttp.WSMsgType.ERROR:
+ print("Error during receive %s" % ws.exception())
+ elif msg.type == aiohttp.WSMsgType.CLOSED:
+ pass
+
+ break
+
+ # send request
+ async with aiohttp.ClientSession() as session:
+ async with session.ws_connect(url, autoclose=False, autoping=False) as ws:
+ await dispatch()
+
+
+ARGS = argparse.ArgumentParser(
+ description="websocket console client for wssrv.py example."
+)
+ARGS.add_argument(
+ "--host", action="store", dest="host", default="127.0.0.1", help="Host name"
+)
+ARGS.add_argument(
+ "--port", action="store", dest="port", default=8080, type=int, help="Port number"
+)
+
+if __name__ == "__main__":
+ args = ARGS.parse_args()
+ if ":" in args.host:
+ args.host, port = args.host.split(":", 1)
+ args.port = int(port)
+
+ url = f"http://{args.host}:{args.port}"
+
+ loop = asyncio.get_event_loop()
+
+ loop.add_signal_handler(signal.SIGINT, loop.stop)
+ loop.create_task(start_client(loop, url))
+ loop.run_forever()
diff --git a/third_party/python/aiohttp/examples/curl.py b/third_party/python/aiohttp/examples/curl.py
new file mode 100755
index 0000000000..a39639af34
--- /dev/null
+++ b/third_party/python/aiohttp/examples/curl.py
@@ -0,0 +1,35 @@
+#!/usr/bin/env python3
+
+import argparse
+import asyncio
+
+import aiohttp
+
+
+async def curl(url):
+ async with aiohttp.ClientSession() as session:
+ async with session.request("GET", url) as response:
+ print(repr(response))
+ chunk = await response.content.read()
+ print("Downloaded: %s" % len(chunk))
+
+
+if __name__ == "__main__":
+ ARGS = argparse.ArgumentParser(description="GET url example")
+ ARGS.add_argument("url", nargs=1, metavar="URL", help="URL to download")
+ ARGS.add_argument(
+ "--iocp",
+ default=False,
+ action="store_true",
+ help="Use ProactorEventLoop on Windows",
+ )
+ options = ARGS.parse_args()
+
+ if options.iocp:
+ from asyncio import events, windows_events
+
+ el = windows_events.ProactorEventLoop()
+ events.set_event_loop(el)
+
+ loop = asyncio.get_event_loop()
+ loop.run_until_complete(curl(options.url[0]))
diff --git a/third_party/python/aiohttp/examples/fake_server.py b/third_party/python/aiohttp/examples/fake_server.py
new file mode 100755
index 0000000000..0006f5f002
--- /dev/null
+++ b/third_party/python/aiohttp/examples/fake_server.py
@@ -0,0 +1,119 @@
+#!/usr/bin/env python3
+import asyncio
+import pathlib
+import socket
+import ssl
+
+import aiohttp
+from aiohttp import web
+from aiohttp.abc import AbstractResolver
+from aiohttp.resolver import DefaultResolver
+from aiohttp.test_utils import unused_port
+
+
+class FakeResolver(AbstractResolver):
+ _LOCAL_HOST = {0: "127.0.0.1", socket.AF_INET: "127.0.0.1", socket.AF_INET6: "::1"}
+
+ def __init__(self, fakes, *, loop):
+ """fakes -- dns -> port dict"""
+ self._fakes = fakes
+ self._resolver = DefaultResolver(loop=loop)
+
+ async def resolve(self, host, port=0, family=socket.AF_INET):
+ fake_port = self._fakes.get(host)
+ if fake_port is not None:
+ return [
+ {
+ "hostname": host,
+ "host": self._LOCAL_HOST[family],
+ "port": fake_port,
+ "family": family,
+ "proto": 0,
+ "flags": socket.AI_NUMERICHOST,
+ }
+ ]
+ else:
+ return await self._resolver.resolve(host, port, family)
+
+ async def close(self) -> None:
+ self._resolver.close()
+
+
+class FakeFacebook:
+ def __init__(self, *, loop):
+ self.loop = loop
+ self.app = web.Application(loop=loop)
+ self.app.router.add_routes(
+ [
+ web.get("/v2.7/me", self.on_me),
+ web.get("/v2.7/me/friends", self.on_my_friends),
+ ]
+ )
+ self.runner = web.AppRunner(self.app)
+ here = pathlib.Path(__file__)
+ ssl_cert = here.parent / "server.crt"
+ ssl_key = here.parent / "server.key"
+ self.ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
+ self.ssl_context.load_cert_chain(str(ssl_cert), str(ssl_key))
+
+ async def start(self):
+ port = unused_port()
+ self.runner = web.AppRunner(self.app)
+ await self.runner.setup()
+ site = web.TCPSite(self.runner, "127.0.0.1", port, ssl_context=self.ssl_context)
+ await site.start()
+ return {"graph.facebook.com": port}
+
+ async def stop(self):
+ await self.runner.cleanup()
+
+ async def on_me(self, request):
+ return web.json_response({"name": "John Doe", "id": "12345678901234567"})
+
+ async def on_my_friends(self, request):
+ return web.json_response(
+ {
+ "data": [
+ {"name": "Bill Doe", "id": "233242342342"},
+ {"name": "Mary Doe", "id": "2342342343222"},
+ {"name": "Alex Smith", "id": "234234234344"},
+ ],
+ "paging": {
+ "cursors": {
+ "before": "QVFIUjRtc2c5NEl0ajN",
+ "after": "QVFIUlpFQWM0TmVuaDRad0dt",
+ },
+ "next": (
+ "https://graph.facebook.com/v2.7/12345678901234567/"
+ "friends?access_token=EAACEdEose0cB"
+ ),
+ },
+ "summary": {"total_count": 3},
+ }
+ )
+
+
+async def main(loop):
+ token = "ER34gsSGGS34XCBKd7u"
+
+ fake_facebook = FakeFacebook(loop=loop)
+ info = await fake_facebook.start()
+ resolver = FakeResolver(info, loop=loop)
+ connector = aiohttp.TCPConnector(loop=loop, resolver=resolver, verify_ssl=False)
+
+ async with aiohttp.ClientSession(connector=connector, loop=loop) as session:
+ async with session.get(
+ "https://graph.facebook.com/v2.7/me", params={"access_token": token}
+ ) as resp:
+ print(await resp.json())
+
+ async with session.get(
+ "https://graph.facebook.com/v2.7/me/friends", params={"access_token": token}
+ ) as resp:
+ print(await resp.json())
+
+ await fake_facebook.stop()
+
+
+loop = asyncio.get_event_loop()
+loop.run_until_complete(main(loop))
diff --git a/third_party/python/aiohttp/examples/lowlevel_srv.py b/third_party/python/aiohttp/examples/lowlevel_srv.py
new file mode 100644
index 0000000000..5a003f40f4
--- /dev/null
+++ b/third_party/python/aiohttp/examples/lowlevel_srv.py
@@ -0,0 +1,26 @@
+import asyncio
+
+from aiohttp import web
+
+
+async def handler(request):
+ return web.Response(text="OK")
+
+
+async def main(loop):
+ server = web.Server(handler)
+ await loop.create_server(server, "127.0.0.1", 8080)
+ print("======= Serving on http://127.0.0.1:8080/ ======")
+
+ # pause here for very long time by serving HTTP requests and
+ # waiting for keyboard interruption
+ await asyncio.sleep(100 * 3600)
+
+
+loop = asyncio.get_event_loop()
+
+try:
+ loop.run_until_complete(main(loop))
+except KeyboardInterrupt:
+ pass
+loop.close()
diff --git a/third_party/python/aiohttp/examples/server.crt b/third_party/python/aiohttp/examples/server.crt
new file mode 100644
index 0000000000..708971a376
--- /dev/null
+++ b/third_party/python/aiohttp/examples/server.crt
@@ -0,0 +1,19 @@
+-----BEGIN CERTIFICATE-----
+MIIDADCCAegCCQCgevpPMuTTLzANBgkqhkiG9w0BAQsFADBCMQswCQYDVQQGEwJV
+QTEQMA4GA1UECAwHVWtyYWluZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQ
+dHkgTHRkMB4XDTE2MDgwNzIzMTMwOFoXDTI2MDgwNTIzMTMwOFowQjELMAkGA1UE
+BhMCVUExEDAOBgNVBAgMB1VrcmFpbmUxITAfBgNVBAoMGEludGVybmV0IFdpZGdp
+dHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOUgkn3j
+X/sdg6GGueGDHCM+snIUVY3fM6D4jXjyBhnT3TqKG1lJwCGYR11AD+2SJYppU+w4
+QaF6YZwMeZBKy+mVQ9+CrVYyKQE7j9H8XgNEHV9BQzoragT8lia8eC5aOQzUeX8A
+xCSSbsnyT/X+S1IKdd0txLOeZOD6pWwJoc3dpDELglk2b1tzhyN2GjQv3aRHj55P
+x7127MeZyRXwODFpXrpbnwih4OqkA4EYtmqFbZttGEzMhd4Y5mkbyuRbGM+IE99o
+QJMvnIkjAfUo0aKnDrcAIkWCkwLIci9TIG6u3R1P2Tn+HYVntzQZ4BnxanbFNQ5S
+9ARd3529EmO3BzUCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEAXyiw1+YUnTEDI3C/
+vq1Vn9pnwZALVQPiPlTqEGkl/nbq0suMmeZZG7pwrOJp3wr+sGwRAv9sPTro6srf
+Vj12wTo4LrTRKEDuS+AUJl0Mut7cPGIUKo+MGeZmmnDjMqcjljN3AO47ef4eWYo5
+XGe4r4NDABEk5auOD/vQW5IiIMdmWsaMJ+0mZNpAV2NhAD/6ia28VvSL/yuaNqDW
+TYTUYHWLH08H6M6qrQ7FdoIDyYR5siqBukQzeqlnuq45bQ3ViYttNIkzZN4jbWJV
+/MFYLuJQ/fNoalDIC+ec0EIa9NbrfpoocJ8h6HlmWOqkES4QpBSOrkVid64Cdy3P
+JgiEWg==
+-----END CERTIFICATE-----
diff --git a/third_party/python/aiohttp/examples/server.csr b/third_party/python/aiohttp/examples/server.csr
new file mode 100644
index 0000000000..1df3087b91
--- /dev/null
+++ b/third_party/python/aiohttp/examples/server.csr
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIChzCCAW8CAQAwQjELMAkGA1UEBhMCVUExEDAOBgNVBAgMB1VrcmFpbmUxITAf
+BgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDCCASIwDQYJKoZIhvcNAQEB
+BQADggEPADCCAQoCggEBAOUgkn3jX/sdg6GGueGDHCM+snIUVY3fM6D4jXjyBhnT
+3TqKG1lJwCGYR11AD+2SJYppU+w4QaF6YZwMeZBKy+mVQ9+CrVYyKQE7j9H8XgNE
+HV9BQzoragT8lia8eC5aOQzUeX8AxCSSbsnyT/X+S1IKdd0txLOeZOD6pWwJoc3d
+pDELglk2b1tzhyN2GjQv3aRHj55Px7127MeZyRXwODFpXrpbnwih4OqkA4EYtmqF
+bZttGEzMhd4Y5mkbyuRbGM+IE99oQJMvnIkjAfUo0aKnDrcAIkWCkwLIci9TIG6u
+3R1P2Tn+HYVntzQZ4BnxanbFNQ5S9ARd3529EmO3BzUCAwEAAaAAMA0GCSqGSIb3
+DQEBCwUAA4IBAQDO/PSd29KgisTdGXhntg7yBEhBAjsDW7uQCrdrPSZtFyN6wUHy
+/1yrrWe56ZuW8jpuP5tG0eTZ+0bT2RXIRot8a2Cc3eBhpoe8M3d84yXjKAoHutGE
+5IK+TViQdvT3pT3a7pTmjlf8Ojq9tx+U2ckiz8Ccnjd9yM47M9NgMhrS1aBpVZSt
+gOD+zzrqMML4xks9id94H7bi9Tgs3AbEJIyDpBpoK6i4OvK7KTidCngCg80qmdTy
+bcScLapoy1Ped2BKKuxWdOOlP+mDJatc/pcfBLE13AncQjJgMerS9M5RWCBjmRow
+A+aB6fBEU8bOTrqCryfBeTiV6xzyDDcIXtc6
+-----END CERTIFICATE REQUEST-----
diff --git a/third_party/python/aiohttp/examples/server.key b/third_party/python/aiohttp/examples/server.key
new file mode 100644
index 0000000000..37dae99e67
--- /dev/null
+++ b/third_party/python/aiohttp/examples/server.key
@@ -0,0 +1,27 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIEowIBAAKCAQEA5SCSfeNf+x2DoYa54YMcIz6ychRVjd8zoPiNePIGGdPdOoob
+WUnAIZhHXUAP7ZIlimlT7DhBoXphnAx5kErL6ZVD34KtVjIpATuP0fxeA0QdX0FD
+OitqBPyWJrx4Llo5DNR5fwDEJJJuyfJP9f5LUgp13S3Es55k4PqlbAmhzd2kMQuC
+WTZvW3OHI3YaNC/dpEePnk/HvXbsx5nJFfA4MWleulufCKHg6qQDgRi2aoVtm20Y
+TMyF3hjmaRvK5FsYz4gT32hAky+ciSMB9SjRoqcOtwAiRYKTAshyL1Mgbq7dHU/Z
+Of4dhWe3NBngGfFqdsU1DlL0BF3fnb0SY7cHNQIDAQABAoIBAG9BJ6B03VADfrzZ
+vDwh+3Gpqd/2u6wNqvYIejk123yDATLBiJIMW3x0goJm7tT+V7gjeJqEnmmYEPlC
+nWxQxT6AOdq3iw8FgB+XGjhuAAA5/MEZ4VjHZ81QEGBytzBaosT2DqB6cMMJTz5D
+qEvb1Brb9WsWJCLLUFRloBkbfDOG9lMvt34ixYTTmqjsVj5WByD5BhzKH51OJ72L
+00IYpvrsEOtSev1hNV4199CHPYE90T/YQVooRBiHtTcfN+/KNVJu6Rf/zcaJ3WMS
+1l3MBI8HwMimjKKkbddpoMHyFMtSNmS9Yq+4a9w7XZo1F5rt88hYSCtAF8HRAarX
+0VBCJmkCgYEA9HenBBnmfDoN857femzoTHdWQQrZQ4YPAKHvKPlcgudizE5tQbs0
+iTpwm+IsecgJS2Rio7zY+P7A5nKFz3N5c0IX3smYo0J2PoakkLAm25KMxFZYBuz4
+MFWVdfByAU7d28BdNfyOVbA2kU2eal9lJ0yPLpMLbH8+bbvw5uBS808CgYEA7++p
+ftwib3DvKWMpl6G5eA1C2xprdbE0jm2fSr3LYp/vZ4QN2V6kK2YIlyUqQvhYCnxX
+oIP3v2MWDRHKKwJtBWR4+t23PaDaSXS2Ifm0qhRxwSm/oqpAJQXbR7VzxXp4/4FP
+1SgkLe51bubc4h+cDngqBLcplCanvj52CqhqzDsCgYAEIhG8zANNjl22BLWaiETV
+Jh9bMifCMH4IcLRuaOjbfbX55kmKlvOobkiBGi3OUUd28teIFSVF8GiqfL0uaLFg
+9XkZ1yaxe+or3HLjz1aY171xhFQwqcj4aDoCqHIE+6Rclr/8raxqXnRNuJY5DivT
+okO5cdr7lpsjl83W2WwNmQKBgCPXi1xWChbXqgJmu8nY8NnMMVaFpdPY+t7j5U3G
++GDtP1gZU/BKwP9yqInblWqXqp82X+isjg/a/2pIZAj0vdB2Z9Qh1sOwCau7cZG1
+uZVGpI+UavojsJ1XOKCHrJmtZ/HTIVfYPT9XRdehSRHGYwuOS8iUi/ODqr8ymXOS
+IRINAoGBAMEmhTihgFz6Y8ezRK3QTubguehHZG1zIvtgVhOk+8hRUTSJPI9nBJPC
+4gOZsPx4g2oLK6PiudPR79bhxRxPACCMnXkdwZ/8FaIdmvRHsWVs8T80wID0wthI
+r5hW4uqi9CcKZrGWH7mx9cVJktspeGUczvKyzNMfCaojwzA/49Z1
+-----END RSA PRIVATE KEY-----
diff --git a/third_party/python/aiohttp/examples/server_simple.py b/third_party/python/aiohttp/examples/server_simple.py
new file mode 100644
index 0000000000..d464383d26
--- /dev/null
+++ b/third_party/python/aiohttp/examples/server_simple.py
@@ -0,0 +1,31 @@
+# server_simple.py
+from aiohttp import web
+
+
+async def handle(request):
+ name = request.match_info.get("name", "Anonymous")
+ text = "Hello, " + name
+ return web.Response(text=text)
+
+
+async def wshandle(request):
+ ws = web.WebSocketResponse()
+ await ws.prepare(request)
+
+ async for msg in ws:
+ if msg.type == web.WSMsgType.text:
+ await ws.send_str(f"Hello, {msg.data}")
+ elif msg.type == web.WSMsgType.binary:
+ await ws.send_bytes(msg.data)
+ elif msg.type == web.WSMsgType.close:
+ break
+
+ return ws
+
+
+app = web.Application()
+app.add_routes(
+ [web.get("/", handle), web.get("/echo", wshandle), web.get("/{name}", handle)]
+)
+
+web.run_app(app)
diff --git a/third_party/python/aiohttp/examples/static_files.py b/third_party/python/aiohttp/examples/static_files.py
new file mode 100755
index 0000000000..65f6bb9c76
--- /dev/null
+++ b/third_party/python/aiohttp/examples/static_files.py
@@ -0,0 +1,9 @@
+#!/usr/bin/env python3
+import pathlib
+
+from aiohttp import web
+
+app = web.Application()
+app.router.add_static("/", pathlib.Path(__file__).parent, show_index=True)
+
+web.run_app(app)
diff --git a/third_party/python/aiohttp/examples/web_classview.py b/third_party/python/aiohttp/examples/web_classview.py
new file mode 100755
index 0000000000..1f1afdae47
--- /dev/null
+++ b/third_party/python/aiohttp/examples/web_classview.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python3
+"""Example for aiohttp.web class based views."""
+
+
+import functools
+import json
+
+from aiohttp import web
+
+
+class MyView(web.View):
+ async def get(self):
+ return web.json_response(
+ {
+ "method": "get",
+ "args": dict(self.request.query),
+ "headers": dict(self.request.headers),
+ },
+ dumps=functools.partial(json.dumps, indent=4),
+ )
+
+ async def post(self):
+ data = await self.request.post()
+ return web.json_response(
+ {
+ "method": "post",
+ "args": dict(self.request.query),
+ "data": dict(data),
+ "headers": dict(self.request.headers),
+ },
+ dumps=functools.partial(json.dumps, indent=4),
+ )
+
+
+async def index(request):
+ txt = """
+ <html>
+ <head>
+ <title>Class based view example</title>
+ </head>
+ <body>
+ <h1>Class based view example</h1>
+ <ul>
+ <li><a href="/">/</a> This page
+ <li><a href="/get">/get</a> Returns GET data.
+ <li><a href="/post">/post</a> Returns POST data.
+ </ul>
+ </body>
+ </html>
+ """
+ return web.Response(text=txt, content_type="text/html")
+
+
+def init():
+ app = web.Application()
+ app.router.add_get("/", index)
+ app.router.add_get("/get", MyView)
+ app.router.add_post("/post", MyView)
+ return app
+
+
+web.run_app(init())
diff --git a/third_party/python/aiohttp/examples/web_cookies.py b/third_party/python/aiohttp/examples/web_cookies.py
new file mode 100755
index 0000000000..c028d19b55
--- /dev/null
+++ b/third_party/python/aiohttp/examples/web_cookies.py
@@ -0,0 +1,45 @@
+#!/usr/bin/env python3
+"""Example for aiohttp.web basic server with cookies."""
+
+from pprint import pformat
+from typing import NoReturn
+
+from aiohttp import web
+
+tmpl = """\
+<html>
+ <body>
+ <a href="/login">Login</a><br/>
+ <a href="/logout">Logout</a><br/>
+ <pre>{}</pre>
+ </body>
+</html>"""
+
+
+async def root(request):
+ resp = web.Response(content_type="text/html")
+ resp.text = tmpl.format(pformat(request.cookies))
+ return resp
+
+
+async def login(request: web.Request) -> NoReturn:
+ exc = web.HTTPFound(location="/")
+ exc.set_cookie("AUTH", "secret")
+ raise exc
+
+
+async def logout(request: web.Request) -> NoReturn:
+ exc = web.HTTPFound(location="/")
+ exc.del_cookie("AUTH")
+ raise exc
+
+
+def init():
+ app = web.Application()
+ app.router.add_get("/", root)
+ app.router.add_get("/login", login)
+ app.router.add_get("/logout", logout)
+ return app
+
+
+web.run_app(init())
diff --git a/third_party/python/aiohttp/examples/web_rewrite_headers_middleware.py b/third_party/python/aiohttp/examples/web_rewrite_headers_middleware.py
new file mode 100755
index 0000000000..15e985e14d
--- /dev/null
+++ b/third_party/python/aiohttp/examples/web_rewrite_headers_middleware.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python3
+"""Example for rewriting response headers by middleware."""
+
+from aiohttp import web
+from aiohttp.typedefs import Handler
+
+
+async def handler(request):
+ return web.Response(text="Everything is fine")
+
+
+@web.middleware
+async def middleware(request: web.Request, handler: Handler) -> web.StreamResponse:
+ try:
+ response = await handler(request)
+ except web.HTTPException as exc:
+ raise exc
+ if not response.prepared:
+ response.headers["SERVER"] = "Secured Server Software"
+ return response
+
+
+def init():
+ app = web.Application(middlewares=[middleware])
+ app.router.add_get("/", handler)
+ return app
+
+
+web.run_app(init())
diff --git a/third_party/python/aiohttp/examples/web_srv.py b/third_party/python/aiohttp/examples/web_srv.py
new file mode 100755
index 0000000000..4d0e7c4697
--- /dev/null
+++ b/third_party/python/aiohttp/examples/web_srv.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python3
+"""Example for aiohttp.web basic server."""
+
+import textwrap
+
+from aiohttp import web
+
+
+async def intro(request):
+ txt = textwrap.dedent(
+ """\
+ Type {url}/hello/John {url}/simple or {url}/change_body
+ in browser url bar
+ """
+ ).format(url="127.0.0.1:8080")
+ binary = txt.encode("utf8")
+ resp = web.StreamResponse()
+ resp.content_length = len(binary)
+ resp.content_type = "text/plain"
+ await resp.prepare(request)
+ await resp.write(binary)
+ return resp
+
+
+async def simple(request):
+ return web.Response(text="Simple answer")
+
+
+async def change_body(request):
+ resp = web.Response()
+ resp.body = b"Body changed"
+ resp.content_type = "text/plain"
+ return resp
+
+
+async def hello(request):
+ resp = web.StreamResponse()
+ name = request.match_info.get("name", "Anonymous")
+ answer = ("Hello, " + name).encode("utf8")
+ resp.content_length = len(answer)
+ resp.content_type = "text/plain"
+ await resp.prepare(request)
+ await resp.write(answer)
+ await resp.write_eof()
+ return resp
+
+
+def init():
+ app = web.Application()
+ app.router.add_get("/", intro)
+ app.router.add_get("/simple", simple)
+ app.router.add_get("/change_body", change_body)
+ app.router.add_get("/hello/{name}", hello)
+ app.router.add_get("/hello", hello)
+ return app
+
+
+web.run_app(init())
diff --git a/third_party/python/aiohttp/examples/web_srv_route_deco.py b/third_party/python/aiohttp/examples/web_srv_route_deco.py
new file mode 100644
index 0000000000..4e1769d192
--- /dev/null
+++ b/third_party/python/aiohttp/examples/web_srv_route_deco.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python3
+"""Example for aiohttp.web basic server with decorator definition for routes."""
+
+import textwrap
+
+from aiohttp import web
+
+routes = web.RouteTableDef()
+
+
+@routes.get("/")
+async def intro(request):
+ txt = textwrap.dedent(
+ """\
+ Type {url}/hello/John {url}/simple or {url}/change_body
+ in browser url bar
+ """
+ ).format(url="127.0.0.1:8080")
+ binary = txt.encode("utf8")
+ resp = web.StreamResponse()
+ resp.content_length = len(binary)
+ resp.content_type = "text/plain"
+ await resp.prepare(request)
+ await resp.write(binary)
+ return resp
+
+
+@routes.get("/simple")
+async def simple(request):
+ return web.Response(text="Simple answer")
+
+
+@routes.get("/change_body")
+async def change_body(request):
+ resp = web.Response()
+ resp.body = b"Body changed"
+ resp.content_type = "text/plain"
+ return resp
+
+
+@routes.get("/hello")
+async def hello(request):
+ resp = web.StreamResponse()
+ name = request.match_info.get("name", "Anonymous")
+ answer = ("Hello, " + name).encode("utf8")
+ resp.content_length = len(answer)
+ resp.content_type = "text/plain"
+ await resp.prepare(request)
+ await resp.write(answer)
+ await resp.write_eof()
+ return resp
+
+
+def init():
+ app = web.Application()
+ app.router.add_routes(routes)
+ return app
+
+
+web.run_app(init())
diff --git a/third_party/python/aiohttp/examples/web_srv_route_table.py b/third_party/python/aiohttp/examples/web_srv_route_table.py
new file mode 100644
index 0000000000..24815b237b
--- /dev/null
+++ b/third_party/python/aiohttp/examples/web_srv_route_table.py
@@ -0,0 +1,62 @@
+#!/usr/bin/env python3
+"""Example for aiohttp.web basic server with table definition for routes."""
+
+import textwrap
+
+from aiohttp import web
+
+
+async def intro(request):
+ txt = textwrap.dedent(
+ """\
+ Type {url}/hello/John {url}/simple or {url}/change_body
+ in browser url bar
+ """
+ ).format(url="127.0.0.1:8080")
+ binary = txt.encode("utf8")
+ resp = web.StreamResponse()
+ resp.content_length = len(binary)
+ resp.content_type = "text/plain"
+ await resp.prepare(request)
+ await resp.write(binary)
+ return resp
+
+
+async def simple(request):
+ return web.Response(text="Simple answer")
+
+
+async def change_body(request):
+ resp = web.Response()
+ resp.body = b"Body changed"
+ resp.content_type = "text/plain"
+ return resp
+
+
+async def hello(request):
+ resp = web.StreamResponse()
+ name = request.match_info.get("name", "Anonymous")
+ answer = ("Hello, " + name).encode("utf8")
+ resp.content_length = len(answer)
+ resp.content_type = "text/plain"
+ await resp.prepare(request)
+ await resp.write(answer)
+ await resp.write_eof()
+ return resp
+
+
+def init():
+ app = web.Application()
+ app.router.add_routes(
+ [
+ web.get("/", intro),
+ web.get("/simple", simple),
+ web.get("/change_body", change_body),
+ web.get("/hello/{name}", hello),
+ web.get("/hello", hello),
+ ]
+ )
+ return app
+
+
+web.run_app(init())
diff --git a/third_party/python/aiohttp/examples/web_ws.py b/third_party/python/aiohttp/examples/web_ws.py
new file mode 100755
index 0000000000..f6c0593333
--- /dev/null
+++ b/third_party/python/aiohttp/examples/web_ws.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python3
+"""Example for aiohttp.web websocket server."""
+
+import os
+
+from aiohttp import web
+
+WS_FILE = os.path.join(os.path.dirname(__file__), "websocket.html")
+
+
+async def wshandler(request):
+ resp = web.WebSocketResponse()
+ available = resp.can_prepare(request)
+ if not available:
+ with open(WS_FILE, "rb") as fp:
+ return web.Response(body=fp.read(), content_type="text/html")
+
+ await resp.prepare(request)
+
+ await resp.send_str("Welcome!!!")
+
+ try:
+ print("Someone joined.")
+ for ws in request.app["sockets"]:
+ await ws.send_str("Someone joined")
+ request.app["sockets"].append(resp)
+
+ async for msg in resp:
+ if msg.type == web.WSMsgType.TEXT:
+ for ws in request.app["sockets"]:
+ if ws is not resp:
+ await ws.send_str(msg.data)
+ else:
+ return resp
+ return resp
+
+ finally:
+ request.app["sockets"].remove(resp)
+ print("Someone disconnected.")
+ for ws in request.app["sockets"]:
+ await ws.send_str("Someone disconnected.")
+
+
+async def on_shutdown(app):
+ for ws in app["sockets"]:
+ await ws.close()
+
+
+def init():
+ app = web.Application()
+ app["sockets"] = []
+ app.router.add_get("/", wshandler)
+ app.on_shutdown.append(on_shutdown)
+ return app
+
+
+web.run_app(init())
diff --git a/third_party/python/aiohttp/examples/websocket.html b/third_party/python/aiohttp/examples/websocket.html
new file mode 100644
index 0000000000..2ba9ff367d
--- /dev/null
+++ b/third_party/python/aiohttp/examples/websocket.html
@@ -0,0 +1,89 @@
+<!DOCTYPE html>
+<meta charset="utf-8" />
+<html>
+<head>
+<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js">
+</script>
+ <script language="javascript" type="text/javascript">
+ $(function() {
+ var conn = null;
+ function log(msg) {
+ var control = $('#log');
+ control.html(control.html() + msg + '<br/>');
+ control.scrollTop(control.scrollTop() + 1000);
+ }
+ function connect() {
+ disconnect();
+ var wsUri = (window.location.protocol=='https:'&&'wss://'||'ws://')+window.location.host;
+ conn = new WebSocket(wsUri);
+ log('Connecting...');
+ conn.onopen = function() {
+ log('Connected.');
+ update_ui();
+ };
+ conn.onmessage = function(e) {
+ log('Received: ' + e.data);
+ };
+ conn.onclose = function() {
+ log('Disconnected.');
+ conn = null;
+ update_ui();
+ };
+ }
+ function disconnect() {
+ if (conn != null) {
+ log('Disconnecting...');
+ conn.close();
+ conn = null;
+ update_ui();
+ }
+ }
+ function update_ui() {
+ if (conn == null) {
+ $('#status').text('disconnected');
+ $('#connect').html('Connect');
+ } else {
+ $('#status').text('connected (' + conn.protocol + ')');
+ $('#connect').html('Disconnect');
+ }
+ }
+ $('#connect').click(function() {
+ if (conn == null) {
+ connect();
+ } else {
+ disconnect();
+ }
+ update_ui();
+ return false;
+ });
+ $('#send').click(function() {
+ var text = $('#text').val();
+ log('Sending: ' + text);
+ conn.send(text);
+ $('#text').val('').focus();
+ return false;
+ });
+ $('#text').keyup(function(e) {
+ if (e.keyCode === 13) {
+ $('#send').click();
+ return false;
+ }
+ });
+ });
+</script>
+</head>
+<body>
+<h3>Chat!</h3>
+<div>
+ <button id="connect">Connect</button>&nbsp;|&nbsp;Status:
+ <span id="status">disconnected</span>
+</div>
+<div id="log"
+ style="width:20em;height:15em;overflow:auto;border:1px solid black">
+</div>
+<form id="chatform" onsubmit="return false;">
+ <input id="text" type="text" />
+ <input id="send" type="button" value="Send" />
+</form>
+</body>
+</html>
diff --git a/third_party/python/aiohttp/pyproject.toml b/third_party/python/aiohttp/pyproject.toml
new file mode 100644
index 0000000000..262623fecd
--- /dev/null
+++ b/third_party/python/aiohttp/pyproject.toml
@@ -0,0 +1,19 @@
+[build-system]
+requires = [
+ "setuptools >= 46.4.0",
+]
+build-backend = "setuptools.build_meta"
+
+[tool.towncrier]
+package = "aiohttp"
+filename = "CHANGES.rst"
+directory = "CHANGES/"
+title_format = "{version} ({project_date})"
+template = "CHANGES/.TEMPLATE.rst"
+issue_format = "`#{issue} <https://github.com/aio-libs/aiohttp/issues/{issue}>`_"
+
+
+[tool.cibuildwheel]
+test-command = ""
+# don't build PyPy wheels, install from source instead
+skip = "pp*"
diff --git a/third_party/python/aiohttp/setup.cfg b/third_party/python/aiohttp/setup.cfg
new file mode 100644
index 0000000000..6944b7e2bb
--- /dev/null
+++ b/third_party/python/aiohttp/setup.cfg
@@ -0,0 +1,141 @@
+[metadata]
+name = aiohttp
+version = attr: aiohttp.__version__
+url = https://github.com/aio-libs/aiohttp
+project_urls =
+ Chat: Matrix = https://matrix.to/#/#aio-libs:matrix.org
+ Chat: Matrix Space = https://matrix.to/#/#aio-libs-space:matrix.org
+ CI: GitHub Actions = https://github.com/aio-libs/aiohttp/actions?query=workflow%%3ACI
+ Coverage: codecov = https://codecov.io/github/aio-libs/aiohttp
+ Docs: Changelog = https://docs.aiohttp.org/en/stable/changes.html
+ Docs: RTD = https://docs.aiohttp.org
+ GitHub: issues = https://github.com/aio-libs/aiohttp/issues
+ GitHub: repo = https://github.com/aio-libs/aiohttp
+description = Async http client/server framework (asyncio)
+long_description = file: README.rst
+long_description_content_type = text/x-rst
+maintainer = aiohttp team <team@aiohttp.org>
+maintainer_email = team@aiohttp.org
+license = Apache 2
+license_files = LICENSE.txt
+classifiers =
+ Development Status :: 5 - Production/Stable
+
+ Framework :: AsyncIO
+
+ Intended Audience :: Developers
+
+ License :: OSI Approved :: Apache Software License
+
+ Operating System :: POSIX
+ Operating System :: MacOS :: MacOS X
+ Operating System :: Microsoft :: Windows
+
+ Programming Language :: Python
+ Programming Language :: Python :: 3
+ Programming Language :: Python :: 3.6
+ Programming Language :: Python :: 3.7
+ Programming Language :: Python :: 3.8
+ Programming Language :: Python :: 3.9
+ Programming Language :: Python :: 3.10
+
+ Topic :: Internet :: WWW/HTTP
+
+[options]
+python_requires = >=3.6
+packages = find:
+zip_safe = False
+include_package_data = True
+install_requires =
+ attrs >= 17.3.0
+ charset-normalizer >=2.0, < 4.0
+ multidict >=4.5, < 7.0
+ async_timeout >= 4.0.0a3, < 5.0
+ asynctest == 0.13.0; python_version<"3.8"
+ yarl >= 1.0, < 2.0
+ idna-ssl >= 1.0; python_version<"3.7"
+ typing_extensions >= 3.7.4; python_version<"3.8"
+ frozenlist >= 1.1.1
+ aiosignal >= 1.1.2
+
+[options.exclude_package_data]
+* =
+ *.c
+ *.h
+
+[options.extras_require]
+speedups =
+ aiodns
+ Brotli
+ cchardet; python_version < "3.10"
+
+[options.packages.find]
+exclude =
+ examples
+
+[options.package_data]
+* =
+ *.so
+
+[pep8]
+max-line-length = 79
+
+[easy_install]
+zip_ok = false
+
+[flake8]
+ignore = N801,N802,N803,E203,E226,E305,W504,E252,E301,E302,E704,W503,W504,F811,D1,D4
+max-line-length = 88
+
+[isort]
+line_length = 88
+include_trailing_comma = True
+multi_line_output = 3
+force_grid_wrap = 0
+combine_as_imports = True
+known_third_party = jinja2,pytest,multidict,yarl,gunicorn,freezegun,async_generator
+known_first_party = aiohttp,aiohttp_jinja2,aiopg
+
+[report]
+exclude_lines =
+ @abc.abstractmethod
+ @abstractmethod
+
+[coverage:run]
+branch = True
+source = aiohttp, tests
+omit = site-packages
+
+[tool:pytest]
+addopts =
+ --durations=10
+
+ -v
+
+ -ra
+
+ --showlocals
+
+ --cov=aiohttp
+ --cov=tests/
+filterwarnings =
+ error
+ ignore:module 'ssl' has no attribute 'OP_NO_COMPRESSION'. The Python interpreter is compiled against OpenSSL < 1.0.0. Ref. https.//docs.python.org/3/library/ssl.html#ssl.OP_NO_COMPRESSION:UserWarning
+ ignore:unclosed transport <asyncio.sslproto._SSLProtocolTransport object.*:ResourceWarning
+ ignore:unclosed transport <_ProactorSocketTransport closing fd=-1>:ResourceWarning
+ ignore:Unclosed client session <aiohttp.client.ClientSession object at 0x:ResourceWarning
+ ignore:The loop argument is deprecated:DeprecationWarning:asyncio
+ ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning::
+ ignore:module 'sre_constants' is deprecated:DeprecationWarning:pkg_resources._vendor.pyparsing
+ ignore:path is deprecated. Use files.. instead. Refer to https.//importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.:DeprecationWarning:certifi.core
+junit_suite_name = aiohttp_test_suite
+norecursedirs = dist docs build .tox .eggs
+minversion = 3.8.2
+testpaths = tests/
+junit_family = xunit2
+xfail_strict = true
+
+[egg_info]
+tag_build =
+tag_date = 0
+
diff --git a/third_party/python/aiohttp/setup.py b/third_party/python/aiohttp/setup.py
new file mode 100644
index 0000000000..4d59a0226a
--- /dev/null
+++ b/third_party/python/aiohttp/setup.py
@@ -0,0 +1,54 @@
+import os
+import pathlib
+import sys
+
+from setuptools import Extension, setup
+
+if sys.version_info < (3, 6):
+ raise RuntimeError("aiohttp 3.x requires Python 3.6+")
+
+
+NO_EXTENSIONS: bool = bool(os.environ.get("AIOHTTP_NO_EXTENSIONS"))
+HERE = pathlib.Path(__file__).parent
+IS_GIT_REPO = (HERE / ".git").exists()
+
+
+if sys.implementation.name != "cpython":
+ NO_EXTENSIONS = True
+
+
+if IS_GIT_REPO and not (HERE / "vendor/llhttp/README.md").exists():
+ print("Install submodules when building from git clone", file=sys.stderr)
+ print("Hint:", file=sys.stderr)
+ print(" git submodule update --init", file=sys.stderr)
+ sys.exit(2)
+
+
+# NOTE: makefile cythonizes all Cython modules
+
+extensions = [
+ Extension("aiohttp._websocket", ["aiohttp/_websocket.c"]),
+ Extension(
+ "aiohttp._http_parser",
+ [
+ "aiohttp/_http_parser.c",
+ "aiohttp/_find_header.c",
+ "vendor/llhttp/build/c/llhttp.c",
+ "vendor/llhttp/src/native/api.c",
+ "vendor/llhttp/src/native/http.c",
+ ],
+ define_macros=[("LLHTTP_STRICT_MODE", 0)],
+ include_dirs=["vendor/llhttp/build"],
+ ),
+ Extension("aiohttp._helpers", ["aiohttp/_helpers.c"]),
+ Extension("aiohttp._http_writer", ["aiohttp/_http_writer.c"]),
+]
+
+
+build_type = "Pure" if NO_EXTENSIONS else "Accelerated"
+setup_kwargs = {} if NO_EXTENSIONS else {"ext_modules": extensions}
+
+print("*********************", file=sys.stderr)
+print("* {build_type} build *".format_map(locals()), file=sys.stderr)
+print("*********************", file=sys.stderr)
+setup(**setup_kwargs)
diff --git a/third_party/python/aiohttp/vendor/README.rst b/third_party/python/aiohttp/vendor/README.rst
new file mode 100644
index 0000000000..1f10e20cce
--- /dev/null
+++ b/third_party/python/aiohttp/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/third_party/python/aiohttp/vendor/llhttp/.dockerignore b/third_party/python/aiohttp/vendor/llhttp/.dockerignore
new file mode 100644
index 0000000000..11b226d8eb
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/.dockerignore
@@ -0,0 +1,6 @@
+*
+!package.json
+!package-lock.json
+!tsconfig.json
+!bin
+!src
diff --git a/third_party/python/aiohttp/vendor/llhttp/.eslintrc.js b/third_party/python/aiohttp/vendor/llhttp/.eslintrc.js
new file mode 100644
index 0000000000..595cf53191
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/.eslintrc.js
@@ -0,0 +1,31 @@
+module.exports = {
+ 'env': {
+ 'browser': false,
+ 'commonjs': true,
+ 'es6': true,
+ 'node': true
+ },
+ 'extends': 'eslint:recommended',
+ 'rules': {
+ 'max-len': [ 2, {
+ 'code': 80,
+ 'ignoreComments': true
+ } ],
+ 'indent': [
+ 'error',
+ 2
+ ],
+ 'linebreak-style': [
+ 'error',
+ 'unix'
+ ],
+ 'quotes': [
+ 'error',
+ 'single'
+ ],
+ 'semi': [
+ 'error',
+ 'always'
+ ]
+ }
+};
diff --git a/third_party/python/aiohttp/vendor/llhttp/.github/workflows/ci.yaml b/third_party/python/aiohttp/vendor/llhttp/.github/workflows/ci.yaml
new file mode 100644
index 0000000000..d1b3a65a18
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/.github/workflows/ci.yaml
@@ -0,0 +1,117 @@
+name: CI
+
+on: [push, pull_request]
+
+env:
+ CI: true
+
+jobs:
+ build:
+ name: Build libllhttp.a
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os:
+ - macos-latest
+ - ubuntu-latest
+ - windows-latest
+ steps:
+ - name: Install clang for Windows
+ if: runner.os == 'Windows'
+ run: |
+ iwr -useb get.scoop.sh -outfile 'install.ps1'
+ .\install.ps1 -RunAsAdmin
+ scoop install llvm --global
+
+ # Scoop modifies the PATH so we make the modified PATH global.
+ echo $env:PATH >> $env:GITHUB_PATH
+
+ - name: Fetch code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 1
+
+ # Skip macOS & Windows, cache there is slower
+ - name: Restore node_modules cache for Linux
+ uses: actions/cache@v3
+ if: runner.os == 'Linux'
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-node-
+
+ - name: Install dependencies
+ run: npm install --ignore-scripts
+
+ - name: Build libllhttp.a
+ shell: bash
+ run: |
+ make build/libllhttp.a
+
+ test:
+ name: Run tests
+ runs-on: ${{ matrix.os }}
+ strategy:
+ matrix:
+ os:
+ - macos-latest
+ - ubuntu-latest
+ - windows-latest
+ steps:
+ - name: Install clang for Windows
+ if: runner.os == 'Windows'
+ run: |
+ iwr -useb get.scoop.sh -outfile 'install.ps1'
+ .\install.ps1 -RunAsAdmin
+ scoop install llvm --global
+
+ # Scoop modifies the PATH so we make the modified PATH global.
+ echo $env:PATH >> $env:GITHUB_PATH
+
+ - name: Fetch code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 1
+
+ # Skip macOS & Windows, cache there is slower
+ - name: Restore node_modules cache for Linux
+ uses: actions/cache@v3
+ if: runner.os == 'Linux'
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-node-
+
+ - name: Install dependencies
+ run: npm install --ignore-scripts
+
+ # Custom script, because progress looks not good in CI
+ - name: Run tests
+ env:
+ CFLAGS: -O0
+ run: npx mocha --timeout 30000 -r ts-node/register/type-check test/*-test.ts
+
+ lint:
+ name: Run TSLint
+ runs-on: ubuntu-latest
+ steps:
+ - name: Fetch code
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 1
+
+ - name: Restore node_modules cache
+ uses: actions/cache@v3
+ with:
+ path: ~/.npm
+ key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
+ restore-keys: |
+ ${{ runner.os }}-node-
+
+ - name: Install dependencies
+ run: npm install --ignore-scripts
+
+ - name: Run lint command
+ run: npm run lint
diff --git a/third_party/python/aiohttp/vendor/llhttp/.gitignore b/third_party/python/aiohttp/vendor/llhttp/.gitignore
new file mode 100644
index 0000000000..c2e9902df4
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/.gitignore
@@ -0,0 +1,6 @@
+node_modules/
+npm-debug.log
+test/tmp/
+lib/
+build/
+release/
diff --git a/third_party/python/aiohttp/vendor/llhttp/.npmrc b/third_party/python/aiohttp/vendor/llhttp/.npmrc
new file mode 100644
index 0000000000..cafe685a11
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/.npmrc
@@ -0,0 +1 @@
+package-lock=true
diff --git a/third_party/python/aiohttp/vendor/llhttp/CMakeLists.txt b/third_party/python/aiohttp/vendor/llhttp/CMakeLists.txt
new file mode 100644
index 0000000000..ab434c5848
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/CMakeLists.txt
@@ -0,0 +1,115 @@
+cmake_minimum_required(VERSION 3.5.1)
+cmake_policy(SET CMP0069 NEW)
+
+project(llhttp VERSION _RELEASE_)
+include(GNUInstallDirs)
+
+set(CMAKE_C_STANDARD 99)
+
+# By default build in relwithdebinfo type, supports both lowercase and uppercase
+if(NOT CMAKE_CONFIGURATION_TYPES)
+ set(allowableBuildTypes DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
+ set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${allowableBuildTypes}")
+ if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE RELWITHDEBINFO CACHE STRING "" FORCE)
+ else()
+ string(TOUPPER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+ if(NOT CMAKE_BUILD_TYPE IN_LIST allowableBuildTypes)
+ message(FATAL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE}")
+ endif()
+ endif()
+endif()
+
+#
+# Options
+#
+# Generic option
+option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so)" ON)
+option(BUILD_STATIC_LIBS "Build static libraries (.lib/.a)" OFF)
+
+# Source code
+set(LLHTTP_SOURCES
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/llhttp.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/http.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/src/api.c
+)
+
+set(LLHTTP_HEADERS
+ ${CMAKE_CURRENT_SOURCE_DIR}/include/llhttp.h
+)
+
+configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc.in
+ ${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc
+ @ONLY
+)
+
+function(config_library target)
+ target_sources(${target} PRIVATE ${LLHTTP_SOURCES} ${LLHTTP_HEADERS})
+
+ target_include_directories(${target} PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ )
+
+ set_target_properties(${target} PROPERTIES
+ OUTPUT_NAME llhttp
+ VERSION ${PROJECT_VERSION}
+ SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
+ PUBLIC_HEADER ${LLHTTP_HEADERS}
+ )
+
+ install(TARGETS ${target}
+ EXPORT llhttp
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ )
+
+ install(FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+ )
+
+ # This is required to work with FetchContent
+ install(EXPORT llhttp
+ FILE llhttp-config.cmake
+ NAMESPACE llhttp::
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/llhttp)
+endfunction(config_library target)
+
+if(BUILD_SHARED_LIBS)
+ add_library(llhttp_shared SHARED
+ ${llhttp_src}
+ )
+ add_library(llhttp::llhttp ALIAS llhttp_shared)
+ config_library(llhttp_shared)
+endif()
+
+if(BUILD_STATIC_LIBS)
+ add_library(llhttp_static STATIC
+ ${llhttp_src}
+ )
+ if(BUILD_SHARED_LIBS)
+ add_library(llhttp::llhttp ALIAS llhttp_shared)
+ else()
+ add_library(llhttp::llhttp ALIAS llhttp_static)
+ endif()
+ config_library(llhttp_static)
+endif()
+
+# On windows with Visual Studio, add a debug postfix so that release
+# and debug libraries can coexist.
+if(MSVC)
+ set(CMAKE_DEBUG_POSTFIX "d")
+endif()
+
+# Print project configure summary
+message(STATUS "")
+message(STATUS "")
+message(STATUS "Project configure summary:")
+message(STATUS "")
+message(STATUS " CMake build type .................: ${CMAKE_BUILD_TYPE}")
+message(STATUS " Install prefix ...................: ${CMAKE_INSTALL_PREFIX}")
+message(STATUS " Build shared library .............: ${BUILD_SHARED_LIBS}")
+message(STATUS " Build static library .............: ${BUILD_STATIC_LIBS}")
+message(STATUS "")
diff --git a/third_party/python/aiohttp/vendor/llhttp/CNAME b/third_party/python/aiohttp/vendor/llhttp/CNAME
new file mode 100644
index 0000000000..4c4e0786d3
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/CNAME
@@ -0,0 +1 @@
+llhttp.org \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/CODE_OF_CONDUCT.md b/third_party/python/aiohttp/vendor/llhttp/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000000..8470ae4e86
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/CODE_OF_CONDUCT.md
@@ -0,0 +1,4 @@
+# Code of Conduct
+
+* [Node.js Code of Conduct](https://github.com/nodejs/admin/blob/main/CODE_OF_CONDUCT.md)
+* [Node.js Moderation Policy](https://github.com/nodejs/admin/blob/main/Moderation-Policy.md)
diff --git a/third_party/python/aiohttp/vendor/llhttp/Dockerfile b/third_party/python/aiohttp/vendor/llhttp/Dockerfile
new file mode 100644
index 0000000000..2b5bfae192
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/Dockerfile
@@ -0,0 +1,13 @@
+FROM node:18-alpine
+ARG UID=1000
+ARG GID=1000
+
+RUN apk add -U clang lld wasi-sdk && mkdir /home/node/llhttp
+
+WORKDIR /home/node/llhttp
+
+COPY . .
+
+RUN npm ci
+
+USER node
diff --git a/third_party/python/aiohttp/vendor/llhttp/LICENSE-MIT b/third_party/python/aiohttp/vendor/llhttp/LICENSE-MIT
new file mode 100644
index 0000000000..6c1512dd6b
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/LICENSE-MIT
@@ -0,0 +1,22 @@
+This software is licensed under the MIT License.
+
+Copyright Fedor Indutny, 2018.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/third_party/python/aiohttp/vendor/llhttp/Makefile b/third_party/python/aiohttp/vendor/llhttp/Makefile
new file mode 100644
index 0000000000..5b941b3b31
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/Makefile
@@ -0,0 +1,94 @@
+CLANG ?= clang
+CFLAGS ?=
+OS ?=
+
+CFLAGS += -Os -g3 -Wall -Wextra -Wno-unused-parameter
+ifneq ($(OS),Windows_NT)
+ # NOTE: clang on windows does not support fPIC
+ CFLAGS += -fPIC
+endif
+
+INCLUDES += -Ibuild/
+
+INSTALL ?= install
+PREFIX ?= /usr/local
+LIBDIR = $(PREFIX)/lib
+INCLUDEDIR = $(PREFIX)/include
+
+all: build/libllhttp.a build/libllhttp.so
+
+clean:
+ rm -rf release/
+ rm -rf build/
+
+build/libllhttp.so: build/c/llhttp.o build/native/api.o \
+ build/native/http.o
+ $(CLANG) -shared $^ -o $@
+
+build/libllhttp.a: build/c/llhttp.o build/native/api.o \
+ build/native/http.o
+ $(AR) rcs $@ build/c/llhttp.o build/native/api.o build/native/http.o
+
+build/c/llhttp.o: build/c/llhttp.c
+ $(CLANG) $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+build/native/%.o: src/native/%.c build/llhttp.h src/native/api.h \
+ build/native
+ $(CLANG) $(CFLAGS) $(INCLUDES) -c $< -o $@
+
+build/llhttp.h: generate
+build/c/llhttp.c: generate
+
+build/native:
+ mkdir -p build/native
+
+release: clean generate
+ @echo "${RELEASE}" | grep -q -E ".+" || { echo "Please make sure the RELEASE argument is set."; exit 1; }
+ rm -rf release
+ mkdir -p release/src
+ mkdir -p release/include
+ cp -rf build/llhttp.h release/include/
+ cp -rf build/c/llhttp.c release/src/
+ cp -rf src/native/*.c release/src/
+ cp -rf src/llhttp.gyp release/
+ cp -rf src/common.gypi release/
+ cp -rf CMakeLists.txt release/
+ sed -i '' s/_RELEASE_/$(RELEASE)/ release/CMakeLists.txt
+ cp -rf libllhttp.pc.in release/
+ cp -rf README.md release/
+ cp -rf LICENSE-MIT release/
+
+github-release:
+ @echo "${RELEASE_V}" | grep -q -E "^v" || { echo "Please make sure version starts with \"v\"."; exit 1; }
+ gh release create -d --generate-notes ${RELEASE_V}
+ @sleep 5
+ gh release view ${RELEASE_V} -t "{{.body}}" --json body > RELEASE_NOTES
+ gh release delete ${RELEASE_V} -y
+ gh release create -F RELEASE_NOTES -d --title ${RELEASE_V} --target release release/${RELEASE_V}
+ @sleep 5
+ rm -rf RELEASE_NOTES
+ open $$(gh release view release/${RELEASE_V} --json url -t "{{.url}}")
+
+postversion: release
+ git fetch origin
+ git push
+ git checkout release --
+ cp -rf release/* ./
+ rm -rf release
+ git add include src *.gyp *.gypi CMakeLists.txt README.md LICENSE-MIT libllhttp.pc.in
+ git commit -a -m "release: $(RELEASE)"
+ git tag "release/v$(RELEASE)"
+ git push && git push --tags
+ git checkout main
+
+generate:
+ npx ts-node bin/generate.ts
+
+install: build/libllhttp.a build/libllhttp.so
+ $(INSTALL) -d $(DESTDIR)$(INCLUDEDIR)
+ $(INSTALL) -d $(DESTDIR)$(LIBDIR)
+ $(INSTALL) -C build/llhttp.h $(DESTDIR)$(INCLUDEDIR)/llhttp.h
+ $(INSTALL) -C build/libllhttp.a $(DESTDIR)$(LIBDIR)/libllhttp.a
+ $(INSTALL) build/libllhttp.so $(DESTDIR)$(LIBDIR)/libllhttp.so
+
+.PHONY: all generate clean release postversion github-release
diff --git a/third_party/python/aiohttp/vendor/llhttp/README.md b/third_party/python/aiohttp/vendor/llhttp/README.md
new file mode 100644
index 0000000000..6f109da61c
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/README.md
@@ -0,0 +1,434 @@
+# llhttp
+[![CI](https://github.com/nodejs/llhttp/workflows/CI/badge.svg)](https://github.com/nodejs/llhttp/actions?query=workflow%3ACI)
+
+Port of [http_parser][0] to [llparse][1].
+
+## Why?
+
+Let's face it, [http_parser][0] is practically unmaintainable. Even
+introduction of a single new method results in a significant code churn.
+
+This project aims to:
+
+* Make it maintainable
+* Verifiable
+* Improving benchmarks where possible
+
+More details in [Fedor Indutny's talk at JSConf EU 2019](https://youtu.be/x3k_5Mi66sY)
+
+## How?
+
+Over time, different approaches for improving [http_parser][0]'s code base
+were tried. However, all of them failed due to resulting significant performance
+degradation.
+
+This project is a port of [http_parser][0] to TypeScript. [llparse][1] is used
+to generate the output C source file, which could be compiled and
+linked with the embedder's program (like [Node.js][7]).
+
+## Performance
+
+So far llhttp outperforms http_parser:
+
+| | input size | bandwidth | reqs/sec | time |
+|:----------------|-----------:|-------------:|-----------:|--------:|
+| **llhttp** | 8192.00 mb | 1777.24 mb/s | 3583799.39 req/sec | 4.61 s |
+| **http_parser** | 8192.00 mb | 694.66 mb/s | 1406180.33 req/sec | 11.79 s |
+
+llhttp is faster by approximately **156%**.
+
+## Maintenance
+
+llhttp project has about 1400 lines of TypeScript code describing the parser
+itself and around 450 lines of C code and headers providing the helper methods.
+The whole [http_parser][0] is implemented in approximately 2500 lines of C, and
+436 lines of headers.
+
+All optimizations and multi-character matching in llhttp are generated
+automatically, and thus doesn't add any extra maintenance cost. On the contrary,
+most of http_parser's code is hand-optimized and unrolled. Instead describing
+"how" it should parse the HTTP requests/responses, a maintainer should
+implement the new features in [http_parser][0] cautiously, considering
+possible performance degradation and manually optimizing the new code.
+
+## Verification
+
+The state machine graph is encoded explicitly in llhttp. The [llparse][1]
+automatically checks the graph for absence of loops and correct reporting of the
+input ranges (spans) like header names and values. In the future, additional
+checks could be performed to get even stricter verification of the llhttp.
+
+## Usage
+
+```C
+#include "llhttp.h"
+
+llhttp_t parser;
+llhttp_settings_t settings;
+
+/* Initialize user callbacks and settings */
+llhttp_settings_init(&settings);
+
+/* Set user callback */
+settings.on_message_complete = handle_on_message_complete;
+
+/* Initialize the parser in HTTP_BOTH mode, meaning that it will select between
+ * HTTP_REQUEST and HTTP_RESPONSE parsing automatically while reading the first
+ * input.
+ */
+llhttp_init(&parser, HTTP_BOTH, &settings);
+
+/* Parse request! */
+const char* request = "GET / HTTP/1.1\r\n\r\n";
+int request_len = strlen(request);
+
+enum llhttp_errno err = llhttp_execute(&parser, request, request_len);
+if (err == HPE_OK) {
+ /* Successfully parsed! */
+} else {
+ fprintf(stderr, "Parse error: %s %s\n", llhttp_errno_name(err),
+ parser.reason);
+}
+```
+For more information on API usage, please refer to [src/native/api.h](https://github.com/nodejs/llhttp/blob/main/src/native/api.h).
+
+## API
+
+### llhttp_settings_t
+
+The settings object contains a list of callbacks that the parser will invoke.
+
+The following callbacks can return `0` (proceed normally), `-1` (error) or `HPE_PAUSED` (pause the parser):
+
+* `on_message_begin`: Invoked when a new request/response starts.
+* `on_message_complete`: Invoked when a request/response has been completedly parsed.
+* `on_url_complete`: Invoked after the URL has been parsed.
+* `on_method_complete`: Invoked after the HTTP method has been parsed.
+* `on_version_complete`: Invoked after the HTTP version has been parsed.
+* `on_status_complete`: Invoked after the status code has been parsed.
+* `on_header_field_complete`: Invoked after a header name has been parsed.
+* `on_header_value_complete`: Invoked after a header value has been parsed.
+* `on_chunk_header`: Invoked after a new chunk is started. The current chunk length is stored in `parser->content_length`.
+* `on_chunk_extension_name_complete`: Invoked after a chunk extension name is started.
+* `on_chunk_extension_value_complete`: Invoked after a chunk extension value is started.
+* `on_chunk_complete`: Invoked after a new chunk is received.
+* `on_reset`: Invoked after `on_message_complete` and before `on_message_begin` when a new message
+ is received on the same parser. This is not invoked for the first message of the parser.
+
+The following callbacks can return `0` (proceed normally), `-1` (error) or `HPE_USER` (error from the callback):
+
+* `on_url`: Invoked when another character of the URL is received.
+* `on_status`: Invoked when another character of the status is received.
+* `on_method`: Invoked when another character of the method is received.
+ When parser is created with `HTTP_BOTH` and the input is a response, this also invoked for the sequence `HTTP/`
+ of the first message.
+* `on_version`: Invoked when another character of the version is received.
+* `on_header_field`: Invoked when another character of a header name is received.
+* `on_header_value`: Invoked when another character of a header value is received.
+* `on_chunk_extension_name`: Invoked when another character of a chunk extension name is received.
+* `on_chunk_extension_value`: Invoked when another character of a extension value is received.
+
+The callback `on_headers_complete`, invoked when headers are completed, can return:
+
+* `0`: Proceed normally.
+* `1`: Assume that request/response has no body, and proceed to parsing the next message.
+* `2`: Assume absence of body (as above) and make `llhttp_execute()` return `HPE_PAUSED_UPGRADE`.
+* `-1`: Error
+* `HPE_PAUSED`: Pause the parser.
+
+### `void llhttp_init(llhttp_t* parser, llhttp_type_t type, const llhttp_settings_t* settings)`
+
+Initialize the parser with specific type and user settings.
+
+### `uint8_t llhttp_get_type(llhttp_t* parser)`
+
+Returns the type of the parser.
+
+### `uint8_t llhttp_get_http_major(llhttp_t* parser)`
+
+Returns the major version of the HTTP protocol of the current request/response.
+
+### `uint8_t llhttp_get_http_minor(llhttp_t* parser)`
+
+Returns the minor version of the HTTP protocol of the current request/response.
+
+### `uint8_t llhttp_get_method(llhttp_t* parser)`
+
+Returns the method of the current request.
+
+### `int llhttp_get_status_code(llhttp_t* parser)`
+
+Returns the method of the current response.
+
+### `uint8_t llhttp_get_upgrade(llhttp_t* parser)`
+
+Returns `1` if request includes the `Connection: upgrade` header.
+
+### `void llhttp_reset(llhttp_t* parser)`
+
+Reset an already initialized parser back to the start state, preserving the
+existing parser type, callback settings, user data, and lenient flags.
+
+### `void llhttp_settings_init(llhttp_settings_t* settings)`
+
+Initialize the settings object.
+
+### `llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len)`
+
+Parse full or partial request/response, invoking user callbacks along the way.
+
+If any of `llhttp_data_cb` returns errno not equal to `HPE_OK` - the parsing interrupts,
+and such errno is returned from `llhttp_execute()`. If `HPE_PAUSED` was used as a errno,
+the execution can be resumed with `llhttp_resume()` call.
+
+In a special case of CONNECT/Upgrade request/response `HPE_PAUSED_UPGRADE` is returned
+after fully parsing the request/response. If the user wishes to continue parsing,
+they need to invoke `llhttp_resume_after_upgrade()`.
+
+**if this function ever returns a non-pause type error, it will continue to return
+the same error upon each successive call up until `llhttp_init()` is called.**
+
+### `llhttp_errno_t llhttp_finish(llhttp_t* parser)`
+
+This method should be called when the other side has no further bytes to
+send (e.g. shutdown of readable side of the TCP connection.)
+
+Requests without `Content-Length` and other messages might require treating
+all incoming bytes as the part of the body, up to the last byte of the
+connection.
+
+This method will invoke `on_message_complete()` callback if the
+request was terminated safely. Otherwise a error code would be returned.
+
+
+### `int llhttp_message_needs_eof(const llhttp_t* parser)`
+
+Returns `1` if the incoming message is parsed until the last byte, and has to be completed by calling `llhttp_finish()` on EOF.
+
+### `int llhttp_should_keep_alive(const llhttp_t* parser)`
+
+Returns `1` if there might be any other messages following the last that was
+successfully parsed.
+
+### `void llhttp_pause(llhttp_t* parser)`
+
+Make further calls of `llhttp_execute()` return `HPE_PAUSED` and set
+appropriate error reason.
+
+**Do not call this from user callbacks! User callbacks must return
+`HPE_PAUSED` if pausing is required.**
+
+### `void llhttp_resume(llhttp_t* parser)`
+
+Might be called to resume the execution after the pause in user's callback.
+
+See `llhttp_execute()` above for details.
+
+**Call this only if `llhttp_execute()` returns `HPE_PAUSED`.**
+
+### `void llhttp_resume_after_upgrade(llhttp_t* parser)`
+
+Might be called to resume the execution after the pause in user's callback.
+See `llhttp_execute()` above for details.
+
+**Call this only if `llhttp_execute()` returns `HPE_PAUSED_UPGRADE`**
+
+### `llhttp_errno_t llhttp_get_errno(const llhttp_t* parser)`
+
+Returns the latest error.
+
+### `const char* llhttp_get_error_reason(const llhttp_t* parser)`
+
+Returns the verbal explanation of the latest returned error.
+
+**User callback should set error reason when returning the error. See
+`llhttp_set_error_reason()` for details.**
+
+### `void llhttp_set_error_reason(llhttp_t* parser, const char* reason)`
+
+Assign verbal description to the returned error. Must be called in user
+callbacks right before returning the errno.
+
+**`HPE_USER` error code might be useful in user callbacks.**
+
+### `const char* llhttp_get_error_pos(const llhttp_t* parser)`
+
+Returns the pointer to the last parsed byte before the returned error. The
+pointer is relative to the `data` argument of `llhttp_execute()`.
+
+**This method might be useful for counting the number of parsed bytes.**
+
+### `const char* llhttp_errno_name(llhttp_errno_t err)`
+
+Returns textual name of error code.
+
+### `const char* llhttp_method_name(llhttp_method_t method)`
+
+Returns textual name of HTTP method.
+
+### `const char* llhttp_status_name(llhttp_status_t status)`
+
+Returns textual name of HTTP status.
+
+### `void llhttp_set_lenient_headers(llhttp_t* parser, int enabled)`
+
+Enables/disables lenient header value parsing (disabled by default).
+Lenient parsing disables header value token checks, extending llhttp's
+protocol support to highly non-compliant clients/server.
+
+No `HPE_INVALID_HEADER_TOKEN` will be raised for incorrect header values when
+lenient parsing is "on".
+
+**USE AT YOUR OWN RISK!**
+
+### `void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled)`
+
+Enables/disables lenient handling of conflicting `Transfer-Encoding` and
+`Content-Length` headers (disabled by default).
+
+Normally `llhttp` would error when `Transfer-Encoding` is present in
+conjunction with `Content-Length`.
+
+This error is important to prevent HTTP request smuggling, but may be less desirable
+for small number of cases involving legacy servers.
+
+**USE AT YOUR OWN RISK!**
+
+### `void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled)`
+
+Enables/disables lenient handling of `Connection: close` and HTTP/1.0
+requests responses.
+
+Normally `llhttp` would error on (in strict mode) or discard (in loose mode)
+the HTTP request/response after the request/response with `Connection: close`
+and `Content-Length`.
+
+This is important to prevent cache poisoning attacks,
+but might interact badly with outdated and insecure clients.
+
+With this flag the extra request/response will be parsed normally.
+
+**USE AT YOUR OWN RISK!**
+
+### `void llhttp_set_lenient_transfer_encoding(llhttp_t* parser, int enabled)`
+
+Enables/disables lenient handling of `Transfer-Encoding` header.
+
+Normally `llhttp` would error when a `Transfer-Encoding` has `chunked` value
+and another value after it (either in a single header or in multiple
+headers whose value are internally joined using `, `).
+
+This is mandated by the spec to reliably determine request body size and thus
+avoid request smuggling.
+
+With this flag the extra value will be parsed normally.
+
+**USE AT YOUR OWN RISK!**
+
+## Build Instructions
+
+Make sure you have [Node.js](https://nodejs.org/), npm and npx installed. Then under project directory run:
+
+```sh
+npm install
+make
+```
+
+---
+
+### Bindings to other languages
+
+* Lua: [MunifTanjim/llhttp.lua][11]
+* Python: [pallas/pyllhttp][8]
+* Ruby: [metabahn/llhttp][9]
+* Rust: [JackLiar/rust-llhttp][10]
+
+### Using with CMake
+
+If you want to use this library in a CMake project as a shared library, you can use the snippet below.
+
+```
+FetchContent_Declare(llhttp
+ URL "https://github.com/nodejs/llhttp/archive/refs/tags/release/v8.1.0.tar.gz")
+
+FetchContent_MakeAvailable(llhttp)
+
+# Link with the llhttp_shared target
+target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp_shared ${PROJECT_NAME})
+```
+
+If you want to use this library in a CMake project as a static library, you can set some cache variables first.
+
+```
+FetchContent_Declare(llhttp
+ URL "https://github.com/nodejs/llhttp/archive/refs/tags/release/v8.1.0.tar.gz")
+
+set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
+set(BUILD_STATIC_LIBS ON CACHE INTERNAL "")
+FetchContent_MakeAvailable(llhttp)
+
+# Link with the llhttp_static target
+target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp_static ${PROJECT_NAME})
+```
+
+_Note that using the git repo directly (e.g., via a git repo url and tag) will not work with FetchContent_Declare because [CMakeLists.txt](./CMakeLists.txt) requires string replacements (e.g., `_RELEASE_`) before it will build._
+
+## Building on Windows
+
+### Installation
+
+* `choco install git`
+* `choco install node`
+* `choco install llvm` (or install the `C++ Clang tools for Windows` optional package from the Visual Studio 2019 installer)
+* `choco install make` (or if you have MinGW, it comes bundled)
+
+1. Ensure that `Clang` and `make` are in your system path.
+2. Using Git Bash, clone the repo to your preferred location.
+3. Cd into the cloned directory and run `npm install`
+5. Run `make`
+6. Your `repo/build` directory should now have `libllhttp.a` and `libllhttp.so` static and dynamic libraries.
+7. When building your executable, you can link to these libraries. Make sure to set the build folder as an include path when building so you can reference the declarations in `repo/build/llhttp.h`.
+
+### A simple example on linking with the library:
+
+Assuming you have an executable `main.cpp` in your current working directory, you would run: `clang++ -Os -g3 -Wall -Wextra -Wno-unused-parameter -I/path/to/llhttp/build main.cpp /path/to/llhttp/build/libllhttp.a -o main.exe`.
+
+If you are getting `unresolved external symbol` linker errors you are likely attempting to build `llhttp.c` without linking it with object files from `api.c` and `http.c`.
+
+#### LICENSE
+
+This software is licensed under the MIT License.
+
+Copyright Fedor Indutny, 2018.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+[0]: https://github.com/nodejs/http-parser
+[1]: https://github.com/nodejs/llparse
+[2]: https://en.wikipedia.org/wiki/Register_allocation#Spilling
+[3]: https://en.wikipedia.org/wiki/Tail_call
+[4]: https://llvm.org/docs/LangRef.html
+[5]: https://llvm.org/docs/LangRef.html#call-instruction
+[6]: https://clang.llvm.org/
+[7]: https://github.com/nodejs/node
+[8]: https://github.com/pallas/pyllhttp
+[9]: https://github.com/metabahn/llhttp
+[10]: https://github.com/JackLiar/rust-llhttp
+[11]: https://github.com/MunifTanjim/llhttp.lua
diff --git a/third_party/python/aiohttp/vendor/llhttp/_config.yml b/third_party/python/aiohttp/vendor/llhttp/_config.yml
new file mode 100644
index 0000000000..18854876c6
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/_config.yml
@@ -0,0 +1 @@
+theme: jekyll-theme-midnight \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/bench/index.ts b/third_party/python/aiohttp/vendor/llhttp/bench/index.ts
new file mode 100644
index 0000000000..953766142b
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/bench/index.ts
@@ -0,0 +1,89 @@
+// NOTE: run `npm test` to build `./test/tmp/http-loose-request`
+
+import * as assert from 'assert';
+import { spawnSync } from 'child_process';
+import { existsSync } from 'fs';
+
+const isURL = !process.argv[2] || process.argv[2] === 'url';
+const isHTTP = !process.argv[2] || process.argv[2] === 'http';
+
+const requests: Map<string, string> = new Map();
+
+if (!existsSync('./test/tmp/http-loose-request.c')) {
+ console.error('Run npm test to build ./test/tmp/http-loose-request');
+ process.exit(1);
+}
+
+requests.set('seanmonstar/httparse',
+ 'GET /wp-content/uploads/2010/03/hello-kitty-darth-vader-pink.jpg HTTP/1.1\r\n' +
+ 'Host: www.kittyhell.com\r\n' +
+ 'User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; ja-JP-mac; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 Pathtraq/0.9\r\n' +
+ 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n' +
+ 'Accept-Language: ja,en-us;q=0.7,en;q=0.3\r\n' +
+ 'Accept-Encoding: gzip,deflate\r\n' +
+ 'Accept-Charset: Shift_JIS,utf-8;q=0.7,*;q=0.7\r\n' +
+ 'Keep-Alive: 115\r\n' +
+ 'Connection: keep-alive\r\n' +
+ 'Cookie: wp_ozh_wsa_visits=2; wp_ozh_wsa_visit_lasttime=xxxxxxxxxx; __utma=xxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.xxxxxxxxxx.x; __utmz=xxxxxxxxx.xxxxxxxxxx.x.x.utmccn=(referral)|utmcsr=reader.livedoor.com|utmcct=/reader/|utmcmd=referral\r\n\r\n');
+
+requests.set('nodejs/http-parser',
+ 'POST /joyent/http-parser HTTP/1.1\r\n' +
+ 'Host: github.com\r\n' +
+ 'DNT: 1\r\n' +
+ 'Accept-Encoding: gzip, deflate, sdch\r\n' +
+ 'Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4\r\n' +
+ 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) ' +
+ 'AppleWebKit/537.36 (KHTML, like Gecko) ' +
+ 'Chrome/39.0.2171.65 Safari/537.36\r\n' +
+ 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,' +
+ 'image/webp,*/*;q=0.8\r\n' +
+ 'Referer: https://github.com/joyent/http-parser\r\n' +
+ 'Connection: keep-alive\r\n' +
+ 'Transfer-Encoding: chunked\r\n' +
+ 'Cache-Control: max-age=0\r\n\r\nb\r\nhello world\r\n0\r\n\r\n');
+
+if (process.argv[2] === 'loop') {
+ const reqName = process.argv[3];
+ assert(requests.has(reqName), `Unknown request name: "${reqName}"`);
+
+ const request = requests.get(reqName)!;
+ spawnSync('./test/tmp/http-loose-request', [
+ 'loop',
+ request
+ ], { stdio: 'inherit' });
+ process.exit(0);
+}
+
+if (isURL) {
+ console.log('url loose (C)');
+
+ spawnSync('./test/tmp/url-loose-url-c', [
+ 'bench',
+ 'http://example.com/path/to/file?query=value#fragment'
+ ], { stdio: 'inherit' });
+
+ console.log('url strict (C)');
+
+ spawnSync('./test/tmp/url-strict-url-c', [
+ 'bench',
+ 'http://example.com/path/to/file?query=value#fragment'
+ ], { stdio: 'inherit' });
+}
+
+if (isHTTP) {
+ for(const [name, request] of requests) {
+ console.log('http loose: "%s" (C)', name);
+
+ spawnSync('./test/tmp/http-loose-request-c', [
+ 'bench',
+ request
+ ], { stdio: 'inherit' });
+
+ console.log('http strict: "%s" (C)', name);
+
+ spawnSync('./test/tmp/http-strict-request-c', [
+ 'bench',
+ request
+ ], { stdio: 'inherit' });
+ }
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/bin/build_wasm.ts b/third_party/python/aiohttp/vendor/llhttp/bin/build_wasm.ts
new file mode 100644
index 0000000000..a8857037fe
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/bin/build_wasm.ts
@@ -0,0 +1,95 @@
+import { execSync } from 'child_process';
+import { copyFileSync, mkdirSync } from 'fs';
+import { join, resolve } from 'path';
+
+let platform = process.env.WASM_PLATFORM ?? '';
+const WASM_OUT = resolve(__dirname, '../build/wasm');
+const WASM_SRC = resolve(__dirname, '../');
+
+if (!platform && process.argv[2]) {
+ platform = execSync('docker info -f "{{.OSType}}/{{.Architecture}}"').toString().trim();
+}
+
+if (process.argv[2] === '--prebuild') {
+ const cmd = `docker build --platform=${platform.toString().trim()} -t llhttp_wasm_builder .`;
+
+ /* tslint:disable-next-line no-console */
+ console.log(`> ${cmd}\n\n`);
+ execSync(cmd, { stdio: 'inherit' });
+
+ process.exit(0);
+}
+
+if (process.argv[2] === '--setup') {
+ try {
+ mkdirSync(join(WASM_SRC, 'build'));
+ process.exit(0);
+ } catch (error) {
+ if (error.code !== 'EEXIST') {
+ throw error;
+ }
+ process.exit(0);
+ }
+}
+
+if (process.argv[2] === '--docker') {
+ let cmd = `docker run --rm -it --platform=${platform.toString().trim()}`;
+ // Try to avoid root permission problems on compiled assets
+ // when running on linux.
+ // It will work flawessly if uid === gid === 1000
+ // there will be some warnings otherwise.
+ if (process.platform === 'linux') {
+ cmd += ` --user ${process.getuid()}:${process.getegid()}`;
+ }
+ cmd += ` --mount type=bind,source=${WASM_SRC}/build,target=/home/node/llhttp/build llhttp_wasm_builder npm run wasm`;
+
+ /* tslint:disable-next-line no-console */
+ console.log(`> ${cmd}\n\n`);
+ execSync(cmd, { cwd: WASM_SRC, stdio: 'inherit' });
+ process.exit(0);
+}
+
+try {
+ mkdirSync(WASM_OUT);
+} catch (error) {
+ if (error.code !== 'EEXIST') {
+ throw error;
+ }
+}
+
+// Build ts
+execSync('npm run build', { cwd: WASM_SRC, stdio: 'inherit' });
+
+// Build wasm binary
+execSync(
+ `clang \
+ --sysroot=/usr/share/wasi-sysroot \
+ -target wasm32-unknown-wasi \
+ -Ofast \
+ -fno-exceptions \
+ -fvisibility=hidden \
+ -mexec-model=reactor \
+ -Wl,-error-limit=0 \
+ -Wl,-O3 \
+ -Wl,--lto-O3 \
+ -Wl,--strip-all \
+ -Wl,--allow-undefined \
+ -Wl,--export-dynamic \
+ -Wl,--export-table \
+ -Wl,--export=malloc \
+ -Wl,--export=free \
+ -Wl,--no-entry \
+ ${join(WASM_SRC, 'build', 'c')}/*.c \
+ ${join(WASM_SRC, 'src', 'native')}/*.c \
+ -I${join(WASM_SRC, 'build')} \
+ -o ${join(WASM_OUT, 'llhttp.wasm')}`,
+ { stdio: 'inherit' },
+);
+
+// Copy constants for `.js` and `.ts` users.
+copyFileSync(join(WASM_SRC, 'lib', 'llhttp', 'constants.js'), join(WASM_OUT, 'constants.js'));
+copyFileSync(join(WASM_SRC, 'lib', 'llhttp', 'constants.js.map'), join(WASM_OUT, 'constants.js.map'));
+copyFileSync(join(WASM_SRC, 'lib', 'llhttp', 'constants.d.ts'), join(WASM_OUT, 'constants.d.ts'));
+copyFileSync(join(WASM_SRC, 'lib', 'llhttp', 'utils.js'), join(WASM_OUT, 'utils.js'));
+copyFileSync(join(WASM_SRC, 'lib', 'llhttp', 'utils.js.map'), join(WASM_OUT, 'utils.js.map'));
+copyFileSync(join(WASM_SRC, 'lib', 'llhttp', 'utils.d.ts'), join(WASM_OUT, 'utils.d.ts'));
diff --git a/third_party/python/aiohttp/vendor/llhttp/bin/generate.ts b/third_party/python/aiohttp/vendor/llhttp/bin/generate.ts
new file mode 100755
index 0000000000..cb0d8c74dd
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/bin/generate.ts
@@ -0,0 +1,101 @@
+#!/usr/bin/env -S npx ts-node
+import * as fs from 'fs';
+import { LLParse } from 'llparse';
+import * as path from 'path';
+import * as semver from 'semver';
+
+import * as llhttp from '../src/llhttp';
+
+const pkgFile = path.join(__dirname, '..', 'package.json');
+const pkg = JSON.parse(fs.readFileSync(pkgFile).toString());
+
+const BUILD_DIR = path.join(__dirname, '..', 'build');
+const C_DIR = path.join(BUILD_DIR, 'c');
+const SRC_DIR = path.join(__dirname, '..', 'src');
+
+const C_FILE = path.join(C_DIR, 'llhttp.c');
+const HEADER_FILE = path.join(BUILD_DIR, 'llhttp.h');
+
+for (const dir of [ BUILD_DIR, C_DIR ]) {
+ try {
+ fs.mkdirSync(dir);
+ } catch (e) {
+ // no-op
+ }
+}
+
+function build(mode: 'strict' | 'loose') {
+ const llparse = new LLParse('llhttp__internal');
+ const instance = new llhttp.HTTP(llparse, mode);
+
+ return llparse.build(instance.build().entry, {
+ c: {
+ header: 'llhttp',
+ },
+ debug: process.env.LLPARSE_DEBUG ? 'llhttp__debug' : undefined,
+ headerGuard: 'INCLUDE_LLHTTP_ITSELF_H_',
+ });
+}
+
+function guard(strict: string, loose: string): string {
+ let out = '';
+
+ if (strict === loose) {
+ return strict;
+ }
+
+ out += '#if LLHTTP_STRICT_MODE\n';
+ out += '\n';
+ out += strict + '\n';
+ out += '\n';
+ out += '#else /* !LLHTTP_STRICT_MODE */\n';
+ out += '\n';
+ out += loose + '\n';
+ out += '\n';
+ out += '#endif /* LLHTTP_STRICT_MODE */\n';
+
+ return out;
+}
+
+const artifacts = {
+ loose: build('loose'),
+ strict: build('strict'),
+};
+
+let headers = '';
+
+headers += '#ifndef INCLUDE_LLHTTP_H_\n';
+headers += '#define INCLUDE_LLHTTP_H_\n';
+
+headers += '\n';
+
+const version = semver.parse(pkg.version)!;
+
+headers += `#define LLHTTP_VERSION_MAJOR ${version.major}\n`;
+headers += `#define LLHTTP_VERSION_MINOR ${version.minor}\n`;
+headers += `#define LLHTTP_VERSION_PATCH ${version.patch}\n`;
+headers += '\n';
+
+headers += '#ifndef LLHTTP_STRICT_MODE\n';
+headers += '# define LLHTTP_STRICT_MODE 0\n';
+headers += '#endif\n';
+headers += '\n';
+
+const cHeaders = new llhttp.CHeaders();
+
+headers += guard(artifacts.strict.header, artifacts.loose.header);
+
+headers += '\n';
+
+headers += cHeaders.build();
+
+headers += '\n';
+
+headers += fs.readFileSync(path.join(SRC_DIR, 'native', 'api.h'));
+
+headers += '\n';
+headers += '#endif /* INCLUDE_LLHTTP_H_ */\n';
+
+fs.writeFileSync(C_FILE,
+ guard(artifacts.strict.c || '', artifacts.loose.c || ''));
+fs.writeFileSync(HEADER_FILE, headers);
diff --git a/third_party/python/aiohttp/vendor/llhttp/build/c/llhttp.c b/third_party/python/aiohttp/vendor/llhttp/build/c/llhttp.c
new file mode 100644
index 0000000000..e426c6d974
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/build/c/llhttp.c
@@ -0,0 +1,18682 @@
+#if LLHTTP_STRICT_MODE
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#ifdef __SSE4_2__
+ #ifdef _MSC_VER
+ #include <nmmintrin.h>
+ #else /* !_MSC_VER */
+ #include <x86intrin.h>
+ #endif /* _MSC_VER */
+#endif /* __SSE4_2__ */
+
+#ifdef _MSC_VER
+ #define ALIGN(n) _declspec(align(n))
+#else /* !_MSC_VER */
+ #define ALIGN(n) __attribute__((aligned(n)))
+#endif /* _MSC_VER */
+
+#include "llhttp.h"
+
+typedef int (*llhttp__internal__span_cb)(
+ llhttp__internal_t*, const char*, const char*);
+
+static const unsigned char llparse_blob0[] = {
+ 0xd, 0xa
+};
+static const unsigned char llparse_blob1[] = {
+ 'o', 'n'
+};
+static const unsigned char llparse_blob2[] = {
+ 'e', 'c', 't', 'i', 'o', 'n'
+};
+static const unsigned char llparse_blob3[] = {
+ 'l', 'o', 's', 'e'
+};
+static const unsigned char llparse_blob4[] = {
+ 'e', 'e', 'p', '-', 'a', 'l', 'i', 'v', 'e'
+};
+static const unsigned char llparse_blob5[] = {
+ 'p', 'g', 'r', 'a', 'd', 'e'
+};
+static const unsigned char llparse_blob6[] = {
+ 'c', 'h', 'u', 'n', 'k', 'e', 'd'
+};
+#ifdef __SSE4_2__
+static const unsigned char ALIGN(16) llparse_blob7[] = {
+ 0x9, 0x9, ' ', '~', 0x80, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0
+};
+#endif /* __SSE4_2__ */
+#ifdef __SSE4_2__
+static const unsigned char ALIGN(16) llparse_blob8[] = {
+ '!', '!', '#', '\'', '*', '+', '-', '.', '0', '9', 'A',
+ 'Z', '^', 'z', '|', '|'
+};
+#endif /* __SSE4_2__ */
+#ifdef __SSE4_2__
+static const unsigned char ALIGN(16) llparse_blob9[] = {
+ '~', '~', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0
+};
+#endif /* __SSE4_2__ */
+static const unsigned char llparse_blob10[] = {
+ 'e', 'n', 't', '-', 'l', 'e', 'n', 'g', 't', 'h'
+};
+static const unsigned char llparse_blob11[] = {
+ 'r', 'o', 'x', 'y', '-', 'c', 'o', 'n', 'n', 'e', 'c',
+ 't', 'i', 'o', 'n'
+};
+static const unsigned char llparse_blob12[] = {
+ 'r', 'a', 'n', 's', 'f', 'e', 'r', '-', 'e', 'n', 'c',
+ 'o', 'd', 'i', 'n', 'g'
+};
+static const unsigned char llparse_blob13[] = {
+ 'p', 'g', 'r', 'a', 'd', 'e'
+};
+static const unsigned char llparse_blob14[] = {
+ 'T', 'T', 'P', '/'
+};
+static const unsigned char llparse_blob15[] = {
+ 0xd, 0xa, 0xd, 0xa, 'S', 'M', 0xd, 0xa, 0xd, 0xa
+};
+static const unsigned char llparse_blob16[] = {
+ 'C', 'E', '/'
+};
+static const unsigned char llparse_blob17[] = {
+ 'T', 'S', 'P', '/'
+};
+static const unsigned char llparse_blob18[] = {
+ 'N', 'O', 'U', 'N', 'C', 'E'
+};
+static const unsigned char llparse_blob19[] = {
+ 'I', 'N', 'D'
+};
+static const unsigned char llparse_blob20[] = {
+ 'E', 'C', 'K', 'O', 'U', 'T'
+};
+static const unsigned char llparse_blob21[] = {
+ 'N', 'E', 'C', 'T'
+};
+static const unsigned char llparse_blob22[] = {
+ 'E', 'T', 'E'
+};
+static const unsigned char llparse_blob23[] = {
+ 'C', 'R', 'I', 'B', 'E'
+};
+static const unsigned char llparse_blob24[] = {
+ 'L', 'U', 'S', 'H'
+};
+static const unsigned char llparse_blob25[] = {
+ 'E', 'T'
+};
+static const unsigned char llparse_blob26[] = {
+ 'P', 'A', 'R', 'A', 'M', 'E', 'T', 'E', 'R'
+};
+static const unsigned char llparse_blob27[] = {
+ 'E', 'A', 'D'
+};
+static const unsigned char llparse_blob28[] = {
+ 'N', 'K'
+};
+static const unsigned char llparse_blob29[] = {
+ 'C', 'K'
+};
+static const unsigned char llparse_blob30[] = {
+ 'S', 'E', 'A', 'R', 'C', 'H'
+};
+static const unsigned char llparse_blob31[] = {
+ 'R', 'G', 'E'
+};
+static const unsigned char llparse_blob32[] = {
+ 'C', 'T', 'I', 'V', 'I', 'T', 'Y'
+};
+static const unsigned char llparse_blob33[] = {
+ 'L', 'E', 'N', 'D', 'A', 'R'
+};
+static const unsigned char llparse_blob34[] = {
+ 'V', 'E'
+};
+static const unsigned char llparse_blob35[] = {
+ 'O', 'T', 'I', 'F', 'Y'
+};
+static const unsigned char llparse_blob36[] = {
+ 'P', 'T', 'I', 'O', 'N', 'S'
+};
+static const unsigned char llparse_blob37[] = {
+ 'C', 'H'
+};
+static const unsigned char llparse_blob38[] = {
+ 'S', 'E'
+};
+static const unsigned char llparse_blob39[] = {
+ 'A', 'Y'
+};
+static const unsigned char llparse_blob40[] = {
+ 'S', 'T'
+};
+static const unsigned char llparse_blob41[] = {
+ 'I', 'N', 'D'
+};
+static const unsigned char llparse_blob42[] = {
+ 'A', 'T', 'C', 'H'
+};
+static const unsigned char llparse_blob43[] = {
+ 'G', 'E'
+};
+static const unsigned char llparse_blob44[] = {
+ 'I', 'N', 'D'
+};
+static const unsigned char llparse_blob45[] = {
+ 'O', 'R', 'D'
+};
+static const unsigned char llparse_blob46[] = {
+ 'I', 'R', 'E', 'C', 'T'
+};
+static const unsigned char llparse_blob47[] = {
+ 'O', 'R', 'T'
+};
+static const unsigned char llparse_blob48[] = {
+ 'R', 'C', 'H'
+};
+static const unsigned char llparse_blob49[] = {
+ 'P', 'A', 'R', 'A', 'M', 'E', 'T', 'E', 'R'
+};
+static const unsigned char llparse_blob50[] = {
+ 'U', 'R', 'C', 'E'
+};
+static const unsigned char llparse_blob51[] = {
+ 'B', 'S', 'C', 'R', 'I', 'B', 'E'
+};
+static const unsigned char llparse_blob52[] = {
+ 'A', 'R', 'D', 'O', 'W', 'N'
+};
+static const unsigned char llparse_blob53[] = {
+ 'A', 'C', 'E'
+};
+static const unsigned char llparse_blob54[] = {
+ 'I', 'N', 'D'
+};
+static const unsigned char llparse_blob55[] = {
+ 'N', 'K'
+};
+static const unsigned char llparse_blob56[] = {
+ 'C', 'K'
+};
+static const unsigned char llparse_blob57[] = {
+ 'U', 'B', 'S', 'C', 'R', 'I', 'B', 'E'
+};
+static const unsigned char llparse_blob58[] = {
+ 'H', 'T', 'T', 'P', '/'
+};
+static const unsigned char llparse_blob59[] = {
+ 'A', 'D'
+};
+static const unsigned char llparse_blob60[] = {
+ 'T', 'P', '/'
+};
+
+enum llparse_match_status_e {
+ kMatchComplete,
+ kMatchPause,
+ kMatchMismatch
+};
+typedef enum llparse_match_status_e llparse_match_status_t;
+
+struct llparse_match_s {
+ llparse_match_status_t status;
+ const unsigned char* current;
+};
+typedef struct llparse_match_s llparse_match_t;
+
+static llparse_match_t llparse__match_sequence_id(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp,
+ const unsigned char* seq, uint32_t seq_len) {
+ uint32_t index;
+ llparse_match_t res;
+
+ index = s->_index;
+ for (; p != endp; p++) {
+ unsigned char current;
+
+ current = *p;
+ if (current == seq[index]) {
+ if (++index == seq_len) {
+ res.status = kMatchComplete;
+ goto reset;
+ }
+ } else {
+ res.status = kMatchMismatch;
+ goto reset;
+ }
+ }
+ s->_index = index;
+ res.status = kMatchPause;
+ res.current = p;
+ return res;
+reset:
+ s->_index = 0;
+ res.current = p;
+ return res;
+}
+
+static llparse_match_t llparse__match_sequence_to_lower(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp,
+ const unsigned char* seq, uint32_t seq_len) {
+ uint32_t index;
+ llparse_match_t res;
+
+ index = s->_index;
+ for (; p != endp; p++) {
+ unsigned char current;
+
+ current = ((*p) >= 'A' && (*p) <= 'Z' ? (*p | 0x20) : (*p));
+ if (current == seq[index]) {
+ if (++index == seq_len) {
+ res.status = kMatchComplete;
+ goto reset;
+ }
+ } else {
+ res.status = kMatchMismatch;
+ goto reset;
+ }
+ }
+ s->_index = index;
+ res.status = kMatchPause;
+ res.current = p;
+ return res;
+reset:
+ s->_index = 0;
+ res.current = p;
+ return res;
+}
+
+static llparse_match_t llparse__match_sequence_to_lower_unsafe(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp,
+ const unsigned char* seq, uint32_t seq_len) {
+ uint32_t index;
+ llparse_match_t res;
+
+ index = s->_index;
+ for (; p != endp; p++) {
+ unsigned char current;
+
+ current = ((*p) | 0x20);
+ if (current == seq[index]) {
+ if (++index == seq_len) {
+ res.status = kMatchComplete;
+ goto reset;
+ }
+ } else {
+ res.status = kMatchMismatch;
+ goto reset;
+ }
+ }
+ s->_index = index;
+ res.status = kMatchPause;
+ res.current = p;
+ return res;
+reset:
+ s->_index = 0;
+ res.current = p;
+ return res;
+}
+
+enum llparse_state_e {
+ s_error,
+ s_n_llhttp__internal__n_closed,
+ s_n_llhttp__internal__n_invoke_llhttp__after_message_complete,
+ s_n_llhttp__internal__n_pause_1,
+ s_n_llhttp__internal__n_invoke_is_equal_upgrade,
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2,
+ s_n_llhttp__internal__n_chunk_data_almost_done,
+ s_n_llhttp__internal__n_consume_content_length,
+ s_n_llhttp__internal__n_span_start_llhttp__on_body,
+ s_n_llhttp__internal__n_invoke_is_equal_content_length,
+ s_n_llhttp__internal__n_chunk_size_almost_done,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete,
+ s_n_llhttp__internal__n_chunk_extension_quoted_value_done,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1,
+ s_n_llhttp__internal__n_error_21,
+ s_n_llhttp__internal__n_chunk_extension_quoted_value,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2,
+ s_n_llhttp__internal__n_error_23,
+ s_n_llhttp__internal__n_chunk_extension_value,
+ s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value,
+ s_n_llhttp__internal__n_error_24,
+ s_n_llhttp__internal__n_chunk_extension_name,
+ s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name,
+ s_n_llhttp__internal__n_chunk_extensions,
+ s_n_llhttp__internal__n_chunk_size_otherwise,
+ s_n_llhttp__internal__n_chunk_size,
+ s_n_llhttp__internal__n_chunk_size_digit,
+ s_n_llhttp__internal__n_invoke_update_content_length_1,
+ s_n_llhttp__internal__n_consume_content_length_1,
+ s_n_llhttp__internal__n_span_start_llhttp__on_body_1,
+ s_n_llhttp__internal__n_eof,
+ s_n_llhttp__internal__n_span_start_llhttp__on_body_2,
+ s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete,
+ s_n_llhttp__internal__n_headers_almost_done,
+ s_n_llhttp__internal__n_header_field_colon_discard_ws,
+ s_n_llhttp__internal__n_error_33,
+ s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete,
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_value,
+ s_n_llhttp__internal__n_header_value_discard_lws,
+ s_n_llhttp__internal__n_header_value_discard_ws_almost_done,
+ s_n_llhttp__internal__n_header_value_lws,
+ s_n_llhttp__internal__n_header_value_almost_done,
+ s_n_llhttp__internal__n_header_value_lenient,
+ s_n_llhttp__internal__n_error_41,
+ s_n_llhttp__internal__n_header_value_otherwise,
+ s_n_llhttp__internal__n_header_value_connection_token,
+ s_n_llhttp__internal__n_header_value_connection_ws,
+ s_n_llhttp__internal__n_header_value_connection_1,
+ s_n_llhttp__internal__n_header_value_connection_2,
+ s_n_llhttp__internal__n_header_value_connection_3,
+ s_n_llhttp__internal__n_header_value_connection,
+ s_n_llhttp__internal__n_error_43,
+ s_n_llhttp__internal__n_error_44,
+ s_n_llhttp__internal__n_header_value_content_length_ws,
+ s_n_llhttp__internal__n_header_value_content_length,
+ s_n_llhttp__internal__n_error_46,
+ s_n_llhttp__internal__n_error_45,
+ s_n_llhttp__internal__n_header_value_te_token_ows,
+ s_n_llhttp__internal__n_header_value,
+ s_n_llhttp__internal__n_header_value_te_token,
+ s_n_llhttp__internal__n_header_value_te_chunked_last,
+ s_n_llhttp__internal__n_header_value_te_chunked,
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1,
+ s_n_llhttp__internal__n_header_value_discard_ws,
+ s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete,
+ s_n_llhttp__internal__n_header_field_general_otherwise,
+ s_n_llhttp__internal__n_header_field_general,
+ s_n_llhttp__internal__n_header_field_colon,
+ s_n_llhttp__internal__n_header_field_3,
+ s_n_llhttp__internal__n_header_field_4,
+ s_n_llhttp__internal__n_header_field_2,
+ s_n_llhttp__internal__n_header_field_1,
+ s_n_llhttp__internal__n_header_field_5,
+ s_n_llhttp__internal__n_header_field_6,
+ s_n_llhttp__internal__n_header_field_7,
+ s_n_llhttp__internal__n_header_field,
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_field,
+ s_n_llhttp__internal__n_header_field_start,
+ s_n_llhttp__internal__n_headers_start,
+ s_n_llhttp__internal__n_url_to_http_09,
+ s_n_llhttp__internal__n_url_skip_to_http09,
+ s_n_llhttp__internal__n_url_skip_lf_to_http09_1,
+ s_n_llhttp__internal__n_url_skip_lf_to_http09,
+ s_n_llhttp__internal__n_req_pri_upgrade,
+ s_n_llhttp__internal__n_req_http_complete_1,
+ s_n_llhttp__internal__n_req_http_complete,
+ s_n_llhttp__internal__n_invoke_load_method_1,
+ s_n_llhttp__internal__n_invoke_llhttp__on_version_complete,
+ s_n_llhttp__internal__n_error_51,
+ s_n_llhttp__internal__n_error_56,
+ s_n_llhttp__internal__n_req_http_minor,
+ s_n_llhttp__internal__n_error_57,
+ s_n_llhttp__internal__n_req_http_dot,
+ s_n_llhttp__internal__n_error_58,
+ s_n_llhttp__internal__n_req_http_major,
+ s_n_llhttp__internal__n_span_start_llhttp__on_version,
+ s_n_llhttp__internal__n_req_http_start_1,
+ s_n_llhttp__internal__n_req_http_start_2,
+ s_n_llhttp__internal__n_req_http_start_3,
+ s_n_llhttp__internal__n_req_http_start,
+ s_n_llhttp__internal__n_url_to_http,
+ s_n_llhttp__internal__n_url_skip_to_http,
+ s_n_llhttp__internal__n_url_fragment,
+ s_n_llhttp__internal__n_span_end_stub_query_3,
+ s_n_llhttp__internal__n_url_query,
+ s_n_llhttp__internal__n_url_query_or_fragment,
+ s_n_llhttp__internal__n_url_path,
+ s_n_llhttp__internal__n_span_start_stub_path_2,
+ s_n_llhttp__internal__n_span_start_stub_path,
+ s_n_llhttp__internal__n_span_start_stub_path_1,
+ s_n_llhttp__internal__n_url_server_with_at,
+ s_n_llhttp__internal__n_url_server,
+ s_n_llhttp__internal__n_url_schema_delim_1,
+ s_n_llhttp__internal__n_url_schema_delim,
+ s_n_llhttp__internal__n_span_end_stub_schema,
+ s_n_llhttp__internal__n_url_schema,
+ s_n_llhttp__internal__n_url_start,
+ s_n_llhttp__internal__n_span_start_llhttp__on_url_1,
+ s_n_llhttp__internal__n_url_entry_normal,
+ s_n_llhttp__internal__n_span_start_llhttp__on_url,
+ s_n_llhttp__internal__n_url_entry_connect,
+ s_n_llhttp__internal__n_req_spaces_before_url,
+ s_n_llhttp__internal__n_req_first_space_before_url,
+ s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1,
+ s_n_llhttp__internal__n_after_start_req_2,
+ s_n_llhttp__internal__n_after_start_req_3,
+ s_n_llhttp__internal__n_after_start_req_1,
+ s_n_llhttp__internal__n_after_start_req_4,
+ s_n_llhttp__internal__n_after_start_req_6,
+ s_n_llhttp__internal__n_after_start_req_8,
+ s_n_llhttp__internal__n_after_start_req_9,
+ s_n_llhttp__internal__n_after_start_req_7,
+ s_n_llhttp__internal__n_after_start_req_5,
+ s_n_llhttp__internal__n_after_start_req_12,
+ s_n_llhttp__internal__n_after_start_req_13,
+ s_n_llhttp__internal__n_after_start_req_11,
+ s_n_llhttp__internal__n_after_start_req_10,
+ s_n_llhttp__internal__n_after_start_req_14,
+ s_n_llhttp__internal__n_after_start_req_17,
+ s_n_llhttp__internal__n_after_start_req_16,
+ s_n_llhttp__internal__n_after_start_req_15,
+ s_n_llhttp__internal__n_after_start_req_18,
+ s_n_llhttp__internal__n_after_start_req_20,
+ s_n_llhttp__internal__n_after_start_req_21,
+ s_n_llhttp__internal__n_after_start_req_19,
+ s_n_llhttp__internal__n_after_start_req_23,
+ s_n_llhttp__internal__n_after_start_req_24,
+ s_n_llhttp__internal__n_after_start_req_26,
+ s_n_llhttp__internal__n_after_start_req_28,
+ s_n_llhttp__internal__n_after_start_req_29,
+ s_n_llhttp__internal__n_after_start_req_27,
+ s_n_llhttp__internal__n_after_start_req_25,
+ s_n_llhttp__internal__n_after_start_req_30,
+ s_n_llhttp__internal__n_after_start_req_22,
+ s_n_llhttp__internal__n_after_start_req_31,
+ s_n_llhttp__internal__n_after_start_req_32,
+ s_n_llhttp__internal__n_after_start_req_35,
+ s_n_llhttp__internal__n_after_start_req_36,
+ s_n_llhttp__internal__n_after_start_req_34,
+ s_n_llhttp__internal__n_after_start_req_37,
+ s_n_llhttp__internal__n_after_start_req_38,
+ s_n_llhttp__internal__n_after_start_req_42,
+ s_n_llhttp__internal__n_after_start_req_43,
+ s_n_llhttp__internal__n_after_start_req_41,
+ s_n_llhttp__internal__n_after_start_req_40,
+ s_n_llhttp__internal__n_after_start_req_39,
+ s_n_llhttp__internal__n_after_start_req_45,
+ s_n_llhttp__internal__n_after_start_req_44,
+ s_n_llhttp__internal__n_after_start_req_33,
+ s_n_llhttp__internal__n_after_start_req_48,
+ s_n_llhttp__internal__n_after_start_req_49,
+ s_n_llhttp__internal__n_after_start_req_50,
+ s_n_llhttp__internal__n_after_start_req_51,
+ s_n_llhttp__internal__n_after_start_req_47,
+ s_n_llhttp__internal__n_after_start_req_46,
+ s_n_llhttp__internal__n_after_start_req_54,
+ s_n_llhttp__internal__n_after_start_req_56,
+ s_n_llhttp__internal__n_after_start_req_57,
+ s_n_llhttp__internal__n_after_start_req_55,
+ s_n_llhttp__internal__n_after_start_req_53,
+ s_n_llhttp__internal__n_after_start_req_58,
+ s_n_llhttp__internal__n_after_start_req_59,
+ s_n_llhttp__internal__n_after_start_req_52,
+ s_n_llhttp__internal__n_after_start_req_61,
+ s_n_llhttp__internal__n_after_start_req_62,
+ s_n_llhttp__internal__n_after_start_req_60,
+ s_n_llhttp__internal__n_after_start_req_65,
+ s_n_llhttp__internal__n_after_start_req_67,
+ s_n_llhttp__internal__n_after_start_req_68,
+ s_n_llhttp__internal__n_after_start_req_66,
+ s_n_llhttp__internal__n_after_start_req_69,
+ s_n_llhttp__internal__n_after_start_req_64,
+ s_n_llhttp__internal__n_after_start_req_63,
+ s_n_llhttp__internal__n_after_start_req,
+ s_n_llhttp__internal__n_span_start_llhttp__on_method_1,
+ s_n_llhttp__internal__n_invoke_llhttp__on_status_complete,
+ s_n_llhttp__internal__n_res_line_almost_done,
+ s_n_llhttp__internal__n_res_status,
+ s_n_llhttp__internal__n_span_start_llhttp__on_status,
+ s_n_llhttp__internal__n_res_status_start,
+ s_n_llhttp__internal__n_res_status_code_otherwise,
+ s_n_llhttp__internal__n_res_status_code_digit_3,
+ s_n_llhttp__internal__n_res_status_code_digit_2,
+ s_n_llhttp__internal__n_res_status_code_digit_1,
+ s_n_llhttp__internal__n_res_after_version,
+ s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1,
+ s_n_llhttp__internal__n_error_73,
+ s_n_llhttp__internal__n_error_85,
+ s_n_llhttp__internal__n_res_http_minor,
+ s_n_llhttp__internal__n_error_86,
+ s_n_llhttp__internal__n_res_http_dot,
+ s_n_llhttp__internal__n_error_87,
+ s_n_llhttp__internal__n_res_http_major,
+ s_n_llhttp__internal__n_span_start_llhttp__on_version_1,
+ s_n_llhttp__internal__n_start_res,
+ s_n_llhttp__internal__n_invoke_llhttp__on_method_complete,
+ s_n_llhttp__internal__n_req_or_res_method_2,
+ s_n_llhttp__internal__n_invoke_update_type_1,
+ s_n_llhttp__internal__n_req_or_res_method_3,
+ s_n_llhttp__internal__n_req_or_res_method_1,
+ s_n_llhttp__internal__n_req_or_res_method,
+ s_n_llhttp__internal__n_span_start_llhttp__on_method,
+ s_n_llhttp__internal__n_start_req_or_res,
+ s_n_llhttp__internal__n_invoke_load_type,
+ s_n_llhttp__internal__n_invoke_update_finish,
+ s_n_llhttp__internal__n_start,
+};
+typedef enum llparse_state_e llparse_state_t;
+
+int llhttp__on_method(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_url(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_version(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_header_field(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_header_value(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_body(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_chunk_extension_name(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_chunk_extension_value(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_status(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_load_initial_message_completed(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->initial_message_completed;
+}
+
+int llhttp__on_reset(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_update_finish(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->finish = 2;
+ return 0;
+}
+
+int llhttp__on_message_begin(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_load_type(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->type;
+}
+
+int llhttp__internal__c_store_method(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ state->method = match;
+ return 0;
+}
+
+int llhttp__on_method_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_is_equal_method(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->method == 5;
+}
+
+int llhttp__internal__c_update_http_major(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->http_major = 0;
+ return 0;
+}
+
+int llhttp__internal__c_update_http_minor(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->http_minor = 9;
+ return 0;
+}
+
+int llhttp__on_url_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_test_lenient_flags(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 1) == 1;
+}
+
+int llhttp__internal__c_test_flags(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->flags & 128) == 128;
+}
+
+int llhttp__on_chunk_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_message_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_is_equal_upgrade(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->upgrade == 1;
+}
+
+int llhttp__after_message_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_update_content_length(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->content_length = 0;
+ return 0;
+}
+
+int llhttp__internal__c_update_initial_message_completed(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->initial_message_completed = 1;
+ return 0;
+}
+
+int llhttp__internal__c_update_finish_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->finish = 0;
+ return 0;
+}
+
+int llhttp__internal__c_test_lenient_flags_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 4) == 4;
+}
+
+int llhttp__internal__c_test_flags_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->flags & 544) == 544;
+}
+
+int llhttp__internal__c_test_lenient_flags_2(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 2) == 2;
+}
+
+int llhttp__before_headers_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_headers_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__after_headers_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_mul_add_content_length(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ /* Multiplication overflow */
+ if (state->content_length > 0xffffffffffffffffULL / 16) {
+ return 1;
+ }
+
+ state->content_length *= 16;
+
+ /* Addition overflow */
+ if (match >= 0) {
+ if (state->content_length > 0xffffffffffffffffULL - match) {
+ return 1;
+ }
+ } else {
+ if (state->content_length < 0ULL - match) {
+ return 1;
+ }
+ }
+ state->content_length += match;
+ return 0;
+}
+
+int llhttp__on_chunk_header(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_is_equal_content_length(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->content_length == 0;
+}
+
+int llhttp__internal__c_or_flags(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 128;
+ return 0;
+}
+
+int llhttp__on_chunk_extension_name_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_chunk_extension_value_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_update_finish_3(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->finish = 1;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 64;
+ return 0;
+}
+
+int llhttp__internal__c_update_upgrade(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->upgrade = 1;
+ return 0;
+}
+
+int llhttp__internal__c_store_header_state(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ state->header_state = match;
+ return 0;
+}
+
+int llhttp__on_header_field_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_load_header_state(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->header_state;
+}
+
+int llhttp__internal__c_or_flags_3(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 1;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 1;
+ return 0;
+}
+
+int llhttp__on_header_value_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_or_flags_4(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 2;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_5(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 4;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_6(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 8;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_3(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 6;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 0;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_6(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 5;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_7(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 7;
+ return 0;
+}
+
+int llhttp__internal__c_test_flags_2(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->flags & 32) == 32;
+}
+
+int llhttp__internal__c_mul_add_content_length_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ /* Multiplication overflow */
+ if (state->content_length > 0xffffffffffffffffULL / 10) {
+ return 1;
+ }
+
+ state->content_length *= 10;
+
+ /* Addition overflow */
+ if (match >= 0) {
+ if (state->content_length > 0xffffffffffffffffULL - match) {
+ return 1;
+ }
+ } else {
+ if (state->content_length < 0ULL - match) {
+ return 1;
+ }
+ }
+ state->content_length += match;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_15(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 32;
+ return 0;
+}
+
+int llhttp__internal__c_test_flags_3(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->flags & 8) == 8;
+}
+
+int llhttp__internal__c_test_lenient_flags_8(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 8) == 8;
+}
+
+int llhttp__internal__c_or_flags_16(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 512;
+ return 0;
+}
+
+int llhttp__internal__c_and_flags(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags &= -9;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_8(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 8;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_18(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 16;
+ return 0;
+}
+
+int llhttp__internal__c_load_method(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->method;
+}
+
+int llhttp__internal__c_store_http_major(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ state->http_major = match;
+ return 0;
+}
+
+int llhttp__internal__c_store_http_minor(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ state->http_minor = match;
+ return 0;
+}
+
+int llhttp__internal__c_test_lenient_flags_10(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 16) == 16;
+}
+
+int llhttp__on_version_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_load_http_major(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->http_major;
+}
+
+int llhttp__internal__c_load_http_minor(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->http_minor;
+}
+
+int llhttp__internal__c_update_status_code(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->status_code = 0;
+ return 0;
+}
+
+int llhttp__internal__c_mul_add_status_code(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ /* Multiplication overflow */
+ if (state->status_code > 0xffff / 10) {
+ return 1;
+ }
+
+ state->status_code *= 10;
+
+ /* Addition overflow */
+ if (match >= 0) {
+ if (state->status_code > 0xffff - match) {
+ return 1;
+ }
+ } else {
+ if (state->status_code < 0 - match) {
+ return 1;
+ }
+ }
+ state->status_code += match;
+ return 0;
+}
+
+int llhttp__on_status_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_update_type(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->type = 1;
+ return 0;
+}
+
+int llhttp__internal__c_update_type_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->type = 2;
+ return 0;
+}
+
+int llhttp__internal_init(llhttp__internal_t* state) {
+ memset(state, 0, sizeof(*state));
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_start;
+ return 0;
+}
+
+static llparse_state_t llhttp__internal__run(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ int match;
+ switch ((llparse_state_t) (intptr_t) state->_current) {
+ case s_n_llhttp__internal__n_closed:
+ s_n_llhttp__internal__n_closed: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_closed;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_closed;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_closed;
+ }
+ default: {
+ p++;
+ goto s_n_llhttp__internal__n_error_7;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__after_message_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__after_message_complete: {
+ switch (llhttp__after_message_complete(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_update_content_length;
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_finish_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_pause_1:
+ s_n_llhttp__internal__n_pause_1: {
+ state->error = 0x16;
+ state->reason = "Pause on CONNECT/Upgrade";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__after_message_complete;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_is_equal_upgrade:
+ s_n_llhttp__internal__n_invoke_is_equal_upgrade: {
+ switch (llhttp__internal__c_is_equal_upgrade(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_message_complete;
+ default:
+ goto s_n_llhttp__internal__n_pause_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2:
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2: {
+ switch (llhttp__on_message_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_is_equal_upgrade;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_11;
+ default:
+ goto s_n_llhttp__internal__n_error_28;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_data_almost_done:
+ s_n_llhttp__internal__n_chunk_data_almost_done: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_data_almost_done;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob0, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_complete;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_chunk_data_almost_done;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_consume_content_length:
+ s_n_llhttp__internal__n_consume_content_length: {
+ size_t avail;
+ uint64_t need;
+
+ avail = endp - p;
+ need = state->content_length;
+ if (avail >= need) {
+ p += need;
+ state->content_length = 0;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_body;
+ }
+
+ state->content_length -= avail;
+ return s_n_llhttp__internal__n_consume_content_length;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_body:
+ s_n_llhttp__internal__n_span_start_llhttp__on_body: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_body;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_body;
+ goto s_n_llhttp__internal__n_consume_content_length;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_is_equal_content_length:
+ s_n_llhttp__internal__n_invoke_is_equal_content_length: {
+ switch (llhttp__internal__c_is_equal_content_length(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_body;
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_size_almost_done:
+ s_n_llhttp__internal__n_chunk_size_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_size_almost_done;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_header;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_12;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete: {
+ switch (llhttp__on_chunk_extension_name_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_size_almost_done;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_5;
+ default:
+ goto s_n_llhttp__internal__n_error_15;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1: {
+ switch (llhttp__on_chunk_extension_name_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_extensions;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_6;
+ default:
+ goto s_n_llhttp__internal__n_error_16;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete: {
+ switch (llhttp__on_chunk_extension_value_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_size_almost_done;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_7;
+ default:
+ goto s_n_llhttp__internal__n_error_18;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extension_quoted_value_done:
+ s_n_llhttp__internal__n_chunk_extension_quoted_value_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extension_quoted_value_done;
+ }
+ switch (*p) {
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_size_almost_done;
+ }
+ case ';': {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extensions;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_20;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1: {
+ switch (llhttp__on_chunk_extension_value_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_extension_quoted_value_done;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_8;
+ default:
+ goto s_n_llhttp__internal__n_error_19;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_21:
+ s_n_llhttp__internal__n_error_21: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions quoted value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extension_quoted_value:
+ s_n_llhttp__internal__n_chunk_extension_quoted_value: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extension_quoted_value;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extension_quoted_value;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_2;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2: {
+ switch (llhttp__on_chunk_extension_value_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_size_otherwise;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_9;
+ default:
+ goto s_n_llhttp__internal__n_error_22;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_23:
+ s_n_llhttp__internal__n_error_23: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extension_value:
+ s_n_llhttp__internal__n_chunk_extension_value: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 2, 3, 2, 2, 2, 2, 2, 0, 0, 2, 2, 0, 2, 2, 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 4, 0, 0, 0, 0,
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extension_value;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extension_value;
+ }
+ case 3: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extension_quoted_value;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_4;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value:
+ s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_chunk_extension_value;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_2;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_24:
+ s_n_llhttp__internal__n_error_24: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions name";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extension_name:
+ s_n_llhttp__internal__n_chunk_extension_name: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 2, 0, 2, 2, 2, 2, 2, 0, 0, 2, 2, 0, 2, 2, 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 0, 4, 0, 0,
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extension_name;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extension_name;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_1;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_3;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name:
+ s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_chunk_extension_name;
+ goto s_n_llhttp__internal__n_chunk_extension_name;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extensions:
+ s_n_llhttp__internal__n_chunk_extensions: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extensions;
+ }
+ switch (*p) {
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_error_13;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_error_14;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_size_otherwise:
+ s_n_llhttp__internal__n_chunk_size_otherwise: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_size_otherwise;
+ }
+ switch (*p) {
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_size_almost_done;
+ }
+ case ';': {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extensions;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_25;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_size:
+ s_n_llhttp__internal__n_chunk_size: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_size;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'A': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'B': {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'C': {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'D': {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'E': {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'F': {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'a': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'b': {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'c': {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'd': {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'e': {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'f': {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_chunk_size_otherwise;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_size_digit:
+ s_n_llhttp__internal__n_chunk_size_digit: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_size_digit;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'A': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'B': {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'C': {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'D': {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'E': {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'F': {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'a': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'b': {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'c': {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'd': {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'e': {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'f': {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_27;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_update_content_length_1:
+ s_n_llhttp__internal__n_invoke_update_content_length_1: {
+ switch (llhttp__internal__c_update_content_length(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_chunk_size_digit;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_consume_content_length_1:
+ s_n_llhttp__internal__n_consume_content_length_1: {
+ size_t avail;
+ uint64_t need;
+
+ avail = endp - p;
+ need = state->content_length;
+ if (avail >= need) {
+ p += need;
+ state->content_length = 0;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_body_1;
+ }
+
+ state->content_length -= avail;
+ return s_n_llhttp__internal__n_consume_content_length_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_body_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_body_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_body_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_body;
+ goto s_n_llhttp__internal__n_consume_content_length_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_eof:
+ s_n_llhttp__internal__n_eof: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_eof;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_eof;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_body_2:
+ s_n_llhttp__internal__n_span_start_llhttp__on_body_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_body_2;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_body;
+ goto s_n_llhttp__internal__n_eof;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete: {
+ switch (llhttp__after_headers_complete(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_1;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_update_content_length_1;
+ case 3:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_body_1;
+ case 4:
+ goto s_n_llhttp__internal__n_invoke_update_finish_3;
+ case 5:
+ goto s_n_llhttp__internal__n_error_29;
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_headers_almost_done:
+ s_n_llhttp__internal__n_headers_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_headers_almost_done;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_flags;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_32;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_colon_discard_ws:
+ s_n_llhttp__internal__n_header_field_colon_discard_ws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_colon_discard_ws;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_colon_discard_ws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_field_colon;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_33:
+ s_n_llhttp__internal__n_error_33: {
+ state->error = 0xa;
+ state->reason = "Invalid header field char";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete: {
+ switch (llhttp__on_header_value_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_header_field_start;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_14;
+ default:
+ goto s_n_llhttp__internal__n_error_37;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_header_value:
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_value: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_header_value;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_header_value;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_discard_lws:
+ s_n_llhttp__internal__n_header_value_discard_lws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_discard_lws;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_5;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_5;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_load_header_state;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_discard_ws_almost_done:
+ s_n_llhttp__internal__n_header_value_discard_ws_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_discard_ws_almost_done;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_discard_lws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_6;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_lws:
+ s_n_llhttp__internal__n_header_value_lws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_lws;
+ }
+ switch (*p) {
+ case 9: {
+ goto s_n_llhttp__internal__n_invoke_load_header_state_3;
+ }
+ case ' ': {
+ goto s_n_llhttp__internal__n_invoke_load_header_state_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_load_header_state_4;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_almost_done:
+ s_n_llhttp__internal__n_header_value_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_almost_done;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_lws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_40;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_lenient:
+ s_n_llhttp__internal__n_header_value_lenient: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_lenient;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_3;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4;
+ }
+ default: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_lenient;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_41:
+ s_n_llhttp__internal__n_error_41: {
+ state->error = 0xa;
+ state->reason = "Invalid header value char";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_otherwise:
+ s_n_llhttp__internal__n_header_value_otherwise: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ switch (*p) {
+ case 13: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_7;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_token:
+ s_n_llhttp__internal__n_header_value_connection_token: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_ws:
+ s_n_llhttp__internal__n_header_value_connection_ws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ case ',': {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_load_header_state_5;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_5;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_1:
+ s_n_llhttp__internal__n_header_value_connection_1: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_1;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob3, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_header_state_3;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_value_connection_1;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_2:
+ s_n_llhttp__internal__n_header_value_connection_2: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_2;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob4, 9);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_header_state_6;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_value_connection_2;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_3:
+ s_n_llhttp__internal__n_header_value_connection_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_3;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob5, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_header_state_7;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_value_connection_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection:
+ s_n_llhttp__internal__n_header_value_connection: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection;
+ }
+ switch (((*p) >= 'A' && (*p) <= 'Z' ? (*p | 0x20) : (*p))) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ case 'c': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_1;
+ }
+ case 'k': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_2;
+ }
+ case 'u': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_43:
+ s_n_llhttp__internal__n_error_43: {
+ state->error = 0xb;
+ state->reason = "Content-Length overflow";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_44:
+ s_n_llhttp__internal__n_error_44: {
+ state->error = 0xb;
+ state->reason = "Invalid character in Content-Length";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_content_length_ws:
+ s_n_llhttp__internal__n_header_value_content_length_ws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_content_length_ws;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_invoke_or_flags_15;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_invoke_or_flags_15;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_content_length_ws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_6;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_content_length:
+ s_n_llhttp__internal__n_header_value_content_length: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_content_length;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_content_length_ws;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_46:
+ s_n_llhttp__internal__n_error_46: {
+ state->error = 0xf;
+ state->reason = "Invalid `Transfer-Encoding` header value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_45:
+ s_n_llhttp__internal__n_error_45: {
+ state->error = 0xf;
+ state->reason = "Invalid `Transfer-Encoding` header value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_te_token_ows:
+ s_n_llhttp__internal__n_header_value_te_token_ows: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_te_token_ows;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_token_ows;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_token_ows;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value:
+ s_n_llhttp__internal__n_header_value: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value;
+ }
+ #ifdef __SSE4_2__
+ if (endp - p >= 16) {
+ __m128i ranges;
+ __m128i input;
+ int avail;
+ int match_len;
+
+ /* Load input */
+ input = _mm_loadu_si128((__m128i const*) p);
+ ranges = _mm_loadu_si128((__m128i const*) llparse_blob7);
+
+ /* Find first character that does not match `ranges` */
+ match_len = _mm_cmpestri(ranges, 6,
+ input, 16,
+ _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES |
+ _SIDD_NEGATIVE_POLARITY);
+
+ if (match_len != 0) {
+ p += match_len;
+ goto s_n_llhttp__internal__n_header_value;
+ }
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ #endif /* __SSE4_2__ */
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_te_token:
+ s_n_llhttp__internal__n_header_value_te_token: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_te_token;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_token;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_token_ows;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_9;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_te_chunked_last:
+ s_n_llhttp__internal__n_header_value_te_chunked_last: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_te_chunked_last;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_8;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_8;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_chunked_last;
+ }
+ case ',': {
+ goto s_n_llhttp__internal__n_invoke_load_type_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_te_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_te_chunked:
+ s_n_llhttp__internal__n_header_value_te_chunked: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ match_seq = llparse__match_sequence_to_lower_unsafe(state, p, endp, llparse_blob6, 7);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_chunked_last;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_header_value_te_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_header_value;
+ goto s_n_llhttp__internal__n_invoke_load_header_state_2;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_discard_ws:
+ s_n_llhttp__internal__n_header_value_discard_ws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_discard_ws;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_discard_ws;
+ }
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_4;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_discard_ws_almost_done;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_discard_ws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete: {
+ switch (llhttp__on_header_field_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_header_value_discard_ws;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_15;
+ default:
+ goto s_n_llhttp__internal__n_error_34;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_general_otherwise:
+ s_n_llhttp__internal__n_header_field_general_otherwise: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_general_otherwise;
+ }
+ switch (*p) {
+ case ':': {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_47;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_general:
+ s_n_llhttp__internal__n_header_field_general: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_general;
+ }
+ #ifdef __SSE4_2__
+ if (endp - p >= 16) {
+ __m128i ranges;
+ __m128i input;
+ int avail;
+ int match_len;
+
+ /* Load input */
+ input = _mm_loadu_si128((__m128i const*) p);
+ ranges = _mm_loadu_si128((__m128i const*) llparse_blob8);
+
+ /* Find first character that does not match `ranges` */
+ match_len = _mm_cmpestri(ranges, 16,
+ input, 16,
+ _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES |
+ _SIDD_NEGATIVE_POLARITY);
+
+ if (match_len != 0) {
+ p += match_len;
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ ranges = _mm_loadu_si128((__m128i const*) llparse_blob9);
+
+ /* Find first character that does not match `ranges` */
+ match_len = _mm_cmpestri(ranges, 2,
+ input, 16,
+ _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES |
+ _SIDD_NEGATIVE_POLARITY);
+
+ if (match_len != 0) {
+ p += match_len;
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ goto s_n_llhttp__internal__n_header_field_general_otherwise;
+ }
+ #endif /* __SSE4_2__ */
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_field_general_otherwise;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_colon:
+ s_n_llhttp__internal__n_header_field_colon: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_colon;
+ }
+ switch (*p) {
+ case ' ': {
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_3;
+ }
+ case ':': {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_10;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_3:
+ s_n_llhttp__internal__n_header_field_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_3;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob2, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_4:
+ s_n_llhttp__internal__n_header_field_4: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_4;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob10, 10);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_4;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_2:
+ s_n_llhttp__internal__n_header_field_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_2;
+ }
+ switch (((*p) >= 'A' && (*p) <= 'Z' ? (*p | 0x20) : (*p))) {
+ case 'n': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_3;
+ }
+ case 't': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_4;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_1:
+ s_n_llhttp__internal__n_header_field_1: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_1;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob1, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_2;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_1;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_5:
+ s_n_llhttp__internal__n_header_field_5: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_5;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob11, 15);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_5;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_6:
+ s_n_llhttp__internal__n_header_field_6: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_6;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob12, 16);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_6;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_7:
+ s_n_llhttp__internal__n_header_field_7: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_7;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob13, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_7;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field:
+ s_n_llhttp__internal__n_header_field: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field;
+ }
+ switch (((*p) >= 'A' && (*p) <= 'Z' ? (*p | 0x20) : (*p))) {
+ case 'c': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_1;
+ }
+ case 'p': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_5;
+ }
+ case 't': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_6;
+ }
+ case 'u': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_7;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_header_field:
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_field: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_header_field;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_header_field;
+ goto s_n_llhttp__internal__n_header_field;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_start:
+ s_n_llhttp__internal__n_header_field_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_start;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_headers_almost_done;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_headers_almost_done;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_field;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_headers_start:
+ s_n_llhttp__internal__n_headers_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_headers_start;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_field_start;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_to_http_09:
+ s_n_llhttp__internal__n_url_to_http_09: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_to_http_09;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_http_major;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_skip_to_http09:
+ s_n_llhttp__internal__n_url_skip_to_http09: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_skip_to_http09;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ default: {
+ p++;
+ goto s_n_llhttp__internal__n_url_to_http_09;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_skip_lf_to_http09_1:
+ s_n_llhttp__internal__n_url_skip_lf_to_http09_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_skip_lf_to_http09_1;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_url_to_http_09;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_48;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_skip_lf_to_http09:
+ s_n_llhttp__internal__n_url_skip_lf_to_http09: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_48;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_pri_upgrade:
+ s_n_llhttp__internal__n_req_pri_upgrade: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_pri_upgrade;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob15, 10);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_error_54;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_pri_upgrade;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_55;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_complete_1:
+ s_n_llhttp__internal__n_req_http_complete_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_complete_1;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_headers_start;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_53;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_complete:
+ s_n_llhttp__internal__n_req_http_complete: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_complete;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_headers_start;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_complete_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_53;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_load_method_1:
+ s_n_llhttp__internal__n_invoke_load_method_1: {
+ switch (llhttp__internal__c_load_method(state, p, endp)) {
+ case 34:
+ goto s_n_llhttp__internal__n_req_pri_upgrade;
+ default:
+ goto s_n_llhttp__internal__n_req_http_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_version_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_version_complete: {
+ switch (llhttp__on_version_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_load_method_1;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_17;
+ default:
+ goto s_n_llhttp__internal__n_error_52;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_51:
+ s_n_llhttp__internal__n_error_51: {
+ state->error = 0x9;
+ state->reason = "Invalid HTTP version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_56:
+ s_n_llhttp__internal__n_error_56: {
+ state->error = 0x9;
+ state->reason = "Invalid minor version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_minor:
+ s_n_llhttp__internal__n_req_http_minor: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_minor;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_2;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_57:
+ s_n_llhttp__internal__n_error_57: {
+ state->error = 0x9;
+ state->reason = "Expected dot";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_dot:
+ s_n_llhttp__internal__n_req_http_dot: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_dot;
+ }
+ switch (*p) {
+ case '.': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_minor;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_3;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_58:
+ s_n_llhttp__internal__n_error_58: {
+ state->error = 0x9;
+ state->reason = "Invalid major version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_major:
+ s_n_llhttp__internal__n_req_http_major: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_major;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_4;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_version:
+ s_n_llhttp__internal__n_span_start_llhttp__on_version: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_version;
+ goto s_n_llhttp__internal__n_req_http_major;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_start_1:
+ s_n_llhttp__internal__n_req_http_start_1: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_start_1;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob14, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_load_method;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_http_start_1;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_61;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_start_2:
+ s_n_llhttp__internal__n_req_http_start_2: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_start_2;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob16, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_load_method_2;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_http_start_2;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_61;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_start_3:
+ s_n_llhttp__internal__n_req_http_start_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_start_3;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob17, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_load_method_3;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_http_start_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_61;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_start:
+ s_n_llhttp__internal__n_req_http_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_start;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_start;
+ }
+ case 'H': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_start_1;
+ }
+ case 'I': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_start_2;
+ }
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_start_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_61;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_to_http:
+ s_n_llhttp__internal__n_url_to_http: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_to_http;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_url_complete_1;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_skip_to_http:
+ s_n_llhttp__internal__n_url_skip_to_http: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_skip_to_http;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ default: {
+ p++;
+ goto s_n_llhttp__internal__n_url_to_http;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_fragment:
+ s_n_llhttp__internal__n_url_fragment: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_fragment;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_6;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_7;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_8;
+ }
+ case 5: {
+ p++;
+ goto s_n_llhttp__internal__n_url_fragment;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_62;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_end_stub_query_3:
+ s_n_llhttp__internal__n_span_end_stub_query_3: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_end_stub_query_3;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_fragment;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_query:
+ s_n_llhttp__internal__n_url_query: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 5, 5, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_query;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_9;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_10;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_11;
+ }
+ case 5: {
+ p++;
+ goto s_n_llhttp__internal__n_url_query;
+ }
+ case 6: {
+ goto s_n_llhttp__internal__n_span_end_stub_query_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_63;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_query_or_fragment:
+ s_n_llhttp__internal__n_url_query_or_fragment: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_query_or_fragment;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 10: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_3;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_4;
+ }
+ case ' ': {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_5;
+ }
+ case '#': {
+ p++;
+ goto s_n_llhttp__internal__n_url_fragment;
+ }
+ case '?': {
+ p++;
+ goto s_n_llhttp__internal__n_url_query;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_64;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_path:
+ s_n_llhttp__internal__n_url_path: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_path;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_url_path;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_url_query_or_fragment;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_stub_path_2:
+ s_n_llhttp__internal__n_span_start_stub_path_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_stub_path_2;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_path;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_stub_path:
+ s_n_llhttp__internal__n_span_start_stub_path: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_stub_path;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_path;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_stub_path_1:
+ s_n_llhttp__internal__n_span_start_stub_path_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_stub_path_1;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_path;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_server_with_at:
+ s_n_llhttp__internal__n_url_server_with_at: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 0, 7,
+ 8, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 0, 5,
+ 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_server_with_at;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_12;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_13;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_14;
+ }
+ case 5: {
+ p++;
+ goto s_n_llhttp__internal__n_url_server;
+ }
+ case 6: {
+ goto s_n_llhttp__internal__n_span_start_stub_path_1;
+ }
+ case 7: {
+ p++;
+ goto s_n_llhttp__internal__n_url_query;
+ }
+ case 8: {
+ p++;
+ goto s_n_llhttp__internal__n_error_65;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_66;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_server:
+ s_n_llhttp__internal__n_url_server: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 5, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 0, 7,
+ 8, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 5, 0, 5,
+ 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 0, 0, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_server;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_1;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_2;
+ }
+ case 5: {
+ p++;
+ goto s_n_llhttp__internal__n_url_server;
+ }
+ case 6: {
+ goto s_n_llhttp__internal__n_span_start_stub_path;
+ }
+ case 7: {
+ p++;
+ goto s_n_llhttp__internal__n_url_query;
+ }
+ case 8: {
+ p++;
+ goto s_n_llhttp__internal__n_url_server_with_at;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_67;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_schema_delim_1:
+ s_n_llhttp__internal__n_url_schema_delim_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_schema_delim_1;
+ }
+ switch (*p) {
+ case '/': {
+ p++;
+ goto s_n_llhttp__internal__n_url_server;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_69;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_schema_delim:
+ s_n_llhttp__internal__n_url_schema_delim: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_schema_delim;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_error_68;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_error_68;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_error_68;
+ }
+ case '/': {
+ p++;
+ goto s_n_llhttp__internal__n_url_schema_delim_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_69;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_end_stub_schema:
+ s_n_llhttp__internal__n_span_end_stub_schema: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_end_stub_schema;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_schema_delim;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_schema:
+ s_n_llhttp__internal__n_url_schema: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0,
+ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,
+ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_schema;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_error_68;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_stub_schema;
+ }
+ case 4: {
+ p++;
+ goto s_n_llhttp__internal__n_url_schema;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_70;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_start:
+ s_n_llhttp__internal__n_url_start: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 3,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,
+ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_start;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_error_68;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_start_stub_path_2;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_url_schema;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_71;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_url_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_url_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_url_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_url;
+ goto s_n_llhttp__internal__n_url_start;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_entry_normal:
+ s_n_llhttp__internal__n_url_entry_normal: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_entry_normal;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_url_1;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_url:
+ s_n_llhttp__internal__n_span_start_llhttp__on_url: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_url;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_url;
+ goto s_n_llhttp__internal__n_url_server;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_entry_connect:
+ s_n_llhttp__internal__n_url_entry_connect: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_entry_connect;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ case 12: {
+ p++;
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_url;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_spaces_before_url:
+ s_n_llhttp__internal__n_req_spaces_before_url: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_spaces_before_url;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_req_spaces_before_url;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_is_equal_method;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_first_space_before_url:
+ s_n_llhttp__internal__n_req_first_space_before_url: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_first_space_before_url;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_req_spaces_before_url;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_72;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1:
+ s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1: {
+ switch (llhttp__on_method_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_req_first_space_before_url;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_22;
+ default:
+ goto s_n_llhttp__internal__n_error_89;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_2:
+ s_n_llhttp__internal__n_after_start_req_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_2;
+ }
+ switch (*p) {
+ case 'L': {
+ p++;
+ match = 19;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_3:
+ s_n_llhttp__internal__n_after_start_req_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_3;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob18, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 36;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_1:
+ s_n_llhttp__internal__n_after_start_req_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_1;
+ }
+ switch (*p) {
+ case 'C': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_2;
+ }
+ case 'N': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_4:
+ s_n_llhttp__internal__n_after_start_req_4: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_4;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob19, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 16;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_4;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_6:
+ s_n_llhttp__internal__n_after_start_req_6: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_6;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob20, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 22;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_6;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_8:
+ s_n_llhttp__internal__n_after_start_req_8: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_8;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob21, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_8;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_9:
+ s_n_llhttp__internal__n_after_start_req_9: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_9;
+ }
+ switch (*p) {
+ case 'Y': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_7:
+ s_n_llhttp__internal__n_after_start_req_7: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_7;
+ }
+ switch (*p) {
+ case 'N': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_8;
+ }
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_9;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_5:
+ s_n_llhttp__internal__n_after_start_req_5: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_5;
+ }
+ switch (*p) {
+ case 'H': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_6;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_7;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_12:
+ s_n_llhttp__internal__n_after_start_req_12: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_12;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob22, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_12;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_13:
+ s_n_llhttp__internal__n_after_start_req_13: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_13;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob23, 5);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 35;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_13;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_11:
+ s_n_llhttp__internal__n_after_start_req_11: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_11;
+ }
+ switch (*p) {
+ case 'L': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_12;
+ }
+ case 'S': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_13;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_10:
+ s_n_llhttp__internal__n_after_start_req_10: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_10;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_11;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_14:
+ s_n_llhttp__internal__n_after_start_req_14: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_14;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob24, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 45;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_14;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_17:
+ s_n_llhttp__internal__n_after_start_req_17: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_17;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob26, 9);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 41;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_17;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_16:
+ s_n_llhttp__internal__n_after_start_req_16: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_16;
+ }
+ switch (*p) {
+ case '_': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_17;
+ }
+ default: {
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_15:
+ s_n_llhttp__internal__n_after_start_req_15: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_15;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob25, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_16;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_15;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_18:
+ s_n_llhttp__internal__n_after_start_req_18: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_18;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob27, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_18;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_20:
+ s_n_llhttp__internal__n_after_start_req_20: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_20;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob28, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 31;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_20;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_21:
+ s_n_llhttp__internal__n_after_start_req_21: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_21;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob29, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_21;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_19:
+ s_n_llhttp__internal__n_after_start_req_19: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_19;
+ }
+ switch (*p) {
+ case 'I': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_20;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_21;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_23:
+ s_n_llhttp__internal__n_after_start_req_23: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_23;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob30, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 24;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_23;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_24:
+ s_n_llhttp__internal__n_after_start_req_24: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_24;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob31, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 23;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_24;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_26:
+ s_n_llhttp__internal__n_after_start_req_26: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_26;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob32, 7);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 21;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_26;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_28:
+ s_n_llhttp__internal__n_after_start_req_28: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_28;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob33, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 30;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_28;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_29:
+ s_n_llhttp__internal__n_after_start_req_29: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_29;
+ }
+ switch (*p) {
+ case 'L': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_27:
+ s_n_llhttp__internal__n_after_start_req_27: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_27;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_28;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_29;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_25:
+ s_n_llhttp__internal__n_after_start_req_25: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_25;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_26;
+ }
+ case 'C': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_27;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_30:
+ s_n_llhttp__internal__n_after_start_req_30: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_30;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob34, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_30;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_22:
+ s_n_llhttp__internal__n_after_start_req_22: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_22;
+ }
+ switch (*p) {
+ case '-': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_23;
+ }
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_24;
+ }
+ case 'K': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_25;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_30;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_31:
+ s_n_llhttp__internal__n_after_start_req_31: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_31;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob35, 5);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 25;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_31;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_32:
+ s_n_llhttp__internal__n_after_start_req_32: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_32;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob36, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_32;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_35:
+ s_n_llhttp__internal__n_after_start_req_35: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_35;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob37, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 28;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_35;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_36:
+ s_n_llhttp__internal__n_after_start_req_36: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_36;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob38, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 39;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_36;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_34:
+ s_n_llhttp__internal__n_after_start_req_34: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_34;
+ }
+ switch (*p) {
+ case 'T': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_35;
+ }
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_36;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_37:
+ s_n_llhttp__internal__n_after_start_req_37: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_37;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob39, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 38;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_37;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_38:
+ s_n_llhttp__internal__n_after_start_req_38: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_38;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob40, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_38;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_42:
+ s_n_llhttp__internal__n_after_start_req_42: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_42;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob41, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_42;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_43:
+ s_n_llhttp__internal__n_after_start_req_43: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_43;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob42, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_43;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_41:
+ s_n_llhttp__internal__n_after_start_req_41: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_41;
+ }
+ switch (*p) {
+ case 'F': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_42;
+ }
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_43;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_40:
+ s_n_llhttp__internal__n_after_start_req_40: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_40;
+ }
+ switch (*p) {
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_41;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_39:
+ s_n_llhttp__internal__n_after_start_req_39: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_39;
+ }
+ switch (*p) {
+ case 'I': {
+ p++;
+ match = 34;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_40;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_45:
+ s_n_llhttp__internal__n_after_start_req_45: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_45;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob43, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 29;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_45;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_44:
+ s_n_llhttp__internal__n_after_start_req_44: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_44;
+ }
+ switch (*p) {
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_45;
+ }
+ case 'T': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_33:
+ s_n_llhttp__internal__n_after_start_req_33: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_33;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_34;
+ }
+ case 'L': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_37;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_38;
+ }
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_39;
+ }
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_44;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_48:
+ s_n_llhttp__internal__n_after_start_req_48: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_48;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob44, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 17;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_48;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_49:
+ s_n_llhttp__internal__n_after_start_req_49: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_49;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob45, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 44;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_49;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_50:
+ s_n_llhttp__internal__n_after_start_req_50: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_50;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob46, 5);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 43;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_50;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_51:
+ s_n_llhttp__internal__n_after_start_req_51: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_51;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob47, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 20;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_51;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_47:
+ s_n_llhttp__internal__n_after_start_req_47: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_47;
+ }
+ switch (*p) {
+ case 'B': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_48;
+ }
+ case 'C': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_49;
+ }
+ case 'D': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_50;
+ }
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_51;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_46:
+ s_n_llhttp__internal__n_after_start_req_46: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_46;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_47;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_54:
+ s_n_llhttp__internal__n_after_start_req_54: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_54;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob48, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_54;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_56:
+ s_n_llhttp__internal__n_after_start_req_56: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_56;
+ }
+ switch (*p) {
+ case 'P': {
+ p++;
+ match = 37;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_57:
+ s_n_llhttp__internal__n_after_start_req_57: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_57;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob49, 9);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 42;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_57;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_55:
+ s_n_llhttp__internal__n_after_start_req_55: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_55;
+ }
+ switch (*p) {
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_56;
+ }
+ case '_': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_57;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_53:
+ s_n_llhttp__internal__n_after_start_req_53: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_53;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_54;
+ }
+ case 'T': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_55;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_58:
+ s_n_llhttp__internal__n_after_start_req_58: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_58;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob50, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 33;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_58;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_59:
+ s_n_llhttp__internal__n_after_start_req_59: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_59;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob51, 7);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 26;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_59;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_52:
+ s_n_llhttp__internal__n_after_start_req_52: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_52;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_53;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_58;
+ }
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_59;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_61:
+ s_n_llhttp__internal__n_after_start_req_61: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_61;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob52, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 40;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_61;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_62:
+ s_n_llhttp__internal__n_after_start_req_62: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_62;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob53, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_62;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_60:
+ s_n_llhttp__internal__n_after_start_req_60: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_60;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_61;
+ }
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_62;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_65:
+ s_n_llhttp__internal__n_after_start_req_65: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_65;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob54, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 18;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_65;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_67:
+ s_n_llhttp__internal__n_after_start_req_67: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_67;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob55, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 32;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_67;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_68:
+ s_n_llhttp__internal__n_after_start_req_68: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_68;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob56, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_68;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_66:
+ s_n_llhttp__internal__n_after_start_req_66: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_66;
+ }
+ switch (*p) {
+ case 'I': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_67;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_68;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_69:
+ s_n_llhttp__internal__n_after_start_req_69: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_69;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob57, 8);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 27;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_69;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_64:
+ s_n_llhttp__internal__n_after_start_req_64: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_64;
+ }
+ switch (*p) {
+ case 'B': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_65;
+ }
+ case 'L': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_66;
+ }
+ case 'S': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_69;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_63:
+ s_n_llhttp__internal__n_after_start_req_63: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_63;
+ }
+ switch (*p) {
+ case 'N': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_64;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req:
+ s_n_llhttp__internal__n_after_start_req: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_1;
+ }
+ case 'B': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_4;
+ }
+ case 'C': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_5;
+ }
+ case 'D': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_10;
+ }
+ case 'F': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_14;
+ }
+ case 'G': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_15;
+ }
+ case 'H': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_18;
+ }
+ case 'L': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_19;
+ }
+ case 'M': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_22;
+ }
+ case 'N': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_31;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_32;
+ }
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_33;
+ }
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_46;
+ }
+ case 'S': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_52;
+ }
+ case 'T': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_60;
+ }
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_63;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_90;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_method_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_method_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_method_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_method;
+ goto s_n_llhttp__internal__n_after_start_req;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_status_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_status_complete: {
+ switch (llhttp__on_status_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_headers_start;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_20;
+ default:
+ goto s_n_llhttp__internal__n_error_75;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_line_almost_done:
+ s_n_llhttp__internal__n_res_line_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_line_almost_done;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_76;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status:
+ s_n_llhttp__internal__n_res_status: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_status;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_status_1;
+ }
+ default: {
+ p++;
+ goto s_n_llhttp__internal__n_res_status;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_status:
+ s_n_llhttp__internal__n_span_start_llhttp__on_status: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_status;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_status;
+ goto s_n_llhttp__internal__n_res_status;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_start:
+ s_n_llhttp__internal__n_res_status_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_start;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_res_line_almost_done;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_status;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_code_otherwise:
+ s_n_llhttp__internal__n_res_status_code_otherwise: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_code_otherwise;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_res_status_start;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_res_status_start;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_res_status_start;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_77;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_code_digit_3:
+ s_n_llhttp__internal__n_res_status_code_digit_3: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_code_digit_3;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_79;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_code_digit_2:
+ s_n_llhttp__internal__n_res_status_code_digit_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_code_digit_2;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_81;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_code_digit_1:
+ s_n_llhttp__internal__n_res_status_code_digit_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_code_digit_1;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_83;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_after_version:
+ s_n_llhttp__internal__n_res_after_version: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_after_version;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_status_code;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1:
+ s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1: {
+ switch (llhttp__on_version_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_res_after_version;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_21;
+ default:
+ goto s_n_llhttp__internal__n_error_74;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_73:
+ s_n_llhttp__internal__n_error_73: {
+ state->error = 0x9;
+ state->reason = "Invalid HTTP version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_85:
+ s_n_llhttp__internal__n_error_85: {
+ state->error = 0x9;
+ state->reason = "Invalid minor version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_http_minor:
+ s_n_llhttp__internal__n_res_http_minor: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_http_minor;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_7;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_86:
+ s_n_llhttp__internal__n_error_86: {
+ state->error = 0x9;
+ state->reason = "Expected dot";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_http_dot:
+ s_n_llhttp__internal__n_res_http_dot: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_http_dot;
+ }
+ switch (*p) {
+ case '.': {
+ p++;
+ goto s_n_llhttp__internal__n_res_http_minor;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_8;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_87:
+ s_n_llhttp__internal__n_error_87: {
+ state->error = 0x9;
+ state->reason = "Invalid major version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_http_major:
+ s_n_llhttp__internal__n_res_http_major: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_http_major;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_9;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_version_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_version_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_version_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_version;
+ goto s_n_llhttp__internal__n_res_http_major;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_start_res:
+ s_n_llhttp__internal__n_start_res: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_start_res;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob58, 5);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_start_res;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_91;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_method_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_method_complete: {
+ switch (llhttp__on_method_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_req_first_space_before_url;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_19;
+ default:
+ goto s_n_llhttp__internal__n_error_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_or_res_method_2:
+ s_n_llhttp__internal__n_req_or_res_method_2: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_or_res_method_2;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob59, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_method;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_or_res_method_2;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_88;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_update_type_1:
+ s_n_llhttp__internal__n_invoke_update_type_1: {
+ switch (llhttp__internal__c_update_type_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_or_res_method_3:
+ s_n_llhttp__internal__n_req_or_res_method_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_or_res_method_3;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob60, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_or_res_method_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_88;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_or_res_method_1:
+ s_n_llhttp__internal__n_req_or_res_method_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_or_res_method_1;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_req_or_res_method_2;
+ }
+ case 'T': {
+ p++;
+ goto s_n_llhttp__internal__n_req_or_res_method_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_88;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_or_res_method:
+ s_n_llhttp__internal__n_req_or_res_method: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_or_res_method;
+ }
+ switch (*p) {
+ case 'H': {
+ p++;
+ goto s_n_llhttp__internal__n_req_or_res_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_88;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_method:
+ s_n_llhttp__internal__n_span_start_llhttp__on_method: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_method;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_method;
+ goto s_n_llhttp__internal__n_req_or_res_method;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_start_req_or_res:
+ s_n_llhttp__internal__n_start_req_or_res: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_start_req_or_res;
+ }
+ switch (*p) {
+ case 'H': {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_method;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_type_2;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_load_type:
+ s_n_llhttp__internal__n_invoke_load_type: {
+ switch (llhttp__internal__c_load_type(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_method_1;
+ case 2:
+ goto s_n_llhttp__internal__n_start_res;
+ default:
+ goto s_n_llhttp__internal__n_start_req_or_res;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_update_finish:
+ s_n_llhttp__internal__n_invoke_update_finish: {
+ switch (llhttp__internal__c_update_finish(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_begin;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_start:
+ s_n_llhttp__internal__n_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_start;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_start;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_start;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_load_initial_message_completed;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ default:
+ /* UNREACHABLE */
+ abort();
+ }
+ s_n_llhttp__internal__n_error_2: {
+ state->error = 0x7;
+ state->reason = "Invalid characters in url (strict mode)";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_68: {
+ state->error = 0x7;
+ state->reason = "Invalid characters in url";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_finish_2: {
+ switch (llhttp__internal__c_update_finish_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_start;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_initial_message_completed: {
+ switch (llhttp__internal__c_update_initial_message_completed(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_finish_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_content_length: {
+ switch (llhttp__internal__c_update_content_length(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_initial_message_completed;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_7: {
+ state->error = 0x5;
+ state->reason = "Data after `Connection: close`";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_1: {
+ switch (llhttp__internal__c_test_lenient_flags_1(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_update_initial_message_completed;
+ default:
+ goto s_n_llhttp__internal__n_closed;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_finish_1: {
+ switch (llhttp__internal__c_update_finish_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_11: {
+ state->error = 0x15;
+ state->reason = "on_message_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_is_equal_upgrade;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_28: {
+ state->error = 0x12;
+ state->reason = "`on_message_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_13: {
+ state->error = 0x15;
+ state->reason = "on_chunk_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_31: {
+ state->error = 0x14;
+ state->reason = "`on_chunk_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_complete_1: {
+ switch (llhttp__on_chunk_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_13;
+ default:
+ goto s_n_llhttp__internal__n_error_31;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_30: {
+ state->error = 0x4;
+ state->reason = "Content-Length can't be present with Transfer-Encoding";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_2: {
+ state->error = 0x15;
+ state->reason = "on_message_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_pause_1;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_8: {
+ state->error = 0x12;
+ state->reason = "`on_message_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_1: {
+ switch (llhttp__on_message_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_pause_1;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_2;
+ default:
+ goto s_n_llhttp__internal__n_error_8;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_26: {
+ state->error = 0xc;
+ state->reason = "Chunk size overflow";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_3: {
+ state->error = 0x15;
+ state->reason = "on_chunk_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_update_content_length_1;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_10: {
+ state->error = 0x14;
+ state->reason = "`on_chunk_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_complete: {
+ switch (llhttp__on_chunk_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_update_content_length_1;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_3;
+ default:
+ goto s_n_llhttp__internal__n_error_10;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_11: {
+ state->error = 0x2;
+ state->reason = "Expected CRLF after chunk";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_body: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_body(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_data_almost_done;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_chunk_data_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags: {
+ switch (llhttp__internal__c_or_flags(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_field_start;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_4: {
+ state->error = 0x15;
+ state->reason = "on_chunk_header pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_is_equal_content_length;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_9: {
+ state->error = 0x13;
+ state->reason = "`on_chunk_header` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_header: {
+ switch (llhttp__on_chunk_header(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_is_equal_content_length;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_4;
+ default:
+ goto s_n_llhttp__internal__n_error_9;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_12: {
+ state->error = 0x2;
+ state->reason = "Expected LF after chunk size";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_13: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_14: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_5: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_name pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_size_almost_done;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_15: {
+ state->error = 0x22;
+ state->reason = "`on_chunk_extension_name` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_name(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_6: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_name pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_extensions;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_16: {
+ state->error = 0x22;
+ state->reason = "`on_chunk_extension_name` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_name(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_7: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_value pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_size_almost_done;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_18: {
+ state->error = 0x23;
+ state->reason = "`on_chunk_extension_value` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_20: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions quote value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_8: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_value pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_extension_quoted_value_done;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_19: {
+ state->error = 0x23;
+ state->reason = "`on_chunk_extension_value` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_21;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_21;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_9: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_value pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_size_otherwise;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_22: {
+ state->error = 0x23;
+ state->reason = "`on_chunk_extension_value` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_4: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_23;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_23;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_10: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_name pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_extension_value;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_17: {
+ state->error = 0x22;
+ state->reason = "`on_chunk_extension_name` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_2: {
+ switch (llhttp__on_chunk_extension_name_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_extension_value;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_10;
+ default:
+ goto s_n_llhttp__internal__n_error_17;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_name(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_name(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_24;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_24;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_25: {
+ state->error = 0xc;
+ state->reason = "Invalid character in chunk size";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_content_length: {
+ switch (llhttp__internal__c_mul_add_content_length(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_error_26;
+ default:
+ goto s_n_llhttp__internal__n_chunk_size;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_27: {
+ state->error = 0xc;
+ state->reason = "Invalid character in chunk size";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_body_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_body(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_finish_3: {
+ switch (llhttp__internal__c_update_finish_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_body_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_29: {
+ state->error = 0xf;
+ state->reason = "Request has invalid `Transfer-Encoding`";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause: {
+ state->error = 0x15;
+ state->reason = "on_message_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__after_message_complete;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_6: {
+ state->error = 0x12;
+ state->reason = "`on_message_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_complete: {
+ switch (llhttp__on_message_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_message_complete;
+ case 21:
+ goto s_n_llhttp__internal__n_pause;
+ default:
+ goto s_n_llhttp__internal__n_error_6;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_1: {
+ switch (llhttp__internal__c_or_flags_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_2: {
+ switch (llhttp__internal__c_or_flags_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_upgrade: {
+ switch (llhttp__internal__c_update_upgrade(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_12: {
+ state->error = 0x15;
+ state->reason = "Paused by on_headers_complete";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_5: {
+ state->error = 0x11;
+ state->reason = "User callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_headers_complete: {
+ switch (llhttp__on_headers_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete;
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_or_flags_1;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_update_upgrade;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_12;
+ default:
+ goto s_n_llhttp__internal__n_error_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__before_headers_complete: {
+ switch (llhttp__before_headers_complete(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_2: {
+ switch (llhttp__internal__c_test_lenient_flags_2(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_error_30;
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__before_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_flags_1: {
+ switch (llhttp__internal__c_test_flags_1(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_2;
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__before_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_flags: {
+ switch (llhttp__internal__c_test_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_complete_1;
+ default:
+ goto s_n_llhttp__internal__n_invoke_test_flags_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_32: {
+ state->error = 0x2;
+ state->reason = "Expected LF after headers";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_field: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_field(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_33;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_33;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_3: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_field_colon_discard_ws;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_36: {
+ state->error = 0xa;
+ state->reason = "Invalid header value char";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_5: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_discard_ws;
+ default:
+ goto s_n_llhttp__internal__n_error_36;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_38: {
+ state->error = 0xb;
+ state->reason = "Empty Content-Length";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_14: {
+ state->error = 0x15;
+ state->reason = "on_header_value_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_field_start;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_37: {
+ state->error = 0x1d;
+ state->reason = "`on_header_value_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state: {
+ switch (llhttp__internal__c_update_header_state(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_3: {
+ switch (llhttp__internal__c_or_flags_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_4: {
+ switch (llhttp__internal__c_or_flags_4(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_5: {
+ switch (llhttp__internal__c_or_flags_5(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_6: {
+ switch (llhttp__internal__c_or_flags_6(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_1: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 5:
+ goto s_n_llhttp__internal__n_invoke_or_flags_3;
+ case 6:
+ goto s_n_llhttp__internal__n_invoke_or_flags_4;
+ case 7:
+ goto s_n_llhttp__internal__n_invoke_or_flags_5;
+ case 8:
+ goto s_n_llhttp__internal__n_invoke_or_flags_6;
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 2:
+ goto s_n_llhttp__internal__n_error_38;
+ default:
+ goto s_n_llhttp__internal__n_invoke_load_header_state_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_35: {
+ state->error = 0xa;
+ state->reason = "Invalid header value char";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_4: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_discard_lws;
+ default:
+ goto s_n_llhttp__internal__n_error_35;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_39: {
+ state->error = 0x2;
+ state->reason = "Expected LF after CR";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_6: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_discard_lws;
+ default:
+ goto s_n_llhttp__internal__n_error_39;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_1: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_3: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 8:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_1;
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_2: {
+ switch (llhttp__internal__c_update_header_state(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_7: {
+ switch (llhttp__internal__c_or_flags_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_8: {
+ switch (llhttp__internal__c_or_flags_4(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_9: {
+ switch (llhttp__internal__c_or_flags_5(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_10: {
+ switch (llhttp__internal__c_or_flags_6(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_4: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 5:
+ goto s_n_llhttp__internal__n_invoke_or_flags_7;
+ case 6:
+ goto s_n_llhttp__internal__n_invoke_or_flags_8;
+ case 7:
+ goto s_n_llhttp__internal__n_invoke_or_flags_9;
+ case 8:
+ goto s_n_llhttp__internal__n_invoke_or_flags_10;
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_40: {
+ state->error = 0x3;
+ state->reason = "Missing expected LF after header value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_header_value_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_header_value_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_header_value_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_41;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_41;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_7: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_lenient;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_4: {
+ switch (llhttp__internal__c_update_header_state(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_11: {
+ switch (llhttp__internal__c_or_flags_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_4;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_12: {
+ switch (llhttp__internal__c_or_flags_4(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_4;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_13: {
+ switch (llhttp__internal__c_or_flags_5(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_4;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_14: {
+ switch (llhttp__internal__c_or_flags_6(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_5: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 5:
+ goto s_n_llhttp__internal__n_invoke_or_flags_11;
+ case 6:
+ goto s_n_llhttp__internal__n_invoke_or_flags_12;
+ case 7:
+ goto s_n_llhttp__internal__n_invoke_or_flags_13;
+ case 8:
+ goto s_n_llhttp__internal__n_invoke_or_flags_14;
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_5: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_3: {
+ switch (llhttp__internal__c_update_header_state_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_6: {
+ switch (llhttp__internal__c_update_header_state_6(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_7: {
+ switch (llhttp__internal__c_update_header_state_7(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_43;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_43;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_content_length_1: {
+ switch (llhttp__internal__c_mul_add_content_length_1(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5;
+ default:
+ goto s_n_llhttp__internal__n_header_value_content_length;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_15: {
+ switch (llhttp__internal__c_or_flags_15(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_6: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_44;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_44;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_42: {
+ state->error = 0x4;
+ state->reason = "Duplicate Content-Length";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_flags_2: {
+ switch (llhttp__internal__c_test_flags_2(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_header_value_content_length;
+ default:
+ goto s_n_llhttp__internal__n_error_42;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_8: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_46;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_46;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_8: {
+ switch (llhttp__internal__c_update_header_state_8(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_7: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_45;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_45;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_8: {
+ switch (llhttp__internal__c_test_lenient_flags_8(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_7;
+ default:
+ goto s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_type_1: {
+ switch (llhttp__internal__c_load_type(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_8;
+ default:
+ goto s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_9: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_and_flags: {
+ switch (llhttp__internal__c_and_flags(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_17: {
+ switch (llhttp__internal__c_or_flags_16(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_and_flags;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_9: {
+ switch (llhttp__internal__c_test_lenient_flags_8(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_8;
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags_17;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_type_2: {
+ switch (llhttp__internal__c_load_type(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_9;
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags_17;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_16: {
+ switch (llhttp__internal__c_or_flags_16(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_and_flags;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_flags_3: {
+ switch (llhttp__internal__c_test_flags_3(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_load_type_2;
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags_16;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_18: {
+ switch (llhttp__internal__c_or_flags_18(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_9;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_2: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_connection;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_test_flags_2;
+ case 3:
+ goto s_n_llhttp__internal__n_invoke_test_flags_3;
+ case 4:
+ goto s_n_llhttp__internal__n_invoke_or_flags_18;
+ default:
+ goto s_n_llhttp__internal__n_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_15: {
+ state->error = 0x15;
+ state->reason = "on_header_field_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_discard_ws;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_34: {
+ state->error = 0x1c;
+ state->reason = "`on_header_field_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_field_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_field(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_field(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_47: {
+ state->error = 0xa;
+ state->reason = "Invalid header token";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_10: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_header_state: {
+ switch (llhttp__internal__c_store_header_state(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_header_field_colon;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_11: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_4: {
+ state->error = 0x1e;
+ state->reason = "Unexpected space after start line";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_field_start;
+ default:
+ goto s_n_llhttp__internal__n_error_4;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_16: {
+ state->error = 0x15;
+ state->reason = "on_url_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_headers_start;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_3: {
+ state->error = 0x1a;
+ state->reason = "`on_url_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_url_complete: {
+ switch (llhttp__on_url_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_headers_start;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_16;
+ default:
+ goto s_n_llhttp__internal__n_error_3;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_http_minor: {
+ switch (llhttp__internal__c_update_http_minor(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_url_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_http_major: {
+ switch (llhttp__internal__c_update_http_major(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_http_minor;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_48: {
+ state->error = 0x7;
+ state->reason = "Expected CRLF";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_4: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_54: {
+ state->error = 0x17;
+ state->reason = "Pause on PRI/Upgrade";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_55: {
+ state->error = 0x9;
+ state->reason = "Expected HTTP/2 Connection Preface";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_53: {
+ state->error = 0x9;
+ state->reason = "Expected CRLF after version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_17: {
+ state->error = 0x15;
+ state->reason = "on_version_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_load_method_1;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_52: {
+ state->error = 0x21;
+ state->reason = "`on_version_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_version_complete;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_version_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_51;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_51;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 9:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_1: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_2: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_major: {
+ switch (llhttp__internal__c_load_http_major(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor;
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_1;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_2;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_10: {
+ switch (llhttp__internal__c_test_lenient_flags_10(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ default:
+ goto s_n_llhttp__internal__n_invoke_load_http_major;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_http_minor: {
+ switch (llhttp__internal__c_store_http_minor(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_10;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_56;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_56;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_57;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_57;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_http_major: {
+ switch (llhttp__internal__c_store_http_major(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_req_http_dot;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_4: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_58;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_58;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_50: {
+ state->error = 0x8;
+ state->reason = "Invalid method for HTTP/x.x request";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_method: {
+ switch (llhttp__internal__c_load_method(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 1:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 2:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 3:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 4:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 5:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 6:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 7:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 8:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 9:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 10:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 11:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 12:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 13:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 14:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 15:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 16:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 17:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 18:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 19:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 20:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 21:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 22:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 23:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 24:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 25:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 26:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 27:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 28:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 29:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 30:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 31:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 32:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 33:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 34:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ default:
+ goto s_n_llhttp__internal__n_error_50;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_61: {
+ state->error = 0x8;
+ state->reason = "Expected HTTP/";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_59: {
+ state->error = 0x8;
+ state->reason = "Expected SOURCE method for ICE/x.x request";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_method_2: {
+ switch (llhttp__internal__c_load_method(state, p, endp)) {
+ case 33:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ default:
+ goto s_n_llhttp__internal__n_error_59;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_60: {
+ state->error = 0x8;
+ state->reason = "Invalid method for RTSP/x.x request";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_method_3: {
+ switch (llhttp__internal__c_load_method(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 3:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 6:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 35:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 36:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 37:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 38:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 39:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 40:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 41:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 42:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 43:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 44:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 45:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ default:
+ goto s_n_llhttp__internal__n_error_60;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_18: {
+ state->error = 0x15;
+ state->reason = "on_url_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_req_http_start;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_49: {
+ state->error = 0x1a;
+ state->reason = "`on_url_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_url_complete_1: {
+ switch (llhttp__on_url_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_req_http_start;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_18;
+ default:
+ goto s_n_llhttp__internal__n_error_49;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_5: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_6: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_7: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_8: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_62: {
+ state->error = 0x7;
+ state->reason = "Invalid char in url fragment start";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_9: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_10: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_11: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_63: {
+ state->error = 0x7;
+ state->reason = "Invalid char in url query";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_64: {
+ state->error = 0x7;
+ state->reason = "Invalid char in url path";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_12: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_13: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_14: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_65: {
+ state->error = 0x7;
+ state->reason = "Double @ in url";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_66: {
+ state->error = 0x7;
+ state->reason = "Unexpected char in url server";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_67: {
+ state->error = 0x7;
+ state->reason = "Unexpected char in url server";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_69: {
+ state->error = 0x7;
+ state->reason = "Unexpected char in url schema";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_70: {
+ state->error = 0x7;
+ state->reason = "Unexpected char in url schema";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_71: {
+ state->error = 0x7;
+ state->reason = "Unexpected start char in url";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_is_equal_method: {
+ switch (llhttp__internal__c_is_equal_method(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_url_entry_normal;
+ default:
+ goto s_n_llhttp__internal__n_url_entry_connect;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_72: {
+ state->error = 0x6;
+ state->reason = "Expected space after method";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_22: {
+ state->error = 0x15;
+ state->reason = "on_method_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_req_first_space_before_url;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_89: {
+ state->error = 0x20;
+ state->reason = "`on_method_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_method_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_method(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_method_1: {
+ switch (llhttp__internal__c_store_method(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_method_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_90: {
+ state->error = 0x6;
+ state->reason = "Invalid method encountered";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_82: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_80: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_78: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_20: {
+ state->error = 0x15;
+ state->reason = "on_status_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_headers_start;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_75: {
+ state->error = 0x1b;
+ state->reason = "`on_status_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_76: {
+ state->error = 0x2;
+ state->reason = "Expected LF after CR";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_status: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_status(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_status_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_status(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_res_line_almost_done;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_res_line_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_77: {
+ state->error = 0xd;
+ state->reason = "Invalid response status";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_status_code_2: {
+ switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_error_78;
+ default:
+ goto s_n_llhttp__internal__n_res_status_code_otherwise;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_79: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_status_code_1: {
+ switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_error_80;
+ default:
+ goto s_n_llhttp__internal__n_res_status_code_digit_3;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_81: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_status_code: {
+ switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_error_82;
+ default:
+ goto s_n_llhttp__internal__n_res_status_code_digit_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_83: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_status_code: {
+ switch (llhttp__internal__c_update_status_code(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_res_status_code_digit_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_84: {
+ state->error = 0x9;
+ state->reason = "Expected space after version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_21: {
+ state->error = 0x15;
+ state->reason = "on_version_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_res_after_version;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_74: {
+ state->error = 0x21;
+ state->reason = "`on_version_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_6: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_5: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_73;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_73;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_3: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 9:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_4: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_5: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_major_1: {
+ switch (llhttp__internal__c_load_http_major(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_3;
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_4;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_5;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_11: {
+ switch (llhttp__internal__c_test_lenient_flags_10(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ default:
+ goto s_n_llhttp__internal__n_invoke_load_http_major_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_http_minor_1: {
+ switch (llhttp__internal__c_store_http_minor(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_11;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_7: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_85;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_85;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_8: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_86;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_86;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_http_major_1: {
+ switch (llhttp__internal__c_store_http_major(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_res_http_dot;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_9: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_87;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_87;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_91: {
+ state->error = 0x8;
+ state->reason = "Expected HTTP/";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_19: {
+ state->error = 0x15;
+ state->reason = "on_method_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_req_first_space_before_url;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_1: {
+ state->error = 0x20;
+ state->reason = "`on_method_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_method: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_method(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_method_complete;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_method_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_type: {
+ switch (llhttp__internal__c_update_type(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_method;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_method: {
+ switch (llhttp__internal__c_store_method(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_type;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_88: {
+ state->error = 0x8;
+ state->reason = "Invalid word encountered";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_method_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_method(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_update_type_1;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_update_type_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_type_2: {
+ switch (llhttp__internal__c_update_type(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_method_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_23: {
+ state->error = 0x15;
+ state->reason = "on_message_begin pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_load_type;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error: {
+ state->error = 0x10;
+ state->reason = "`on_message_begin` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_begin: {
+ switch (llhttp__on_message_begin(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_load_type;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_23;
+ default:
+ goto s_n_llhttp__internal__n_error;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_24: {
+ state->error = 0x15;
+ state->reason = "on_reset pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_update_finish;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_92: {
+ state->error = 0x1f;
+ state->reason = "`on_reset` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_reset: {
+ switch (llhttp__on_reset(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_update_finish;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_24;
+ default:
+ goto s_n_llhttp__internal__n_error_92;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_initial_message_completed: {
+ switch (llhttp__internal__c_load_initial_message_completed(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_reset;
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_finish;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+}
+
+int llhttp__internal_execute(llhttp__internal_t* state, const char* p, const char* endp) {
+ llparse_state_t next;
+
+ /* check lingering errors */
+ if (state->error != 0) {
+ return state->error;
+ }
+
+ /* restart spans */
+ if (state->_span_pos0 != NULL) {
+ state->_span_pos0 = (void*) p;
+ }
+
+ next = llhttp__internal__run(state, (const unsigned char*) p, (const unsigned char*) endp);
+ if (next == s_error) {
+ return state->error;
+ }
+ state->_current = (void*) (intptr_t) next;
+
+ /* execute spans */
+ if (state->_span_pos0 != NULL) {
+ int error;
+
+ error = ((llhttp__internal__span_cb) state->_span_cb0)(state, state->_span_pos0, (const char*) endp);
+ if (error != 0) {
+ state->error = error;
+ state->error_pos = endp;
+ return error;
+ }
+ }
+
+ return 0;
+}
+
+#else /* !LLHTTP_STRICT_MODE */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+
+#ifdef __SSE4_2__
+ #ifdef _MSC_VER
+ #include <nmmintrin.h>
+ #else /* !_MSC_VER */
+ #include <x86intrin.h>
+ #endif /* _MSC_VER */
+#endif /* __SSE4_2__ */
+
+#ifdef _MSC_VER
+ #define ALIGN(n) _declspec(align(n))
+#else /* !_MSC_VER */
+ #define ALIGN(n) __attribute__((aligned(n)))
+#endif /* _MSC_VER */
+
+#include "llhttp.h"
+
+typedef int (*llhttp__internal__span_cb)(
+ llhttp__internal_t*, const char*, const char*);
+
+#ifdef __SSE4_2__
+static const unsigned char ALIGN(16) llparse_blob0[] = {
+ 0x9, 0x9, 0xc, 0xc, '!', '"', '$', '>', '@', '~', 0x80,
+ 0xff, 0x0, 0x0, 0x0, 0x0
+};
+#endif /* __SSE4_2__ */
+static const unsigned char llparse_blob1[] = {
+ 'o', 'n'
+};
+static const unsigned char llparse_blob2[] = {
+ 'e', 'c', 't', 'i', 'o', 'n'
+};
+static const unsigned char llparse_blob3[] = {
+ 'l', 'o', 's', 'e'
+};
+static const unsigned char llparse_blob4[] = {
+ 'e', 'e', 'p', '-', 'a', 'l', 'i', 'v', 'e'
+};
+static const unsigned char llparse_blob5[] = {
+ 'p', 'g', 'r', 'a', 'd', 'e'
+};
+static const unsigned char llparse_blob6[] = {
+ 'c', 'h', 'u', 'n', 'k', 'e', 'd'
+};
+#ifdef __SSE4_2__
+static const unsigned char ALIGN(16) llparse_blob7[] = {
+ 0x9, 0x9, ' ', '~', 0x80, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0
+};
+#endif /* __SSE4_2__ */
+#ifdef __SSE4_2__
+static const unsigned char ALIGN(16) llparse_blob8[] = {
+ ' ', '!', '#', '\'', '*', '+', '-', '.', '0', '9', 'A',
+ 'Z', '^', 'z', '|', '|'
+};
+#endif /* __SSE4_2__ */
+#ifdef __SSE4_2__
+static const unsigned char ALIGN(16) llparse_blob9[] = {
+ '~', '~', 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
+ 0x0, 0x0, 0x0, 0x0, 0x0
+};
+#endif /* __SSE4_2__ */
+static const unsigned char llparse_blob10[] = {
+ 'e', 'n', 't', '-', 'l', 'e', 'n', 'g', 't', 'h'
+};
+static const unsigned char llparse_blob11[] = {
+ 'r', 'o', 'x', 'y', '-', 'c', 'o', 'n', 'n', 'e', 'c',
+ 't', 'i', 'o', 'n'
+};
+static const unsigned char llparse_blob12[] = {
+ 'r', 'a', 'n', 's', 'f', 'e', 'r', '-', 'e', 'n', 'c',
+ 'o', 'd', 'i', 'n', 'g'
+};
+static const unsigned char llparse_blob13[] = {
+ 'p', 'g', 'r', 'a', 'd', 'e'
+};
+static const unsigned char llparse_blob14[] = {
+ 0xd, 0xa
+};
+static const unsigned char llparse_blob15[] = {
+ 'T', 'T', 'P', '/'
+};
+static const unsigned char llparse_blob16[] = {
+ 0xd, 0xa, 0xd, 0xa, 'S', 'M', 0xd, 0xa, 0xd, 0xa
+};
+static const unsigned char llparse_blob17[] = {
+ 'C', 'E', '/'
+};
+static const unsigned char llparse_blob18[] = {
+ 'T', 'S', 'P', '/'
+};
+static const unsigned char llparse_blob19[] = {
+ 'N', 'O', 'U', 'N', 'C', 'E'
+};
+static const unsigned char llparse_blob20[] = {
+ 'I', 'N', 'D'
+};
+static const unsigned char llparse_blob21[] = {
+ 'E', 'C', 'K', 'O', 'U', 'T'
+};
+static const unsigned char llparse_blob22[] = {
+ 'N', 'E', 'C', 'T'
+};
+static const unsigned char llparse_blob23[] = {
+ 'E', 'T', 'E'
+};
+static const unsigned char llparse_blob24[] = {
+ 'C', 'R', 'I', 'B', 'E'
+};
+static const unsigned char llparse_blob25[] = {
+ 'L', 'U', 'S', 'H'
+};
+static const unsigned char llparse_blob26[] = {
+ 'E', 'T'
+};
+static const unsigned char llparse_blob27[] = {
+ 'P', 'A', 'R', 'A', 'M', 'E', 'T', 'E', 'R'
+};
+static const unsigned char llparse_blob28[] = {
+ 'E', 'A', 'D'
+};
+static const unsigned char llparse_blob29[] = {
+ 'N', 'K'
+};
+static const unsigned char llparse_blob30[] = {
+ 'C', 'K'
+};
+static const unsigned char llparse_blob31[] = {
+ 'S', 'E', 'A', 'R', 'C', 'H'
+};
+static const unsigned char llparse_blob32[] = {
+ 'R', 'G', 'E'
+};
+static const unsigned char llparse_blob33[] = {
+ 'C', 'T', 'I', 'V', 'I', 'T', 'Y'
+};
+static const unsigned char llparse_blob34[] = {
+ 'L', 'E', 'N', 'D', 'A', 'R'
+};
+static const unsigned char llparse_blob35[] = {
+ 'V', 'E'
+};
+static const unsigned char llparse_blob36[] = {
+ 'O', 'T', 'I', 'F', 'Y'
+};
+static const unsigned char llparse_blob37[] = {
+ 'P', 'T', 'I', 'O', 'N', 'S'
+};
+static const unsigned char llparse_blob38[] = {
+ 'C', 'H'
+};
+static const unsigned char llparse_blob39[] = {
+ 'S', 'E'
+};
+static const unsigned char llparse_blob40[] = {
+ 'A', 'Y'
+};
+static const unsigned char llparse_blob41[] = {
+ 'S', 'T'
+};
+static const unsigned char llparse_blob42[] = {
+ 'I', 'N', 'D'
+};
+static const unsigned char llparse_blob43[] = {
+ 'A', 'T', 'C', 'H'
+};
+static const unsigned char llparse_blob44[] = {
+ 'G', 'E'
+};
+static const unsigned char llparse_blob45[] = {
+ 'I', 'N', 'D'
+};
+static const unsigned char llparse_blob46[] = {
+ 'O', 'R', 'D'
+};
+static const unsigned char llparse_blob47[] = {
+ 'I', 'R', 'E', 'C', 'T'
+};
+static const unsigned char llparse_blob48[] = {
+ 'O', 'R', 'T'
+};
+static const unsigned char llparse_blob49[] = {
+ 'R', 'C', 'H'
+};
+static const unsigned char llparse_blob50[] = {
+ 'P', 'A', 'R', 'A', 'M', 'E', 'T', 'E', 'R'
+};
+static const unsigned char llparse_blob51[] = {
+ 'U', 'R', 'C', 'E'
+};
+static const unsigned char llparse_blob52[] = {
+ 'B', 'S', 'C', 'R', 'I', 'B', 'E'
+};
+static const unsigned char llparse_blob53[] = {
+ 'A', 'R', 'D', 'O', 'W', 'N'
+};
+static const unsigned char llparse_blob54[] = {
+ 'A', 'C', 'E'
+};
+static const unsigned char llparse_blob55[] = {
+ 'I', 'N', 'D'
+};
+static const unsigned char llparse_blob56[] = {
+ 'N', 'K'
+};
+static const unsigned char llparse_blob57[] = {
+ 'C', 'K'
+};
+static const unsigned char llparse_blob58[] = {
+ 'U', 'B', 'S', 'C', 'R', 'I', 'B', 'E'
+};
+static const unsigned char llparse_blob59[] = {
+ 'H', 'T', 'T', 'P', '/'
+};
+static const unsigned char llparse_blob60[] = {
+ 'A', 'D'
+};
+static const unsigned char llparse_blob61[] = {
+ 'T', 'P', '/'
+};
+
+enum llparse_match_status_e {
+ kMatchComplete,
+ kMatchPause,
+ kMatchMismatch
+};
+typedef enum llparse_match_status_e llparse_match_status_t;
+
+struct llparse_match_s {
+ llparse_match_status_t status;
+ const unsigned char* current;
+};
+typedef struct llparse_match_s llparse_match_t;
+
+static llparse_match_t llparse__match_sequence_to_lower(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp,
+ const unsigned char* seq, uint32_t seq_len) {
+ uint32_t index;
+ llparse_match_t res;
+
+ index = s->_index;
+ for (; p != endp; p++) {
+ unsigned char current;
+
+ current = ((*p) >= 'A' && (*p) <= 'Z' ? (*p | 0x20) : (*p));
+ if (current == seq[index]) {
+ if (++index == seq_len) {
+ res.status = kMatchComplete;
+ goto reset;
+ }
+ } else {
+ res.status = kMatchMismatch;
+ goto reset;
+ }
+ }
+ s->_index = index;
+ res.status = kMatchPause;
+ res.current = p;
+ return res;
+reset:
+ s->_index = 0;
+ res.current = p;
+ return res;
+}
+
+static llparse_match_t llparse__match_sequence_to_lower_unsafe(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp,
+ const unsigned char* seq, uint32_t seq_len) {
+ uint32_t index;
+ llparse_match_t res;
+
+ index = s->_index;
+ for (; p != endp; p++) {
+ unsigned char current;
+
+ current = ((*p) | 0x20);
+ if (current == seq[index]) {
+ if (++index == seq_len) {
+ res.status = kMatchComplete;
+ goto reset;
+ }
+ } else {
+ res.status = kMatchMismatch;
+ goto reset;
+ }
+ }
+ s->_index = index;
+ res.status = kMatchPause;
+ res.current = p;
+ return res;
+reset:
+ s->_index = 0;
+ res.current = p;
+ return res;
+}
+
+static llparse_match_t llparse__match_sequence_id(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp,
+ const unsigned char* seq, uint32_t seq_len) {
+ uint32_t index;
+ llparse_match_t res;
+
+ index = s->_index;
+ for (; p != endp; p++) {
+ unsigned char current;
+
+ current = *p;
+ if (current == seq[index]) {
+ if (++index == seq_len) {
+ res.status = kMatchComplete;
+ goto reset;
+ }
+ } else {
+ res.status = kMatchMismatch;
+ goto reset;
+ }
+ }
+ s->_index = index;
+ res.status = kMatchPause;
+ res.current = p;
+ return res;
+reset:
+ s->_index = 0;
+ res.current = p;
+ return res;
+}
+
+enum llparse_state_e {
+ s_error,
+ s_n_llhttp__internal__n_closed,
+ s_n_llhttp__internal__n_invoke_llhttp__after_message_complete,
+ s_n_llhttp__internal__n_pause_1,
+ s_n_llhttp__internal__n_invoke_is_equal_upgrade,
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2,
+ s_n_llhttp__internal__n_chunk_data_almost_done_skip,
+ s_n_llhttp__internal__n_chunk_data_almost_done,
+ s_n_llhttp__internal__n_consume_content_length,
+ s_n_llhttp__internal__n_span_start_llhttp__on_body,
+ s_n_llhttp__internal__n_invoke_is_equal_content_length,
+ s_n_llhttp__internal__n_chunk_size_almost_done,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete,
+ s_n_llhttp__internal__n_chunk_extension_quoted_value_done,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1,
+ s_n_llhttp__internal__n_error_17,
+ s_n_llhttp__internal__n_chunk_extension_quoted_value,
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2,
+ s_n_llhttp__internal__n_error_19,
+ s_n_llhttp__internal__n_chunk_extension_value,
+ s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value,
+ s_n_llhttp__internal__n_error_20,
+ s_n_llhttp__internal__n_chunk_extension_name,
+ s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name,
+ s_n_llhttp__internal__n_chunk_extensions,
+ s_n_llhttp__internal__n_chunk_size_otherwise,
+ s_n_llhttp__internal__n_chunk_size,
+ s_n_llhttp__internal__n_chunk_size_digit,
+ s_n_llhttp__internal__n_invoke_update_content_length_1,
+ s_n_llhttp__internal__n_consume_content_length_1,
+ s_n_llhttp__internal__n_span_start_llhttp__on_body_1,
+ s_n_llhttp__internal__n_eof,
+ s_n_llhttp__internal__n_span_start_llhttp__on_body_2,
+ s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete,
+ s_n_llhttp__internal__n_headers_almost_done,
+ s_n_llhttp__internal__n_header_field_colon_discard_ws,
+ s_n_llhttp__internal__n_error_28,
+ s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete,
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_value,
+ s_n_llhttp__internal__n_header_value_discard_lws,
+ s_n_llhttp__internal__n_header_value_discard_ws_almost_done,
+ s_n_llhttp__internal__n_header_value_lws,
+ s_n_llhttp__internal__n_header_value_almost_done,
+ s_n_llhttp__internal__n_header_value_lenient,
+ s_n_llhttp__internal__n_error_36,
+ s_n_llhttp__internal__n_header_value_otherwise,
+ s_n_llhttp__internal__n_header_value_connection_token,
+ s_n_llhttp__internal__n_header_value_connection_ws,
+ s_n_llhttp__internal__n_header_value_connection_1,
+ s_n_llhttp__internal__n_header_value_connection_2,
+ s_n_llhttp__internal__n_header_value_connection_3,
+ s_n_llhttp__internal__n_header_value_connection,
+ s_n_llhttp__internal__n_error_38,
+ s_n_llhttp__internal__n_error_39,
+ s_n_llhttp__internal__n_header_value_content_length_ws,
+ s_n_llhttp__internal__n_header_value_content_length,
+ s_n_llhttp__internal__n_error_41,
+ s_n_llhttp__internal__n_error_40,
+ s_n_llhttp__internal__n_header_value_te_token_ows,
+ s_n_llhttp__internal__n_header_value,
+ s_n_llhttp__internal__n_header_value_te_token,
+ s_n_llhttp__internal__n_header_value_te_chunked_last,
+ s_n_llhttp__internal__n_header_value_te_chunked,
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1,
+ s_n_llhttp__internal__n_header_value_discard_ws,
+ s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete,
+ s_n_llhttp__internal__n_header_field_general_otherwise,
+ s_n_llhttp__internal__n_header_field_general,
+ s_n_llhttp__internal__n_header_field_colon,
+ s_n_llhttp__internal__n_header_field_3,
+ s_n_llhttp__internal__n_header_field_4,
+ s_n_llhttp__internal__n_header_field_2,
+ s_n_llhttp__internal__n_header_field_1,
+ s_n_llhttp__internal__n_header_field_5,
+ s_n_llhttp__internal__n_header_field_6,
+ s_n_llhttp__internal__n_header_field_7,
+ s_n_llhttp__internal__n_header_field,
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_field,
+ s_n_llhttp__internal__n_header_field_start,
+ s_n_llhttp__internal__n_headers_start,
+ s_n_llhttp__internal__n_url_skip_to_http09,
+ s_n_llhttp__internal__n_url_skip_lf_to_http09,
+ s_n_llhttp__internal__n_req_pri_upgrade,
+ s_n_llhttp__internal__n_req_http_complete_1,
+ s_n_llhttp__internal__n_req_http_complete,
+ s_n_llhttp__internal__n_invoke_load_method_1,
+ s_n_llhttp__internal__n_invoke_llhttp__on_version_complete,
+ s_n_llhttp__internal__n_error_46,
+ s_n_llhttp__internal__n_error_51,
+ s_n_llhttp__internal__n_req_http_minor,
+ s_n_llhttp__internal__n_error_52,
+ s_n_llhttp__internal__n_req_http_dot,
+ s_n_llhttp__internal__n_error_53,
+ s_n_llhttp__internal__n_req_http_major,
+ s_n_llhttp__internal__n_span_start_llhttp__on_version,
+ s_n_llhttp__internal__n_req_http_start_1,
+ s_n_llhttp__internal__n_req_http_start_2,
+ s_n_llhttp__internal__n_req_http_start_3,
+ s_n_llhttp__internal__n_req_http_start,
+ s_n_llhttp__internal__n_url_skip_to_http,
+ s_n_llhttp__internal__n_url_fragment,
+ s_n_llhttp__internal__n_span_end_stub_query_3,
+ s_n_llhttp__internal__n_url_query,
+ s_n_llhttp__internal__n_url_query_or_fragment,
+ s_n_llhttp__internal__n_url_path,
+ s_n_llhttp__internal__n_span_start_stub_path_2,
+ s_n_llhttp__internal__n_span_start_stub_path,
+ s_n_llhttp__internal__n_span_start_stub_path_1,
+ s_n_llhttp__internal__n_url_server_with_at,
+ s_n_llhttp__internal__n_url_server,
+ s_n_llhttp__internal__n_url_schema_delim_1,
+ s_n_llhttp__internal__n_url_schema_delim,
+ s_n_llhttp__internal__n_span_end_stub_schema,
+ s_n_llhttp__internal__n_url_schema,
+ s_n_llhttp__internal__n_url_start,
+ s_n_llhttp__internal__n_span_start_llhttp__on_url_1,
+ s_n_llhttp__internal__n_span_start_llhttp__on_url,
+ s_n_llhttp__internal__n_req_spaces_before_url,
+ s_n_llhttp__internal__n_req_first_space_before_url,
+ s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1,
+ s_n_llhttp__internal__n_after_start_req_2,
+ s_n_llhttp__internal__n_after_start_req_3,
+ s_n_llhttp__internal__n_after_start_req_1,
+ s_n_llhttp__internal__n_after_start_req_4,
+ s_n_llhttp__internal__n_after_start_req_6,
+ s_n_llhttp__internal__n_after_start_req_8,
+ s_n_llhttp__internal__n_after_start_req_9,
+ s_n_llhttp__internal__n_after_start_req_7,
+ s_n_llhttp__internal__n_after_start_req_5,
+ s_n_llhttp__internal__n_after_start_req_12,
+ s_n_llhttp__internal__n_after_start_req_13,
+ s_n_llhttp__internal__n_after_start_req_11,
+ s_n_llhttp__internal__n_after_start_req_10,
+ s_n_llhttp__internal__n_after_start_req_14,
+ s_n_llhttp__internal__n_after_start_req_17,
+ s_n_llhttp__internal__n_after_start_req_16,
+ s_n_llhttp__internal__n_after_start_req_15,
+ s_n_llhttp__internal__n_after_start_req_18,
+ s_n_llhttp__internal__n_after_start_req_20,
+ s_n_llhttp__internal__n_after_start_req_21,
+ s_n_llhttp__internal__n_after_start_req_19,
+ s_n_llhttp__internal__n_after_start_req_23,
+ s_n_llhttp__internal__n_after_start_req_24,
+ s_n_llhttp__internal__n_after_start_req_26,
+ s_n_llhttp__internal__n_after_start_req_28,
+ s_n_llhttp__internal__n_after_start_req_29,
+ s_n_llhttp__internal__n_after_start_req_27,
+ s_n_llhttp__internal__n_after_start_req_25,
+ s_n_llhttp__internal__n_after_start_req_30,
+ s_n_llhttp__internal__n_after_start_req_22,
+ s_n_llhttp__internal__n_after_start_req_31,
+ s_n_llhttp__internal__n_after_start_req_32,
+ s_n_llhttp__internal__n_after_start_req_35,
+ s_n_llhttp__internal__n_after_start_req_36,
+ s_n_llhttp__internal__n_after_start_req_34,
+ s_n_llhttp__internal__n_after_start_req_37,
+ s_n_llhttp__internal__n_after_start_req_38,
+ s_n_llhttp__internal__n_after_start_req_42,
+ s_n_llhttp__internal__n_after_start_req_43,
+ s_n_llhttp__internal__n_after_start_req_41,
+ s_n_llhttp__internal__n_after_start_req_40,
+ s_n_llhttp__internal__n_after_start_req_39,
+ s_n_llhttp__internal__n_after_start_req_45,
+ s_n_llhttp__internal__n_after_start_req_44,
+ s_n_llhttp__internal__n_after_start_req_33,
+ s_n_llhttp__internal__n_after_start_req_48,
+ s_n_llhttp__internal__n_after_start_req_49,
+ s_n_llhttp__internal__n_after_start_req_50,
+ s_n_llhttp__internal__n_after_start_req_51,
+ s_n_llhttp__internal__n_after_start_req_47,
+ s_n_llhttp__internal__n_after_start_req_46,
+ s_n_llhttp__internal__n_after_start_req_54,
+ s_n_llhttp__internal__n_after_start_req_56,
+ s_n_llhttp__internal__n_after_start_req_57,
+ s_n_llhttp__internal__n_after_start_req_55,
+ s_n_llhttp__internal__n_after_start_req_53,
+ s_n_llhttp__internal__n_after_start_req_58,
+ s_n_llhttp__internal__n_after_start_req_59,
+ s_n_llhttp__internal__n_after_start_req_52,
+ s_n_llhttp__internal__n_after_start_req_61,
+ s_n_llhttp__internal__n_after_start_req_62,
+ s_n_llhttp__internal__n_after_start_req_60,
+ s_n_llhttp__internal__n_after_start_req_65,
+ s_n_llhttp__internal__n_after_start_req_67,
+ s_n_llhttp__internal__n_after_start_req_68,
+ s_n_llhttp__internal__n_after_start_req_66,
+ s_n_llhttp__internal__n_after_start_req_69,
+ s_n_llhttp__internal__n_after_start_req_64,
+ s_n_llhttp__internal__n_after_start_req_63,
+ s_n_llhttp__internal__n_after_start_req,
+ s_n_llhttp__internal__n_span_start_llhttp__on_method_1,
+ s_n_llhttp__internal__n_invoke_llhttp__on_status_complete,
+ s_n_llhttp__internal__n_res_line_almost_done,
+ s_n_llhttp__internal__n_res_status,
+ s_n_llhttp__internal__n_span_start_llhttp__on_status,
+ s_n_llhttp__internal__n_res_status_start,
+ s_n_llhttp__internal__n_res_status_code_otherwise,
+ s_n_llhttp__internal__n_res_status_code_digit_3,
+ s_n_llhttp__internal__n_res_status_code_digit_2,
+ s_n_llhttp__internal__n_res_status_code_digit_1,
+ s_n_llhttp__internal__n_res_after_version,
+ s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1,
+ s_n_llhttp__internal__n_error_68,
+ s_n_llhttp__internal__n_error_79,
+ s_n_llhttp__internal__n_res_http_minor,
+ s_n_llhttp__internal__n_error_80,
+ s_n_llhttp__internal__n_res_http_dot,
+ s_n_llhttp__internal__n_error_81,
+ s_n_llhttp__internal__n_res_http_major,
+ s_n_llhttp__internal__n_span_start_llhttp__on_version_1,
+ s_n_llhttp__internal__n_start_res,
+ s_n_llhttp__internal__n_invoke_llhttp__on_method_complete,
+ s_n_llhttp__internal__n_req_or_res_method_2,
+ s_n_llhttp__internal__n_invoke_update_type_1,
+ s_n_llhttp__internal__n_req_or_res_method_3,
+ s_n_llhttp__internal__n_req_or_res_method_1,
+ s_n_llhttp__internal__n_req_or_res_method,
+ s_n_llhttp__internal__n_span_start_llhttp__on_method,
+ s_n_llhttp__internal__n_start_req_or_res,
+ s_n_llhttp__internal__n_invoke_load_type,
+ s_n_llhttp__internal__n_invoke_update_finish,
+ s_n_llhttp__internal__n_start,
+};
+typedef enum llparse_state_e llparse_state_t;
+
+int llhttp__on_method(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_url(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_version(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_header_field(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_header_value(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_body(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_chunk_extension_name(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_chunk_extension_value(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_status(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_load_initial_message_completed(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->initial_message_completed;
+}
+
+int llhttp__on_reset(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_update_finish(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->finish = 2;
+ return 0;
+}
+
+int llhttp__on_message_begin(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_load_type(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->type;
+}
+
+int llhttp__internal__c_store_method(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ state->method = match;
+ return 0;
+}
+
+int llhttp__on_method_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_is_equal_method(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->method == 5;
+}
+
+int llhttp__internal__c_update_http_major(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->http_major = 0;
+ return 0;
+}
+
+int llhttp__internal__c_update_http_minor(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->http_minor = 9;
+ return 0;
+}
+
+int llhttp__on_url_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_test_lenient_flags(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 1) == 1;
+}
+
+int llhttp__internal__c_test_flags(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->flags & 128) == 128;
+}
+
+int llhttp__on_chunk_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_message_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_is_equal_upgrade(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->upgrade == 1;
+}
+
+int llhttp__after_message_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_update_content_length(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->content_length = 0;
+ return 0;
+}
+
+int llhttp__internal__c_update_initial_message_completed(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->initial_message_completed = 1;
+ return 0;
+}
+
+int llhttp__internal__c_update_finish_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->finish = 0;
+ return 0;
+}
+
+int llhttp__internal__c_test_lenient_flags_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 4) == 4;
+}
+
+int llhttp__internal__c_test_flags_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->flags & 544) == 544;
+}
+
+int llhttp__internal__c_test_lenient_flags_2(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 2) == 2;
+}
+
+int llhttp__before_headers_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_headers_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__after_headers_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_mul_add_content_length(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ /* Multiplication overflow */
+ if (state->content_length > 0xffffffffffffffffULL / 16) {
+ return 1;
+ }
+
+ state->content_length *= 16;
+
+ /* Addition overflow */
+ if (match >= 0) {
+ if (state->content_length > 0xffffffffffffffffULL - match) {
+ return 1;
+ }
+ } else {
+ if (state->content_length < 0ULL - match) {
+ return 1;
+ }
+ }
+ state->content_length += match;
+ return 0;
+}
+
+int llhttp__on_chunk_header(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_is_equal_content_length(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->content_length == 0;
+}
+
+int llhttp__internal__c_or_flags(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 128;
+ return 0;
+}
+
+int llhttp__on_chunk_extension_name_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__on_chunk_extension_value_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_update_finish_3(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->finish = 1;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 64;
+ return 0;
+}
+
+int llhttp__internal__c_update_upgrade(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->upgrade = 1;
+ return 0;
+}
+
+int llhttp__internal__c_store_header_state(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ state->header_state = match;
+ return 0;
+}
+
+int llhttp__on_header_field_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_load_header_state(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->header_state;
+}
+
+int llhttp__internal__c_or_flags_3(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 1;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 1;
+ return 0;
+}
+
+int llhttp__on_header_value_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_or_flags_4(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 2;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_5(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 4;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_6(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 8;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_3(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 6;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 0;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_6(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 5;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_7(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 7;
+ return 0;
+}
+
+int llhttp__internal__c_test_flags_2(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->flags & 32) == 32;
+}
+
+int llhttp__internal__c_mul_add_content_length_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ /* Multiplication overflow */
+ if (state->content_length > 0xffffffffffffffffULL / 10) {
+ return 1;
+ }
+
+ state->content_length *= 10;
+
+ /* Addition overflow */
+ if (match >= 0) {
+ if (state->content_length > 0xffffffffffffffffULL - match) {
+ return 1;
+ }
+ } else {
+ if (state->content_length < 0ULL - match) {
+ return 1;
+ }
+ }
+ state->content_length += match;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_15(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 32;
+ return 0;
+}
+
+int llhttp__internal__c_test_flags_3(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->flags & 8) == 8;
+}
+
+int llhttp__internal__c_test_lenient_flags_8(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 8) == 8;
+}
+
+int llhttp__internal__c_or_flags_16(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 512;
+ return 0;
+}
+
+int llhttp__internal__c_and_flags(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags &= -9;
+ return 0;
+}
+
+int llhttp__internal__c_update_header_state_8(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->header_state = 8;
+ return 0;
+}
+
+int llhttp__internal__c_or_flags_18(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->flags |= 16;
+ return 0;
+}
+
+int llhttp__internal__c_load_method(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->method;
+}
+
+int llhttp__internal__c_store_http_major(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ state->http_major = match;
+ return 0;
+}
+
+int llhttp__internal__c_store_http_minor(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ state->http_minor = match;
+ return 0;
+}
+
+int llhttp__internal__c_test_lenient_flags_10(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return (state->lenient_flags & 16) == 16;
+}
+
+int llhttp__on_version_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_load_http_major(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->http_major;
+}
+
+int llhttp__internal__c_load_http_minor(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ return state->http_minor;
+}
+
+int llhttp__internal__c_update_status_code(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->status_code = 0;
+ return 0;
+}
+
+int llhttp__internal__c_mul_add_status_code(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp,
+ int match) {
+ /* Multiplication overflow */
+ if (state->status_code > 0xffff / 10) {
+ return 1;
+ }
+
+ state->status_code *= 10;
+
+ /* Addition overflow */
+ if (match >= 0) {
+ if (state->status_code > 0xffff - match) {
+ return 1;
+ }
+ } else {
+ if (state->status_code < 0 - match) {
+ return 1;
+ }
+ }
+ state->status_code += match;
+ return 0;
+}
+
+int llhttp__on_status_complete(
+ llhttp__internal_t* s, const unsigned char* p,
+ const unsigned char* endp);
+
+int llhttp__internal__c_update_type(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->type = 1;
+ return 0;
+}
+
+int llhttp__internal__c_update_type_1(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ state->type = 2;
+ return 0;
+}
+
+int llhttp__internal_init(llhttp__internal_t* state) {
+ memset(state, 0, sizeof(*state));
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_start;
+ return 0;
+}
+
+static llparse_state_t llhttp__internal__run(
+ llhttp__internal_t* state,
+ const unsigned char* p,
+ const unsigned char* endp) {
+ int match;
+ switch ((llparse_state_t) (intptr_t) state->_current) {
+ case s_n_llhttp__internal__n_closed:
+ s_n_llhttp__internal__n_closed: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_closed;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_closed;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__after_message_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__after_message_complete: {
+ switch (llhttp__after_message_complete(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_update_content_length;
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_finish_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_pause_1:
+ s_n_llhttp__internal__n_pause_1: {
+ state->error = 0x16;
+ state->reason = "Pause on CONNECT/Upgrade";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__after_message_complete;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_is_equal_upgrade:
+ s_n_llhttp__internal__n_invoke_is_equal_upgrade: {
+ switch (llhttp__internal__c_is_equal_upgrade(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_message_complete;
+ default:
+ goto s_n_llhttp__internal__n_pause_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2:
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2: {
+ switch (llhttp__on_message_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_is_equal_upgrade;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_11;
+ default:
+ goto s_n_llhttp__internal__n_error_24;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_data_almost_done_skip:
+ s_n_llhttp__internal__n_chunk_data_almost_done_skip: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_data_almost_done_skip;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_data_almost_done:
+ s_n_llhttp__internal__n_chunk_data_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_data_almost_done;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_chunk_data_almost_done_skip;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_consume_content_length:
+ s_n_llhttp__internal__n_consume_content_length: {
+ size_t avail;
+ uint64_t need;
+
+ avail = endp - p;
+ need = state->content_length;
+ if (avail >= need) {
+ p += need;
+ state->content_length = 0;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_body;
+ }
+
+ state->content_length -= avail;
+ return s_n_llhttp__internal__n_consume_content_length;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_body:
+ s_n_llhttp__internal__n_span_start_llhttp__on_body: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_body;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_body;
+ goto s_n_llhttp__internal__n_consume_content_length;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_is_equal_content_length:
+ s_n_llhttp__internal__n_invoke_is_equal_content_length: {
+ switch (llhttp__internal__c_is_equal_content_length(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_body;
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_size_almost_done:
+ s_n_llhttp__internal__n_chunk_size_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_size_almost_done;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_header;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete: {
+ switch (llhttp__on_chunk_extension_name_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_size_almost_done;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_5;
+ default:
+ goto s_n_llhttp__internal__n_error_11;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1: {
+ switch (llhttp__on_chunk_extension_name_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_extensions;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_6;
+ default:
+ goto s_n_llhttp__internal__n_error_12;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete: {
+ switch (llhttp__on_chunk_extension_value_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_size_almost_done;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_7;
+ default:
+ goto s_n_llhttp__internal__n_error_14;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extension_quoted_value_done:
+ s_n_llhttp__internal__n_chunk_extension_quoted_value_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extension_quoted_value_done;
+ }
+ switch (*p) {
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_size_almost_done;
+ }
+ case ';': {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extensions;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_16;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1: {
+ switch (llhttp__on_chunk_extension_value_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_extension_quoted_value_done;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_8;
+ default:
+ goto s_n_llhttp__internal__n_error_15;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_17:
+ s_n_llhttp__internal__n_error_17: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions quoted value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extension_quoted_value:
+ s_n_llhttp__internal__n_chunk_extension_quoted_value: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extension_quoted_value;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extension_quoted_value;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_2;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2:
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2: {
+ switch (llhttp__on_chunk_extension_value_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_size_otherwise;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_9;
+ default:
+ goto s_n_llhttp__internal__n_error_18;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_19:
+ s_n_llhttp__internal__n_error_19: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extension_value:
+ s_n_llhttp__internal__n_chunk_extension_value: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 2, 3, 2, 2, 2, 2, 2, 0, 0, 2, 2, 0, 2, 2, 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 4, 0, 0, 0, 0,
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extension_value;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extension_value;
+ }
+ case 3: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extension_quoted_value;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_4;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value:
+ s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_chunk_extension_value;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_2;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_20:
+ s_n_llhttp__internal__n_error_20: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions name";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extension_name:
+ s_n_llhttp__internal__n_chunk_extension_name: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 2, 0, 2, 2, 2, 2, 2, 0, 0, 2, 2, 0, 2, 2, 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 3, 0, 4, 0, 0,
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 0, 0, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 0, 2, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extension_name;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extension_name;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_1;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_3;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name:
+ s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_chunk_extension_name;
+ goto s_n_llhttp__internal__n_chunk_extension_name;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_extensions:
+ s_n_llhttp__internal__n_chunk_extensions: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_extensions;
+ }
+ switch (*p) {
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_error_9;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_error_10;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_name;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_size_otherwise:
+ s_n_llhttp__internal__n_chunk_size_otherwise: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_size_otherwise;
+ }
+ switch (*p) {
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_size_almost_done;
+ }
+ case ';': {
+ p++;
+ goto s_n_llhttp__internal__n_chunk_extensions;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_21;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_size:
+ s_n_llhttp__internal__n_chunk_size: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_size;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'A': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'B': {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'C': {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'D': {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'E': {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'F': {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'a': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'b': {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'c': {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'd': {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'e': {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'f': {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_chunk_size_otherwise;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_chunk_size_digit:
+ s_n_llhttp__internal__n_chunk_size_digit: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_chunk_size_digit;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'A': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'B': {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'C': {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'D': {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'E': {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'F': {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'a': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'b': {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'c': {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'd': {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'e': {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ case 'f': {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_23;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_update_content_length_1:
+ s_n_llhttp__internal__n_invoke_update_content_length_1: {
+ switch (llhttp__internal__c_update_content_length(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_chunk_size_digit;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_consume_content_length_1:
+ s_n_llhttp__internal__n_consume_content_length_1: {
+ size_t avail;
+ uint64_t need;
+
+ avail = endp - p;
+ need = state->content_length;
+ if (avail >= need) {
+ p += need;
+ state->content_length = 0;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_body_1;
+ }
+
+ state->content_length -= avail;
+ return s_n_llhttp__internal__n_consume_content_length_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_body_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_body_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_body_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_body;
+ goto s_n_llhttp__internal__n_consume_content_length_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_eof:
+ s_n_llhttp__internal__n_eof: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_eof;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_eof;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_body_2:
+ s_n_llhttp__internal__n_span_start_llhttp__on_body_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_body_2;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_body;
+ goto s_n_llhttp__internal__n_eof;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete: {
+ switch (llhttp__after_headers_complete(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_1;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_update_content_length_1;
+ case 3:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_body_1;
+ case 4:
+ goto s_n_llhttp__internal__n_invoke_update_finish_3;
+ case 5:
+ goto s_n_llhttp__internal__n_error_25;
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_headers_almost_done:
+ s_n_llhttp__internal__n_headers_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_headers_almost_done;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_flags;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_colon_discard_ws:
+ s_n_llhttp__internal__n_header_field_colon_discard_ws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_colon_discard_ws;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_colon_discard_ws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_field_colon;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_28:
+ s_n_llhttp__internal__n_error_28: {
+ state->error = 0xa;
+ state->reason = "Invalid header field char";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete: {
+ switch (llhttp__on_header_value_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_header_field_start;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_14;
+ default:
+ goto s_n_llhttp__internal__n_error_32;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_header_value:
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_value: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_header_value;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_header_value;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_discard_lws:
+ s_n_llhttp__internal__n_header_value_discard_lws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_discard_lws;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_5;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_5;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_load_header_state;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_discard_ws_almost_done:
+ s_n_llhttp__internal__n_header_value_discard_ws_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_discard_ws_almost_done;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_discard_lws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_6;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_lws:
+ s_n_llhttp__internal__n_header_value_lws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_lws;
+ }
+ switch (*p) {
+ case 9: {
+ goto s_n_llhttp__internal__n_invoke_load_header_state_3;
+ }
+ case ' ': {
+ goto s_n_llhttp__internal__n_invoke_load_header_state_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_load_header_state_4;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_almost_done:
+ s_n_llhttp__internal__n_header_value_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_almost_done;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_lws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_35;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_lenient:
+ s_n_llhttp__internal__n_header_value_lenient: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_lenient;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_3;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4;
+ }
+ default: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_lenient;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_36:
+ s_n_llhttp__internal__n_error_36: {
+ state->error = 0xa;
+ state->reason = "Invalid header value char";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_otherwise:
+ s_n_llhttp__internal__n_header_value_otherwise: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ switch (*p) {
+ case 13: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_7;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_token:
+ s_n_llhttp__internal__n_header_value_connection_token: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_ws:
+ s_n_llhttp__internal__n_header_value_connection_ws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ case ',': {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_load_header_state_5;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_5;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_1:
+ s_n_llhttp__internal__n_header_value_connection_1: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_1;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob3, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_header_state_3;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_value_connection_1;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_2:
+ s_n_llhttp__internal__n_header_value_connection_2: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_2;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob4, 9);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_header_state_6;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_value_connection_2;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection_3:
+ s_n_llhttp__internal__n_header_value_connection_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection_3;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob5, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_header_state_7;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_value_connection_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_connection:
+ s_n_llhttp__internal__n_header_value_connection: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_connection;
+ }
+ switch (((*p) >= 'A' && (*p) <= 'Z' ? (*p | 0x20) : (*p))) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ case 'c': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_1;
+ }
+ case 'k': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_2;
+ }
+ case 'u': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_connection_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_38:
+ s_n_llhttp__internal__n_error_38: {
+ state->error = 0xb;
+ state->reason = "Content-Length overflow";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_39:
+ s_n_llhttp__internal__n_error_39: {
+ state->error = 0xb;
+ state->reason = "Invalid character in Content-Length";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_content_length_ws:
+ s_n_llhttp__internal__n_header_value_content_length_ws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_content_length_ws;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_invoke_or_flags_15;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_invoke_or_flags_15;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_content_length_ws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_6;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_content_length:
+ s_n_llhttp__internal__n_header_value_content_length: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_content_length;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_content_length_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_content_length_ws;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_41:
+ s_n_llhttp__internal__n_error_41: {
+ state->error = 0xf;
+ state->reason = "Invalid `Transfer-Encoding` header value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_40:
+ s_n_llhttp__internal__n_error_40: {
+ state->error = 0xf;
+ state->reason = "Invalid `Transfer-Encoding` header value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_te_token_ows:
+ s_n_llhttp__internal__n_header_value_te_token_ows: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_te_token_ows;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_token_ows;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_token_ows;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value:
+ s_n_llhttp__internal__n_header_value: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value;
+ }
+ #ifdef __SSE4_2__
+ if (endp - p >= 16) {
+ __m128i ranges;
+ __m128i input;
+ int avail;
+ int match_len;
+
+ /* Load input */
+ input = _mm_loadu_si128((__m128i const*) p);
+ ranges = _mm_loadu_si128((__m128i const*) llparse_blob7);
+
+ /* Find first character that does not match `ranges` */
+ match_len = _mm_cmpestri(ranges, 6,
+ input, 16,
+ _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES |
+ _SIDD_NEGATIVE_POLARITY);
+
+ if (match_len != 0) {
+ p += match_len;
+ goto s_n_llhttp__internal__n_header_value;
+ }
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ #endif /* __SSE4_2__ */
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_te_token:
+ s_n_llhttp__internal__n_header_value_te_token: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_te_token;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_token;
+ }
+ case 2: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_token_ows;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_9;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_te_chunked_last:
+ s_n_llhttp__internal__n_header_value_te_chunked_last: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_te_chunked_last;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_8;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_8;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_chunked_last;
+ }
+ case ',': {
+ goto s_n_llhttp__internal__n_invoke_load_type_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_value_te_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_te_chunked:
+ s_n_llhttp__internal__n_header_value_te_chunked: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ match_seq = llparse__match_sequence_to_lower_unsafe(state, p, endp, llparse_blob6, 7);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_te_chunked_last;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_header_value_te_token;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_header_value;
+ goto s_n_llhttp__internal__n_invoke_load_header_state_2;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_value_discard_ws:
+ s_n_llhttp__internal__n_header_value_discard_ws: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_value_discard_ws;
+ }
+ switch (*p) {
+ case 9: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_discard_ws;
+ }
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_4;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_discard_ws_almost_done;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_header_value_discard_ws;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete: {
+ switch (llhttp__on_header_field_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_header_value_discard_ws;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_15;
+ default:
+ goto s_n_llhttp__internal__n_error_29;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_general_otherwise:
+ s_n_llhttp__internal__n_header_field_general_otherwise: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_general_otherwise;
+ }
+ switch (*p) {
+ case ':': {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_42;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_general:
+ s_n_llhttp__internal__n_header_field_general: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_general;
+ }
+ #ifdef __SSE4_2__
+ if (endp - p >= 16) {
+ __m128i ranges;
+ __m128i input;
+ int avail;
+ int match_len;
+
+ /* Load input */
+ input = _mm_loadu_si128((__m128i const*) p);
+ ranges = _mm_loadu_si128((__m128i const*) llparse_blob8);
+
+ /* Find first character that does not match `ranges` */
+ match_len = _mm_cmpestri(ranges, 16,
+ input, 16,
+ _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES |
+ _SIDD_NEGATIVE_POLARITY);
+
+ if (match_len != 0) {
+ p += match_len;
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ ranges = _mm_loadu_si128((__m128i const*) llparse_blob9);
+
+ /* Find first character that does not match `ranges` */
+ match_len = _mm_cmpestri(ranges, 2,
+ input, 16,
+ _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES |
+ _SIDD_NEGATIVE_POLARITY);
+
+ if (match_len != 0) {
+ p += match_len;
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ goto s_n_llhttp__internal__n_header_field_general_otherwise;
+ }
+ #endif /* __SSE4_2__ */
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_field_general_otherwise;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_colon:
+ s_n_llhttp__internal__n_header_field_colon: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_colon;
+ }
+ switch (*p) {
+ case ' ': {
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_3;
+ }
+ case ':': {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_10;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_3:
+ s_n_llhttp__internal__n_header_field_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_3;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob2, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_4:
+ s_n_llhttp__internal__n_header_field_4: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_4;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob10, 10);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_4;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_2:
+ s_n_llhttp__internal__n_header_field_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_2;
+ }
+ switch (((*p) >= 'A' && (*p) <= 'Z' ? (*p | 0x20) : (*p))) {
+ case 'n': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_3;
+ }
+ case 't': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_4;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_1:
+ s_n_llhttp__internal__n_header_field_1: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_1;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob1, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_2;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_1;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_5:
+ s_n_llhttp__internal__n_header_field_5: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_5;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob11, 15);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_5;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_6:
+ s_n_llhttp__internal__n_header_field_6: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_6;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob12, 16);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_6;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_7:
+ s_n_llhttp__internal__n_header_field_7: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_7;
+ }
+ match_seq = llparse__match_sequence_to_lower(state, p, endp, llparse_blob13, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_header_state;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_header_field_7;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field:
+ s_n_llhttp__internal__n_header_field: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field;
+ }
+ switch (((*p) >= 'A' && (*p) <= 'Z' ? (*p | 0x20) : (*p))) {
+ case 'c': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_1;
+ }
+ case 'p': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_5;
+ }
+ case 't': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_6;
+ }
+ case 'u': {
+ p++;
+ goto s_n_llhttp__internal__n_header_field_7;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_header_state_11;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_header_field:
+ s_n_llhttp__internal__n_span_start_llhttp__on_header_field: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_header_field;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_header_field;
+ goto s_n_llhttp__internal__n_header_field;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_header_field_start:
+ s_n_llhttp__internal__n_header_field_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_header_field_start;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_headers_almost_done;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_headers_almost_done;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_field;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_headers_start:
+ s_n_llhttp__internal__n_headers_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_headers_start;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_header_field_start;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_skip_to_http09:
+ s_n_llhttp__internal__n_url_skip_to_http09: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_skip_to_http09;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_http_major;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_skip_lf_to_http09:
+ s_n_llhttp__internal__n_url_skip_lf_to_http09: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob14, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_http_major;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_43;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_pri_upgrade:
+ s_n_llhttp__internal__n_req_pri_upgrade: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_pri_upgrade;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob16, 10);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_error_49;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_pri_upgrade;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_50;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_complete_1:
+ s_n_llhttp__internal__n_req_http_complete_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_complete_1;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_headers_start;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_48;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_complete:
+ s_n_llhttp__internal__n_req_http_complete: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_complete;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_headers_start;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_complete_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_48;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_load_method_1:
+ s_n_llhttp__internal__n_invoke_load_method_1: {
+ switch (llhttp__internal__c_load_method(state, p, endp)) {
+ case 34:
+ goto s_n_llhttp__internal__n_req_pri_upgrade;
+ default:
+ goto s_n_llhttp__internal__n_req_http_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_version_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_version_complete: {
+ switch (llhttp__on_version_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_load_method_1;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_17;
+ default:
+ goto s_n_llhttp__internal__n_error_47;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_46:
+ s_n_llhttp__internal__n_error_46: {
+ state->error = 0x9;
+ state->reason = "Invalid HTTP version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_51:
+ s_n_llhttp__internal__n_error_51: {
+ state->error = 0x9;
+ state->reason = "Invalid minor version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_minor:
+ s_n_llhttp__internal__n_req_http_minor: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_minor;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_2;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_52:
+ s_n_llhttp__internal__n_error_52: {
+ state->error = 0x9;
+ state->reason = "Expected dot";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_dot:
+ s_n_llhttp__internal__n_req_http_dot: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_dot;
+ }
+ switch (*p) {
+ case '.': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_minor;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_3;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_53:
+ s_n_llhttp__internal__n_error_53: {
+ state->error = 0x9;
+ state->reason = "Invalid major version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_major:
+ s_n_llhttp__internal__n_req_http_major: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_major;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_http_major;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_4;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_version:
+ s_n_llhttp__internal__n_span_start_llhttp__on_version: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_version;
+ goto s_n_llhttp__internal__n_req_http_major;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_start_1:
+ s_n_llhttp__internal__n_req_http_start_1: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_start_1;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob15, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_load_method;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_http_start_1;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_56;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_start_2:
+ s_n_llhttp__internal__n_req_http_start_2: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_start_2;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob17, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_load_method_2;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_http_start_2;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_56;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_start_3:
+ s_n_llhttp__internal__n_req_http_start_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_start_3;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob18, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_load_method_3;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_http_start_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_56;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_http_start:
+ s_n_llhttp__internal__n_req_http_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_http_start;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_start;
+ }
+ case 'H': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_start_1;
+ }
+ case 'I': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_start_2;
+ }
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_req_http_start_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_56;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_skip_to_http:
+ s_n_llhttp__internal__n_url_skip_to_http: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_skip_to_http;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_url_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_fragment:
+ s_n_llhttp__internal__n_url_fragment: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_fragment;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_url_fragment;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_6;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_7;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_8;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_57;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_end_stub_query_3:
+ s_n_llhttp__internal__n_span_end_stub_query_3: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_end_stub_query_3;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_fragment;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_query:
+ s_n_llhttp__internal__n_url_query: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 1, 3, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 4, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_query;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_url_query;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_9;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_10;
+ }
+ case 4: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_11;
+ }
+ case 5: {
+ goto s_n_llhttp__internal__n_span_end_stub_query_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_58;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_query_or_fragment:
+ s_n_llhttp__internal__n_url_query_or_fragment: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_query_or_fragment;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_3;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_4;
+ }
+ case ' ': {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_5;
+ }
+ case '#': {
+ p++;
+ goto s_n_llhttp__internal__n_url_fragment;
+ }
+ case '?': {
+ p++;
+ goto s_n_llhttp__internal__n_url_query;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_59;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_path:
+ s_n_llhttp__internal__n_url_path: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_path;
+ }
+ #ifdef __SSE4_2__
+ if (endp - p >= 16) {
+ __m128i ranges;
+ __m128i input;
+ int avail;
+ int match_len;
+
+ /* Load input */
+ input = _mm_loadu_si128((__m128i const*) p);
+ ranges = _mm_loadu_si128((__m128i const*) llparse_blob0);
+
+ /* Find first character that does not match `ranges` */
+ match_len = _mm_cmpestri(ranges, 12,
+ input, 16,
+ _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES |
+ _SIDD_NEGATIVE_POLARITY);
+
+ if (match_len != 0) {
+ p += match_len;
+ goto s_n_llhttp__internal__n_url_path;
+ }
+ goto s_n_llhttp__internal__n_url_query_or_fragment;
+ }
+ #endif /* __SSE4_2__ */
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_url_path;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_url_query_or_fragment;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_stub_path_2:
+ s_n_llhttp__internal__n_span_start_stub_path_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_stub_path_2;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_path;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_stub_path:
+ s_n_llhttp__internal__n_span_start_stub_path: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_stub_path;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_path;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_stub_path_1:
+ s_n_llhttp__internal__n_span_start_stub_path_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_stub_path_1;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_path;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_server_with_at:
+ s_n_llhttp__internal__n_url_server_with_at: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 4, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 0, 6,
+ 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 0, 4,
+ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_server_with_at;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_12;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_13;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_14;
+ }
+ case 4: {
+ p++;
+ goto s_n_llhttp__internal__n_url_server;
+ }
+ case 5: {
+ goto s_n_llhttp__internal__n_span_start_stub_path_1;
+ }
+ case 6: {
+ p++;
+ goto s_n_llhttp__internal__n_url_query;
+ }
+ case 7: {
+ p++;
+ goto s_n_llhttp__internal__n_error_60;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_61;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_server:
+ s_n_llhttp__internal__n_url_server: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 4, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 0, 6,
+ 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 4, 0, 4,
+ 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_server;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_1;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_2;
+ }
+ case 4: {
+ p++;
+ goto s_n_llhttp__internal__n_url_server;
+ }
+ case 5: {
+ goto s_n_llhttp__internal__n_span_start_stub_path;
+ }
+ case 6: {
+ p++;
+ goto s_n_llhttp__internal__n_url_query;
+ }
+ case 7: {
+ p++;
+ goto s_n_llhttp__internal__n_url_server_with_at;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_62;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_schema_delim_1:
+ s_n_llhttp__internal__n_url_schema_delim_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_schema_delim_1;
+ }
+ switch (*p) {
+ case '/': {
+ p++;
+ goto s_n_llhttp__internal__n_url_server;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_64;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_schema_delim:
+ s_n_llhttp__internal__n_url_schema_delim: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_schema_delim;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_error_63;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_error_63;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_error_63;
+ }
+ case '/': {
+ p++;
+ goto s_n_llhttp__internal__n_url_schema_delim_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_64;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_end_stub_schema:
+ s_n_llhttp__internal__n_span_end_stub_schema: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_end_stub_schema;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_url_schema_delim;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_schema:
+ s_n_llhttp__internal__n_url_schema: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0,
+ 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0,
+ 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_schema;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_63;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_end_stub_schema;
+ }
+ case 3: {
+ p++;
+ goto s_n_llhttp__internal__n_url_schema;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_65;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_url_start:
+ s_n_llhttp__internal__n_url_start: {
+ static uint8_t lookup_table[] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 2,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0,
+ 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ if (p == endp) {
+ return s_n_llhttp__internal__n_url_start;
+ }
+ switch (lookup_table[(uint8_t) *p]) {
+ case 1: {
+ p++;
+ goto s_n_llhttp__internal__n_error_63;
+ }
+ case 2: {
+ goto s_n_llhttp__internal__n_span_start_stub_path_2;
+ }
+ case 3: {
+ goto s_n_llhttp__internal__n_url_schema;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_66;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_url_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_url_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_url_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_url;
+ goto s_n_llhttp__internal__n_url_start;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_url:
+ s_n_llhttp__internal__n_span_start_llhttp__on_url: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_url;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_url;
+ goto s_n_llhttp__internal__n_url_server;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_spaces_before_url:
+ s_n_llhttp__internal__n_req_spaces_before_url: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_spaces_before_url;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_req_spaces_before_url;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_is_equal_method;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_first_space_before_url:
+ s_n_llhttp__internal__n_req_first_space_before_url: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_first_space_before_url;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_req_spaces_before_url;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_67;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1:
+ s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1: {
+ switch (llhttp__on_method_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_req_first_space_before_url;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_22;
+ default:
+ goto s_n_llhttp__internal__n_error_83;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_2:
+ s_n_llhttp__internal__n_after_start_req_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_2;
+ }
+ switch (*p) {
+ case 'L': {
+ p++;
+ match = 19;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_3:
+ s_n_llhttp__internal__n_after_start_req_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_3;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob19, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 36;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_1:
+ s_n_llhttp__internal__n_after_start_req_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_1;
+ }
+ switch (*p) {
+ case 'C': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_2;
+ }
+ case 'N': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_4:
+ s_n_llhttp__internal__n_after_start_req_4: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_4;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob20, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 16;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_4;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_6:
+ s_n_llhttp__internal__n_after_start_req_6: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_6;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob21, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 22;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_6;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_8:
+ s_n_llhttp__internal__n_after_start_req_8: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_8;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob22, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_8;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_9:
+ s_n_llhttp__internal__n_after_start_req_9: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_9;
+ }
+ switch (*p) {
+ case 'Y': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_7:
+ s_n_llhttp__internal__n_after_start_req_7: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_7;
+ }
+ switch (*p) {
+ case 'N': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_8;
+ }
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_9;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_5:
+ s_n_llhttp__internal__n_after_start_req_5: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_5;
+ }
+ switch (*p) {
+ case 'H': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_6;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_7;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_12:
+ s_n_llhttp__internal__n_after_start_req_12: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_12;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob23, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_12;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_13:
+ s_n_llhttp__internal__n_after_start_req_13: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_13;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob24, 5);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 35;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_13;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_11:
+ s_n_llhttp__internal__n_after_start_req_11: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_11;
+ }
+ switch (*p) {
+ case 'L': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_12;
+ }
+ case 'S': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_13;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_10:
+ s_n_llhttp__internal__n_after_start_req_10: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_10;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_11;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_14:
+ s_n_llhttp__internal__n_after_start_req_14: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_14;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob25, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 45;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_14;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_17:
+ s_n_llhttp__internal__n_after_start_req_17: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_17;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob27, 9);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 41;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_17;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_16:
+ s_n_llhttp__internal__n_after_start_req_16: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_16;
+ }
+ switch (*p) {
+ case '_': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_17;
+ }
+ default: {
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_15:
+ s_n_llhttp__internal__n_after_start_req_15: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_15;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob26, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_16;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_15;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_18:
+ s_n_llhttp__internal__n_after_start_req_18: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_18;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob28, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_18;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_20:
+ s_n_llhttp__internal__n_after_start_req_20: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_20;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob29, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 31;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_20;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_21:
+ s_n_llhttp__internal__n_after_start_req_21: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_21;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob30, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_21;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_19:
+ s_n_llhttp__internal__n_after_start_req_19: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_19;
+ }
+ switch (*p) {
+ case 'I': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_20;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_21;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_23:
+ s_n_llhttp__internal__n_after_start_req_23: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_23;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob31, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 24;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_23;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_24:
+ s_n_llhttp__internal__n_after_start_req_24: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_24;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob32, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 23;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_24;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_26:
+ s_n_llhttp__internal__n_after_start_req_26: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_26;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob33, 7);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 21;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_26;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_28:
+ s_n_llhttp__internal__n_after_start_req_28: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_28;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob34, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 30;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_28;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_29:
+ s_n_llhttp__internal__n_after_start_req_29: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_29;
+ }
+ switch (*p) {
+ case 'L': {
+ p++;
+ match = 10;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_27:
+ s_n_llhttp__internal__n_after_start_req_27: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_27;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_28;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_29;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_25:
+ s_n_llhttp__internal__n_after_start_req_25: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_25;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_26;
+ }
+ case 'C': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_27;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_30:
+ s_n_llhttp__internal__n_after_start_req_30: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_30;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob35, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 11;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_30;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_22:
+ s_n_llhttp__internal__n_after_start_req_22: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_22;
+ }
+ switch (*p) {
+ case '-': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_23;
+ }
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_24;
+ }
+ case 'K': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_25;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_30;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_31:
+ s_n_llhttp__internal__n_after_start_req_31: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_31;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob36, 5);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 25;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_31;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_32:
+ s_n_llhttp__internal__n_after_start_req_32: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_32;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob37, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_32;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_35:
+ s_n_llhttp__internal__n_after_start_req_35: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_35;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob38, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 28;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_35;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_36:
+ s_n_llhttp__internal__n_after_start_req_36: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_36;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob39, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 39;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_36;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_34:
+ s_n_llhttp__internal__n_after_start_req_34: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_34;
+ }
+ switch (*p) {
+ case 'T': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_35;
+ }
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_36;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_37:
+ s_n_llhttp__internal__n_after_start_req_37: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_37;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob40, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 38;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_37;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_38:
+ s_n_llhttp__internal__n_after_start_req_38: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_38;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob41, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_38;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_42:
+ s_n_llhttp__internal__n_after_start_req_42: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_42;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob42, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 12;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_42;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_43:
+ s_n_llhttp__internal__n_after_start_req_43: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_43;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob43, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 13;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_43;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_41:
+ s_n_llhttp__internal__n_after_start_req_41: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_41;
+ }
+ switch (*p) {
+ case 'F': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_42;
+ }
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_43;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_40:
+ s_n_llhttp__internal__n_after_start_req_40: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_40;
+ }
+ switch (*p) {
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_41;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_39:
+ s_n_llhttp__internal__n_after_start_req_39: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_39;
+ }
+ switch (*p) {
+ case 'I': {
+ p++;
+ match = 34;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_40;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_45:
+ s_n_llhttp__internal__n_after_start_req_45: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_45;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob44, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 29;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_45;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_44:
+ s_n_llhttp__internal__n_after_start_req_44: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_44;
+ }
+ switch (*p) {
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_45;
+ }
+ case 'T': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_33:
+ s_n_llhttp__internal__n_after_start_req_33: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_33;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_34;
+ }
+ case 'L': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_37;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_38;
+ }
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_39;
+ }
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_44;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_48:
+ s_n_llhttp__internal__n_after_start_req_48: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_48;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob45, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 17;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_48;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_49:
+ s_n_llhttp__internal__n_after_start_req_49: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_49;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob46, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 44;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_49;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_50:
+ s_n_llhttp__internal__n_after_start_req_50: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_50;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob47, 5);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 43;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_50;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_51:
+ s_n_llhttp__internal__n_after_start_req_51: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_51;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob48, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 20;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_51;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_47:
+ s_n_llhttp__internal__n_after_start_req_47: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_47;
+ }
+ switch (*p) {
+ case 'B': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_48;
+ }
+ case 'C': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_49;
+ }
+ case 'D': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_50;
+ }
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_51;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_46:
+ s_n_llhttp__internal__n_after_start_req_46: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_46;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_47;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_54:
+ s_n_llhttp__internal__n_after_start_req_54: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_54;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob49, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 14;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_54;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_56:
+ s_n_llhttp__internal__n_after_start_req_56: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_56;
+ }
+ switch (*p) {
+ case 'P': {
+ p++;
+ match = 37;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_57:
+ s_n_llhttp__internal__n_after_start_req_57: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_57;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob50, 9);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 42;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_57;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_55:
+ s_n_llhttp__internal__n_after_start_req_55: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_55;
+ }
+ switch (*p) {
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_56;
+ }
+ case '_': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_57;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_53:
+ s_n_llhttp__internal__n_after_start_req_53: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_53;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_54;
+ }
+ case 'T': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_55;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_58:
+ s_n_llhttp__internal__n_after_start_req_58: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_58;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob51, 4);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 33;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_58;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_59:
+ s_n_llhttp__internal__n_after_start_req_59: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_59;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob52, 7);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 26;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_59;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_52:
+ s_n_llhttp__internal__n_after_start_req_52: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_52;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_53;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_58;
+ }
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_59;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_61:
+ s_n_llhttp__internal__n_after_start_req_61: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_61;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob53, 6);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 40;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_61;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_62:
+ s_n_llhttp__internal__n_after_start_req_62: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_62;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob54, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_62;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_60:
+ s_n_llhttp__internal__n_after_start_req_60: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_60;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_61;
+ }
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_62;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_65:
+ s_n_llhttp__internal__n_after_start_req_65: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_65;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob55, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 18;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_65;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_67:
+ s_n_llhttp__internal__n_after_start_req_67: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_67;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob56, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 32;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_67;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_68:
+ s_n_llhttp__internal__n_after_start_req_68: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_68;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob57, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 15;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_68;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_66:
+ s_n_llhttp__internal__n_after_start_req_66: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_66;
+ }
+ switch (*p) {
+ case 'I': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_67;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_68;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_69:
+ s_n_llhttp__internal__n_after_start_req_69: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_69;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob58, 8);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 27;
+ goto s_n_llhttp__internal__n_invoke_store_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_after_start_req_69;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_64:
+ s_n_llhttp__internal__n_after_start_req_64: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_64;
+ }
+ switch (*p) {
+ case 'B': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_65;
+ }
+ case 'L': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_66;
+ }
+ case 'S': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_69;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req_63:
+ s_n_llhttp__internal__n_after_start_req_63: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req_63;
+ }
+ switch (*p) {
+ case 'N': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_64;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_after_start_req:
+ s_n_llhttp__internal__n_after_start_req: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_after_start_req;
+ }
+ switch (*p) {
+ case 'A': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_1;
+ }
+ case 'B': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_4;
+ }
+ case 'C': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_5;
+ }
+ case 'D': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_10;
+ }
+ case 'F': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_14;
+ }
+ case 'G': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_15;
+ }
+ case 'H': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_18;
+ }
+ case 'L': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_19;
+ }
+ case 'M': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_22;
+ }
+ case 'N': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_31;
+ }
+ case 'O': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_32;
+ }
+ case 'P': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_33;
+ }
+ case 'R': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_46;
+ }
+ case 'S': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_52;
+ }
+ case 'T': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_60;
+ }
+ case 'U': {
+ p++;
+ goto s_n_llhttp__internal__n_after_start_req_63;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_84;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_method_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_method_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_method_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_method;
+ goto s_n_llhttp__internal__n_after_start_req;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_status_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_status_complete: {
+ switch (llhttp__on_status_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_headers_start;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_20;
+ default:
+ goto s_n_llhttp__internal__n_error_70;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_line_almost_done:
+ s_n_llhttp__internal__n_res_line_almost_done: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_line_almost_done;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status:
+ s_n_llhttp__internal__n_res_status: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_status;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_status_1;
+ }
+ default: {
+ p++;
+ goto s_n_llhttp__internal__n_res_status;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_status:
+ s_n_llhttp__internal__n_span_start_llhttp__on_status: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_status;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_status;
+ goto s_n_llhttp__internal__n_res_status;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_start:
+ s_n_llhttp__internal__n_res_status_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_start;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_res_line_almost_done;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_status;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_code_otherwise:
+ s_n_llhttp__internal__n_res_status_code_otherwise: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_code_otherwise;
+ }
+ switch (*p) {
+ case 10: {
+ goto s_n_llhttp__internal__n_res_status_start;
+ }
+ case 13: {
+ goto s_n_llhttp__internal__n_res_status_start;
+ }
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_res_status_start;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_71;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_code_digit_3:
+ s_n_llhttp__internal__n_res_status_code_digit_3: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_code_digit_3;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_2;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_73;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_code_digit_2:
+ s_n_llhttp__internal__n_res_status_code_digit_2: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_code_digit_2;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_75;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_status_code_digit_1:
+ s_n_llhttp__internal__n_res_status_code_digit_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_status_code_digit_1;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_mul_add_status_code;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_77;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_after_version:
+ s_n_llhttp__internal__n_res_after_version: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_after_version;
+ }
+ switch (*p) {
+ case ' ': {
+ p++;
+ goto s_n_llhttp__internal__n_invoke_update_status_code;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_78;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1:
+ s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1: {
+ switch (llhttp__on_version_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_res_after_version;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_21;
+ default:
+ goto s_n_llhttp__internal__n_error_69;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_68:
+ s_n_llhttp__internal__n_error_68: {
+ state->error = 0x9;
+ state->reason = "Invalid HTTP version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_79:
+ s_n_llhttp__internal__n_error_79: {
+ state->error = 0x9;
+ state->reason = "Invalid minor version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_http_minor:
+ s_n_llhttp__internal__n_res_http_minor: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_http_minor;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_http_minor_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_7;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_80:
+ s_n_llhttp__internal__n_error_80: {
+ state->error = 0x9;
+ state->reason = "Expected dot";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_http_dot:
+ s_n_llhttp__internal__n_res_http_dot: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_http_dot;
+ }
+ switch (*p) {
+ case '.': {
+ p++;
+ goto s_n_llhttp__internal__n_res_http_minor;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_8;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_error_81:
+ s_n_llhttp__internal__n_error_81: {
+ state->error = 0x9;
+ state->reason = "Invalid major version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_res_http_major:
+ s_n_llhttp__internal__n_res_http_major: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_res_http_major;
+ }
+ switch (*p) {
+ case '0': {
+ p++;
+ match = 0;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '1': {
+ p++;
+ match = 1;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '2': {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '3': {
+ p++;
+ match = 3;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '4': {
+ p++;
+ match = 4;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '5': {
+ p++;
+ match = 5;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '6': {
+ p++;
+ match = 6;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '7': {
+ p++;
+ match = 7;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '8': {
+ p++;
+ match = 8;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ case '9': {
+ p++;
+ match = 9;
+ goto s_n_llhttp__internal__n_invoke_store_http_major_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_9;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_version_1:
+ s_n_llhttp__internal__n_span_start_llhttp__on_version_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_version_1;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_version;
+ goto s_n_llhttp__internal__n_res_http_major;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_start_res:
+ s_n_llhttp__internal__n_start_res: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_start_res;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob59, 5);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_start_res;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_85;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_llhttp__on_method_complete:
+ s_n_llhttp__internal__n_invoke_llhttp__on_method_complete: {
+ switch (llhttp__on_method_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_req_first_space_before_url;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_19;
+ default:
+ goto s_n_llhttp__internal__n_error_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_or_res_method_2:
+ s_n_llhttp__internal__n_req_or_res_method_2: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_or_res_method_2;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob60, 2);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ match = 2;
+ goto s_n_llhttp__internal__n_invoke_store_method;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_or_res_method_2;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_82;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_update_type_1:
+ s_n_llhttp__internal__n_invoke_update_type_1: {
+ switch (llhttp__internal__c_update_type_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_or_res_method_3:
+ s_n_llhttp__internal__n_req_or_res_method_3: {
+ llparse_match_t match_seq;
+
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_or_res_method_3;
+ }
+ match_seq = llparse__match_sequence_id(state, p, endp, llparse_blob61, 3);
+ p = match_seq.current;
+ switch (match_seq.status) {
+ case kMatchComplete: {
+ p++;
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_method_1;
+ }
+ case kMatchPause: {
+ return s_n_llhttp__internal__n_req_or_res_method_3;
+ }
+ case kMatchMismatch: {
+ goto s_n_llhttp__internal__n_error_82;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_or_res_method_1:
+ s_n_llhttp__internal__n_req_or_res_method_1: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_or_res_method_1;
+ }
+ switch (*p) {
+ case 'E': {
+ p++;
+ goto s_n_llhttp__internal__n_req_or_res_method_2;
+ }
+ case 'T': {
+ p++;
+ goto s_n_llhttp__internal__n_req_or_res_method_3;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_82;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_req_or_res_method:
+ s_n_llhttp__internal__n_req_or_res_method: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_req_or_res_method;
+ }
+ switch (*p) {
+ case 'H': {
+ p++;
+ goto s_n_llhttp__internal__n_req_or_res_method_1;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_error_82;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_span_start_llhttp__on_method:
+ s_n_llhttp__internal__n_span_start_llhttp__on_method: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_span_start_llhttp__on_method;
+ }
+ state->_span_pos0 = (void*) p;
+ state->_span_cb0 = llhttp__on_method;
+ goto s_n_llhttp__internal__n_req_or_res_method;
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_start_req_or_res:
+ s_n_llhttp__internal__n_start_req_or_res: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_start_req_or_res;
+ }
+ switch (*p) {
+ case 'H': {
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_method;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_update_type_2;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_load_type:
+ s_n_llhttp__internal__n_invoke_load_type: {
+ switch (llhttp__internal__c_load_type(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_method_1;
+ case 2:
+ goto s_n_llhttp__internal__n_start_res;
+ default:
+ goto s_n_llhttp__internal__n_start_req_or_res;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_invoke_update_finish:
+ s_n_llhttp__internal__n_invoke_update_finish: {
+ switch (llhttp__internal__c_update_finish(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_begin;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ case s_n_llhttp__internal__n_start:
+ s_n_llhttp__internal__n_start: {
+ if (p == endp) {
+ return s_n_llhttp__internal__n_start;
+ }
+ switch (*p) {
+ case 10: {
+ p++;
+ goto s_n_llhttp__internal__n_start;
+ }
+ case 13: {
+ p++;
+ goto s_n_llhttp__internal__n_start;
+ }
+ default: {
+ goto s_n_llhttp__internal__n_invoke_load_initial_message_completed;
+ }
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ default:
+ /* UNREACHABLE */
+ abort();
+ }
+ s_n_llhttp__internal__n_error_63: {
+ state->error = 0x7;
+ state->reason = "Invalid characters in url";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_finish_2: {
+ switch (llhttp__internal__c_update_finish_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_start;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_initial_message_completed: {
+ switch (llhttp__internal__c_update_initial_message_completed(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_finish_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_content_length: {
+ switch (llhttp__internal__c_update_content_length(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_initial_message_completed;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_1: {
+ switch (llhttp__internal__c_test_lenient_flags_1(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_update_initial_message_completed;
+ default:
+ goto s_n_llhttp__internal__n_closed;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_finish_1: {
+ switch (llhttp__internal__c_update_finish_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_11: {
+ state->error = 0x15;
+ state->reason = "on_message_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_is_equal_upgrade;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_24: {
+ state->error = 0x12;
+ state->reason = "`on_message_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_13: {
+ state->error = 0x15;
+ state->reason = "on_chunk_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_27: {
+ state->error = 0x14;
+ state->reason = "`on_chunk_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_complete_1: {
+ switch (llhttp__on_chunk_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_13;
+ default:
+ goto s_n_llhttp__internal__n_error_27;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_26: {
+ state->error = 0x4;
+ state->reason = "Content-Length can't be present with Transfer-Encoding";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_2: {
+ state->error = 0x15;
+ state->reason = "on_message_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_pause_1;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_6: {
+ state->error = 0x12;
+ state->reason = "`on_message_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_1: {
+ switch (llhttp__on_message_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_pause_1;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_2;
+ default:
+ goto s_n_llhttp__internal__n_error_6;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_22: {
+ state->error = 0xc;
+ state->reason = "Chunk size overflow";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_3: {
+ state->error = 0x15;
+ state->reason = "on_chunk_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_update_content_length_1;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_8: {
+ state->error = 0x14;
+ state->reason = "`on_chunk_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_complete: {
+ switch (llhttp__on_chunk_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_update_content_length_1;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_3;
+ default:
+ goto s_n_llhttp__internal__n_error_8;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_body: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_body(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_data_almost_done;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_chunk_data_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags: {
+ switch (llhttp__internal__c_or_flags(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_field_start;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_4: {
+ state->error = 0x15;
+ state->reason = "on_chunk_header pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_is_equal_content_length;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_7: {
+ state->error = 0x13;
+ state->reason = "`on_chunk_header` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_header: {
+ switch (llhttp__on_chunk_header(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_is_equal_content_length;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_4;
+ default:
+ goto s_n_llhttp__internal__n_error_7;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_9: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_10: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_5: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_name pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_size_almost_done;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_11: {
+ state->error = 0x22;
+ state->reason = "`on_chunk_extension_name` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_name(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_6: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_name pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_extensions;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_12: {
+ state->error = 0x22;
+ state->reason = "`on_chunk_extension_name` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_name(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_7: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_value pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_size_almost_done;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_14: {
+ state->error = 0x23;
+ state->reason = "`on_chunk_extension_value` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_16: {
+ state->error = 0x2;
+ state->reason = "Invalid character in chunk extensions quote value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_8: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_value pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_extension_quoted_value_done;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_15: {
+ state->error = 0x23;
+ state->reason = "`on_chunk_extension_value` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_17;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_17;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_9: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_value pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_size_otherwise;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_18: {
+ state->error = 0x23;
+ state->reason = "`on_chunk_extension_value` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_value_complete_2;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_value_4: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_19;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_19;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_10: {
+ state->error = 0x15;
+ state->reason = "on_chunk_extension_name pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_chunk_extension_value;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_13: {
+ state->error = 0x22;
+ state->reason = "`on_chunk_extension_name` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_chunk_extension_name_complete_2: {
+ switch (llhttp__on_chunk_extension_name_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_chunk_extension_value;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_10;
+ default:
+ goto s_n_llhttp__internal__n_error_13;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_name(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_chunk_extension_value;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_chunk_extension_name_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_chunk_extension_name(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_20;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_20;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_21: {
+ state->error = 0xc;
+ state->reason = "Invalid character in chunk size";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_content_length: {
+ switch (llhttp__internal__c_mul_add_content_length(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_error_22;
+ default:
+ goto s_n_llhttp__internal__n_chunk_size;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_23: {
+ state->error = 0xc;
+ state->reason = "Invalid character in chunk size";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_body_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_body(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_message_complete_2;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_finish_3: {
+ switch (llhttp__internal__c_update_finish_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_body_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_25: {
+ state->error = 0xf;
+ state->reason = "Request has invalid `Transfer-Encoding`";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause: {
+ state->error = 0x15;
+ state->reason = "on_message_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__after_message_complete;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_5: {
+ state->error = 0x12;
+ state->reason = "`on_message_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_complete: {
+ switch (llhttp__on_message_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_message_complete;
+ case 21:
+ goto s_n_llhttp__internal__n_pause;
+ default:
+ goto s_n_llhttp__internal__n_error_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_1: {
+ switch (llhttp__internal__c_or_flags_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_2: {
+ switch (llhttp__internal__c_or_flags_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_upgrade: {
+ switch (llhttp__internal__c_update_upgrade(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_12: {
+ state->error = 0x15;
+ state->reason = "Paused by on_headers_complete";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_4: {
+ state->error = 0x11;
+ state->reason = "User callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_headers_complete: {
+ switch (llhttp__on_headers_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_llhttp__after_headers_complete;
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_or_flags_1;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_update_upgrade;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_12;
+ default:
+ goto s_n_llhttp__internal__n_error_4;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__before_headers_complete: {
+ switch (llhttp__before_headers_complete(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_2: {
+ switch (llhttp__internal__c_test_lenient_flags_2(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_error_26;
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__before_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_flags_1: {
+ switch (llhttp__internal__c_test_flags_1(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_2;
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__before_headers_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_flags: {
+ switch (llhttp__internal__c_test_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_chunk_complete_1;
+ default:
+ goto s_n_llhttp__internal__n_invoke_test_flags_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_field: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_field(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_28;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_28;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_3: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_field_colon_discard_ws;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_31: {
+ state->error = 0xa;
+ state->reason = "Invalid header value char";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_5: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_discard_ws;
+ default:
+ goto s_n_llhttp__internal__n_error_31;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_33: {
+ state->error = 0xb;
+ state->reason = "Empty Content-Length";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_14: {
+ state->error = 0x15;
+ state->reason = "on_header_value_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_field_start;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_32: {
+ state->error = 0x1d;
+ state->reason = "`on_header_value_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state: {
+ switch (llhttp__internal__c_update_header_state(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_3: {
+ switch (llhttp__internal__c_or_flags_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_4: {
+ switch (llhttp__internal__c_or_flags_4(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_5: {
+ switch (llhttp__internal__c_or_flags_5(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_6: {
+ switch (llhttp__internal__c_or_flags_6(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_1: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 5:
+ goto s_n_llhttp__internal__n_invoke_or_flags_3;
+ case 6:
+ goto s_n_llhttp__internal__n_invoke_or_flags_4;
+ case 7:
+ goto s_n_llhttp__internal__n_invoke_or_flags_5;
+ case 8:
+ goto s_n_llhttp__internal__n_invoke_or_flags_6;
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 2:
+ goto s_n_llhttp__internal__n_error_33;
+ default:
+ goto s_n_llhttp__internal__n_invoke_load_header_state_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_30: {
+ state->error = 0xa;
+ state->reason = "Invalid header value char";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_4: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_discard_lws;
+ default:
+ goto s_n_llhttp__internal__n_error_30;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_34: {
+ state->error = 0x2;
+ state->reason = "Expected LF after CR";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_6: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_discard_lws;
+ default:
+ goto s_n_llhttp__internal__n_error_34;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_1: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_3: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 8:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_1;
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_2: {
+ switch (llhttp__internal__c_update_header_state(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_7: {
+ switch (llhttp__internal__c_or_flags_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_8: {
+ switch (llhttp__internal__c_or_flags_4(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_9: {
+ switch (llhttp__internal__c_or_flags_5(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_10: {
+ switch (llhttp__internal__c_or_flags_6(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_4: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 5:
+ goto s_n_llhttp__internal__n_invoke_or_flags_7;
+ case 6:
+ goto s_n_llhttp__internal__n_invoke_or_flags_8;
+ case 7:
+ goto s_n_llhttp__internal__n_invoke_or_flags_9;
+ case 8:
+ goto s_n_llhttp__internal__n_invoke_or_flags_10;
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_35: {
+ state->error = 0x3;
+ state->reason = "Missing expected LF after header value";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_header_value_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_header_value_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_header_value_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_36;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_36;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_7: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_lenient;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_4: {
+ switch (llhttp__internal__c_update_header_state(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_11: {
+ switch (llhttp__internal__c_or_flags_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_4;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_12: {
+ switch (llhttp__internal__c_or_flags_4(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_4;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_13: {
+ switch (llhttp__internal__c_or_flags_5(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_4;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_14: {
+ switch (llhttp__internal__c_or_flags_6(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_5: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 5:
+ goto s_n_llhttp__internal__n_invoke_or_flags_11;
+ case 6:
+ goto s_n_llhttp__internal__n_invoke_or_flags_12;
+ case 7:
+ goto s_n_llhttp__internal__n_invoke_or_flags_13;
+ case 8:
+ goto s_n_llhttp__internal__n_invoke_or_flags_14;
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_5: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection_token;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_3: {
+ switch (llhttp__internal__c_update_header_state_3(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_6: {
+ switch (llhttp__internal__c_update_header_state_6(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_7: {
+ switch (llhttp__internal__c_update_header_state_7(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_connection_ws;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_38;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_38;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_content_length_1: {
+ switch (llhttp__internal__c_mul_add_content_length_1(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5;
+ default:
+ goto s_n_llhttp__internal__n_header_value_content_length;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_15: {
+ switch (llhttp__internal__c_or_flags_15(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_6: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_39;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_39;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_37: {
+ state->error = 0x4;
+ state->reason = "Duplicate Content-Length";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_flags_2: {
+ switch (llhttp__internal__c_test_flags_2(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_header_value_content_length;
+ default:
+ goto s_n_llhttp__internal__n_error_37;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_8: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_41;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_41;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_8: {
+ switch (llhttp__internal__c_update_header_state_8(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_otherwise;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_value_7: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_value(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_40;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_error_40;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_8: {
+ switch (llhttp__internal__c_test_lenient_flags_8(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_7;
+ default:
+ goto s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_type_1: {
+ switch (llhttp__internal__c_load_type(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_8;
+ default:
+ goto s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_9: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_and_flags: {
+ switch (llhttp__internal__c_and_flags(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_value_te_chunked;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_17: {
+ switch (llhttp__internal__c_or_flags_16(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_and_flags;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_9: {
+ switch (llhttp__internal__c_test_lenient_flags_8(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_8;
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags_17;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_type_2: {
+ switch (llhttp__internal__c_load_type(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_9;
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags_17;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_16: {
+ switch (llhttp__internal__c_or_flags_16(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_and_flags;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_flags_3: {
+ switch (llhttp__internal__c_test_flags_3(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_load_type_2;
+ default:
+ goto s_n_llhttp__internal__n_invoke_or_flags_16;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_or_flags_18: {
+ switch (llhttp__internal__c_or_flags_18(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_header_state_9;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_header_state_2: {
+ switch (llhttp__internal__c_load_header_state(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_value_connection;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_test_flags_2;
+ case 3:
+ goto s_n_llhttp__internal__n_invoke_test_flags_3;
+ case 4:
+ goto s_n_llhttp__internal__n_invoke_or_flags_18;
+ default:
+ goto s_n_llhttp__internal__n_header_value;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_15: {
+ state->error = 0x15;
+ state->reason = "on_header_field_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_discard_ws;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_29: {
+ state->error = 0x1c;
+ state->reason = "`on_header_field_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_field_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_field(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_header_field(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_header_field_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_42: {
+ state->error = 0xa;
+ state->reason = "Invalid header token";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_10: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_header_state: {
+ switch (llhttp__internal__c_store_header_state(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_header_field_colon;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_header_state_11: {
+ switch (llhttp__internal__c_update_header_state_1(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_header_field_general;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_3: {
+ state->error = 0x1e;
+ state->reason = "Unexpected space after start line";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags: {
+ switch (llhttp__internal__c_test_lenient_flags(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_header_field_start;
+ default:
+ goto s_n_llhttp__internal__n_error_3;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_16: {
+ state->error = 0x15;
+ state->reason = "on_url_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_headers_start;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_2: {
+ state->error = 0x1a;
+ state->reason = "`on_url_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_url_complete: {
+ switch (llhttp__on_url_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_headers_start;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_16;
+ default:
+ goto s_n_llhttp__internal__n_error_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_http_minor: {
+ switch (llhttp__internal__c_update_http_minor(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_url_complete;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_http_major: {
+ switch (llhttp__internal__c_update_http_major(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_http_minor;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_43: {
+ state->error = 0x7;
+ state->reason = "Expected CRLF";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_4: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_49: {
+ state->error = 0x17;
+ state->reason = "Pause on PRI/Upgrade";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_50: {
+ state->error = 0x9;
+ state->reason = "Expected HTTP/2 Connection Preface";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_48: {
+ state->error = 0x9;
+ state->reason = "Expected CRLF after version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_17: {
+ state->error = 0x15;
+ state->reason = "on_version_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_load_method_1;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_47: {
+ state->error = 0x21;
+ state->reason = "`on_version_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_version_complete;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_version_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_46;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_46;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 9:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_1: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_2: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_major: {
+ switch (llhttp__internal__c_load_http_major(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor;
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_1;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_2;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_10: {
+ switch (llhttp__internal__c_test_lenient_flags_10(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_1;
+ default:
+ goto s_n_llhttp__internal__n_invoke_load_http_major;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_http_minor: {
+ switch (llhttp__internal__c_store_http_minor(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_10;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_51;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_51;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_3: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_52;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_52;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_http_major: {
+ switch (llhttp__internal__c_store_http_major(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_req_http_dot;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_4: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_53;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_53;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_45: {
+ state->error = 0x8;
+ state->reason = "Invalid method for HTTP/x.x request";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_method: {
+ switch (llhttp__internal__c_load_method(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 1:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 2:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 3:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 4:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 5:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 6:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 7:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 8:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 9:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 10:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 11:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 12:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 13:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 14:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 15:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 16:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 17:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 18:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 19:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 20:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 21:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 22:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 23:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 24:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 25:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 26:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 27:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 28:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 29:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 30:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 31:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 32:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 33:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 34:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ default:
+ goto s_n_llhttp__internal__n_error_45;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_56: {
+ state->error = 0x8;
+ state->reason = "Expected HTTP/";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_54: {
+ state->error = 0x8;
+ state->reason = "Expected SOURCE method for ICE/x.x request";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_method_2: {
+ switch (llhttp__internal__c_load_method(state, p, endp)) {
+ case 33:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ default:
+ goto s_n_llhttp__internal__n_error_54;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_55: {
+ state->error = 0x8;
+ state->reason = "Invalid method for RTSP/x.x request";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_method_3: {
+ switch (llhttp__internal__c_load_method(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 3:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 6:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 35:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 36:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 37:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 38:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 39:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 40:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 41:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 42:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 43:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 44:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ case 45:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_version;
+ default:
+ goto s_n_llhttp__internal__n_error_55;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_18: {
+ state->error = 0x15;
+ state->reason = "on_url_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_req_http_start;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_44: {
+ state->error = 0x1a;
+ state->reason = "`on_url_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_url_complete_1: {
+ switch (llhttp__on_url_complete(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_req_http_start;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_18;
+ default:
+ goto s_n_llhttp__internal__n_error_44;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_5: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_6: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_7: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_8: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_57: {
+ state->error = 0x7;
+ state->reason = "Invalid char in url fragment start";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_9: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_10: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_11: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_58: {
+ state->error = 0x7;
+ state->reason = "Invalid char in url query";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_59: {
+ state->error = 0x7;
+ state->reason = "Invalid char in url path";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_12: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_13: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_lf_to_http09;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_url_14: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_url(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_url_skip_to_http;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_url_skip_to_http;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_60: {
+ state->error = 0x7;
+ state->reason = "Double @ in url";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_61: {
+ state->error = 0x7;
+ state->reason = "Unexpected char in url server";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_62: {
+ state->error = 0x7;
+ state->reason = "Unexpected char in url server";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_64: {
+ state->error = 0x7;
+ state->reason = "Unexpected char in url schema";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_65: {
+ state->error = 0x7;
+ state->reason = "Unexpected char in url schema";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_66: {
+ state->error = 0x7;
+ state->reason = "Unexpected start char in url";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_is_equal_method: {
+ switch (llhttp__internal__c_is_equal_method(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_url_1;
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_url;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_67: {
+ state->error = 0x6;
+ state->reason = "Expected space after method";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_22: {
+ state->error = 0x15;
+ state->reason = "on_method_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_req_first_space_before_url;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_83: {
+ state->error = 0x20;
+ state->reason = "`on_method_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_method_2: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_method(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_method_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_method_1: {
+ switch (llhttp__internal__c_store_method(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_method_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_84: {
+ state->error = 0x6;
+ state->reason = "Invalid method encountered";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_76: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_74: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_72: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_20: {
+ state->error = 0x15;
+ state->reason = "on_status_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_headers_start;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_70: {
+ state->error = 0x1b;
+ state->reason = "`on_status_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_status: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_status(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_status_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_status(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) (p + 1);
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_res_line_almost_done;
+ return s_error;
+ }
+ p++;
+ goto s_n_llhttp__internal__n_res_line_almost_done;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_71: {
+ state->error = 0xd;
+ state->reason = "Invalid response status";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_status_code_2: {
+ switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_error_72;
+ default:
+ goto s_n_llhttp__internal__n_res_status_code_otherwise;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_73: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_status_code_1: {
+ switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_error_74;
+ default:
+ goto s_n_llhttp__internal__n_res_status_code_digit_3;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_75: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_mul_add_status_code: {
+ switch (llhttp__internal__c_mul_add_status_code(state, p, endp, match)) {
+ case 1:
+ goto s_n_llhttp__internal__n_error_76;
+ default:
+ goto s_n_llhttp__internal__n_res_status_code_digit_2;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_77: {
+ state->error = 0xd;
+ state->reason = "Invalid status code";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_status_code: {
+ switch (llhttp__internal__c_update_status_code(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_res_status_code_digit_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_78: {
+ state->error = 0x9;
+ state->reason = "Expected space after version";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_21: {
+ state->error = 0x15;
+ state->reason = "on_version_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_res_after_version;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_69: {
+ state->error = 0x21;
+ state->reason = "`on_version_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_6: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_version_complete_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_5: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_68;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_68;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_3: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 9:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_4: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_minor_5: {
+ switch (llhttp__internal__c_load_http_minor(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_http_major_1: {
+ switch (llhttp__internal__c_load_http_major(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_3;
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_4;
+ case 2:
+ goto s_n_llhttp__internal__n_invoke_load_http_minor_5;
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_5;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_test_lenient_flags_11: {
+ switch (llhttp__internal__c_test_lenient_flags_10(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_version_6;
+ default:
+ goto s_n_llhttp__internal__n_invoke_load_http_major_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_http_minor_1: {
+ switch (llhttp__internal__c_store_http_minor(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_test_lenient_flags_11;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_7: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_79;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_79;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_8: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_80;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_80;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_http_major_1: {
+ switch (llhttp__internal__c_store_http_major(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_res_http_dot;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_version_9: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_version(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_81;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_error_81;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_85: {
+ state->error = 0x8;
+ state->reason = "Expected HTTP/";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_19: {
+ state->error = 0x15;
+ state->reason = "on_method_complete pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_req_first_space_before_url;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_1: {
+ state->error = 0x20;
+ state->reason = "`on_method_complete` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_method: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_method(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_llhttp__on_method_complete;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_method_complete;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_type: {
+ switch (llhttp__internal__c_update_type(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_end_llhttp__on_method;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_store_method: {
+ switch (llhttp__internal__c_store_method(state, p, endp, match)) {
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_type;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_82: {
+ state->error = 0x8;
+ state->reason = "Invalid word encountered";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_span_end_llhttp__on_method_1: {
+ const unsigned char* start;
+ int err;
+
+ start = state->_span_pos0;
+ state->_span_pos0 = NULL;
+ err = llhttp__on_method(state, start, p);
+ if (err != 0) {
+ state->error = err;
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_update_type_1;
+ return s_error;
+ }
+ goto s_n_llhttp__internal__n_invoke_update_type_1;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_update_type_2: {
+ switch (llhttp__internal__c_update_type(state, p, endp)) {
+ default:
+ goto s_n_llhttp__internal__n_span_start_llhttp__on_method_1;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_23: {
+ state->error = 0x15;
+ state->reason = "on_message_begin pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_load_type;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error: {
+ state->error = 0x10;
+ state->reason = "`on_message_begin` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_message_begin: {
+ switch (llhttp__on_message_begin(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_load_type;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_23;
+ default:
+ goto s_n_llhttp__internal__n_error;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_pause_24: {
+ state->error = 0x15;
+ state->reason = "on_reset pause";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_invoke_update_finish;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_error_86: {
+ state->error = 0x1f;
+ state->reason = "`on_reset` callback error";
+ state->error_pos = (const char*) p;
+ state->_current = (void*) (intptr_t) s_error;
+ return s_error;
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_llhttp__on_reset: {
+ switch (llhttp__on_reset(state, p, endp)) {
+ case 0:
+ goto s_n_llhttp__internal__n_invoke_update_finish;
+ case 21:
+ goto s_n_llhttp__internal__n_pause_24;
+ default:
+ goto s_n_llhttp__internal__n_error_86;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+ s_n_llhttp__internal__n_invoke_load_initial_message_completed: {
+ switch (llhttp__internal__c_load_initial_message_completed(state, p, endp)) {
+ case 1:
+ goto s_n_llhttp__internal__n_invoke_llhttp__on_reset;
+ default:
+ goto s_n_llhttp__internal__n_invoke_update_finish;
+ }
+ /* UNREACHABLE */;
+ abort();
+ }
+}
+
+int llhttp__internal_execute(llhttp__internal_t* state, const char* p, const char* endp) {
+ llparse_state_t next;
+
+ /* check lingering errors */
+ if (state->error != 0) {
+ return state->error;
+ }
+
+ /* restart spans */
+ if (state->_span_pos0 != NULL) {
+ state->_span_pos0 = (void*) p;
+ }
+
+ next = llhttp__internal__run(state, (const unsigned char*) p, (const unsigned char*) endp);
+ if (next == s_error) {
+ return state->error;
+ }
+ state->_current = (void*) (intptr_t) next;
+
+ /* execute spans */
+ if (state->_span_pos0 != NULL) {
+ int error;
+
+ error = ((llhttp__internal__span_cb) state->_span_cb0)(state, state->_span_pos0, (const char*) endp);
+ if (error != 0) {
+ state->error = error;
+ state->error_pos = endp;
+ return error;
+ }
+ }
+
+ return 0;
+}
+
+#endif /* LLHTTP_STRICT_MODE */
diff --git a/third_party/python/aiohttp/vendor/llhttp/build/llhttp.h b/third_party/python/aiohttp/vendor/llhttp/build/llhttp.h
new file mode 100644
index 0000000000..557e1b33a7
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/build/llhttp.h
@@ -0,0 +1,815 @@
+#ifndef INCLUDE_LLHTTP_H_
+#define INCLUDE_LLHTTP_H_
+
+#define LLHTTP_VERSION_MAJOR 8
+#define LLHTTP_VERSION_MINOR 1
+#define LLHTTP_VERSION_PATCH 1
+
+#ifndef LLHTTP_STRICT_MODE
+# define LLHTTP_STRICT_MODE 0
+#endif
+
+#ifndef INCLUDE_LLHTTP_ITSELF_H_
+#define INCLUDE_LLHTTP_ITSELF_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+
+typedef struct llhttp__internal_s llhttp__internal_t;
+struct llhttp__internal_s {
+ int32_t _index;
+ void* _span_pos0;
+ void* _span_cb0;
+ int32_t error;
+ const char* reason;
+ const char* error_pos;
+ void* data;
+ void* _current;
+ uint64_t content_length;
+ uint8_t type;
+ uint8_t method;
+ uint8_t http_major;
+ uint8_t http_minor;
+ uint8_t header_state;
+ uint8_t lenient_flags;
+ uint8_t upgrade;
+ uint8_t finish;
+ uint16_t flags;
+ uint16_t status_code;
+ uint8_t initial_message_completed;
+ void* settings;
+};
+
+int llhttp__internal_init(llhttp__internal_t* s);
+int llhttp__internal_execute(llhttp__internal_t* s, const char* p, const char* endp);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+#endif /* INCLUDE_LLHTTP_ITSELF_H_ */
+
+#ifndef LLLLHTTP_C_HEADERS_
+#define LLLLHTTP_C_HEADERS_
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum llhttp_errno {
+ HPE_OK = 0,
+ HPE_INTERNAL = 1,
+ HPE_STRICT = 2,
+ HPE_CR_EXPECTED = 25,
+ HPE_LF_EXPECTED = 3,
+ HPE_UNEXPECTED_CONTENT_LENGTH = 4,
+ HPE_UNEXPECTED_SPACE = 30,
+ HPE_CLOSED_CONNECTION = 5,
+ HPE_INVALID_METHOD = 6,
+ HPE_INVALID_URL = 7,
+ HPE_INVALID_CONSTANT = 8,
+ HPE_INVALID_VERSION = 9,
+ HPE_INVALID_HEADER_TOKEN = 10,
+ HPE_INVALID_CONTENT_LENGTH = 11,
+ HPE_INVALID_CHUNK_SIZE = 12,
+ HPE_INVALID_STATUS = 13,
+ HPE_INVALID_EOF_STATE = 14,
+ HPE_INVALID_TRANSFER_ENCODING = 15,
+ HPE_CB_MESSAGE_BEGIN = 16,
+ HPE_CB_HEADERS_COMPLETE = 17,
+ HPE_CB_MESSAGE_COMPLETE = 18,
+ HPE_CB_CHUNK_HEADER = 19,
+ HPE_CB_CHUNK_COMPLETE = 20,
+ HPE_PAUSED = 21,
+ HPE_PAUSED_UPGRADE = 22,
+ HPE_PAUSED_H2_UPGRADE = 23,
+ HPE_USER = 24,
+ HPE_CB_URL_COMPLETE = 26,
+ HPE_CB_STATUS_COMPLETE = 27,
+ HPE_CB_METHOD_COMPLETE = 32,
+ HPE_CB_VERSION_COMPLETE = 33,
+ HPE_CB_HEADER_FIELD_COMPLETE = 28,
+ HPE_CB_HEADER_VALUE_COMPLETE = 29,
+ HPE_CB_CHUNK_EXTENSION_NAME_COMPLETE = 34,
+ HPE_CB_CHUNK_EXTENSION_VALUE_COMPLETE = 35,
+ HPE_CB_RESET = 31
+};
+typedef enum llhttp_errno llhttp_errno_t;
+
+enum llhttp_flags {
+ F_CONNECTION_KEEP_ALIVE = 0x1,
+ F_CONNECTION_CLOSE = 0x2,
+ F_CONNECTION_UPGRADE = 0x4,
+ F_CHUNKED = 0x8,
+ F_UPGRADE = 0x10,
+ F_CONTENT_LENGTH = 0x20,
+ F_SKIPBODY = 0x40,
+ F_TRAILING = 0x80,
+ F_TRANSFER_ENCODING = 0x200
+};
+typedef enum llhttp_flags llhttp_flags_t;
+
+enum llhttp_lenient_flags {
+ LENIENT_HEADERS = 0x1,
+ LENIENT_CHUNKED_LENGTH = 0x2,
+ LENIENT_KEEP_ALIVE = 0x4,
+ LENIENT_TRANSFER_ENCODING = 0x8,
+ LENIENT_VERSION = 0x10
+};
+typedef enum llhttp_lenient_flags llhttp_lenient_flags_t;
+
+enum llhttp_type {
+ HTTP_BOTH = 0,
+ HTTP_REQUEST = 1,
+ HTTP_RESPONSE = 2
+};
+typedef enum llhttp_type llhttp_type_t;
+
+enum llhttp_finish {
+ HTTP_FINISH_SAFE = 0,
+ HTTP_FINISH_SAFE_WITH_CB = 1,
+ HTTP_FINISH_UNSAFE = 2
+};
+typedef enum llhttp_finish llhttp_finish_t;
+
+enum llhttp_method {
+ HTTP_DELETE = 0,
+ HTTP_GET = 1,
+ HTTP_HEAD = 2,
+ HTTP_POST = 3,
+ HTTP_PUT = 4,
+ HTTP_CONNECT = 5,
+ HTTP_OPTIONS = 6,
+ HTTP_TRACE = 7,
+ HTTP_COPY = 8,
+ HTTP_LOCK = 9,
+ HTTP_MKCOL = 10,
+ HTTP_MOVE = 11,
+ HTTP_PROPFIND = 12,
+ HTTP_PROPPATCH = 13,
+ HTTP_SEARCH = 14,
+ HTTP_UNLOCK = 15,
+ HTTP_BIND = 16,
+ HTTP_REBIND = 17,
+ HTTP_UNBIND = 18,
+ HTTP_ACL = 19,
+ HTTP_REPORT = 20,
+ HTTP_MKACTIVITY = 21,
+ HTTP_CHECKOUT = 22,
+ HTTP_MERGE = 23,
+ HTTP_MSEARCH = 24,
+ HTTP_NOTIFY = 25,
+ HTTP_SUBSCRIBE = 26,
+ HTTP_UNSUBSCRIBE = 27,
+ HTTP_PATCH = 28,
+ HTTP_PURGE = 29,
+ HTTP_MKCALENDAR = 30,
+ HTTP_LINK = 31,
+ HTTP_UNLINK = 32,
+ HTTP_SOURCE = 33,
+ HTTP_PRI = 34,
+ HTTP_DESCRIBE = 35,
+ HTTP_ANNOUNCE = 36,
+ HTTP_SETUP = 37,
+ HTTP_PLAY = 38,
+ HTTP_PAUSE = 39,
+ HTTP_TEARDOWN = 40,
+ HTTP_GET_PARAMETER = 41,
+ HTTP_SET_PARAMETER = 42,
+ HTTP_REDIRECT = 43,
+ HTTP_RECORD = 44,
+ HTTP_FLUSH = 45
+};
+typedef enum llhttp_method llhttp_method_t;
+
+enum llhttp_status {
+ HTTP_STATUS_CONTINUE = 100,
+ HTTP_STATUS_SWITCHING_PROTOCOLS = 101,
+ HTTP_STATUS_PROCESSING = 102,
+ HTTP_STATUS_EARLY_HINTS = 103,
+ HTTP_STATUS_RESPONSE_IS_STALE = 110,
+ HTTP_STATUS_REVALIDATION_FAILED = 111,
+ HTTP_STATUS_DISCONNECTED_OPERATION = 112,
+ HTTP_STATUS_HEURISTIC_EXPIRATION = 113,
+ HTTP_STATUS_MISCELLANEOUS_WARNING = 199,
+ HTTP_STATUS_OK = 200,
+ HTTP_STATUS_CREATED = 201,
+ HTTP_STATUS_ACCEPTED = 202,
+ HTTP_STATUS_NON_AUTHORITATIVE_INFORMATION = 203,
+ HTTP_STATUS_NO_CONTENT = 204,
+ HTTP_STATUS_RESET_CONTENT = 205,
+ HTTP_STATUS_PARTIAL_CONTENT = 206,
+ HTTP_STATUS_MULTI_STATUS = 207,
+ HTTP_STATUS_ALREADY_REPORTED = 208,
+ HTTP_STATUS_TRANSFORMATION_APPLIED = 214,
+ HTTP_STATUS_IM_USED = 226,
+ HTTP_STATUS_MISCELLANEOUS_PERSISTENT_WARNING = 299,
+ HTTP_STATUS_MULTIPLE_CHOICES = 300,
+ HTTP_STATUS_MOVED_PERMANENTLY = 301,
+ HTTP_STATUS_FOUND = 302,
+ HTTP_STATUS_SEE_OTHER = 303,
+ HTTP_STATUS_NOT_MODIFIED = 304,
+ HTTP_STATUS_USE_PROXY = 305,
+ HTTP_STATUS_SWITCH_PROXY = 306,
+ HTTP_STATUS_TEMPORARY_REDIRECT = 307,
+ HTTP_STATUS_PERMANENT_REDIRECT = 308,
+ HTTP_STATUS_BAD_REQUEST = 400,
+ HTTP_STATUS_UNAUTHORIZED = 401,
+ HTTP_STATUS_PAYMENT_REQUIRED = 402,
+ HTTP_STATUS_FORBIDDEN = 403,
+ HTTP_STATUS_NOT_FOUND = 404,
+ HTTP_STATUS_METHOD_NOT_ALLOWED = 405,
+ HTTP_STATUS_NOT_ACCEPTABLE = 406,
+ HTTP_STATUS_PROXY_AUTHENTICATION_REQUIRED = 407,
+ HTTP_STATUS_REQUEST_TIMEOUT = 408,
+ HTTP_STATUS_CONFLICT = 409,
+ HTTP_STATUS_GONE = 410,
+ HTTP_STATUS_LENGTH_REQUIRED = 411,
+ HTTP_STATUS_PRECONDITION_FAILED = 412,
+ HTTP_STATUS_PAYLOAD_TOO_LARGE = 413,
+ HTTP_STATUS_URI_TOO_LONG = 414,
+ HTTP_STATUS_UNSUPPORTED_MEDIA_TYPE = 415,
+ HTTP_STATUS_RANGE_NOT_SATISFIABLE = 416,
+ HTTP_STATUS_EXPECTATION_FAILED = 417,
+ HTTP_STATUS_IM_A_TEAPOT = 418,
+ HTTP_STATUS_PAGE_EXPIRED = 419,
+ HTTP_STATUS_ENHANCE_YOUR_CALM = 420,
+ HTTP_STATUS_MISDIRECTED_REQUEST = 421,
+ HTTP_STATUS_UNPROCESSABLE_ENTITY = 422,
+ HTTP_STATUS_LOCKED = 423,
+ HTTP_STATUS_FAILED_DEPENDENCY = 424,
+ HTTP_STATUS_TOO_EARLY = 425,
+ HTTP_STATUS_UPGRADE_REQUIRED = 426,
+ HTTP_STATUS_PRECONDITION_REQUIRED = 428,
+ HTTP_STATUS_TOO_MANY_REQUESTS = 429,
+ HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL = 430,
+ HTTP_STATUS_REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
+ HTTP_STATUS_LOGIN_TIMEOUT = 440,
+ HTTP_STATUS_NO_RESPONSE = 444,
+ HTTP_STATUS_RETRY_WITH = 449,
+ HTTP_STATUS_BLOCKED_BY_PARENTAL_CONTROL = 450,
+ HTTP_STATUS_UNAVAILABLE_FOR_LEGAL_REASONS = 451,
+ HTTP_STATUS_CLIENT_CLOSED_LOAD_BALANCED_REQUEST = 460,
+ HTTP_STATUS_INVALID_X_FORWARDED_FOR = 463,
+ HTTP_STATUS_REQUEST_HEADER_TOO_LARGE = 494,
+ HTTP_STATUS_SSL_CERTIFICATE_ERROR = 495,
+ HTTP_STATUS_SSL_CERTIFICATE_REQUIRED = 496,
+ HTTP_STATUS_HTTP_REQUEST_SENT_TO_HTTPS_PORT = 497,
+ HTTP_STATUS_INVALID_TOKEN = 498,
+ HTTP_STATUS_CLIENT_CLOSED_REQUEST = 499,
+ HTTP_STATUS_INTERNAL_SERVER_ERROR = 500,
+ HTTP_STATUS_NOT_IMPLEMENTED = 501,
+ HTTP_STATUS_BAD_GATEWAY = 502,
+ HTTP_STATUS_SERVICE_UNAVAILABLE = 503,
+ HTTP_STATUS_GATEWAY_TIMEOUT = 504,
+ HTTP_STATUS_HTTP_VERSION_NOT_SUPPORTED = 505,
+ HTTP_STATUS_VARIANT_ALSO_NEGOTIATES = 506,
+ HTTP_STATUS_INSUFFICIENT_STORAGE = 507,
+ HTTP_STATUS_LOOP_DETECTED = 508,
+ HTTP_STATUS_BANDWIDTH_LIMIT_EXCEEDED = 509,
+ HTTP_STATUS_NOT_EXTENDED = 510,
+ HTTP_STATUS_NETWORK_AUTHENTICATION_REQUIRED = 511,
+ HTTP_STATUS_WEB_SERVER_UNKNOWN_ERROR = 520,
+ HTTP_STATUS_WEB_SERVER_IS_DOWN = 521,
+ HTTP_STATUS_CONNECTION_TIMEOUT = 522,
+ HTTP_STATUS_ORIGIN_IS_UNREACHABLE = 523,
+ HTTP_STATUS_TIMEOUT_OCCURED = 524,
+ HTTP_STATUS_SSL_HANDSHAKE_FAILED = 525,
+ HTTP_STATUS_INVALID_SSL_CERTIFICATE = 526,
+ HTTP_STATUS_RAILGUN_ERROR = 527,
+ HTTP_STATUS_SITE_IS_OVERLOADED = 529,
+ HTTP_STATUS_SITE_IS_FROZEN = 530,
+ HTTP_STATUS_IDENTITY_PROVIDER_AUTHENTICATION_ERROR = 561,
+ HTTP_STATUS_NETWORK_READ_TIMEOUT = 598,
+ HTTP_STATUS_NETWORK_CONNECT_TIMEOUT = 599
+};
+typedef enum llhttp_status llhttp_status_t;
+
+#define HTTP_ERRNO_MAP(XX) \
+ XX(0, OK, OK) \
+ XX(1, INTERNAL, INTERNAL) \
+ XX(2, STRICT, STRICT) \
+ XX(25, CR_EXPECTED, CR_EXPECTED) \
+ XX(3, LF_EXPECTED, LF_EXPECTED) \
+ XX(4, UNEXPECTED_CONTENT_LENGTH, UNEXPECTED_CONTENT_LENGTH) \
+ XX(30, UNEXPECTED_SPACE, UNEXPECTED_SPACE) \
+ XX(5, CLOSED_CONNECTION, CLOSED_CONNECTION) \
+ XX(6, INVALID_METHOD, INVALID_METHOD) \
+ XX(7, INVALID_URL, INVALID_URL) \
+ XX(8, INVALID_CONSTANT, INVALID_CONSTANT) \
+ XX(9, INVALID_VERSION, INVALID_VERSION) \
+ XX(10, INVALID_HEADER_TOKEN, INVALID_HEADER_TOKEN) \
+ XX(11, INVALID_CONTENT_LENGTH, INVALID_CONTENT_LENGTH) \
+ XX(12, INVALID_CHUNK_SIZE, INVALID_CHUNK_SIZE) \
+ XX(13, INVALID_STATUS, INVALID_STATUS) \
+ XX(14, INVALID_EOF_STATE, INVALID_EOF_STATE) \
+ XX(15, INVALID_TRANSFER_ENCODING, INVALID_TRANSFER_ENCODING) \
+ XX(16, CB_MESSAGE_BEGIN, CB_MESSAGE_BEGIN) \
+ XX(17, CB_HEADERS_COMPLETE, CB_HEADERS_COMPLETE) \
+ XX(18, CB_MESSAGE_COMPLETE, CB_MESSAGE_COMPLETE) \
+ XX(19, CB_CHUNK_HEADER, CB_CHUNK_HEADER) \
+ XX(20, CB_CHUNK_COMPLETE, CB_CHUNK_COMPLETE) \
+ XX(21, PAUSED, PAUSED) \
+ XX(22, PAUSED_UPGRADE, PAUSED_UPGRADE) \
+ XX(23, PAUSED_H2_UPGRADE, PAUSED_H2_UPGRADE) \
+ XX(24, USER, USER) \
+ XX(26, CB_URL_COMPLETE, CB_URL_COMPLETE) \
+ XX(27, CB_STATUS_COMPLETE, CB_STATUS_COMPLETE) \
+ XX(32, CB_METHOD_COMPLETE, CB_METHOD_COMPLETE) \
+ XX(33, CB_VERSION_COMPLETE, CB_VERSION_COMPLETE) \
+ XX(28, CB_HEADER_FIELD_COMPLETE, CB_HEADER_FIELD_COMPLETE) \
+ XX(29, CB_HEADER_VALUE_COMPLETE, CB_HEADER_VALUE_COMPLETE) \
+ XX(34, CB_CHUNK_EXTENSION_NAME_COMPLETE, CB_CHUNK_EXTENSION_NAME_COMPLETE) \
+ XX(35, CB_CHUNK_EXTENSION_VALUE_COMPLETE, CB_CHUNK_EXTENSION_VALUE_COMPLETE) \
+ XX(31, CB_RESET, CB_RESET) \
+
+
+#define HTTP_METHOD_MAP(XX) \
+ XX(0, DELETE, DELETE) \
+ XX(1, GET, GET) \
+ XX(2, HEAD, HEAD) \
+ XX(3, POST, POST) \
+ XX(4, PUT, PUT) \
+ XX(5, CONNECT, CONNECT) \
+ XX(6, OPTIONS, OPTIONS) \
+ XX(7, TRACE, TRACE) \
+ XX(8, COPY, COPY) \
+ XX(9, LOCK, LOCK) \
+ XX(10, MKCOL, MKCOL) \
+ XX(11, MOVE, MOVE) \
+ XX(12, PROPFIND, PROPFIND) \
+ XX(13, PROPPATCH, PROPPATCH) \
+ XX(14, SEARCH, SEARCH) \
+ XX(15, UNLOCK, UNLOCK) \
+ XX(16, BIND, BIND) \
+ XX(17, REBIND, REBIND) \
+ XX(18, UNBIND, UNBIND) \
+ XX(19, ACL, ACL) \
+ XX(20, REPORT, REPORT) \
+ XX(21, MKACTIVITY, MKACTIVITY) \
+ XX(22, CHECKOUT, CHECKOUT) \
+ XX(23, MERGE, MERGE) \
+ XX(24, MSEARCH, M-SEARCH) \
+ XX(25, NOTIFY, NOTIFY) \
+ XX(26, SUBSCRIBE, SUBSCRIBE) \
+ XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \
+ XX(28, PATCH, PATCH) \
+ XX(29, PURGE, PURGE) \
+ XX(30, MKCALENDAR, MKCALENDAR) \
+ XX(31, LINK, LINK) \
+ XX(32, UNLINK, UNLINK) \
+ XX(33, SOURCE, SOURCE) \
+
+
+#define RTSP_METHOD_MAP(XX) \
+ XX(1, GET, GET) \
+ XX(3, POST, POST) \
+ XX(6, OPTIONS, OPTIONS) \
+ XX(35, DESCRIBE, DESCRIBE) \
+ XX(36, ANNOUNCE, ANNOUNCE) \
+ XX(37, SETUP, SETUP) \
+ XX(38, PLAY, PLAY) \
+ XX(39, PAUSE, PAUSE) \
+ XX(40, TEARDOWN, TEARDOWN) \
+ XX(41, GET_PARAMETER, GET_PARAMETER) \
+ XX(42, SET_PARAMETER, SET_PARAMETER) \
+ XX(43, REDIRECT, REDIRECT) \
+ XX(44, RECORD, RECORD) \
+ XX(45, FLUSH, FLUSH) \
+
+
+#define HTTP_ALL_METHOD_MAP(XX) \
+ XX(0, DELETE, DELETE) \
+ XX(1, GET, GET) \
+ XX(2, HEAD, HEAD) \
+ XX(3, POST, POST) \
+ XX(4, PUT, PUT) \
+ XX(5, CONNECT, CONNECT) \
+ XX(6, OPTIONS, OPTIONS) \
+ XX(7, TRACE, TRACE) \
+ XX(8, COPY, COPY) \
+ XX(9, LOCK, LOCK) \
+ XX(10, MKCOL, MKCOL) \
+ XX(11, MOVE, MOVE) \
+ XX(12, PROPFIND, PROPFIND) \
+ XX(13, PROPPATCH, PROPPATCH) \
+ XX(14, SEARCH, SEARCH) \
+ XX(15, UNLOCK, UNLOCK) \
+ XX(16, BIND, BIND) \
+ XX(17, REBIND, REBIND) \
+ XX(18, UNBIND, UNBIND) \
+ XX(19, ACL, ACL) \
+ XX(20, REPORT, REPORT) \
+ XX(21, MKACTIVITY, MKACTIVITY) \
+ XX(22, CHECKOUT, CHECKOUT) \
+ XX(23, MERGE, MERGE) \
+ XX(24, MSEARCH, M-SEARCH) \
+ XX(25, NOTIFY, NOTIFY) \
+ XX(26, SUBSCRIBE, SUBSCRIBE) \
+ XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \
+ XX(28, PATCH, PATCH) \
+ XX(29, PURGE, PURGE) \
+ XX(30, MKCALENDAR, MKCALENDAR) \
+ XX(31, LINK, LINK) \
+ XX(32, UNLINK, UNLINK) \
+ XX(33, SOURCE, SOURCE) \
+ XX(34, PRI, PRI) \
+ XX(35, DESCRIBE, DESCRIBE) \
+ XX(36, ANNOUNCE, ANNOUNCE) \
+ XX(37, SETUP, SETUP) \
+ XX(38, PLAY, PLAY) \
+ XX(39, PAUSE, PAUSE) \
+ XX(40, TEARDOWN, TEARDOWN) \
+ XX(41, GET_PARAMETER, GET_PARAMETER) \
+ XX(42, SET_PARAMETER, SET_PARAMETER) \
+ XX(43, REDIRECT, REDIRECT) \
+ XX(44, RECORD, RECORD) \
+ XX(45, FLUSH, FLUSH) \
+
+
+#define HTTP_STATUS_MAP(XX) \
+ XX(100, CONTINUE, CONTINUE) \
+ XX(101, SWITCHING_PROTOCOLS, SWITCHING_PROTOCOLS) \
+ XX(102, PROCESSING, PROCESSING) \
+ XX(103, EARLY_HINTS, EARLY_HINTS) \
+ XX(110, RESPONSE_IS_STALE, RESPONSE_IS_STALE) \
+ XX(111, REVALIDATION_FAILED, REVALIDATION_FAILED) \
+ XX(112, DISCONNECTED_OPERATION, DISCONNECTED_OPERATION) \
+ XX(113, HEURISTIC_EXPIRATION, HEURISTIC_EXPIRATION) \
+ XX(199, MISCELLANEOUS_WARNING, MISCELLANEOUS_WARNING) \
+ XX(200, OK, OK) \
+ XX(201, CREATED, CREATED) \
+ XX(202, ACCEPTED, ACCEPTED) \
+ XX(203, NON_AUTHORITATIVE_INFORMATION, NON_AUTHORITATIVE_INFORMATION) \
+ XX(204, NO_CONTENT, NO_CONTENT) \
+ XX(205, RESET_CONTENT, RESET_CONTENT) \
+ XX(206, PARTIAL_CONTENT, PARTIAL_CONTENT) \
+ XX(207, MULTI_STATUS, MULTI_STATUS) \
+ XX(208, ALREADY_REPORTED, ALREADY_REPORTED) \
+ XX(214, TRANSFORMATION_APPLIED, TRANSFORMATION_APPLIED) \
+ XX(226, IM_USED, IM_USED) \
+ XX(299, MISCELLANEOUS_PERSISTENT_WARNING, MISCELLANEOUS_PERSISTENT_WARNING) \
+ XX(300, MULTIPLE_CHOICES, MULTIPLE_CHOICES) \
+ XX(301, MOVED_PERMANENTLY, MOVED_PERMANENTLY) \
+ XX(302, FOUND, FOUND) \
+ XX(303, SEE_OTHER, SEE_OTHER) \
+ XX(304, NOT_MODIFIED, NOT_MODIFIED) \
+ XX(305, USE_PROXY, USE_PROXY) \
+ XX(306, SWITCH_PROXY, SWITCH_PROXY) \
+ XX(307, TEMPORARY_REDIRECT, TEMPORARY_REDIRECT) \
+ XX(308, PERMANENT_REDIRECT, PERMANENT_REDIRECT) \
+ XX(400, BAD_REQUEST, BAD_REQUEST) \
+ XX(401, UNAUTHORIZED, UNAUTHORIZED) \
+ XX(402, PAYMENT_REQUIRED, PAYMENT_REQUIRED) \
+ XX(403, FORBIDDEN, FORBIDDEN) \
+ XX(404, NOT_FOUND, NOT_FOUND) \
+ XX(405, METHOD_NOT_ALLOWED, METHOD_NOT_ALLOWED) \
+ XX(406, NOT_ACCEPTABLE, NOT_ACCEPTABLE) \
+ XX(407, PROXY_AUTHENTICATION_REQUIRED, PROXY_AUTHENTICATION_REQUIRED) \
+ XX(408, REQUEST_TIMEOUT, REQUEST_TIMEOUT) \
+ XX(409, CONFLICT, CONFLICT) \
+ XX(410, GONE, GONE) \
+ XX(411, LENGTH_REQUIRED, LENGTH_REQUIRED) \
+ XX(412, PRECONDITION_FAILED, PRECONDITION_FAILED) \
+ XX(413, PAYLOAD_TOO_LARGE, PAYLOAD_TOO_LARGE) \
+ XX(414, URI_TOO_LONG, URI_TOO_LONG) \
+ XX(415, UNSUPPORTED_MEDIA_TYPE, UNSUPPORTED_MEDIA_TYPE) \
+ XX(416, RANGE_NOT_SATISFIABLE, RANGE_NOT_SATISFIABLE) \
+ XX(417, EXPECTATION_FAILED, EXPECTATION_FAILED) \
+ XX(418, IM_A_TEAPOT, IM_A_TEAPOT) \
+ XX(419, PAGE_EXPIRED, PAGE_EXPIRED) \
+ XX(420, ENHANCE_YOUR_CALM, ENHANCE_YOUR_CALM) \
+ XX(421, MISDIRECTED_REQUEST, MISDIRECTED_REQUEST) \
+ XX(422, UNPROCESSABLE_ENTITY, UNPROCESSABLE_ENTITY) \
+ XX(423, LOCKED, LOCKED) \
+ XX(424, FAILED_DEPENDENCY, FAILED_DEPENDENCY) \
+ XX(425, TOO_EARLY, TOO_EARLY) \
+ XX(426, UPGRADE_REQUIRED, UPGRADE_REQUIRED) \
+ XX(428, PRECONDITION_REQUIRED, PRECONDITION_REQUIRED) \
+ XX(429, TOO_MANY_REQUESTS, TOO_MANY_REQUESTS) \
+ XX(430, REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL, REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL) \
+ XX(431, REQUEST_HEADER_FIELDS_TOO_LARGE, REQUEST_HEADER_FIELDS_TOO_LARGE) \
+ XX(440, LOGIN_TIMEOUT, LOGIN_TIMEOUT) \
+ XX(444, NO_RESPONSE, NO_RESPONSE) \
+ XX(449, RETRY_WITH, RETRY_WITH) \
+ XX(450, BLOCKED_BY_PARENTAL_CONTROL, BLOCKED_BY_PARENTAL_CONTROL) \
+ XX(451, UNAVAILABLE_FOR_LEGAL_REASONS, UNAVAILABLE_FOR_LEGAL_REASONS) \
+ XX(460, CLIENT_CLOSED_LOAD_BALANCED_REQUEST, CLIENT_CLOSED_LOAD_BALANCED_REQUEST) \
+ XX(463, INVALID_X_FORWARDED_FOR, INVALID_X_FORWARDED_FOR) \
+ XX(494, REQUEST_HEADER_TOO_LARGE, REQUEST_HEADER_TOO_LARGE) \
+ XX(495, SSL_CERTIFICATE_ERROR, SSL_CERTIFICATE_ERROR) \
+ XX(496, SSL_CERTIFICATE_REQUIRED, SSL_CERTIFICATE_REQUIRED) \
+ XX(497, HTTP_REQUEST_SENT_TO_HTTPS_PORT, HTTP_REQUEST_SENT_TO_HTTPS_PORT) \
+ XX(498, INVALID_TOKEN, INVALID_TOKEN) \
+ XX(499, CLIENT_CLOSED_REQUEST, CLIENT_CLOSED_REQUEST) \
+ XX(500, INTERNAL_SERVER_ERROR, INTERNAL_SERVER_ERROR) \
+ XX(501, NOT_IMPLEMENTED, NOT_IMPLEMENTED) \
+ XX(502, BAD_GATEWAY, BAD_GATEWAY) \
+ XX(503, SERVICE_UNAVAILABLE, SERVICE_UNAVAILABLE) \
+ XX(504, GATEWAY_TIMEOUT, GATEWAY_TIMEOUT) \
+ XX(505, HTTP_VERSION_NOT_SUPPORTED, HTTP_VERSION_NOT_SUPPORTED) \
+ XX(506, VARIANT_ALSO_NEGOTIATES, VARIANT_ALSO_NEGOTIATES) \
+ XX(507, INSUFFICIENT_STORAGE, INSUFFICIENT_STORAGE) \
+ XX(508, LOOP_DETECTED, LOOP_DETECTED) \
+ XX(509, BANDWIDTH_LIMIT_EXCEEDED, BANDWIDTH_LIMIT_EXCEEDED) \
+ XX(510, NOT_EXTENDED, NOT_EXTENDED) \
+ XX(511, NETWORK_AUTHENTICATION_REQUIRED, NETWORK_AUTHENTICATION_REQUIRED) \
+ XX(520, WEB_SERVER_UNKNOWN_ERROR, WEB_SERVER_UNKNOWN_ERROR) \
+ XX(521, WEB_SERVER_IS_DOWN, WEB_SERVER_IS_DOWN) \
+ XX(522, CONNECTION_TIMEOUT, CONNECTION_TIMEOUT) \
+ XX(523, ORIGIN_IS_UNREACHABLE, ORIGIN_IS_UNREACHABLE) \
+ XX(524, TIMEOUT_OCCURED, TIMEOUT_OCCURED) \
+ XX(525, SSL_HANDSHAKE_FAILED, SSL_HANDSHAKE_FAILED) \
+ XX(526, INVALID_SSL_CERTIFICATE, INVALID_SSL_CERTIFICATE) \
+ XX(527, RAILGUN_ERROR, RAILGUN_ERROR) \
+ XX(529, SITE_IS_OVERLOADED, SITE_IS_OVERLOADED) \
+ XX(530, SITE_IS_FROZEN, SITE_IS_FROZEN) \
+ XX(561, IDENTITY_PROVIDER_AUTHENTICATION_ERROR, IDENTITY_PROVIDER_AUTHENTICATION_ERROR) \
+ XX(598, NETWORK_READ_TIMEOUT, NETWORK_READ_TIMEOUT) \
+ XX(599, NETWORK_CONNECT_TIMEOUT, NETWORK_CONNECT_TIMEOUT) \
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+#endif /* LLLLHTTP_C_HEADERS_ */
+
+#ifndef INCLUDE_LLHTTP_API_H_
+#define INCLUDE_LLHTTP_API_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <stddef.h>
+
+#if defined(__wasm__)
+#define LLHTTP_EXPORT __attribute__((visibility("default")))
+#else
+#define LLHTTP_EXPORT
+#endif
+
+typedef llhttp__internal_t llhttp_t;
+typedef struct llhttp_settings_s llhttp_settings_t;
+
+typedef int (*llhttp_data_cb)(llhttp_t*, const char *at, size_t length);
+typedef int (*llhttp_cb)(llhttp_t*);
+
+struct llhttp_settings_s {
+ /* Possible return values 0, -1, `HPE_PAUSED` */
+ llhttp_cb on_message_begin;
+
+ /* Possible return values 0, -1, HPE_USER */
+ llhttp_data_cb on_url;
+ llhttp_data_cb on_status;
+ llhttp_data_cb on_method;
+ llhttp_data_cb on_version;
+ llhttp_data_cb on_header_field;
+ llhttp_data_cb on_header_value;
+ llhttp_data_cb on_chunk_extension_name;
+ llhttp_data_cb on_chunk_extension_value;
+
+ /* Possible return values:
+ * 0 - Proceed normally
+ * 1 - Assume that request/response has no body, and proceed to parsing the
+ * next message
+ * 2 - Assume absence of body (as above) and make `llhttp_execute()` return
+ * `HPE_PAUSED_UPGRADE`
+ * -1 - Error
+ * `HPE_PAUSED`
+ */
+ llhttp_cb on_headers_complete;
+
+ /* Possible return values 0, -1, HPE_USER */
+ llhttp_data_cb on_body;
+
+ /* Possible return values 0, -1, `HPE_PAUSED` */
+ llhttp_cb on_message_complete;
+ llhttp_cb on_url_complete;
+ llhttp_cb on_status_complete;
+ llhttp_cb on_method_complete;
+ llhttp_cb on_version_complete;
+ llhttp_cb on_header_field_complete;
+ llhttp_cb on_header_value_complete;
+ llhttp_cb on_chunk_extension_name_complete;
+ llhttp_cb on_chunk_extension_value_complete;
+
+ /* When on_chunk_header is called, the current chunk length is stored
+ * in parser->content_length.
+ * Possible return values 0, -1, `HPE_PAUSED`
+ */
+ llhttp_cb on_chunk_header;
+ llhttp_cb on_chunk_complete;
+ llhttp_cb on_reset;
+};
+
+/* Initialize the parser with specific type and user settings.
+ *
+ * NOTE: lifetime of `settings` has to be at least the same as the lifetime of
+ * the `parser` here. In practice, `settings` has to be either a static
+ * variable or be allocated with `malloc`, `new`, etc.
+ */
+LLHTTP_EXPORT
+void llhttp_init(llhttp_t* parser, llhttp_type_t type,
+ const llhttp_settings_t* settings);
+
+LLHTTP_EXPORT
+llhttp_t* llhttp_alloc(llhttp_type_t type);
+
+LLHTTP_EXPORT
+void llhttp_free(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_type(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_http_major(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_http_minor(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_method(llhttp_t* parser);
+
+LLHTTP_EXPORT
+int llhttp_get_status_code(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_upgrade(llhttp_t* parser);
+
+/* Reset an already initialized parser back to the start state, preserving the
+ * existing parser type, callback settings, user data, and lenient flags.
+ */
+LLHTTP_EXPORT
+void llhttp_reset(llhttp_t* parser);
+
+/* Initialize the settings object */
+LLHTTP_EXPORT
+void llhttp_settings_init(llhttp_settings_t* settings);
+
+/* Parse full or partial request/response, invoking user callbacks along the
+ * way.
+ *
+ * If any of `llhttp_data_cb` returns errno not equal to `HPE_OK` - the parsing
+ * interrupts, and such errno is returned from `llhttp_execute()`. If
+ * `HPE_PAUSED` was used as a errno, the execution can be resumed with
+ * `llhttp_resume()` call.
+ *
+ * In a special case of CONNECT/Upgrade request/response `HPE_PAUSED_UPGRADE`
+ * is returned after fully parsing the request/response. If the user wishes to
+ * continue parsing, they need to invoke `llhttp_resume_after_upgrade()`.
+ *
+ * NOTE: if this function ever returns a non-pause type error, it will continue
+ * to return the same error upon each successive call up until `llhttp_init()`
+ * is called.
+ */
+LLHTTP_EXPORT
+llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len);
+
+/* This method should be called when the other side has no further bytes to
+ * send (e.g. shutdown of readable side of the TCP connection.)
+ *
+ * Requests without `Content-Length` and other messages might require treating
+ * all incoming bytes as the part of the body, up to the last byte of the
+ * connection. This method will invoke `on_message_complete()` callback if the
+ * request was terminated safely. Otherwise a error code would be returned.
+ */
+LLHTTP_EXPORT
+llhttp_errno_t llhttp_finish(llhttp_t* parser);
+
+/* Returns `1` if the incoming message is parsed until the last byte, and has
+ * to be completed by calling `llhttp_finish()` on EOF
+ */
+LLHTTP_EXPORT
+int llhttp_message_needs_eof(const llhttp_t* parser);
+
+/* Returns `1` if there might be any other messages following the last that was
+ * successfully parsed.
+ */
+LLHTTP_EXPORT
+int llhttp_should_keep_alive(const llhttp_t* parser);
+
+/* Make further calls of `llhttp_execute()` return `HPE_PAUSED` and set
+ * appropriate error reason.
+ *
+ * Important: do not call this from user callbacks! User callbacks must return
+ * `HPE_PAUSED` if pausing is required.
+ */
+LLHTTP_EXPORT
+void llhttp_pause(llhttp_t* parser);
+
+/* Might be called to resume the execution after the pause in user's callback.
+ * See `llhttp_execute()` above for details.
+ *
+ * Call this only if `llhttp_execute()` returns `HPE_PAUSED`.
+ */
+LLHTTP_EXPORT
+void llhttp_resume(llhttp_t* parser);
+
+/* Might be called to resume the execution after the pause in user's callback.
+ * See `llhttp_execute()` above for details.
+ *
+ * Call this only if `llhttp_execute()` returns `HPE_PAUSED_UPGRADE`
+ */
+LLHTTP_EXPORT
+void llhttp_resume_after_upgrade(llhttp_t* parser);
+
+/* Returns the latest return error */
+LLHTTP_EXPORT
+llhttp_errno_t llhttp_get_errno(const llhttp_t* parser);
+
+/* Returns the verbal explanation of the latest returned error.
+ *
+ * Note: User callback should set error reason when returning the error. See
+ * `llhttp_set_error_reason()` for details.
+ */
+LLHTTP_EXPORT
+const char* llhttp_get_error_reason(const llhttp_t* parser);
+
+/* Assign verbal description to the returned error. Must be called in user
+ * callbacks right before returning the errno.
+ *
+ * Note: `HPE_USER` error code might be useful in user callbacks.
+ */
+LLHTTP_EXPORT
+void llhttp_set_error_reason(llhttp_t* parser, const char* reason);
+
+/* Returns the pointer to the last parsed byte before the returned error. The
+ * pointer is relative to the `data` argument of `llhttp_execute()`.
+ *
+ * Note: this method might be useful for counting the number of parsed bytes.
+ */
+LLHTTP_EXPORT
+const char* llhttp_get_error_pos(const llhttp_t* parser);
+
+/* Returns textual name of error code */
+LLHTTP_EXPORT
+const char* llhttp_errno_name(llhttp_errno_t err);
+
+/* Returns textual name of HTTP method */
+LLHTTP_EXPORT
+const char* llhttp_method_name(llhttp_method_t method);
+
+/* Returns textual name of HTTP status */
+LLHTTP_EXPORT
+const char* llhttp_status_name(llhttp_status_t status);
+
+/* Enables/disables lenient header value parsing (disabled by default).
+ *
+ * Lenient parsing disables header value token checks, extending llhttp's
+ * protocol support to highly non-compliant clients/server. No
+ * `HPE_INVALID_HEADER_TOKEN` will be raised for incorrect header values when
+ * lenient parsing is "on".
+ *
+ * **(USE AT YOUR OWN RISK)**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_headers(llhttp_t* parser, int enabled);
+
+
+/* Enables/disables lenient handling of conflicting `Transfer-Encoding` and
+ * `Content-Length` headers (disabled by default).
+ *
+ * Normally `llhttp` would error when `Transfer-Encoding` is present in
+ * conjunction with `Content-Length`. This error is important to prevent HTTP
+ * request smuggling, but may be less desirable for small number of cases
+ * involving legacy servers.
+ *
+ * **(USE AT YOUR OWN RISK)**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled);
+
+
+/* Enables/disables lenient handling of `Connection: close` and HTTP/1.0
+ * requests responses.
+ *
+ * Normally `llhttp` would error on (in strict mode) or discard (in loose mode)
+ * the HTTP request/response after the request/response with `Connection: close`
+ * and `Content-Length`. This is important to prevent cache poisoning attacks,
+ * but might interact badly with outdated and insecure clients. With this flag
+ * the extra request/response will be parsed normally.
+ *
+ * **(USE AT YOUR OWN RISK)**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled);
+
+/* Enables/disables lenient handling of `Transfer-Encoding` header.
+ *
+ * Normally `llhttp` would error when a `Transfer-Encoding` has `chunked` value
+ * and another value after it (either in a single header or in multiple
+ * headers whose value are internally joined using `, `).
+ * This is mandated by the spec to reliably determine request body size and thus
+ * avoid request smuggling.
+ * With this flag the extra value will be parsed normally.
+ *
+ * **(USE AT YOUR OWN RISK)**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_transfer_encoding(llhttp_t* parser, int enabled);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+#endif /* INCLUDE_LLHTTP_API_H_ */
+
+#endif /* INCLUDE_LLHTTP_H_ */
diff --git a/third_party/python/aiohttp/vendor/llhttp/docs/releasing.md b/third_party/python/aiohttp/vendor/llhttp/docs/releasing.md
new file mode 100644
index 0000000000..f83e0f7c0f
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/docs/releasing.md
@@ -0,0 +1,65 @@
+# How to release a new version of llhttp
+
+## What does releasing involves?
+
+These are the required steps to release a new version of llhttp:
+
+1. Increase the version number.
+2. Build it locally.
+3. Create a new build and push it to GitHub.
+4. Create a new release on GitHub release.
+
+> Do not try to execute the commands in the Makefile manually. This is really error-prone!
+
+## Which commands to run?
+
+First of all, make sure you have [GitHub CLI](https://cli.github.com) installed and configured. While this is not strictly necessary, it will make your life way easier.
+
+As a preliminary check, run the build command and execute the test suite locally:
+
+```
+npm run build
+npm test
+```
+
+If all goes good, you are ready to go!
+
+To release a new version of llhttp, first increase the version using `npm`Ā and make sure it also execute the `postversion` script. Unless you have some very specific setup, this should happen automatically, which means the following command will suffice:
+
+```
+npm version [major|minor|patch]
+```
+
+The command will increase the version and then will create a new release branch on GitHub.
+
+> Even thought there is a package on NPM, it is not updated anymore. NEVER RUN `npm publish`!
+
+It's now time to create the release on GitHub. If you DON'T have GitHub CLI available, skip to the next section, otherwise run the following command:
+
+```
+npm run github-release
+```
+
+This command will create a draft release on GitHub and then show it in your browser so you can review and publish it.
+
+Congratulation, you are all set!
+
+## Create a GitHub release without GitHub CLI
+
+> From now on, `$VERSION` will be the new version you are trying to create, including the leading letter, for instance `v6.0.9`.
+
+If you don't want to or can't use GitHub CLI, you can still create the release on GitHub following this procedure.
+
+1. Go on GitHub and start creating a new release which targets tag `$VERSION`. Generate the notes using the `Generate release notes` button.
+
+2. At the bottom of the generated notes, make sure the previous and current version in the notes are correct.
+
+ The last line should be something like this: `**Full Changelog**: https://github.com/nodejs/llhttp/compare/v6.0.8...v6.0.9`
+
+ In this case it says we are creating release `v6.0.9`Ā and we are showing the changes between `v6.0.8` and `v6.0.9`.
+
+3. Change the target of the release to point to tag `release/$VERSION`.
+
+4. Review and then publish the release.
+
+Congratulation, you are all set! \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/examples/wasm.ts b/third_party/python/aiohttp/vendor/llhttp/examples/wasm.ts
new file mode 100644
index 0000000000..995fed83e4
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/examples/wasm.ts
@@ -0,0 +1,248 @@
+/**
+ * A minimal Parser that mimicks a small fraction of the Node.js parser
+ * API.
+ * To run:
+ * - `npm run build-wasm`
+ * - `npx ts-node examples/wasm.ts`
+ */
+import { readFileSync } from 'fs';
+import { resolve } from 'path';
+import * as constants from '../build/wasm/constants';
+
+const bin = readFileSync(resolve(__dirname, '../build/wasm/llhttp.wasm'));
+const mod = new WebAssembly.Module(bin);
+
+const REQUEST = constants.TYPE.REQUEST;
+const RESPONSE = constants.TYPE.RESPONSE;
+const kOnMessageBegin = 0;
+const kOnHeaders = 1;
+const kOnHeadersComplete = 2;
+const kOnBody = 3;
+const kOnMessageComplete = 4;
+const kOnExecute = 5;
+
+const kPtr = Symbol('kPtr');
+const kUrl = Symbol('kUrl');
+const kStatusMessage = Symbol('kStatusMessage');
+const kHeadersFields = Symbol('kHeadersFields');
+const kHeadersValues = Symbol('kHeadersValues');
+const kBody = Symbol('kBody');
+const kReset = Symbol('kReset');
+const kCheckErr = Symbol('kCheckErr');
+
+const cstr = (ptr: number, len: number): string =>
+ Buffer.from(memory.buffer, ptr, len).toString();
+
+const wasm_on_message_begin = (p: number) => {
+ const i = instMap.get(p);
+ i[kReset]();
+ return i[kOnMessageBegin]();
+};
+
+const wasm_on_url = (p: number, at: number, length: number) => {
+ instMap.get(p)[kUrl] = cstr(at, length);
+ return 0;
+};
+
+const wasm_on_status = (p: number, at: number, length: number) => {
+ instMap.get(p)[kStatusMessage] = cstr(at, length);
+ return 0;
+};
+
+const wasm_on_header_field = (p: number, at: number, length: number) => {
+ const i= instMap.get(p)
+ i[kHeadersFields].push(cstr(at, length));
+ return 0;
+};
+
+const wasm_on_header_value = (p: number, at: number, length: number) => {
+ const i = instMap.get(p);
+ i[kHeadersValues].push(cstr(at, length));
+ return 0;
+};
+
+const wasm_on_headers_complete = (p: number) => {
+ const i = instMap.get(p);
+ const type = get_type(p);
+ const versionMajor = get_version_major(p);
+ const versionMinor = get_version_minor(p);
+ const rawHeaders = [];
+ let method;
+ let url;
+ let statusCode;
+ let statusMessage;
+ const upgrade = get_upgrade(p);
+ const shouldKeepAlive = should_keep_alive(p);
+
+ for (let c = 0; c < i[kHeadersFields].length; c++) {
+ rawHeaders.push(i[kHeadersFields][c], i[kHeadersValues][c])
+ }
+
+ if (type === HTTPParser.REQUEST) {
+ method = constants.METHODS[get_method(p)];
+ url = i[kUrl];
+ } else if (type === HTTPParser.RESPONSE) {
+ statusCode = get_status_code(p);
+ statusMessage = i[kStatusMessage];
+ }
+ return i[kOnHeadersComplete](versionMajor, versionMinor, rawHeaders, method,
+url, statusCode, statusMessage, upgrade, shouldKeepAlive);
+};
+
+const wasm_on_body = (p: number, at: number, length: number) => {
+ const i = instMap.get(p);
+ const body = Buffer.from(memory.buffer, at, length);
+ return i[kOnBody](body);
+};
+
+const wasm_on_message_complete = (p: number) => {
+ return instMap.get(p)[kOnMessageComplete]();
+};
+
+const instMap = new Map();
+
+const inst = new WebAssembly.Instance(mod, {
+ env: {
+ wasm_on_message_begin,
+ wasm_on_url,
+ wasm_on_status,
+ wasm_on_header_field,
+ wasm_on_header_value,
+ wasm_on_headers_complete,
+ wasm_on_body,
+ wasm_on_message_complete,
+ },
+});
+
+const memory = inst.exports.memory as any;
+const alloc = inst.exports.llhttp_alloc as CallableFunction;
+const malloc = inst.exports.malloc as CallableFunction;
+const execute = inst.exports.llhttp_execute as CallableFunction;
+const get_type = inst.exports.llhttp_get_type as CallableFunction;
+const get_upgrade = inst.exports.llhttp_get_upgrade as CallableFunction;
+const should_keep_alive = inst.exports.llhttp_should_keep_alive as CallableFunction;
+const get_method = inst.exports.llhttp_get_method as CallableFunction;
+const get_status_code = inst.exports.llhttp_get_status_code as CallableFunction;
+const get_version_minor = inst.exports.llhttp_get_http_minor as CallableFunction;
+const get_version_major = inst.exports.llhttp_get_http_major as CallableFunction;
+const get_error_reason = inst.exports.llhttp_get_error_reason as CallableFunction;
+const free = inst.exports.free as CallableFunction;
+const initialize = inst.exports._initialize as CallableFunction;
+
+initialize(); // wasi reactor
+
+class HTTPParser {
+ static REQUEST = REQUEST;
+ static RESPONSE = RESPONSE;
+ static kOnMessageBegin = kOnMessageBegin;
+ static kOnHeaders = kOnHeaders;
+ static kOnHeadersComplete = kOnHeadersComplete;
+ static kOnBody = kOnBody;
+ static kOnMessageComplete = kOnMessageComplete;
+ static kOnExecute = kOnExecute;
+
+ [kPtr]: number;
+ [kUrl]: string;
+ [kStatusMessage]: null|string;
+ [kHeadersFields]: []|[string];
+ [kHeadersValues]: []|[string];
+ [kBody]: null|Buffer;
+
+ constructor(type: constants.TYPE) {
+ this[kPtr] = alloc(constants.TYPE[type]);
+ instMap.set(this[kPtr], this);
+
+ this[kUrl] = '';
+ this[kStatusMessage] = null;
+ this[kHeadersFields] = [];
+ this[kHeadersValues] = [];
+ this[kBody] = null;
+ }
+
+ [kReset]() {
+ this[kUrl] = '';
+ this[kStatusMessage] = null;
+ this[kHeadersFields] = [];
+ this[kHeadersValues] = [];
+ this[kBody] = null;
+ }
+
+ [kOnMessageBegin]() {
+ return 0;
+ }
+
+ [kOnHeaders](rawHeaders: [string]) {}
+
+ [kOnHeadersComplete](versionMajor: number, versionMinor: number, rawHeaders: [string], method: string,
+ url: string, statusCode: number, statusMessage: string, upgrade: boolean, shouldKeepAlive: boolean) {
+ return 0;
+ }
+
+ [kOnBody](body: Buffer) {
+ this[kBody] = body;
+ return 0;
+ }
+
+ [kOnMessageComplete]() {
+ return 0;
+ }
+
+ destroy() {
+ instMap.delete(this[kPtr]);
+ free(this[kPtr]);
+ }
+
+ execute(data: Buffer) {
+ const ptr = malloc(data.byteLength);
+ const u8 = new Uint8Array(memory.buffer);
+ u8.set(data, ptr);
+ const ret = execute(this[kPtr], ptr, data.length);
+ free(ptr);
+ this[kCheckErr](ret);
+ return ret;
+ }
+
+ [kCheckErr](n: number) {
+ if (n === constants.ERROR.OK) {
+ return;
+ }
+ const ptr = get_error_reason(this[kPtr]);
+ const u8 = new Uint8Array(memory.buffer);
+ const len = u8.indexOf(0, ptr) - ptr;
+ throw new Error(cstr(ptr, len));
+ }
+}
+
+
+{
+ const p = new HTTPParser(HTTPParser.REQUEST);
+
+ p.execute(Buffer.from([
+ 'POST /owo HTTP/1.1',
+ 'X: Y',
+ 'Content-Length: 9',
+ '',
+ 'uh, meow?',
+ '',
+ ].join('\r\n')));
+
+ console.log(p);
+
+ p.destroy();
+}
+
+{
+ const p = new HTTPParser(HTTPParser.RESPONSE);
+
+ p.execute(Buffer.from([
+ 'HTTP/1.1 200 OK',
+ 'X: Y',
+ 'Content-Length: 9',
+ '',
+ 'uh, meow?'
+ ].join('\r\n')));
+
+ console.log(p);
+
+ p.destroy();
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/images/http-loose-none.png b/third_party/python/aiohttp/vendor/llhttp/images/http-loose-none.png
new file mode 100644
index 0000000000..31877654dd
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/images/http-loose-none.png
Binary files differ
diff --git a/third_party/python/aiohttp/vendor/llhttp/images/http-strict-none.png b/third_party/python/aiohttp/vendor/llhttp/images/http-strict-none.png
new file mode 100644
index 0000000000..8f2aacff8c
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/images/http-strict-none.png
Binary files differ
diff --git a/third_party/python/aiohttp/vendor/llhttp/libllhttp.pc.in b/third_party/python/aiohttp/vendor/llhttp/libllhttp.pc.in
new file mode 100644
index 0000000000..67d280a830
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/libllhttp.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
+includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
+
+Name: libllhttp
+Description: Node.js llhttp Library
+Version: @PROJECT_VERSION@
+Libs: -L${libdir} -lllhttp
+Cflags: -I${includedir} \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/package-lock.json b/third_party/python/aiohttp/vendor/llhttp/package-lock.json
new file mode 100644
index 0000000000..05a03c26c9
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/package-lock.json
@@ -0,0 +1,2995 @@
+{
+ "name": "llhttp",
+ "version": "8.1.0",
+ "lockfileVersion": 2,
+ "requires": true,
+ "packages": {
+ "": {
+ "version": "8.1.0",
+ "license": "MIT",
+ "dependencies": {
+ "@types/semver": "^5.5.0",
+ "llparse": "^7.1.1",
+ "semver": "^5.7.1"
+ },
+ "devDependencies": {
+ "@types/mocha": "^5.2.7",
+ "@types/node": "^10.17.52",
+ "javascript-stringify": "^2.0.1",
+ "llparse-dot": "^1.0.1",
+ "llparse-test-fixture": "^5.0.1",
+ "mdgator": "^1.1.2",
+ "mocha": "^10.2.0",
+ "ts-node": "^7.0.1",
+ "tslint": "^5.20.1",
+ "typescript": "^3.9.9"
+ }
+ },
+ "node_modules/@babel/code-frame": {
+ "version": "7.12.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
+ "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
+ "dev": true,
+ "dependencies": {
+ "@babel/highlight": "^7.12.13"
+ }
+ },
+ "node_modules/@babel/helper-validator-identifier": {
+ "version": "7.14.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
+ "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==",
+ "dev": true
+ },
+ "node_modules/@babel/highlight": {
+ "version": "7.14.0",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz",
+ "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/helper-validator-identifier": "^7.14.0",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ }
+ },
+ "node_modules/@types/debug": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz",
+ "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ=="
+ },
+ "node_modules/@types/markdown-it": {
+ "version": "0.0.4",
+ "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-0.0.4.tgz",
+ "integrity": "sha512-FWR7QB7EqBRq1s9BMk0ccOSOuRLfVEWYpHQYpFPaXtCoqN6dJx2ttdsdQbUxLLnAlKpYeVjveGGhQ3583TTa7g==",
+ "dev": true
+ },
+ "node_modules/@types/mocha": {
+ "version": "5.2.7",
+ "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz",
+ "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==",
+ "dev": true
+ },
+ "node_modules/@types/node": {
+ "version": "10.17.59",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.59.tgz",
+ "integrity": "sha512-7Uc8IRrL8yZz5ti45RaFxpbU8TxlzdC3HvxV+hOWo1EyLsuKv/w7y0n+TwZzwL3vdx3oZ2k3ubxPq131hNtXyg==",
+ "dev": true
+ },
+ "node_modules/@types/semver": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz",
+ "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ=="
+ },
+ "node_modules/ansi-colors": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
+ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^1.9.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/anymatch": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
+ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
+ "dev": true,
+ "dependencies": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "dev": true,
+ "dependencies": {
+ "sprintf-js": "~1.0.2"
+ }
+ },
+ "node_modules/arrify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true
+ },
+ "node_modules/binary-extensions": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
+ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/binary-search": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/binary-search/-/binary-search-1.3.6.tgz",
+ "integrity": "sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA=="
+ },
+ "node_modules/brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "node_modules/braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "dependencies": {
+ "fill-range": "^7.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/browser-stdout": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
+ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
+ "dev": true
+ },
+ "node_modules/buffer-from": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
+ "dev": true
+ },
+ "node_modules/builtin-modules": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
+ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/camelcase": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/chalk/node_modules/supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/chokidar": {
+ "version": "3.5.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
+ "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "individual",
+ "url": "https://paulmillr.com/funding/"
+ }
+ ],
+ "dependencies": {
+ "anymatch": "~3.1.2",
+ "braces": "~3.0.2",
+ "glob-parent": "~5.1.2",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.6.0"
+ },
+ "engines": {
+ "node": ">= 8.10.0"
+ },
+ "optionalDependencies": {
+ "fsevents": "~2.3.2"
+ }
+ },
+ "node_modules/cliui": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
+ "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
+ "dev": true,
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^6.2.0"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "1.1.3"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
+ "dev": true
+ },
+ "node_modules/commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "dev": true
+ },
+ "node_modules/concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "node_modules/debug": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "dependencies": {
+ "ms": "2.1.2"
+ },
+ "engines": {
+ "node": ">=6.0"
+ },
+ "peerDependenciesMeta": {
+ "supports-color": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/diff": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
+ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "node_modules/entities": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
+ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
+ "dev": true
+ },
+ "node_modules/escalade": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.8.0"
+ }
+ },
+ "node_modules/esm": {
+ "version": "3.2.25",
+ "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
+ "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true,
+ "bin": {
+ "esparse": "bin/esparse.js",
+ "esvalidate": "bin/esvalidate.js"
+ },
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "dependencies": {
+ "to-regex-range": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/find-up": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "dev": true,
+ "dependencies": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/flat": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",
+ "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
+ "dev": true,
+ "bin": {
+ "flat": "cli.js"
+ }
+ },
+ "node_modules/fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
+ },
+ "node_modules/fsevents": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
+ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
+ "dev": true,
+ "hasInstallScript": true,
+ "optional": true,
+ "os": [
+ "darwin"
+ ],
+ "engines": {
+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
+ "dev": true
+ },
+ "node_modules/get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "dev": true,
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
+ }
+ },
+ "node_modules/glob": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
+ "dev": true,
+ "dependencies": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ },
+ "engines": {
+ "node": "*"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "dependencies": {
+ "is-glob": "^4.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/has": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "dev": true,
+ "dependencies": {
+ "function-bind": "^1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.4.0"
+ }
+ },
+ "node_modules/has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
+ "dev": true,
+ "bin": {
+ "he": "bin/he"
+ }
+ },
+ "node_modules/inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
+ "dependencies": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true
+ },
+ "node_modules/is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dev": true,
+ "dependencies": {
+ "binary-extensions": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-core-module": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz",
+ "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==",
+ "dev": true,
+ "dependencies": {
+ "has": "^1.0.3"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dev": true,
+ "dependencies": {
+ "is-extglob": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.12.0"
+ }
+ },
+ "node_modules/is-plain-obj": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
+ "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-unicode-supported": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
+ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/javascript-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz",
+ "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==",
+ "dev": true
+ },
+ "node_modules/js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "dev": true
+ },
+ "node_modules/js-yaml": {
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
+ "dev": true,
+ "dependencies": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/linkify-it": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz",
+ "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==",
+ "dev": true,
+ "dependencies": {
+ "uc.micro": "^1.0.1"
+ }
+ },
+ "node_modules/llparse": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/llparse/-/llparse-7.1.1.tgz",
+ "integrity": "sha512-lBxN5O6sKq6KSOaRFIGczoVpO/U/37mHhjJioQbPuiXdfZmwzP1zC3txV9xx778TRNFENzeCM0Uoo+mE1rfJOA==",
+ "dependencies": {
+ "debug": "^4.2.0",
+ "llparse-frontend": "^3.0.0"
+ }
+ },
+ "node_modules/llparse-builder": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/llparse-builder/-/llparse-builder-1.5.2.tgz",
+ "integrity": "sha512-i862UNC3YUEdlfK/NUCJxlKjtWjgAI9AJXDRgjcfRHfwFt4Sf8eFPTRsc91/2R9MBZ0kyFdfhi8SVhMsZf1gNQ==",
+ "dependencies": {
+ "@types/debug": "4.1.5 ",
+ "binary-search": "^1.3.6",
+ "debug": "^4.2.0"
+ }
+ },
+ "node_modules/llparse-dot": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/llparse-dot/-/llparse-dot-1.0.1.tgz",
+ "integrity": "sha512-3e271C2LuDWBzhxaCUDzjpufamoEBuTYQz83QyMixI/i99BntCEk6ngHWOhhDb0XdtNNh6qAfRmXyjgNP+Nxpw==",
+ "dev": true,
+ "dependencies": {
+ "llparse-builder": "^1.0.0"
+ }
+ },
+ "node_modules/llparse-frontend": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/llparse-frontend/-/llparse-frontend-3.0.0.tgz",
+ "integrity": "sha512-G/o0Po2C+G5OtP8MJeQDjDf5qwDxcO7K6x4r6jqGsJwxk7yblbJnRqpmye7G/lZ8dD0Hv5neY4/KB5BhDmEc9Q==",
+ "dependencies": {
+ "debug": "^3.2.6",
+ "llparse-builder": "^1.5.2"
+ }
+ },
+ "node_modules/llparse-frontend/node_modules/debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "dependencies": {
+ "ms": "^2.1.1"
+ }
+ },
+ "node_modules/llparse-test-fixture": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/llparse-test-fixture/-/llparse-test-fixture-5.0.2.tgz",
+ "integrity": "sha512-61KI5J/b5uyRktD0y1EezleEW6UfaxhHkn1adLKNVemRZzklE+SpLakr251qo04kb9jN/ytk8lllgK+yFOj4cQ==",
+ "dev": true,
+ "dependencies": {
+ "esm": "^3.2.25",
+ "llparse": "^7.0.0",
+ "yargs": "^15.4.1"
+ }
+ },
+ "node_modules/locate-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+ "dev": true,
+ "dependencies": {
+ "p-locate": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/log-symbols": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
+ "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
+ "dev": true,
+ "dependencies": {
+ "chalk": "^4.1.0",
+ "is-unicode-supported": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/log-symbols/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/log-symbols/node_modules/chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/chalk?sponsor=1"
+ }
+ },
+ "node_modules/log-symbols/node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/log-symbols/node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "node_modules/log-symbols/node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/log-symbols/node_modules/supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/make-error": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
+ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
+ "dev": true
+ },
+ "node_modules/markdown-it": {
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz",
+ "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==",
+ "dev": true,
+ "dependencies": {
+ "argparse": "^1.0.7",
+ "entities": "~1.1.1",
+ "linkify-it": "^2.0.0",
+ "mdurl": "^1.0.1",
+ "uc.micro": "^1.0.5"
+ },
+ "bin": {
+ "markdown-it": "bin/markdown-it.js"
+ }
+ },
+ "node_modules/mdgator": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/mdgator/-/mdgator-1.1.2.tgz",
+ "integrity": "sha512-S2GvsLIznUQ2McXfpe6BCD+IqhnRuHcBO7krqnvnsHgDpjjO1mLhr0vZtVa5ca4WZET037g3G+94DznpicKkOA==",
+ "dev": true,
+ "dependencies": {
+ "@types/markdown-it": "0.0.4",
+ "markdown-it": "^8.4.1"
+ }
+ },
+ "node_modules/mdurl": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
+ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=",
+ "dev": true
+ },
+ "node_modules/minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^1.1.7"
+ },
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/minimist": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
+ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
+ "dev": true
+ },
+ "node_modules/mkdirp": {
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+ "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+ "dev": true,
+ "dependencies": {
+ "minimist": "^1.2.5"
+ },
+ "bin": {
+ "mkdirp": "bin/cmd.js"
+ }
+ },
+ "node_modules/mocha": {
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz",
+ "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==",
+ "dev": true,
+ "dependencies": {
+ "ansi-colors": "4.1.1",
+ "browser-stdout": "1.3.1",
+ "chokidar": "3.5.3",
+ "debug": "4.3.4",
+ "diff": "5.0.0",
+ "escape-string-regexp": "4.0.0",
+ "find-up": "5.0.0",
+ "glob": "7.2.0",
+ "he": "1.2.0",
+ "js-yaml": "4.1.0",
+ "log-symbols": "4.1.0",
+ "minimatch": "5.0.1",
+ "ms": "2.1.3",
+ "nanoid": "3.3.3",
+ "serialize-javascript": "6.0.0",
+ "strip-json-comments": "3.1.1",
+ "supports-color": "8.1.1",
+ "workerpool": "6.2.1",
+ "yargs": "16.2.0",
+ "yargs-parser": "20.2.4",
+ "yargs-unparser": "2.0.0"
+ },
+ "bin": {
+ "_mocha": "bin/_mocha",
+ "mocha": "bin/mocha.js"
+ },
+ "engines": {
+ "node": ">= 14.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/mochajs"
+ }
+ },
+ "node_modules/mocha/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/mocha/node_modules/argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true
+ },
+ "node_modules/mocha/node_modules/brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/mocha/node_modules/cliui": {
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
+ "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+ "dev": true,
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^7.0.0"
+ }
+ },
+ "node_modules/mocha/node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/mocha/node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "node_modules/mocha/node_modules/diff": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
+ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/mocha/node_modules/escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/mocha/node_modules/js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "dev": true,
+ "dependencies": {
+ "argparse": "^2.0.1"
+ },
+ "bin": {
+ "js-yaml": "bin/js-yaml.js"
+ }
+ },
+ "node_modules/mocha/node_modules/minimatch": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
+ "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
+ "dev": true,
+ "dependencies": {
+ "brace-expansion": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/mocha/node_modules/ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true
+ },
+ "node_modules/mocha/node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+ }
+ },
+ "node_modules/mocha/node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/mocha/node_modules/yargs": {
+ "version": "16.2.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
+ "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
+ "dev": true,
+ "dependencies": {
+ "cliui": "^7.0.2",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.0",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^20.2.2"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "node_modules/nanoid": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
+ "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
+ "dev": true,
+ "bin": {
+ "nanoid": "bin/nanoid.cjs"
+ },
+ "engines": {
+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
+ }
+ },
+ "node_modules/normalize-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "node_modules/p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "dev": true,
+ "dependencies": {
+ "p-try": "^2.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-locate": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+ "dev": true,
+ "dependencies": {
+ "p-limit": "^3.0.2"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-locate/node_modules/p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "dev": true,
+ "dependencies": {
+ "yocto-queue": "^0.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/path-parse": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
+ "dev": true
+ },
+ "node_modules/picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true,
+ "engines": {
+ "node": ">=8.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/jonschlinkert"
+ }
+ },
+ "node_modules/randombytes": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
+ "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
+ "dev": true,
+ "dependencies": {
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "node_modules/readdirp": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "dev": true,
+ "dependencies": {
+ "picomatch": "^2.2.1"
+ },
+ "engines": {
+ "node": ">=8.10.0"
+ }
+ },
+ "node_modules/require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
+ },
+ "node_modules/resolve": {
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
+ "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
+ "dev": true,
+ "dependencies": {
+ "is-core-module": "^2.2.0",
+ "path-parse": "^1.0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "dev": true,
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ]
+ },
+ "node_modules/semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
+ "node_modules/serialize-javascript": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
+ "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
+ "dev": true,
+ "dependencies": {
+ "randombytes": "^2.1.0"
+ }
+ },
+ "node_modules/set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
+ "dev": true
+ },
+ "node_modules/source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/source-map-support": {
+ "version": "0.5.19",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
+ "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+ "dev": true,
+ "dependencies": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ }
+ },
+ "node_modules/sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
+ "dev": true
+ },
+ "node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "dependencies": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/supports-color": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
+ "dev": true,
+ "dependencies": {
+ "has-flag": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/supports-color?sponsor=1"
+ }
+ },
+ "node_modules/supports-color/node_modules/has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "dependencies": {
+ "is-number": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=8.0"
+ }
+ },
+ "node_modules/ts-node": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz",
+ "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==",
+ "dev": true,
+ "dependencies": {
+ "arrify": "^1.0.0",
+ "buffer-from": "^1.1.0",
+ "diff": "^3.1.0",
+ "make-error": "^1.1.1",
+ "minimist": "^1.2.0",
+ "mkdirp": "^0.5.1",
+ "source-map-support": "^0.5.6",
+ "yn": "^2.0.0"
+ },
+ "bin": {
+ "ts-node": "dist/bin.js"
+ },
+ "engines": {
+ "node": ">=4.2.0"
+ }
+ },
+ "node_modules/tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ },
+ "node_modules/tslint": {
+ "version": "5.20.1",
+ "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz",
+ "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==",
+ "dev": true,
+ "dependencies": {
+ "@babel/code-frame": "^7.0.0",
+ "builtin-modules": "^1.1.1",
+ "chalk": "^2.3.0",
+ "commander": "^2.12.1",
+ "diff": "^4.0.1",
+ "glob": "^7.1.1",
+ "js-yaml": "^3.13.1",
+ "minimatch": "^3.0.4",
+ "mkdirp": "^0.5.1",
+ "resolve": "^1.3.2",
+ "semver": "^5.3.0",
+ "tslib": "^1.8.0",
+ "tsutils": "^2.29.0"
+ },
+ "bin": {
+ "tslint": "bin/tslint"
+ },
+ "engines": {
+ "node": ">=4.8.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev"
+ }
+ },
+ "node_modules/tslint/node_modules/diff": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
+ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
+ "dev": true,
+ "engines": {
+ "node": ">=0.3.1"
+ }
+ },
+ "node_modules/tsutils": {
+ "version": "2.29.0",
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
+ "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
+ "dev": true,
+ "dependencies": {
+ "tslib": "^1.8.1"
+ },
+ "peerDependencies": {
+ "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev"
+ }
+ },
+ "node_modules/typescript": {
+ "version": "3.9.9",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz",
+ "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==",
+ "dev": true,
+ "bin": {
+ "tsc": "bin/tsc",
+ "tsserver": "bin/tsserver"
+ },
+ "engines": {
+ "node": ">=4.2.0"
+ }
+ },
+ "node_modules/uc.micro": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
+ "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
+ "dev": true
+ },
+ "node_modules/which-module": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
+ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
+ "dev": true
+ },
+ "node_modules/workerpool": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
+ "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
+ "dev": true
+ },
+ "node_modules/wrap-ansi": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
+ "dev": true,
+ "dependencies": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/wrap-ansi/node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "node_modules/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "dev": true
+ },
+ "node_modules/y18n": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+ "dev": true
+ },
+ "node_modules/yargs": {
+ "version": "15.4.1",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
+ "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
+ "dev": true,
+ "dependencies": {
+ "cliui": "^6.0.0",
+ "decamelize": "^1.2.0",
+ "find-up": "^4.1.0",
+ "get-caller-file": "^2.0.1",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^2.0.0",
+ "set-blocking": "^2.0.0",
+ "string-width": "^4.2.0",
+ "which-module": "^2.0.0",
+ "y18n": "^4.0.0",
+ "yargs-parser": "^18.1.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yargs-parser": {
+ "version": "20.2.4",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
+ "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/yargs-unparser": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz",
+ "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==",
+ "dev": true,
+ "dependencies": {
+ "camelcase": "^6.0.0",
+ "decamelize": "^4.0.0",
+ "flat": "^5.0.2",
+ "is-plain-obj": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/yargs-unparser/node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yargs-unparser/node_modules/decamelize": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz",
+ "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/yargs/node_modules/find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dev": true,
+ "dependencies": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yargs/node_modules/locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dev": true,
+ "dependencies": {
+ "p-locate": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yargs/node_modules/p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dev": true,
+ "dependencies": {
+ "p-limit": "^2.2.0"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/yargs/node_modules/yargs-parser": {
+ "version": "18.1.3",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
+ "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
+ "dev": true,
+ "dependencies": {
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/yn": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz",
+ "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=",
+ "dev": true,
+ "engines": {
+ "node": ">=4"
+ }
+ },
+ "node_modules/yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
+ "dev": true,
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ }
+ },
+ "dependencies": {
+ "@babel/code-frame": {
+ "version": "7.12.13",
+ "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
+ "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
+ "dev": true,
+ "requires": {
+ "@babel/highlight": "^7.12.13"
+ }
+ },
+ "@babel/helper-validator-identifier": {
+ "version": "7.14.0",
+ "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
+ "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==",
+ "dev": true
+ },
+ "@babel/highlight": {
+ "version": "7.14.0",
+ "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz",
+ "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==",
+ "dev": true,
+ "requires": {
+ "@babel/helper-validator-identifier": "^7.14.0",
+ "chalk": "^2.0.0",
+ "js-tokens": "^4.0.0"
+ }
+ },
+ "@types/debug": {
+ "version": "4.1.5",
+ "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.5.tgz",
+ "integrity": "sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ=="
+ },
+ "@types/markdown-it": {
+ "version": "0.0.4",
+ "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-0.0.4.tgz",
+ "integrity": "sha512-FWR7QB7EqBRq1s9BMk0ccOSOuRLfVEWYpHQYpFPaXtCoqN6dJx2ttdsdQbUxLLnAlKpYeVjveGGhQ3583TTa7g==",
+ "dev": true
+ },
+ "@types/mocha": {
+ "version": "5.2.7",
+ "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz",
+ "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==",
+ "dev": true
+ },
+ "@types/node": {
+ "version": "10.17.59",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.59.tgz",
+ "integrity": "sha512-7Uc8IRrL8yZz5ti45RaFxpbU8TxlzdC3HvxV+hOWo1EyLsuKv/w7y0n+TwZzwL3vdx3oZ2k3ubxPq131hNtXyg==",
+ "dev": true
+ },
+ "@types/semver": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/@types/semver/-/semver-5.5.0.tgz",
+ "integrity": "sha512-41qEJgBH/TWgo5NFSvBCJ1qkoi3Q6ONSF2avrHq1LVEZfYpdHmj0y9SuTK+u9ZhG1sYQKBL1AWXKyLWP4RaUoQ=="
+ },
+ "ansi-colors": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz",
+ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==",
+ "dev": true
+ },
+ "ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "dev": true
+ },
+ "ansi-styles": {
+ "version": "3.2.1",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^1.9.0"
+ }
+ },
+ "anymatch": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
+ "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
+ "dev": true,
+ "requires": {
+ "normalize-path": "^3.0.0",
+ "picomatch": "^2.0.4"
+ }
+ },
+ "argparse": {
+ "version": "1.0.10",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+ "dev": true,
+ "requires": {
+ "sprintf-js": "~1.0.2"
+ }
+ },
+ "arrify": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+ "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+ "dev": true
+ },
+ "balanced-match": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+ "dev": true
+ },
+ "binary-extensions": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz",
+ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==",
+ "dev": true
+ },
+ "binary-search": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/binary-search/-/binary-search-1.3.6.tgz",
+ "integrity": "sha512-nbE1WxOTTrUWIfsfZ4aHGYu5DOuNkbxGokjV6Z2kxfJK3uaAb8zNK1muzOeipoLHZjInT4Br88BHpzevc681xA=="
+ },
+ "brace-expansion": {
+ "version": "1.1.11",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0",
+ "concat-map": "0.0.1"
+ }
+ },
+ "braces": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
+ "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "dev": true,
+ "requires": {
+ "fill-range": "^7.0.1"
+ }
+ },
+ "browser-stdout": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz",
+ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==",
+ "dev": true
+ },
+ "buffer-from": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+ "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
+ "dev": true
+ },
+ "builtin-modules": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
+ "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
+ "dev": true
+ },
+ "camelcase": {
+ "version": "5.3.1",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+ "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+ "dev": true
+ },
+ "chalk": {
+ "version": "2.4.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+ "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^3.2.1",
+ "escape-string-regexp": "^1.0.5",
+ "supports-color": "^5.3.0"
+ },
+ "dependencies": {
+ "supports-color": {
+ "version": "5.5.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+ "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^3.0.0"
+ }
+ }
+ }
+ },
+ "chokidar": {
+ "version": "3.5.3",
+ "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz",
+ "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==",
+ "dev": true,
+ "requires": {
+ "anymatch": "~3.1.2",
+ "braces": "~3.0.2",
+ "fsevents": "~2.3.2",
+ "glob-parent": "~5.1.2",
+ "is-binary-path": "~2.1.0",
+ "is-glob": "~4.0.1",
+ "normalize-path": "~3.0.0",
+ "readdirp": "~3.6.0"
+ }
+ },
+ "cliui": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
+ "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
+ "dev": true,
+ "requires": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^6.2.0"
+ }
+ },
+ "color-convert": {
+ "version": "1.9.3",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+ "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+ "dev": true,
+ "requires": {
+ "color-name": "1.1.3"
+ }
+ },
+ "color-name": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
+ "dev": true
+ },
+ "commander": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+ "dev": true
+ },
+ "concat-map": {
+ "version": "0.0.1",
+ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
+ "dev": true
+ },
+ "debug": {
+ "version": "4.3.4",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
+ "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+ "requires": {
+ "ms": "2.1.2"
+ }
+ },
+ "decamelize": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
+ "dev": true
+ },
+ "diff": {
+ "version": "3.5.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
+ "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
+ "dev": true
+ },
+ "emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "dev": true
+ },
+ "entities": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz",
+ "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==",
+ "dev": true
+ },
+ "escalade": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+ "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+ "dev": true
+ },
+ "escape-string-regexp": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
+ "dev": true
+ },
+ "esm": {
+ "version": "3.2.25",
+ "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz",
+ "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==",
+ "dev": true
+ },
+ "esprima": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+ "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+ "dev": true
+ },
+ "fill-range": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
+ "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "dev": true,
+ "requires": {
+ "to-regex-range": "^5.0.1"
+ }
+ },
+ "find-up": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
+ "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^6.0.0",
+ "path-exists": "^4.0.0"
+ }
+ },
+ "flat": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz",
+ "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==",
+ "dev": true
+ },
+ "fs.realpath": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
+ "dev": true
+ },
+ "fsevents": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
+ "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==",
+ "dev": true,
+ "optional": true
+ },
+ "function-bind": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+ "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
+ "dev": true
+ },
+ "get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "dev": true
+ },
+ "glob": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz",
+ "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==",
+ "dev": true,
+ "requires": {
+ "fs.realpath": "^1.0.0",
+ "inflight": "^1.0.4",
+ "inherits": "2",
+ "minimatch": "^3.0.4",
+ "once": "^1.3.0",
+ "path-is-absolute": "^1.0.0"
+ }
+ },
+ "glob-parent": {
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+ "dev": true,
+ "requires": {
+ "is-glob": "^4.0.1"
+ }
+ },
+ "has": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+ "dev": true,
+ "requires": {
+ "function-bind": "^1.1.1"
+ }
+ },
+ "has-flag": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+ "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
+ "dev": true
+ },
+ "he": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
+ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==",
+ "dev": true
+ },
+ "inflight": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
+ "dev": true,
+ "requires": {
+ "once": "^1.3.0",
+ "wrappy": "1"
+ }
+ },
+ "inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "dev": true
+ },
+ "is-binary-path": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
+ "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
+ "dev": true,
+ "requires": {
+ "binary-extensions": "^2.0.0"
+ }
+ },
+ "is-core-module": {
+ "version": "2.4.0",
+ "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.4.0.tgz",
+ "integrity": "sha512-6A2fkfq1rfeQZjxrZJGerpLCTHRNEBiSgnu0+obeJpEPZRUooHgsizvzv0ZjJwOz3iWIHdJtVWJ/tmPr3D21/A==",
+ "dev": true,
+ "requires": {
+ "has": "^1.0.3"
+ }
+ },
+ "is-extglob": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
+ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+ "dev": true
+ },
+ "is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "dev": true
+ },
+ "is-glob": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
+ "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+ "dev": true,
+ "requires": {
+ "is-extglob": "^2.1.1"
+ }
+ },
+ "is-number": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
+ "dev": true
+ },
+ "is-plain-obj": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz",
+ "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==",
+ "dev": true
+ },
+ "is-unicode-supported": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz",
+ "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==",
+ "dev": true
+ },
+ "javascript-stringify": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz",
+ "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==",
+ "dev": true
+ },
+ "js-tokens": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+ "dev": true
+ },
+ "js-yaml": {
+ "version": "3.13.1",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+ "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
+ "dev": true,
+ "requires": {
+ "argparse": "^1.0.7",
+ "esprima": "^4.0.0"
+ }
+ },
+ "linkify-it": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz",
+ "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==",
+ "dev": true,
+ "requires": {
+ "uc.micro": "^1.0.1"
+ }
+ },
+ "llparse": {
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/llparse/-/llparse-7.1.1.tgz",
+ "integrity": "sha512-lBxN5O6sKq6KSOaRFIGczoVpO/U/37mHhjJioQbPuiXdfZmwzP1zC3txV9xx778TRNFENzeCM0Uoo+mE1rfJOA==",
+ "requires": {
+ "debug": "^4.2.0",
+ "llparse-frontend": "^3.0.0"
+ }
+ },
+ "llparse-builder": {
+ "version": "1.5.2",
+ "resolved": "https://registry.npmjs.org/llparse-builder/-/llparse-builder-1.5.2.tgz",
+ "integrity": "sha512-i862UNC3YUEdlfK/NUCJxlKjtWjgAI9AJXDRgjcfRHfwFt4Sf8eFPTRsc91/2R9MBZ0kyFdfhi8SVhMsZf1gNQ==",
+ "requires": {
+ "@types/debug": "4.1.5 ",
+ "binary-search": "^1.3.6",
+ "debug": "^4.2.0"
+ }
+ },
+ "llparse-dot": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/llparse-dot/-/llparse-dot-1.0.1.tgz",
+ "integrity": "sha512-3e271C2LuDWBzhxaCUDzjpufamoEBuTYQz83QyMixI/i99BntCEk6ngHWOhhDb0XdtNNh6qAfRmXyjgNP+Nxpw==",
+ "dev": true,
+ "requires": {
+ "llparse-builder": "^1.0.0"
+ }
+ },
+ "llparse-frontend": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/llparse-frontend/-/llparse-frontend-3.0.0.tgz",
+ "integrity": "sha512-G/o0Po2C+G5OtP8MJeQDjDf5qwDxcO7K6x4r6jqGsJwxk7yblbJnRqpmye7G/lZ8dD0Hv5neY4/KB5BhDmEc9Q==",
+ "requires": {
+ "debug": "^3.2.6",
+ "llparse-builder": "^1.5.2"
+ },
+ "dependencies": {
+ "debug": {
+ "version": "3.2.7",
+ "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+ "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+ "requires": {
+ "ms": "^2.1.1"
+ }
+ }
+ }
+ },
+ "llparse-test-fixture": {
+ "version": "5.0.2",
+ "resolved": "https://registry.npmjs.org/llparse-test-fixture/-/llparse-test-fixture-5.0.2.tgz",
+ "integrity": "sha512-61KI5J/b5uyRktD0y1EezleEW6UfaxhHkn1adLKNVemRZzklE+SpLakr251qo04kb9jN/ytk8lllgK+yFOj4cQ==",
+ "dev": true,
+ "requires": {
+ "esm": "^3.2.25",
+ "llparse": "^7.0.0",
+ "yargs": "^15.4.1"
+ }
+ },
+ "locate-path": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
+ "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^5.0.0"
+ }
+ },
+ "log-symbols": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz",
+ "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==",
+ "dev": true,
+ "requires": {
+ "chalk": "^4.1.0",
+ "is-unicode-supported": "^0.1.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "chalk": {
+ "version": "4.1.2",
+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
+ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.1.0",
+ "supports-color": "^7.1.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
+ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ }
+ }
+ }
+ },
+ "make-error": {
+ "version": "1.3.6",
+ "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
+ "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
+ "dev": true
+ },
+ "markdown-it": {
+ "version": "8.4.2",
+ "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz",
+ "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==",
+ "dev": true,
+ "requires": {
+ "argparse": "^1.0.7",
+ "entities": "~1.1.1",
+ "linkify-it": "^2.0.0",
+ "mdurl": "^1.0.1",
+ "uc.micro": "^1.0.5"
+ }
+ },
+ "mdgator": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/mdgator/-/mdgator-1.1.2.tgz",
+ "integrity": "sha512-S2GvsLIznUQ2McXfpe6BCD+IqhnRuHcBO7krqnvnsHgDpjjO1mLhr0vZtVa5ca4WZET037g3G+94DznpicKkOA==",
+ "dev": true,
+ "requires": {
+ "@types/markdown-it": "0.0.4",
+ "markdown-it": "^8.4.1"
+ }
+ },
+ "mdurl": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz",
+ "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=",
+ "dev": true
+ },
+ "minimatch": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+ "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^1.1.7"
+ }
+ },
+ "minimist": {
+ "version": "1.2.6",
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz",
+ "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==",
+ "dev": true
+ },
+ "mkdirp": {
+ "version": "0.5.5",
+ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
+ "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
+ "dev": true,
+ "requires": {
+ "minimist": "^1.2.5"
+ }
+ },
+ "mocha": {
+ "version": "10.2.0",
+ "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz",
+ "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==",
+ "dev": true,
+ "requires": {
+ "ansi-colors": "4.1.1",
+ "browser-stdout": "1.3.1",
+ "chokidar": "3.5.3",
+ "debug": "4.3.4",
+ "diff": "5.0.0",
+ "escape-string-regexp": "4.0.0",
+ "find-up": "5.0.0",
+ "glob": "7.2.0",
+ "he": "1.2.0",
+ "js-yaml": "4.1.0",
+ "log-symbols": "4.1.0",
+ "minimatch": "5.0.1",
+ "ms": "2.1.3",
+ "nanoid": "3.3.3",
+ "serialize-javascript": "6.0.0",
+ "strip-json-comments": "3.1.1",
+ "supports-color": "8.1.1",
+ "workerpool": "6.2.1",
+ "yargs": "16.2.0",
+ "yargs-parser": "20.2.4",
+ "yargs-unparser": "2.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "argparse": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
+ "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
+ "dev": true
+ },
+ "brace-expansion": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz",
+ "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
+ "dev": true,
+ "requires": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "cliui": {
+ "version": "7.0.4",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz",
+ "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==",
+ "dev": true,
+ "requires": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.0",
+ "wrap-ansi": "^7.0.0"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ },
+ "diff": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz",
+ "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==",
+ "dev": true
+ },
+ "escape-string-regexp": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
+ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
+ "dev": true
+ },
+ "js-yaml": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
+ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
+ "dev": true,
+ "requires": {
+ "argparse": "^2.0.1"
+ }
+ },
+ "minimatch": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz",
+ "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==",
+ "dev": true,
+ "requires": {
+ "brace-expansion": "^2.0.1"
+ }
+ },
+ "ms": {
+ "version": "2.1.3",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
+ "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
+ "dev": true
+ },
+ "wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ }
+ },
+ "y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "dev": true
+ },
+ "yargs": {
+ "version": "16.2.0",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz",
+ "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==",
+ "dev": true,
+ "requires": {
+ "cliui": "^7.0.2",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.0",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^20.2.2"
+ }
+ }
+ }
+ },
+ "ms": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
+ },
+ "nanoid": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz",
+ "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==",
+ "dev": true
+ },
+ "normalize-path": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
+ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
+ "dev": true
+ },
+ "once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
+ "dev": true,
+ "requires": {
+ "wrappy": "1"
+ }
+ },
+ "p-limit": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+ "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+ "dev": true,
+ "requires": {
+ "p-try": "^2.0.0"
+ }
+ },
+ "p-locate": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
+ "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^3.0.2"
+ },
+ "dependencies": {
+ "p-limit": {
+ "version": "3.1.0",
+ "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
+ "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
+ "dev": true,
+ "requires": {
+ "yocto-queue": "^0.1.0"
+ }
+ }
+ }
+ },
+ "p-try": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+ "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+ "dev": true
+ },
+ "path-exists": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
+ "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
+ "dev": true
+ },
+ "path-is-absolute": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+ "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+ "dev": true
+ },
+ "path-parse": {
+ "version": "1.0.7",
+ "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
+ "dev": true
+ },
+ "picomatch": {
+ "version": "2.3.1",
+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
+ "dev": true
+ },
+ "randombytes": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
+ "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
+ "dev": true,
+ "requires": {
+ "safe-buffer": "^5.1.0"
+ }
+ },
+ "readdirp": {
+ "version": "3.6.0",
+ "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
+ "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
+ "dev": true,
+ "requires": {
+ "picomatch": "^2.2.1"
+ }
+ },
+ "require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
+ "dev": true
+ },
+ "require-main-filename": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+ "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+ "dev": true
+ },
+ "resolve": {
+ "version": "1.20.0",
+ "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.20.0.tgz",
+ "integrity": "sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==",
+ "dev": true,
+ "requires": {
+ "is-core-module": "^2.2.0",
+ "path-parse": "^1.0.6"
+ }
+ },
+ "safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "dev": true
+ },
+ "semver": {
+ "version": "5.7.1",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
+ },
+ "serialize-javascript": {
+ "version": "6.0.0",
+ "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz",
+ "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==",
+ "dev": true,
+ "requires": {
+ "randombytes": "^2.1.0"
+ }
+ },
+ "set-blocking": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
+ "dev": true
+ },
+ "source-map": {
+ "version": "0.6.1",
+ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+ "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+ "dev": true
+ },
+ "source-map-support": {
+ "version": "0.5.19",
+ "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz",
+ "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==",
+ "dev": true,
+ "requires": {
+ "buffer-from": "^1.0.0",
+ "source-map": "^0.6.0"
+ }
+ },
+ "sprintf-js": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
+ "dev": true
+ },
+ "string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "dev": true,
+ "requires": {
+ "emoji-regex": "^8.0.0",
+ "is-fullwidth-code-point": "^3.0.0",
+ "strip-ansi": "^6.0.1"
+ }
+ },
+ "strip-ansi": {
+ "version": "6.0.1",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^5.0.1"
+ }
+ },
+ "strip-json-comments": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
+ "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
+ "dev": true
+ },
+ "supports-color": {
+ "version": "8.1.1",
+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
+ "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
+ "dev": true,
+ "requires": {
+ "has-flag": "^4.0.0"
+ },
+ "dependencies": {
+ "has-flag": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
+ "dev": true
+ }
+ }
+ },
+ "to-regex-range": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
+ "dev": true,
+ "requires": {
+ "is-number": "^7.0.0"
+ }
+ },
+ "ts-node": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-7.0.1.tgz",
+ "integrity": "sha512-BVwVbPJRspzNh2yfslyT1PSbl5uIk03EZlb493RKHN4qej/D06n1cEhjlOJG69oFsE7OT8XjpTUcYf6pKTLMhw==",
+ "dev": true,
+ "requires": {
+ "arrify": "^1.0.0",
+ "buffer-from": "^1.1.0",
+ "diff": "^3.1.0",
+ "make-error": "^1.1.1",
+ "minimist": "^1.2.0",
+ "mkdirp": "^0.5.1",
+ "source-map-support": "^0.5.6",
+ "yn": "^2.0.0"
+ }
+ },
+ "tslib": {
+ "version": "1.14.1",
+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+ "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+ "dev": true
+ },
+ "tslint": {
+ "version": "5.20.1",
+ "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz",
+ "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==",
+ "dev": true,
+ "requires": {
+ "@babel/code-frame": "^7.0.0",
+ "builtin-modules": "^1.1.1",
+ "chalk": "^2.3.0",
+ "commander": "^2.12.1",
+ "diff": "^4.0.1",
+ "glob": "^7.1.1",
+ "js-yaml": "^3.13.1",
+ "minimatch": "^3.0.4",
+ "mkdirp": "^0.5.1",
+ "resolve": "^1.3.2",
+ "semver": "^5.3.0",
+ "tslib": "^1.8.0",
+ "tsutils": "^2.29.0"
+ },
+ "dependencies": {
+ "diff": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
+ "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
+ "dev": true
+ }
+ }
+ },
+ "tsutils": {
+ "version": "2.29.0",
+ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
+ "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
+ "dev": true,
+ "requires": {
+ "tslib": "^1.8.1"
+ }
+ },
+ "typescript": {
+ "version": "3.9.9",
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.9.tgz",
+ "integrity": "sha512-kdMjTiekY+z/ubJCATUPlRDl39vXYiMV9iyeMuEuXZh2we6zz80uovNN2WlAxmmdE/Z/YQe+EbOEXB5RHEED3w==",
+ "dev": true
+ },
+ "uc.micro": {
+ "version": "1.0.6",
+ "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",
+ "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==",
+ "dev": true
+ },
+ "which-module": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
+ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
+ "dev": true
+ },
+ "workerpool": {
+ "version": "6.2.1",
+ "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz",
+ "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==",
+ "dev": true
+ },
+ "wrap-ansi": {
+ "version": "6.2.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
+ "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
+ "dev": true,
+ "requires": {
+ "ansi-styles": "^4.0.0",
+ "string-width": "^4.1.0",
+ "strip-ansi": "^6.0.0"
+ },
+ "dependencies": {
+ "ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "dev": true,
+ "requires": {
+ "color-convert": "^2.0.1"
+ }
+ },
+ "color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "dev": true,
+ "requires": {
+ "color-name": "~1.1.4"
+ }
+ },
+ "color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "dev": true
+ }
+ }
+ },
+ "wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
+ "dev": true
+ },
+ "y18n": {
+ "version": "4.0.3",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+ "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+ "dev": true
+ },
+ "yargs": {
+ "version": "15.4.1",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz",
+ "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
+ "dev": true,
+ "requires": {
+ "cliui": "^6.0.0",
+ "decamelize": "^1.2.0",
+ "find-up": "^4.1.0",
+ "get-caller-file": "^2.0.1",
+ "require-directory": "^2.1.1",
+ "require-main-filename": "^2.0.0",
+ "set-blocking": "^2.0.0",
+ "string-width": "^4.2.0",
+ "which-module": "^2.0.0",
+ "y18n": "^4.0.0",
+ "yargs-parser": "^18.1.2"
+ },
+ "dependencies": {
+ "find-up": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
+ "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
+ "dev": true,
+ "requires": {
+ "locate-path": "^5.0.0",
+ "path-exists": "^4.0.0"
+ }
+ },
+ "locate-path": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
+ "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
+ "dev": true,
+ "requires": {
+ "p-locate": "^4.1.0"
+ }
+ },
+ "p-locate": {
+ "version": "4.1.0",
+ "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
+ "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
+ "dev": true,
+ "requires": {
+ "p-limit": "^2.2.0"
+ }
+ },
+ "yargs-parser": {
+ "version": "18.1.3",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
+ "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
+ "dev": true,
+ "requires": {
+ "camelcase": "^5.0.0",
+ "decamelize": "^1.2.0"
+ }
+ }
+ }
+ },
+ "yargs-parser": {
+ "version": "20.2.4",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz",
+ "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==",
+ "dev": true
+ },
+ "yargs-unparser": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz",
+ "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==",
+ "dev": true,
+ "requires": {
+ "camelcase": "^6.0.0",
+ "decamelize": "^4.0.0",
+ "flat": "^5.0.2",
+ "is-plain-obj": "^2.1.0"
+ },
+ "dependencies": {
+ "camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "dev": true
+ },
+ "decamelize": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz",
+ "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==",
+ "dev": true
+ }
+ }
+ },
+ "yn": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/yn/-/yn-2.0.0.tgz",
+ "integrity": "sha1-5a2ryKz0CPY4X8dklWhMiOavaJo=",
+ "dev": true
+ },
+ "yocto-queue": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
+ "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
+ "dev": true
+ }
+ }
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/package.json b/third_party/python/aiohttp/vendor/llhttp/package.json
new file mode 100644
index 0000000000..d44c8121b2
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "llhttp",
+ "version": "8.1.1",
+ "description": "HTTP parser in LLVM IR",
+ "main": "lib/llhttp.js",
+ "types": "lib/llhttp.d.ts",
+ "files": [
+ "lib",
+ "src"
+ ],
+ "scripts": {
+ "bench": "ts-node bench/",
+ "build": "ts-node bin/generate.ts",
+ "build-ts": "tsc",
+ "prebuild-wasm": "npm run wasm -- --prebuild && npm run wasm -- --setup",
+ "build-wasm": "npm run wasm -- --docker",
+ "wasm": "ts-node bin/build_wasm.ts",
+ "clean": "rm -rf lib && rm -rf test/tmp",
+ "prepare": "npm run clean && npm run build-ts",
+ "lint": "tslint -c tslint.json bin/*.ts src/*.ts src/**/*.ts test/*.ts test/**/*.ts",
+ "mocha": "mocha --timeout=10000 -r ts-node/register/type-check --reporter progress test/*-test.ts",
+ "test": "npm run mocha && npm run lint",
+ "postversion": "RELEASE=`node -e \"process.stdout.write(require('./package').version)\"` make -B postversion",
+ "github-release": "RELEASE_V=`node -e \"process.stdout.write('v' + require('./package').version)\"` make github-release"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+ssh://git@github.com/nodejs/llhttp.git"
+ },
+ "keywords": [
+ "http",
+ "llvm",
+ "ir",
+ "llparse"
+ ],
+ "author": "Fedor Indutny <fedor@indutny.com> (http://darksi.de/)",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/nodejs/llhttp/issues"
+ },
+ "homepage": "https://github.com/nodejs/llhttp#readme",
+ "devDependencies": {
+ "@types/mocha": "^5.2.7",
+ "@types/node": "^10.17.52",
+ "javascript-stringify": "^2.0.1",
+ "llparse-dot": "^1.0.1",
+ "llparse-test-fixture": "^5.0.1",
+ "mdgator": "^1.1.2",
+ "mocha": "^10.2.0",
+ "ts-node": "^7.0.1",
+ "tslint": "^5.20.1",
+ "typescript": "^3.9.9"
+ },
+ "dependencies": {
+ "@types/semver": "^5.5.0",
+ "llparse": "^7.1.1",
+ "semver": "^5.7.1"
+ }
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/common.gypi b/third_party/python/aiohttp/vendor/llhttp/src/common.gypi
new file mode 100644
index 0000000000..ef7549f809
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/common.gypi
@@ -0,0 +1,46 @@
+{
+ 'target_defaults': {
+ 'default_configuration': 'Debug',
+ 'configurations': {
+ # TODO: hoist these out and put them somewhere common, because
+ # RuntimeLibrary MUST MATCH across the entire project
+ 'Debug': {
+ 'defines': [ 'DEBUG', '_DEBUG' ],
+ 'cflags': [ '-Wall', '-Wextra', '-O0', '-g', '-ftrapv' ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'RuntimeLibrary': 1, # static debug
+ },
+ },
+ },
+ 'Release': {
+ 'defines': [ 'NDEBUG' ],
+ 'cflags': [ '-Wall', '-Wextra', '-O3' ],
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ 'RuntimeLibrary': 0, # static release
+ },
+ },
+ }
+ },
+ 'msvs_settings': {
+ 'VCCLCompilerTool': {
+ # Compile as C++. llhttp.c is actually C99, but C++ is
+ # close enough in this case.
+ 'CompileAs': 2,
+ },
+ 'VCLibrarianTool': {
+ },
+ 'VCLinkerTool': {
+ 'GenerateDebugInformation': 'true',
+ },
+ },
+ 'conditions': [
+ ['OS == "win"', {
+ 'defines': [
+ 'WIN32'
+ ],
+ }]
+ ],
+ },
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/llhttp.gyp b/third_party/python/aiohttp/vendor/llhttp/src/llhttp.gyp
new file mode 100644
index 0000000000..c7b8800a4f
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/llhttp.gyp
@@ -0,0 +1,22 @@
+{
+ 'variables': {
+ 'llhttp_sources': [
+ 'src/llhttp.c',
+ 'src/api.c',
+ 'src/http.c',
+ ]
+ },
+ 'targets': [
+ {
+ 'target_name': 'llhttp',
+ 'type': 'static_library',
+ 'include_dirs': [ '.', 'include' ],
+ 'direct_dependent_settings': {
+ 'include_dirs': [ 'include' ],
+ },
+ 'sources': [
+ '<@(llhttp_sources)',
+ ],
+ },
+ ]
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/llhttp.ts b/third_party/python/aiohttp/vendor/llhttp/src/llhttp.ts
new file mode 100644
index 0000000000..29adbe9ca9
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/llhttp.ts
@@ -0,0 +1,10 @@
+import * as constants from './llhttp/constants';
+
+import HTTPMode = constants.HTTPMode;
+
+export { constants };
+export { HTTPMode };
+
+export { HTTP } from './llhttp/http';
+export { URL } from './llhttp/url';
+export { CHeaders } from './llhttp/c-headers';
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/llhttp/c-headers.ts b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/c-headers.ts
new file mode 100644
index 0000000000..fad66def5a
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/c-headers.ts
@@ -0,0 +1,106 @@
+import * as constants from './constants';
+import { enumToMap, IEnumMap } from './utils';
+
+type Encoding = 'none' | 'hex';
+
+export class CHeaders {
+ public build(): string {
+ let res = '';
+
+ res += '#ifndef LLLLHTTP_C_HEADERS_\n';
+ res += '#define LLLLHTTP_C_HEADERS_\n';
+
+ res += '#ifdef __cplusplus\n';
+ res += 'extern "C" {\n';
+ res += '#endif\n';
+
+ res += '\n';
+
+ const errorMap = enumToMap(constants.ERROR);
+ const methodMap = enumToMap(constants.METHODS);
+ const httpMethodMap = enumToMap(constants.METHODS, constants.METHODS_HTTP, [
+ constants.METHODS.PRI,
+ ]);
+ const rtspMethodMap = enumToMap(constants.METHODS, constants.METHODS_RTSP);
+ const statusMap = enumToMap(constants.STATUSES, constants.STATUSES_HTTP);
+
+ res += this.buildEnum('llhttp_errno', 'HPE', errorMap);
+ res += '\n';
+ res += this.buildEnum('llhttp_flags', 'F', enumToMap(constants.FLAGS),
+ 'hex');
+ res += '\n';
+ res += this.buildEnum('llhttp_lenient_flags', 'LENIENT',
+ enumToMap(constants.LENIENT_FLAGS), 'hex');
+ res += '\n';
+ res += this.buildEnum('llhttp_type', 'HTTP',
+ enumToMap(constants.TYPE));
+ res += '\n';
+ res += this.buildEnum('llhttp_finish', 'HTTP_FINISH',
+ enumToMap(constants.FINISH));
+ res += '\n';
+ res += this.buildEnum('llhttp_method', 'HTTP', methodMap);
+ res += '\n';
+ res += this.buildEnum('llhttp_status', 'HTTP_STATUS', statusMap);
+
+ res += '\n';
+
+ res += this.buildMap('HTTP_ERRNO', errorMap);
+ res += '\n';
+ res += this.buildMap('HTTP_METHOD', httpMethodMap);
+ res += '\n';
+ res += this.buildMap('RTSP_METHOD', rtspMethodMap);
+ res += '\n';
+ res += this.buildMap('HTTP_ALL_METHOD', methodMap);
+ res += '\n';
+ res += this.buildMap('HTTP_STATUS', statusMap);
+
+ res += '\n';
+
+ res += '#ifdef __cplusplus\n';
+ res += '} /* extern "C" */\n';
+ res += '#endif\n';
+ res += '#endif /* LLLLHTTP_C_HEADERS_ */\n';
+
+ return res;
+ }
+
+ private buildEnum(name: string, prefix: string, map: IEnumMap,
+ encoding: Encoding = 'none'): string {
+ let res = '';
+
+ res += `enum ${name} {\n`;
+ const keys = Object.keys(map);
+ const keysLength = keys.length;
+ for (let i = 0; i < keysLength; i++) {
+ const key = keys[i];
+ const isLast = i === keysLength - 1;
+
+ let value: number | string = map[key];
+
+ if (encoding === 'hex') {
+ value = `0x${value.toString(16)}`;
+ }
+
+ res += ` ${prefix}_${key.replace(/-/g, '')} = ${value}`;
+ if (!isLast) {
+ res += ',\n';
+ }
+ }
+ res += '\n};\n';
+ res += `typedef enum ${name} ${name}_t;\n`;
+
+ return res;
+ }
+
+ private buildMap(name: string, map: IEnumMap): string {
+ let res = '';
+
+ res += `#define ${name}_MAP(XX) \\\n`;
+ for (const [key, value] of Object.entries(map)) {
+ res += ` XX(${value!}, ${key.replace(/-/g, '')}, ${key}) \\\n`;
+ }
+ res += '\n';
+
+ return res;
+ }
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/llhttp/constants.ts b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/constants.ts
new file mode 100644
index 0000000000..31c1638965
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/constants.ts
@@ -0,0 +1,536 @@
+import { enumToMap, IEnumMap } from './utils';
+
+export type HTTPMode = 'loose' | 'strict';
+
+// C headers
+
+export enum ERROR {
+ OK = 0,
+ INTERNAL = 1,
+ STRICT = 2,
+ CR_EXPECTED = 25,
+ LF_EXPECTED = 3,
+ UNEXPECTED_CONTENT_LENGTH = 4,
+ UNEXPECTED_SPACE = 30,
+ CLOSED_CONNECTION = 5,
+ INVALID_METHOD = 6,
+ INVALID_URL = 7,
+ INVALID_CONSTANT = 8,
+ INVALID_VERSION = 9,
+ INVALID_HEADER_TOKEN = 10,
+ INVALID_CONTENT_LENGTH = 11,
+ INVALID_CHUNK_SIZE = 12,
+ INVALID_STATUS = 13,
+ INVALID_EOF_STATE = 14,
+ INVALID_TRANSFER_ENCODING = 15,
+
+ CB_MESSAGE_BEGIN = 16,
+ CB_HEADERS_COMPLETE = 17,
+ CB_MESSAGE_COMPLETE = 18,
+ CB_CHUNK_HEADER = 19,
+ CB_CHUNK_COMPLETE = 20,
+
+ PAUSED = 21,
+ PAUSED_UPGRADE = 22,
+ PAUSED_H2_UPGRADE = 23,
+
+ USER = 24,
+
+ CB_URL_COMPLETE = 26,
+ CB_STATUS_COMPLETE = 27,
+ CB_METHOD_COMPLETE = 32,
+ CB_VERSION_COMPLETE = 33,
+ CB_HEADER_FIELD_COMPLETE = 28,
+ CB_HEADER_VALUE_COMPLETE = 29,
+ CB_CHUNK_EXTENSION_NAME_COMPLETE = 34,
+ CB_CHUNK_EXTENSION_VALUE_COMPLETE = 35,
+ CB_RESET = 31,
+}
+
+export enum TYPE {
+ BOTH = 0, // default
+ REQUEST = 1,
+ RESPONSE = 2,
+}
+
+export enum FLAGS {
+ CONNECTION_KEEP_ALIVE = 1 << 0,
+ CONNECTION_CLOSE = 1 << 1,
+ CONNECTION_UPGRADE = 1 << 2,
+ CHUNKED = 1 << 3,
+ UPGRADE = 1 << 4,
+ CONTENT_LENGTH = 1 << 5,
+ SKIPBODY = 1 << 6,
+ TRAILING = 1 << 7,
+ // 1 << 8 is unused
+ TRANSFER_ENCODING = 1 << 9,
+}
+
+export enum LENIENT_FLAGS {
+ HEADERS = 1 << 0,
+ CHUNKED_LENGTH = 1 << 1,
+ KEEP_ALIVE = 1 << 2,
+ TRANSFER_ENCODING = 1 << 3,
+ VERSION = 1 << 4,
+}
+
+export enum METHODS {
+ DELETE = 0,
+ GET = 1,
+ HEAD = 2,
+ POST = 3,
+ PUT = 4,
+ /* pathological */
+ CONNECT = 5,
+ OPTIONS = 6,
+ TRACE = 7,
+ /* WebDAV */
+ COPY = 8,
+ LOCK = 9,
+ MKCOL = 10,
+ MOVE = 11,
+ PROPFIND = 12,
+ PROPPATCH = 13,
+ SEARCH = 14,
+ UNLOCK = 15,
+ BIND = 16,
+ REBIND = 17,
+ UNBIND = 18,
+ ACL = 19,
+ /* subversion */
+ REPORT = 20,
+ MKACTIVITY = 21,
+ CHECKOUT = 22,
+ MERGE = 23,
+ /* upnp */
+ 'M-SEARCH' = 24,
+ NOTIFY = 25,
+ SUBSCRIBE = 26,
+ UNSUBSCRIBE = 27,
+ /* RFC-5789 */
+ PATCH = 28,
+ PURGE = 29,
+ /* CalDAV */
+ MKCALENDAR = 30,
+ /* RFC-2068, section 19.6.1.2 */
+ LINK = 31,
+ UNLINK = 32,
+ /* icecast */
+ SOURCE = 33,
+ /* RFC-7540, section 11.6 */
+ PRI = 34,
+ /* RFC-2326 RTSP */
+ DESCRIBE = 35,
+ ANNOUNCE = 36,
+ SETUP = 37,
+ PLAY = 38,
+ PAUSE = 39,
+ TEARDOWN = 40,
+ GET_PARAMETER = 41,
+ SET_PARAMETER = 42,
+ REDIRECT = 43,
+ RECORD = 44,
+ /* RAOP */
+ FLUSH = 45,
+}
+
+export const METHODS_HTTP = [
+ METHODS.DELETE,
+ METHODS.GET,
+ METHODS.HEAD,
+ METHODS.POST,
+ METHODS.PUT,
+ METHODS.CONNECT,
+ METHODS.OPTIONS,
+ METHODS.TRACE,
+ METHODS.COPY,
+ METHODS.LOCK,
+ METHODS.MKCOL,
+ METHODS.MOVE,
+ METHODS.PROPFIND,
+ METHODS.PROPPATCH,
+ METHODS.SEARCH,
+ METHODS.UNLOCK,
+ METHODS.BIND,
+ METHODS.REBIND,
+ METHODS.UNBIND,
+ METHODS.ACL,
+ METHODS.REPORT,
+ METHODS.MKACTIVITY,
+ METHODS.CHECKOUT,
+ METHODS.MERGE,
+ METHODS['M-SEARCH'],
+ METHODS.NOTIFY,
+ METHODS.SUBSCRIBE,
+ METHODS.UNSUBSCRIBE,
+ METHODS.PATCH,
+ METHODS.PURGE,
+ METHODS.MKCALENDAR,
+ METHODS.LINK,
+ METHODS.UNLINK,
+ METHODS.PRI,
+
+ // TODO(indutny): should we allow it with HTTP?
+ METHODS.SOURCE,
+];
+
+export const METHODS_ICE = [
+ METHODS.SOURCE,
+];
+
+export const METHODS_RTSP = [
+ METHODS.OPTIONS,
+ METHODS.DESCRIBE,
+ METHODS.ANNOUNCE,
+ METHODS.SETUP,
+ METHODS.PLAY,
+ METHODS.PAUSE,
+ METHODS.TEARDOWN,
+ METHODS.GET_PARAMETER,
+ METHODS.SET_PARAMETER,
+ METHODS.REDIRECT,
+ METHODS.RECORD,
+ METHODS.FLUSH,
+
+ // For AirPlay
+ METHODS.GET,
+ METHODS.POST,
+];
+
+export const METHOD_MAP = enumToMap(METHODS);
+export const H_METHOD_MAP: IEnumMap = {};
+
+for (const key of Object.keys(METHOD_MAP)) {
+ if (/^H/.test(key)) {
+ H_METHOD_MAP[key] = METHOD_MAP[key];
+ }
+}
+
+export enum STATUSES {
+ CONTINUE = 100,
+ SWITCHING_PROTOCOLS = 101,
+ PROCESSING = 102,
+ EARLY_HINTS = 103,
+ RESPONSE_IS_STALE = 110, // Unofficial
+ REVALIDATION_FAILED = 111, // Unofficial
+ DISCONNECTED_OPERATION = 112, // Unofficial
+ HEURISTIC_EXPIRATION = 113, // Unofficial
+ MISCELLANEOUS_WARNING = 199, // Unofficial
+ OK = 200,
+ CREATED = 201,
+ ACCEPTED = 202,
+ NON_AUTHORITATIVE_INFORMATION = 203,
+ NO_CONTENT = 204,
+ RESET_CONTENT = 205,
+ PARTIAL_CONTENT = 206,
+ MULTI_STATUS = 207,
+ ALREADY_REPORTED = 208,
+ TRANSFORMATION_APPLIED = 214, // Unofficial
+ IM_USED = 226,
+ MISCELLANEOUS_PERSISTENT_WARNING = 299, // Unofficial
+ MULTIPLE_CHOICES = 300,
+ MOVED_PERMANENTLY = 301,
+ FOUND = 302,
+ SEE_OTHER = 303,
+ NOT_MODIFIED = 304,
+ USE_PROXY = 305,
+ SWITCH_PROXY = 306, // No longer used
+ TEMPORARY_REDIRECT = 307,
+ PERMANENT_REDIRECT = 308,
+ BAD_REQUEST = 400,
+ UNAUTHORIZED = 401,
+ PAYMENT_REQUIRED = 402,
+ FORBIDDEN = 403,
+ NOT_FOUND = 404,
+ METHOD_NOT_ALLOWED = 405,
+ NOT_ACCEPTABLE = 406,
+ PROXY_AUTHENTICATION_REQUIRED = 407,
+ REQUEST_TIMEOUT = 408,
+ CONFLICT = 409,
+ GONE = 410,
+ LENGTH_REQUIRED = 411,
+ PRECONDITION_FAILED = 412,
+ PAYLOAD_TOO_LARGE = 413,
+ URI_TOO_LONG = 414,
+ UNSUPPORTED_MEDIA_TYPE = 415,
+ RANGE_NOT_SATISFIABLE = 416,
+ EXPECTATION_FAILED = 417,
+ IM_A_TEAPOT = 418,
+ PAGE_EXPIRED = 419, // Unofficial
+ ENHANCE_YOUR_CALM = 420, // Unofficial
+ MISDIRECTED_REQUEST = 421,
+ UNPROCESSABLE_ENTITY = 422,
+ LOCKED = 423,
+ FAILED_DEPENDENCY = 424,
+ TOO_EARLY = 425,
+ UPGRADE_REQUIRED = 426,
+ PRECONDITION_REQUIRED = 428,
+ TOO_MANY_REQUESTS = 429,
+ REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL = 430, // Unofficial
+ REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
+ LOGIN_TIMEOUT = 440, // Unofficial
+ NO_RESPONSE = 444, // Unofficial
+ RETRY_WITH = 449, // Unofficial
+ BLOCKED_BY_PARENTAL_CONTROL = 450, // Unofficial
+ UNAVAILABLE_FOR_LEGAL_REASONS = 451,
+ CLIENT_CLOSED_LOAD_BALANCED_REQUEST = 460, // Unofficial
+ INVALID_X_FORWARDED_FOR = 463, // Unofficial
+ REQUEST_HEADER_TOO_LARGE = 494, // Unofficial
+ SSL_CERTIFICATE_ERROR = 495, // Unofficial
+ SSL_CERTIFICATE_REQUIRED = 496, // Unofficial
+ HTTP_REQUEST_SENT_TO_HTTPS_PORT = 497, // Unofficial
+ INVALID_TOKEN = 498, // Unofficial
+ CLIENT_CLOSED_REQUEST = 499, // Unofficial
+ INTERNAL_SERVER_ERROR = 500,
+ NOT_IMPLEMENTED = 501,
+ BAD_GATEWAY = 502,
+ SERVICE_UNAVAILABLE = 503,
+ GATEWAY_TIMEOUT = 504,
+ HTTP_VERSION_NOT_SUPPORTED = 505,
+ VARIANT_ALSO_NEGOTIATES = 506,
+ INSUFFICIENT_STORAGE = 507,
+ LOOP_DETECTED = 508,
+ BANDWIDTH_LIMIT_EXCEEDED = 509,
+ NOT_EXTENDED = 510,
+ NETWORK_AUTHENTICATION_REQUIRED = 511,
+ WEB_SERVER_UNKNOWN_ERROR = 520, // Unofficial
+ WEB_SERVER_IS_DOWN = 521, // Unofficial
+ CONNECTION_TIMEOUT = 522, // Unofficial
+ ORIGIN_IS_UNREACHABLE = 523, // Unofficial
+ TIMEOUT_OCCURED = 524, // Unofficial
+ SSL_HANDSHAKE_FAILED = 525, // Unofficial
+ INVALID_SSL_CERTIFICATE = 526, // Unofficial
+ RAILGUN_ERROR = 527, // Unofficial
+ SITE_IS_OVERLOADED = 529, // Unofficial
+ SITE_IS_FROZEN = 530, // Unofficial
+ IDENTITY_PROVIDER_AUTHENTICATION_ERROR = 561, // Unofficial
+ NETWORK_READ_TIMEOUT = 598, // Unofficial
+ NETWORK_CONNECT_TIMEOUT = 599, // Unofficial
+}
+
+export const STATUSES_HTTP = [
+ STATUSES.CONTINUE,
+ STATUSES.SWITCHING_PROTOCOLS,
+ STATUSES.PROCESSING,
+ STATUSES.EARLY_HINTS,
+ STATUSES.RESPONSE_IS_STALE,
+ STATUSES.REVALIDATION_FAILED,
+ STATUSES.DISCONNECTED_OPERATION,
+ STATUSES.HEURISTIC_EXPIRATION,
+ STATUSES.MISCELLANEOUS_WARNING,
+ STATUSES.OK,
+ STATUSES.CREATED,
+ STATUSES.ACCEPTED,
+ STATUSES.NON_AUTHORITATIVE_INFORMATION,
+ STATUSES.NO_CONTENT,
+ STATUSES.RESET_CONTENT,
+ STATUSES.PARTIAL_CONTENT,
+ STATUSES.MULTI_STATUS,
+ STATUSES.ALREADY_REPORTED,
+ STATUSES.TRANSFORMATION_APPLIED,
+ STATUSES.IM_USED,
+ STATUSES.MISCELLANEOUS_PERSISTENT_WARNING,
+ STATUSES.MULTIPLE_CHOICES,
+ STATUSES.MOVED_PERMANENTLY,
+ STATUSES.FOUND,
+ STATUSES.SEE_OTHER,
+ STATUSES.NOT_MODIFIED,
+ STATUSES.USE_PROXY,
+ STATUSES.SWITCH_PROXY,
+ STATUSES.TEMPORARY_REDIRECT,
+ STATUSES.PERMANENT_REDIRECT,
+ STATUSES.BAD_REQUEST,
+ STATUSES.UNAUTHORIZED,
+ STATUSES.PAYMENT_REQUIRED,
+ STATUSES.FORBIDDEN,
+ STATUSES.NOT_FOUND,
+ STATUSES.METHOD_NOT_ALLOWED,
+ STATUSES.NOT_ACCEPTABLE,
+ STATUSES.PROXY_AUTHENTICATION_REQUIRED,
+ STATUSES.REQUEST_TIMEOUT,
+ STATUSES.CONFLICT,
+ STATUSES.GONE,
+ STATUSES.LENGTH_REQUIRED,
+ STATUSES.PRECONDITION_FAILED,
+ STATUSES.PAYLOAD_TOO_LARGE,
+ STATUSES.URI_TOO_LONG,
+ STATUSES.UNSUPPORTED_MEDIA_TYPE,
+ STATUSES.RANGE_NOT_SATISFIABLE,
+ STATUSES.EXPECTATION_FAILED,
+ STATUSES.IM_A_TEAPOT,
+ STATUSES.PAGE_EXPIRED,
+ STATUSES.ENHANCE_YOUR_CALM,
+ STATUSES.MISDIRECTED_REQUEST,
+ STATUSES.UNPROCESSABLE_ENTITY,
+ STATUSES.LOCKED,
+ STATUSES.FAILED_DEPENDENCY,
+ STATUSES.TOO_EARLY,
+ STATUSES.UPGRADE_REQUIRED,
+ STATUSES.PRECONDITION_REQUIRED,
+ STATUSES.TOO_MANY_REQUESTS,
+ STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE_UNOFFICIAL,
+ STATUSES.REQUEST_HEADER_FIELDS_TOO_LARGE,
+ STATUSES.LOGIN_TIMEOUT,
+ STATUSES.NO_RESPONSE,
+ STATUSES.RETRY_WITH,
+ STATUSES.BLOCKED_BY_PARENTAL_CONTROL,
+ STATUSES.UNAVAILABLE_FOR_LEGAL_REASONS,
+ STATUSES.CLIENT_CLOSED_LOAD_BALANCED_REQUEST,
+ STATUSES.INVALID_X_FORWARDED_FOR,
+ STATUSES.REQUEST_HEADER_TOO_LARGE,
+ STATUSES.SSL_CERTIFICATE_ERROR,
+ STATUSES.SSL_CERTIFICATE_REQUIRED,
+ STATUSES.HTTP_REQUEST_SENT_TO_HTTPS_PORT,
+ STATUSES.INVALID_TOKEN,
+ STATUSES.CLIENT_CLOSED_REQUEST,
+ STATUSES.INTERNAL_SERVER_ERROR,
+ STATUSES.NOT_IMPLEMENTED,
+ STATUSES.BAD_GATEWAY,
+ STATUSES.SERVICE_UNAVAILABLE,
+ STATUSES.GATEWAY_TIMEOUT,
+ STATUSES.HTTP_VERSION_NOT_SUPPORTED,
+ STATUSES.VARIANT_ALSO_NEGOTIATES,
+ STATUSES.INSUFFICIENT_STORAGE,
+ STATUSES.LOOP_DETECTED,
+ STATUSES.BANDWIDTH_LIMIT_EXCEEDED,
+ STATUSES.NOT_EXTENDED,
+ STATUSES.NETWORK_AUTHENTICATION_REQUIRED,
+ STATUSES.WEB_SERVER_UNKNOWN_ERROR,
+ STATUSES.WEB_SERVER_IS_DOWN,
+ STATUSES.CONNECTION_TIMEOUT,
+ STATUSES.ORIGIN_IS_UNREACHABLE,
+ STATUSES.TIMEOUT_OCCURED,
+ STATUSES.SSL_HANDSHAKE_FAILED,
+ STATUSES.INVALID_SSL_CERTIFICATE,
+ STATUSES.RAILGUN_ERROR,
+ STATUSES.SITE_IS_OVERLOADED,
+ STATUSES.SITE_IS_FROZEN,
+ STATUSES.IDENTITY_PROVIDER_AUTHENTICATION_ERROR,
+ STATUSES.NETWORK_READ_TIMEOUT,
+ STATUSES.NETWORK_CONNECT_TIMEOUT,
+];
+
+export enum FINISH {
+ SAFE = 0,
+ SAFE_WITH_CB = 1,
+ UNSAFE = 2,
+}
+
+// Internal
+
+export type CharList = Array<string | number>;
+
+export const ALPHA: CharList = [];
+
+for (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {
+ // Upper case
+ ALPHA.push(String.fromCharCode(i));
+
+ // Lower case
+ ALPHA.push(String.fromCharCode(i + 0x20));
+}
+
+export const NUM_MAP = {
+ 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
+ 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
+};
+
+export const HEX_MAP = {
+ 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,
+ 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,
+ A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,
+ a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,
+};
+
+export const NUM: CharList = [
+ '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+];
+
+export const ALPHANUM: CharList = ALPHA.concat(NUM);
+export const MARK: CharList = [ '-', '_', '.', '!', '~', '*', '\'', '(', ')' ];
+export const USERINFO_CHARS: CharList = ALPHANUM
+ .concat(MARK)
+ .concat([ '%', ';', ':', '&', '=', '+', '$', ',' ]);
+
+// TODO(indutny): use RFC
+export const STRICT_URL_CHAR: CharList = ([
+ '!', '"', '$', '%', '&', '\'',
+ '(', ')', '*', '+', ',', '-', '.', '/',
+ ':', ';', '<', '=', '>',
+ '@', '[', '\\', ']', '^', '_',
+ '`',
+ '{', '|', '}', '~',
+] as CharList).concat(ALPHANUM);
+
+export const URL_CHAR: CharList = STRICT_URL_CHAR
+ .concat(([ '\t', '\f' ] as CharList));
+
+// All characters with 0x80 bit set to 1
+for (let i = 0x80; i <= 0xff; i++) {
+ URL_CHAR.push(i);
+}
+
+export const HEX: CharList = NUM.concat(
+ [ 'a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F' ]);
+
+/* Tokens as defined by rfc 2616. Also lowercases them.
+ * token = 1*<any CHAR except CTLs or separators>
+ * separators = "(" | ")" | "<" | ">" | "@"
+ * | "," | ";" | ":" | "\" | <">
+ * | "/" | "[" | "]" | "?" | "="
+ * | "{" | "}" | SP | HT
+ */
+export const STRICT_TOKEN: CharList = ([
+ '!', '#', '$', '%', '&', '\'',
+ '*', '+', '-', '.',
+ '^', '_', '`',
+ '|', '~',
+] as CharList).concat(ALPHANUM);
+
+export const TOKEN: CharList = STRICT_TOKEN.concat([ ' ' ]);
+
+/*
+ * Verify that a char is a valid visible (printable) US-ASCII
+ * character or %x80-FF
+ */
+export const HEADER_CHARS: CharList = [ '\t' ];
+for (let i = 32; i <= 255; i++) {
+ if (i !== 127) {
+ HEADER_CHARS.push(i);
+ }
+}
+
+// ',' = \x44
+export const CONNECTION_TOKEN_CHARS: CharList =
+ HEADER_CHARS.filter((c: string | number) => c !== 44);
+
+export const QUOTED_STRING: CharList = [ '\t', ' ' ];
+for (let i = 0x21; i <= 0xff; i++) {
+ if (i !== 0x22 && i !== 0x5c) { // All characters in ASCII except \ and "
+ QUOTED_STRING.push(i);
+ }
+}
+
+export const MAJOR = NUM_MAP;
+export const MINOR = MAJOR;
+
+export enum HEADER_STATE {
+ GENERAL = 0,
+ CONNECTION = 1,
+ CONTENT_LENGTH = 2,
+ TRANSFER_ENCODING = 3,
+ UPGRADE = 4,
+
+ CONNECTION_KEEP_ALIVE = 5,
+ CONNECTION_CLOSE = 6,
+ CONNECTION_UPGRADE = 7,
+ TRANSFER_ENCODING_CHUNKED = 8,
+}
+
+export const SPECIAL_HEADERS = {
+ 'connection': HEADER_STATE.CONNECTION,
+ 'content-length': HEADER_STATE.CONTENT_LENGTH,
+ 'proxy-connection': HEADER_STATE.CONNECTION,
+ 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,
+ 'upgrade': HEADER_STATE.UPGRADE,
+};
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/llhttp/http.ts b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/http.ts
new file mode 100644
index 0000000000..6b94f65cf4
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/http.ts
@@ -0,0 +1,1208 @@
+import * as assert from 'assert';
+import { LLParse, source } from 'llparse';
+
+import Match = source.node.Match;
+import Node = source.node.Node;
+
+import {
+ CharList,
+ CONNECTION_TOKEN_CHARS, ERROR, FINISH, FLAGS, H_METHOD_MAP, HEADER_CHARS,
+ HEADER_STATE, HEX_MAP,
+ HTTPMode,
+ LENIENT_FLAGS,
+ MAJOR, METHOD_MAP, METHODS, METHODS_HTTP, METHODS_ICE, METHODS_RTSP,
+ MINOR, NUM_MAP, QUOTED_STRING, SPECIAL_HEADERS,
+ STRICT_TOKEN, TOKEN, TYPE,
+} from './constants';
+import { URL } from './url';
+
+type MaybeNode = string | Match | Node;
+
+const NODES: ReadonlyArray<string> = [
+ 'start',
+ 'after_start',
+ 'start_req',
+ 'after_start_req',
+ 'start_res',
+ 'start_req_or_res',
+
+ 'req_or_res_method',
+
+ 'res_http_major',
+ 'res_http_dot',
+ 'res_http_minor',
+ 'res_http_end',
+ 'res_after_version',
+ 'res_status_code_digit_1',
+ 'res_status_code_digit_2',
+ 'res_status_code_digit_3',
+ 'res_status_code_otherwise',
+ 'res_status_start',
+ 'res_status',
+ 'res_line_almost_done',
+
+ 'req_first_space_before_url',
+ 'req_spaces_before_url',
+ 'req_http_start',
+ 'req_http_version',
+ 'req_http_major',
+ 'req_http_dot',
+ 'req_http_minor',
+ 'req_http_end',
+ 'req_http_complete',
+
+ 'req_pri_upgrade',
+
+ 'headers_start',
+ 'header_field_start',
+ 'header_field',
+ 'header_field_colon',
+ 'header_field_colon_discard_ws',
+ 'header_field_general',
+ 'header_field_general_otherwise',
+ 'header_value_discard_ws',
+ 'header_value_discard_ws_almost_done',
+ 'header_value_discard_lws',
+ 'header_value_start',
+ 'header_value',
+ 'header_value_otherwise',
+ 'header_value_lenient',
+ 'header_value_lenient_failed',
+ 'header_value_lws',
+ 'header_value_te_chunked',
+ 'header_value_te_chunked_last',
+ 'header_value_te_token',
+ 'header_value_te_token_ows',
+ 'header_value_content_length_once',
+ 'header_value_content_length',
+ 'header_value_content_length_ws',
+ 'header_value_connection',
+ 'header_value_connection_ws',
+ 'header_value_connection_token',
+ 'header_value_almost_done',
+
+ 'headers_almost_done',
+ 'headers_done',
+
+ 'chunk_size_start',
+ 'chunk_size_digit',
+ 'chunk_size',
+ 'chunk_size_otherwise',
+ 'chunk_size_almost_done',
+ 'chunk_size_almost_done_lf',
+ 'chunk_extensions',
+ 'chunk_extension_name',
+ 'chunk_extension_value',
+ 'chunk_extension_quoted_value',
+ 'chunk_extension_quoted_value_done',
+ 'chunk_data',
+ 'chunk_data_almost_done',
+ 'chunk_data_almost_done_skip',
+ 'chunk_complete',
+ 'body_identity',
+ 'body_identity_eof',
+
+ 'message_done',
+
+ 'eof',
+ 'cleanup',
+ 'closed',
+ 'restart',
+];
+
+interface ISpanMap {
+ readonly status: source.Span;
+ readonly method: source.Span;
+ readonly version: source.Span;
+ readonly headerField: source.Span;
+ readonly headerValue: source.Span;
+ readonly chunkExtensionName: source.Span;
+ readonly chunkExtensionValue: source.Span;
+ readonly body: source.Span;
+}
+
+interface ICallbackMap {
+ readonly onMessageBegin: source.code.Code;
+ readonly onUrlComplete: source.code.Code;
+ readonly onMethodComplete: source.code.Code;
+ readonly onVersionComplete: source.code.Code;
+ readonly onStatusComplete: source.code.Code;
+ readonly beforeHeadersComplete: source.code.Code;
+ readonly onHeaderFieldComplete: source.code.Code;
+ readonly onHeaderValueComplete: source.code.Code;
+ readonly onHeadersComplete: source.code.Code;
+ readonly afterHeadersComplete: source.code.Code;
+ readonly onChunkHeader: source.code.Code;
+ readonly onChunkExtensionName: source.code.Code;
+ readonly onChunkExtensionValue: source.code.Code;
+ readonly onChunkComplete: source.code.Code;
+ readonly onMessageComplete: source.code.Code;
+ readonly afterMessageComplete: source.code.Code;
+ readonly onReset: source.code.Code;
+}
+
+interface IMulTargets {
+ readonly overflow: string | Node;
+ readonly success: string | Node;
+}
+
+interface IMulOptions {
+ readonly base: number;
+ readonly max?: number;
+ readonly signed: boolean;
+}
+
+interface IIsEqualTargets {
+ readonly equal: string | Node;
+ readonly notEqual: string | Node;
+}
+
+export interface IHTTPResult {
+ readonly entry: Node;
+}
+
+export class HTTP {
+ private readonly url: URL;
+ private readonly TOKEN: CharList;
+ private readonly span: ISpanMap;
+ private readonly callback: ICallbackMap;
+ private readonly nodes: Map<string, Match> = new Map();
+
+ constructor(private readonly llparse: LLParse,
+ private readonly mode: HTTPMode = 'loose') {
+ const p = llparse;
+
+ this.url = new URL(p, mode);
+ this.TOKEN = mode === 'strict' ? STRICT_TOKEN : TOKEN;
+
+ this.span = {
+ body: p.span(p.code.span('llhttp__on_body')),
+ chunkExtensionName: p.span(p.code.span('llhttp__on_chunk_extension_name')),
+ chunkExtensionValue: p.span(p.code.span('llhttp__on_chunk_extension_value')),
+ headerField: p.span(p.code.span('llhttp__on_header_field')),
+ headerValue: p.span(p.code.span('llhttp__on_header_value')),
+ method: p.span(p.code.span('llhttp__on_method')),
+ status: p.span(p.code.span('llhttp__on_status')),
+ version: p.span(p.code.span('llhttp__on_version')),
+ };
+
+ /* tslint:disable:object-literal-sort-keys */
+ this.callback = {
+ // User callbacks
+ onUrlComplete: p.code.match('llhttp__on_url_complete'),
+ onStatusComplete: p.code.match('llhttp__on_status_complete'),
+ onMethodComplete: p.code.match('llhttp__on_method_complete'),
+ onVersionComplete: p.code.match('llhttp__on_version_complete'),
+ onHeaderFieldComplete: p.code.match('llhttp__on_header_field_complete'),
+ onHeaderValueComplete: p.code.match('llhttp__on_header_value_complete'),
+ onHeadersComplete: p.code.match('llhttp__on_headers_complete'),
+ onMessageBegin: p.code.match('llhttp__on_message_begin'),
+ onMessageComplete: p.code.match('llhttp__on_message_complete'),
+ onChunkHeader: p.code.match('llhttp__on_chunk_header'),
+ onChunkExtensionName: p.code.match('llhttp__on_chunk_extension_name_complete'),
+ onChunkExtensionValue: p.code.match('llhttp__on_chunk_extension_value_complete'),
+ onChunkComplete: p.code.match('llhttp__on_chunk_complete'),
+ onReset: p.code.match('llhttp__on_reset'),
+
+ // Internal callbacks `src/http.c`
+ beforeHeadersComplete:
+ p.code.match('llhttp__before_headers_complete'),
+ afterHeadersComplete: p.code.match('llhttp__after_headers_complete'),
+ afterMessageComplete: p.code.match('llhttp__after_message_complete'),
+ };
+ /* tslint:enable:object-literal-sort-keys */
+
+ for (const name of NODES) {
+ this.nodes.set(name, p.node(name) as Match);
+ }
+ }
+
+ public build(): IHTTPResult {
+ const p = this.llparse;
+
+ p.property('i64', 'content_length');
+ p.property('i8', 'type');
+ p.property('i8', 'method');
+ p.property('i8', 'http_major');
+ p.property('i8', 'http_minor');
+ p.property('i8', 'header_state');
+ p.property('i8', 'lenient_flags');
+ p.property('i8', 'upgrade');
+ p.property('i8', 'finish');
+ p.property('i16', 'flags');
+ p.property('i16', 'status_code');
+ p.property('i8', 'initial_message_completed');
+
+ // Verify defaults
+ assert.strictEqual(FINISH.SAFE, 0);
+ assert.strictEqual(TYPE.BOTH, 0);
+
+ // Shared settings (to be used in C wrapper)
+ p.property('ptr', 'settings');
+
+ this.buildLine();
+ this.buildHeaders();
+
+ return {
+ entry: this.node('start'),
+ };
+ }
+
+ private buildLine(): void {
+ const p = this.llparse;
+ const span = this.span;
+ const n = (name: string): Match => this.node<Match>(name);
+
+ const url = this.url.build();
+
+ const switchType = this.load('type', {
+ [TYPE.REQUEST]: n('start_req'),
+ [TYPE.RESPONSE]: n('start_res'),
+ }, n('start_req_or_res'));
+
+ n('start')
+ .match([ '\r', '\n' ], n('start'))
+ .otherwise(
+ this.load('initial_message_completed', {
+ 1: this.invokePausable('on_reset', ERROR.CB_RESET, n('after_start')),
+ }, n('after_start')),
+ );
+
+ n('after_start').otherwise(
+ this.update(
+ 'finish',
+ FINISH.UNSAFE,
+ this.invokePausable('on_message_begin', ERROR.CB_MESSAGE_BEGIN, switchType),
+ ),
+ );
+
+ n('start_req_or_res')
+ .peek('H', this.span.method.start(n('req_or_res_method')))
+ .otherwise(this.update('type', TYPE.REQUEST, 'start_req'));
+
+ n('req_or_res_method')
+ .select(H_METHOD_MAP, this.store('method',
+ this.update('type', TYPE.REQUEST, this.span.method.end(
+ this.invokePausable('on_method_complete', ERROR.CB_METHOD_COMPLETE, n('req_first_space_before_url')),
+ )),
+ ))
+ .match('HTTP/', this.span.method.end(this.update('type', TYPE.RESPONSE,
+ this.span.version.start(n('res_http_major')))))
+ .otherwise(p.error(ERROR.INVALID_CONSTANT, 'Invalid word encountered'));
+
+ const checkVersion = (destination: string): Node => {
+ const node = n(destination);
+ const errorNode = this.span.version.end(p.error(ERROR.INVALID_VERSION, 'Invalid HTTP version'));
+
+ return this.testLenientFlags(LENIENT_FLAGS.VERSION,
+ {
+ 1: node,
+ },
+ this.load('http_major', {
+ 0: this.load('http_minor', {
+ 9: node,
+ }, errorNode),
+ 1: this.load('http_minor', {
+ 0: node,
+ 1: node,
+ }, errorNode),
+ 2: this.load('http_minor', {
+ 0: node,
+ }, errorNode),
+ }, errorNode),
+ );
+ };
+
+ // Response
+ n('start_res')
+ .match('HTTP/', span.version.start(n('res_http_major')))
+ .otherwise(p.error(ERROR.INVALID_CONSTANT, 'Expected HTTP/'));
+
+ n('res_http_major')
+ .select(MAJOR, this.store('http_major', 'res_http_dot'))
+ .otherwise(this.span.version.end(p.error(ERROR.INVALID_VERSION, 'Invalid major version')));
+
+ n('res_http_dot')
+ .match('.', n('res_http_minor'))
+ .otherwise(this.span.version.end(p.error(ERROR.INVALID_VERSION, 'Expected dot')));
+
+ n('res_http_minor')
+ .select(MINOR, this.store('http_minor', checkVersion('res_http_end')))
+ .otherwise(this.span.version.end(p.error(ERROR.INVALID_VERSION, 'Invalid minor version')));
+
+ n('res_http_end')
+ .otherwise(this.span.version.end().otherwise(
+ this.invokePausable('on_version_complete', ERROR.CB_VERSION_COMPLETE, 'res_after_version'),
+ ));
+
+ n('res_after_version')
+ .match(' ', this.update('status_code', 0, 'res_status_code_digit_1'))
+ .otherwise(p.error(ERROR.INVALID_VERSION,
+ 'Expected space after version'));
+
+ n('res_status_code_digit_1')
+ .select(NUM_MAP, this.mulAdd('status_code', {
+ overflow: p.error(ERROR.INVALID_STATUS, 'Invalid status code'),
+ success: 'res_status_code_digit_2',
+ }))
+ .otherwise(p.error(ERROR.INVALID_STATUS, 'Invalid status code'));
+
+ n('res_status_code_digit_2')
+ .select(NUM_MAP, this.mulAdd('status_code', {
+ overflow: p.error(ERROR.INVALID_STATUS, 'Invalid status code'),
+ success: 'res_status_code_digit_3',
+ }))
+ .otherwise(p.error(ERROR.INVALID_STATUS, 'Invalid status code'));
+
+ n('res_status_code_digit_3')
+ .select(NUM_MAP, this.mulAdd('status_code', {
+ overflow: p.error(ERROR.INVALID_STATUS, 'Invalid status code'),
+ success: 'res_status_code_otherwise',
+ }))
+ .otherwise(p.error(ERROR.INVALID_STATUS, 'Invalid status code'));
+
+ n('res_status_code_otherwise')
+ .match(' ', n('res_status_start'))
+ .peek([ '\r', '\n' ], n('res_status_start'))
+ .otherwise(p.error(ERROR.INVALID_STATUS, 'Invalid response status'));
+
+ const onStatusComplete = this.invokePausable(
+ 'on_status_complete', ERROR.CB_STATUS_COMPLETE, n('headers_start'),
+ );
+
+ n('res_status_start')
+ .match('\r', n('res_line_almost_done'))
+ .match('\n', onStatusComplete)
+ .otherwise(span.status.start(n('res_status')));
+
+ n('res_status')
+ .peek('\r', span.status.end().skipTo(n('res_line_almost_done')))
+ .peek('\n', span.status.end().skipTo(onStatusComplete))
+ .skipTo(n('res_status'));
+
+ if (this.mode === 'strict') {
+ n('res_line_almost_done')
+ .match('\n', onStatusComplete)
+ .otherwise(p.error(ERROR.STRICT, 'Expected LF after CR'));
+ } else {
+ n('res_line_almost_done')
+ .skipTo(onStatusComplete);
+ }
+
+ // Request
+ n('start_req').otherwise(this.span.method.start(n('after_start_req')));
+
+ n('after_start_req')
+ .select(METHOD_MAP, this.store('method', this.span.method.end(
+ this.invokePausable('on_method_complete', ERROR.CB_METHOD_COMPLETE, n('req_first_space_before_url'),
+ ))))
+ .otherwise(p.error(ERROR.INVALID_METHOD, 'Invalid method encountered'));
+
+ n('req_first_space_before_url')
+ .match(' ', n('req_spaces_before_url'))
+ .otherwise(p.error(ERROR.INVALID_METHOD, 'Expected space after method'));
+
+ n('req_spaces_before_url')
+ .match(' ', n('req_spaces_before_url'))
+ .otherwise(this.isEqual('method', METHODS.CONNECT, {
+ equal: url.entry.connect,
+ notEqual: url.entry.normal,
+ }));
+
+ const onUrlCompleteHTTP = this.invokePausable(
+ 'on_url_complete', ERROR.CB_URL_COMPLETE, n('req_http_start'),
+ );
+
+ url.exit.toHTTP
+ .otherwise(onUrlCompleteHTTP);
+
+ const onUrlCompleteHTTP09 = this.invokePausable(
+ 'on_url_complete', ERROR.CB_URL_COMPLETE, n('headers_start'),
+ );
+
+ url.exit.toHTTP09
+ .otherwise(
+ this.update('http_major', 0,
+ this.update('http_minor', 9, onUrlCompleteHTTP09)),
+ );
+
+ const checkMethod = (methods: METHODS[], error: string): Node => {
+ const success = n('req_http_version');
+ const failure = p.error(ERROR.INVALID_CONSTANT, error);
+
+ const map: { [key: number]: Node } = {};
+ for (const method of methods) {
+ map[method] = success;
+ }
+
+ return this.load('method', map, failure);
+ };
+
+ n('req_http_start')
+ .match('HTTP/', checkMethod(METHODS_HTTP,
+ 'Invalid method for HTTP/x.x request'))
+ .match('RTSP/', checkMethod(METHODS_RTSP,
+ 'Invalid method for RTSP/x.x request'))
+ .match('ICE/', checkMethod(METHODS_ICE,
+ 'Expected SOURCE method for ICE/x.x request'))
+ .match(' ', n('req_http_start'))
+ .otherwise(p.error(ERROR.INVALID_CONSTANT, 'Expected HTTP/'));
+
+ n('req_http_version').otherwise(span.version.start(n('req_http_major')));
+
+ n('req_http_major')
+ .select(MAJOR, this.store('http_major', 'req_http_dot'))
+ .otherwise(this.span.version.end(p.error(ERROR.INVALID_VERSION, 'Invalid major version')));
+
+ n('req_http_dot')
+ .match('.', n('req_http_minor'))
+ .otherwise(this.span.version.end(p.error(ERROR.INVALID_VERSION, 'Expected dot')));
+
+ n('req_http_minor')
+ .select(MINOR, this.store('http_minor', checkVersion('req_http_end')))
+ .otherwise(this.span.version.end(p.error(ERROR.INVALID_VERSION, 'Invalid minor version')));
+
+ n('req_http_end').otherwise(
+ span.version.end().otherwise(
+ this.invokePausable(
+ 'on_version_complete',
+ ERROR.CB_VERSION_COMPLETE,
+ this.load('method', {
+ [METHODS.PRI]: n('req_pri_upgrade'),
+ }, n('req_http_complete')),
+ )),
+ );
+
+ n('req_http_complete')
+ .match([ '\r\n', '\n' ], n('headers_start'))
+ .otherwise(p.error(ERROR.INVALID_VERSION, 'Expected CRLF after version'));
+
+ n('req_pri_upgrade')
+ .match('\r\n\r\nSM\r\n\r\n',
+ p.error(ERROR.PAUSED_H2_UPGRADE, 'Pause on PRI/Upgrade'))
+ .otherwise(
+ p.error(ERROR.INVALID_VERSION, 'Expected HTTP/2 Connection Preface'));
+ }
+
+ private buildHeaders(): void {
+ this.buildHeaderField();
+ this.buildHeaderValue();
+ }
+
+ private buildHeaderField(): void {
+ const p = this.llparse;
+ const span = this.span;
+ const n = (name: string): Match => this.node<Match>(name);
+
+ n('headers_start')
+ .match(' ',
+ this.testLenientFlags(LENIENT_FLAGS.HEADERS, {
+ 1: n('header_field_start'),
+ }, p.error(ERROR.UNEXPECTED_SPACE, 'Unexpected space after start line')),
+ )
+ .otherwise(n('header_field_start'));
+
+ n('header_field_start')
+ .match('\r', n('headers_almost_done'))
+ /* they might be just sending \n instead of \r\n so this would be
+ * the second \n to denote the end of headers*/
+ .peek('\n', n('headers_almost_done'))
+ .otherwise(span.headerField.start(n('header_field')));
+
+ n('header_field')
+ .transform(p.transform.toLower())
+ // Match headers that need special treatment
+ .select(SPECIAL_HEADERS, this.store('header_state', 'header_field_colon'))
+ .otherwise(this.resetHeaderState('header_field_general'));
+
+ const onHeaderFieldComplete = this.invokePausable(
+ 'on_header_field_complete', ERROR.CB_HEADER_FIELD_COMPLETE, n('header_value_discard_ws'),
+ );
+
+ const onInvalidHeaderFieldChar =
+ p.error(ERROR.INVALID_HEADER_TOKEN, 'Invalid header field char');
+
+ const checkLenientFlagsOnColon =
+ this.testLenientFlags(LENIENT_FLAGS.HEADERS, {
+ 1: n('header_field_colon_discard_ws'),
+ }, span.headerField.end().skipTo(onInvalidHeaderFieldChar));
+
+ n('header_field_colon')
+ // https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.4
+ // Whitespace character is not allowed between the header field-name
+ // and colon. If the next token matches whitespace then throw an error.
+ //
+ // Add a check for the lenient flag. If the lenient flag is set, the
+ // whitespace token is allowed to support legacy code not following
+ // http specs.
+ .peek(' ', checkLenientFlagsOnColon)
+ .peek(':', span.headerField.end().skipTo(onHeaderFieldComplete))
+ // Fallback to general header, there're additional characters:
+ // `Connection-Duration` instead of `Connection` and so on.
+ .otherwise(this.resetHeaderState('header_field_general'));
+
+ n('header_field_colon_discard_ws')
+ .match(' ', n('header_field_colon_discard_ws'))
+ .otherwise(n('header_field_colon'));
+
+ n('header_field_general')
+ .match(this.TOKEN, n('header_field_general'))
+ .otherwise(n('header_field_general_otherwise'));
+
+ // Just a performance optimization, split the node so that the fast case
+ // remains in `header_field_general`
+ n('header_field_general_otherwise')
+ .peek(':', span.headerField.end().skipTo(onHeaderFieldComplete))
+ .otherwise(p.error(ERROR.INVALID_HEADER_TOKEN, 'Invalid header token'));
+ }
+
+ private buildHeaderValue(): void {
+ const p = this.llparse;
+ const span = this.span;
+ const callback = this.callback;
+ const n = (name: string): Match => this.node<Match>(name);
+
+ const fallback = this.resetHeaderState('header_value');
+
+ n('header_value_discard_ws')
+ .match([ ' ', '\t' ], n('header_value_discard_ws'))
+ .match('\r', n('header_value_discard_ws_almost_done'))
+ .match('\n', this.testLenientFlags(LENIENT_FLAGS.HEADERS, {
+ 1: n('header_value_discard_lws'),
+ }, p.error(ERROR.INVALID_HEADER_TOKEN, 'Invalid header value char')))
+ .otherwise(span.headerValue.start(n('header_value_start')));
+
+ n('header_value_discard_ws_almost_done')
+ .match('\n', n('header_value_discard_lws'))
+ .otherwise(
+ this.testLenientFlags(LENIENT_FLAGS.HEADERS, {
+ 1: n('header_value_discard_lws'),
+ }, p.error(ERROR.STRICT, 'Expected LF after CR')),
+ );
+
+ const onHeaderValueComplete = this.invokePausable(
+ 'on_header_value_complete', ERROR.CB_HEADER_VALUE_COMPLETE, n('header_field_start'),
+ );
+
+ const emptyContentLengthError = p.error(
+ ERROR.INVALID_CONTENT_LENGTH, 'Empty Content-Length');
+ const checkContentLengthEmptiness = this.load('header_state', {
+ [HEADER_STATE.CONTENT_LENGTH]: emptyContentLengthError,
+ }, this.setHeaderFlags(
+ this.emptySpan(span.headerValue, onHeaderValueComplete)));
+
+ n('header_value_discard_lws')
+ .match([ ' ', '\t' ], this.testLenientFlags(LENIENT_FLAGS.HEADERS, {
+ 1: n('header_value_discard_ws'),
+ }, p.error(ERROR.INVALID_HEADER_TOKEN, 'Invalid header value char')))
+ .otherwise(checkContentLengthEmptiness);
+
+ // Multiple `Transfer-Encoding` headers should be treated as one, but with
+ // values separate by a comma.
+ //
+ // See: https://tools.ietf.org/html/rfc7230#section-3.2.2
+ const toTransferEncoding = this.unsetFlag(
+ FLAGS.CHUNKED,
+ 'header_value_te_chunked');
+
+ // Once chunked has been selected, no other encoding is possible in requests
+ // https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.1
+ const forbidAfterChunkedInRequest = (otherwise: Node) => {
+ return this.load('type', {
+ [TYPE.REQUEST]: this.testLenientFlags(LENIENT_FLAGS.TRANSFER_ENCODING, {
+ 0: span.headerValue.end().skipTo(
+ p.error(ERROR.INVALID_TRANSFER_ENCODING, 'Invalid `Transfer-Encoding` header value'),
+ ),
+ }).otherwise(otherwise),
+ }, otherwise);
+ };
+
+ n('header_value_start')
+ .otherwise(this.load('header_state', {
+ [HEADER_STATE.UPGRADE]: this.setFlag(FLAGS.UPGRADE, fallback),
+ [HEADER_STATE.TRANSFER_ENCODING]: this.testFlags(
+ FLAGS.CHUNKED,
+ {
+ 1: forbidAfterChunkedInRequest(this.setFlag(FLAGS.TRANSFER_ENCODING, toTransferEncoding)),
+ },
+ this.setFlag(FLAGS.TRANSFER_ENCODING, toTransferEncoding)),
+ [HEADER_STATE.CONTENT_LENGTH]: n('header_value_content_length_once'),
+ [HEADER_STATE.CONNECTION]: n('header_value_connection'),
+ }, 'header_value'));
+
+ //
+ // Transfer-Encoding
+ //
+
+ n('header_value_te_chunked')
+ .transform(p.transform.toLowerUnsafe())
+ .match(
+ 'chunked',
+ n('header_value_te_chunked_last'),
+ )
+ .otherwise(n('header_value_te_token'));
+
+ n('header_value_te_chunked_last')
+ .match(' ', n('header_value_te_chunked_last'))
+ .peek([ '\r', '\n' ], this.update('header_state',
+ HEADER_STATE.TRANSFER_ENCODING_CHUNKED,
+ 'header_value_otherwise'))
+ .peek(',', forbidAfterChunkedInRequest(n('header_value_te_chunked')))
+ .otherwise(n('header_value_te_token'));
+
+ n('header_value_te_token')
+ .match(',', n('header_value_te_token_ows'))
+ .match(CONNECTION_TOKEN_CHARS, n('header_value_te_token'))
+ .otherwise(fallback);
+
+ n('header_value_te_token_ows')
+ .match([ ' ', '\t' ], n('header_value_te_token_ows'))
+ .otherwise(n('header_value_te_chunked'));
+
+ //
+ // Content-Length
+ //
+
+ const invalidContentLength = (reason: string): Node => {
+ // End span for easier testing
+ // TODO(indutny): minimize code size
+ return span.headerValue.end()
+ .otherwise(p.error(ERROR.INVALID_CONTENT_LENGTH, reason));
+ };
+
+ n('header_value_content_length_once')
+ .otherwise(this.testFlags(FLAGS.CONTENT_LENGTH, {
+ 0: n('header_value_content_length'),
+ }, p.error(ERROR.UNEXPECTED_CONTENT_LENGTH, 'Duplicate Content-Length')));
+
+ n('header_value_content_length')
+ .select(NUM_MAP, this.mulAdd('content_length', {
+ overflow: invalidContentLength('Content-Length overflow'),
+ success: 'header_value_content_length',
+ }))
+ .otherwise(n('header_value_content_length_ws'));
+
+ n('header_value_content_length_ws')
+ .match(' ', n('header_value_content_length_ws'))
+ .peek([ '\r', '\n' ],
+ this.setFlag(FLAGS.CONTENT_LENGTH, 'header_value_otherwise'))
+ .otherwise(invalidContentLength('Invalid character in Content-Length'));
+
+ //
+ // Connection
+ //
+
+ n('header_value_connection')
+ .transform(p.transform.toLower())
+ // TODO(indutny): extra node for token back-edge?
+ // Skip lws
+ .match([ ' ', '\t' ], n('header_value_connection'))
+ .match(
+ 'close',
+ this.update('header_state', HEADER_STATE.CONNECTION_CLOSE,
+ 'header_value_connection_ws'),
+ )
+ .match(
+ 'upgrade',
+ this.update('header_state', HEADER_STATE.CONNECTION_UPGRADE,
+ 'header_value_connection_ws'),
+ )
+ .match(
+ 'keep-alive',
+ this.update('header_state', HEADER_STATE.CONNECTION_KEEP_ALIVE,
+ 'header_value_connection_ws'),
+ )
+ .otherwise(n('header_value_connection_token'));
+
+ n('header_value_connection_ws')
+ .match(',', this.setHeaderFlags('header_value_connection'))
+ .match(' ', n('header_value_connection_ws'))
+ .peek([ '\r', '\n' ], n('header_value_otherwise'))
+ .otherwise(this.resetHeaderState('header_value_connection_token'));
+
+ n('header_value_connection_token')
+ .match(',', n('header_value_connection'))
+ .match(CONNECTION_TOKEN_CHARS,
+ n('header_value_connection_token'))
+ .otherwise(n('header_value_otherwise'));
+
+ // Split for performance reasons
+ n('header_value')
+ .match(HEADER_CHARS, n('header_value'))
+ .otherwise(n('header_value_otherwise'));
+
+ const checkLenient = this.testLenientFlags(LENIENT_FLAGS.HEADERS, {
+ 1: n('header_value_lenient'),
+ }, span.headerValue.end(p.error(ERROR.INVALID_HEADER_TOKEN, 'Invalid header value char')));
+
+ n('header_value_otherwise')
+ .peek('\r', span.headerValue.end().skipTo(n('header_value_almost_done')))
+ .otherwise(checkLenient);
+
+ n('header_value_lenient')
+ .peek('\r', span.headerValue.end().skipTo(n('header_value_almost_done')))
+ .peek('\n', span.headerValue.end(n('header_value_almost_done')))
+ .skipTo(n('header_value_lenient'));
+
+ n('header_value_lenient_failed')
+ .peek('\n', span.headerValue.end().skipTo(
+ p.error(ERROR.CR_EXPECTED, 'Missing expected CR after header value')),
+ )
+ .otherwise(p.error(ERROR.INVALID_HEADER_TOKEN, 'Invalid header value char'));
+
+ n('header_value_almost_done')
+ .match('\n', n('header_value_lws'))
+ .otherwise(p.error(ERROR.LF_EXPECTED,
+ 'Missing expected LF after header value'));
+
+ n('header_value_lws')
+ .peek([ ' ', '\t' ],
+ this.load('header_state', {
+ [HEADER_STATE.TRANSFER_ENCODING_CHUNKED]:
+ this.resetHeaderState(span.headerValue.start(n('header_value_start'))),
+ }, span.headerValue.start(n('header_value_start'))))
+ .otherwise(this.setHeaderFlags(onHeaderValueComplete));
+
+ const checkTrailing = this.testFlags(FLAGS.TRAILING, {
+ 1: this.invokePausable('on_chunk_complete',
+ ERROR.CB_CHUNK_COMPLETE, 'message_done'),
+ });
+
+ if (this.mode === 'strict') {
+ n('headers_almost_done')
+ .match('\n', checkTrailing)
+ .otherwise(p.error(ERROR.STRICT, 'Expected LF after headers'));
+ } else {
+ n('headers_almost_done')
+ .skipTo(checkTrailing);
+ }
+
+ // Set `upgrade` if needed
+ const beforeHeadersComplete = p.invoke(callback.beforeHeadersComplete);
+
+ /* Present `Transfer-Encoding` header overrides `Content-Length` even if the
+ * actual coding is not `chunked`. As per spec:
+ *
+ * https://www.rfc-editor.org/rfc/rfc7230.html#section-3.3.3
+ *
+ * If a message is received with both a Transfer-Encoding and a
+ * Content-Length header field, the Transfer-Encoding overrides the
+ * Content-Length. Such a message might indicate an attempt to
+ * perform request smuggling (Section 9.5) or response splitting
+ * (Section 9.4) and **ought to be handled as an error**. A sender MUST
+ * remove the received Content-Length field prior to forwarding such
+ * a message downstream.
+ *
+ * (Note our emphasis on **ought to be handled as an error**
+ */
+
+ const ENCODING_CONFLICT = FLAGS.TRANSFER_ENCODING | FLAGS.CONTENT_LENGTH;
+
+ const onEncodingConflict =
+ this.testLenientFlags(LENIENT_FLAGS.CHUNKED_LENGTH, {
+ 0: p.error(ERROR.UNEXPECTED_CONTENT_LENGTH,
+ 'Content-Length can\'t be present with Transfer-Encoding'),
+
+ // For LENIENT mode fall back to past behavior:
+ // Ignore `Transfer-Encoding` when `Content-Length` is present.
+ }).otherwise(beforeHeadersComplete);
+
+ const checkEncConflict = this.testFlags(ENCODING_CONFLICT, {
+ 1: onEncodingConflict,
+ }).otherwise(beforeHeadersComplete);
+
+ checkTrailing.otherwise(checkEncConflict);
+
+ /* Here we call the headers_complete callback. This is somewhat
+ * different than other callbacks because if the user returns 1, we
+ * will interpret that as saying that this message has no body. This
+ * is needed for the annoying case of receiving a response to a HEAD
+ * request.
+ *
+ * We'd like to use CALLBACK_NOTIFY_NOADVANCE() here but we cannot, so
+ * we have to simulate it by handling a change in errno below.
+ */
+ const onHeadersComplete = p.invoke(callback.onHeadersComplete, {
+ 0: n('headers_done'),
+ 1: this.setFlag(FLAGS.SKIPBODY, 'headers_done'),
+ 2: this.update('upgrade', 1,
+ this.setFlag(FLAGS.SKIPBODY, 'headers_done')),
+ [ERROR.PAUSED]: this.pause('Paused by on_headers_complete',
+ 'headers_done'),
+ }, p.error(ERROR.CB_HEADERS_COMPLETE, 'User callback error'));
+
+ beforeHeadersComplete.otherwise(onHeadersComplete);
+
+ const upgradePause = p.pause(ERROR.PAUSED_UPGRADE,
+ 'Pause on CONNECT/Upgrade');
+
+ const afterHeadersComplete = p.invoke(callback.afterHeadersComplete, {
+ 1: this.invokePausable('on_message_complete',
+ ERROR.CB_MESSAGE_COMPLETE, upgradePause),
+ 2: n('chunk_size_start'),
+ 3: n('body_identity'),
+ 4: n('body_identity_eof'),
+
+ // non-chunked `Transfer-Encoding` for request, see `src/native/http.c`
+ 5: p.error(ERROR.INVALID_TRANSFER_ENCODING,
+ 'Request has invalid `Transfer-Encoding`'),
+ });
+
+ n('headers_done')
+ .otherwise(afterHeadersComplete);
+
+ upgradePause
+ .otherwise(n('cleanup'));
+
+ afterHeadersComplete
+ .otherwise(this.invokePausable('on_message_complete',
+ ERROR.CB_MESSAGE_COMPLETE, 'cleanup'));
+
+ n('body_identity')
+ .otherwise(span.body.start()
+ .otherwise(p.consume('content_length').otherwise(
+ span.body.end(n('message_done')))));
+
+ n('body_identity_eof')
+ .otherwise(
+ this.update('finish', FINISH.SAFE_WITH_CB, span.body.start(n('eof'))));
+
+ // Just read everything until EOF
+ n('eof')
+ .skipTo(n('eof'));
+
+ n('chunk_size_start')
+ .otherwise(this.update('content_length', 0, 'chunk_size_digit'));
+
+ const addContentLength = this.mulAdd('content_length', {
+ overflow: p.error(ERROR.INVALID_CHUNK_SIZE, 'Chunk size overflow'),
+ success: 'chunk_size',
+ }, { signed: false, base: 0x10 });
+
+ n('chunk_size_digit')
+ .select(HEX_MAP, addContentLength)
+ .otherwise(p.error(ERROR.INVALID_CHUNK_SIZE,
+ 'Invalid character in chunk size'));
+
+ n('chunk_size')
+ .select(HEX_MAP, addContentLength)
+ .otherwise(n('chunk_size_otherwise'));
+
+ n('chunk_size_otherwise')
+ .match('\r', n('chunk_size_almost_done'))
+ .match(';', n('chunk_extensions'))
+ .otherwise(p.error(ERROR.INVALID_CHUNK_SIZE,
+ 'Invalid character in chunk size'));
+
+ const onChunkExtensionNameCompleted = (destination: Node) => {
+ return this.invokePausable(
+ 'on_chunk_extension_name', ERROR.CB_CHUNK_EXTENSION_NAME_COMPLETE, destination);
+ };
+
+ const onChunkExtensionValueCompleted = (destination: Node) => {
+ return this.invokePausable(
+ 'on_chunk_extension_value', ERROR.CB_CHUNK_EXTENSION_VALUE_COMPLETE, destination);
+ };
+
+ n('chunk_extensions')
+ .match(' ', p.error(ERROR.STRICT, 'Invalid character in chunk extensions'))
+ .match('\r', p.error(ERROR.STRICT, 'Invalid character in chunk extensions'))
+ .otherwise(this.span.chunkExtensionName.start(n('chunk_extension_name')));
+
+ n('chunk_extension_name')
+ .match(STRICT_TOKEN, n('chunk_extension_name'))
+ .peek('=', this.span.chunkExtensionName.end().skipTo(
+ this.span.chunkExtensionValue.start(
+ onChunkExtensionNameCompleted(n('chunk_extension_value')),
+ ),
+ ))
+ .peek(';', this.span.chunkExtensionName.end().skipTo(
+ onChunkExtensionNameCompleted(n('chunk_extensions')),
+ ))
+ .peek('\r', this.span.chunkExtensionName.end().skipTo(
+ onChunkExtensionNameCompleted(n('chunk_size_almost_done')),
+ ))
+ .otherwise(this.span.chunkExtensionName.end().skipTo(
+ p.error(ERROR.STRICT, 'Invalid character in chunk extensions name'),
+ ));
+
+ n('chunk_extension_value')
+ .match('"', n('chunk_extension_quoted_value'))
+ .match(STRICT_TOKEN, n('chunk_extension_value'))
+ .peek(';', this.span.chunkExtensionValue.end().skipTo(
+ onChunkExtensionValueCompleted(n('chunk_size_otherwise')),
+ ))
+ .peek('\r', this.span.chunkExtensionValue.end().skipTo(
+ onChunkExtensionValueCompleted(n('chunk_size_almost_done')),
+ ))
+ .otherwise(this.span.chunkExtensionValue.end().skipTo(
+ p.error(ERROR.STRICT, 'Invalid character in chunk extensions value'),
+ ));
+
+ n('chunk_extension_quoted_value')
+ .match(QUOTED_STRING, n('chunk_extension_quoted_value'))
+ .match('"', this.span.chunkExtensionValue.end(
+ onChunkExtensionValueCompleted(n('chunk_extension_quoted_value_done')),
+ ))
+ .otherwise(this.span.chunkExtensionValue.end().skipTo(
+ p.error(ERROR.STRICT, 'Invalid character in chunk extensions quoted value'),
+ ));
+
+ n('chunk_extension_quoted_value_done')
+ .match(';', n('chunk_extensions'))
+ .match('\r', n('chunk_size_almost_done'))
+ .otherwise(p.error(ERROR.STRICT,
+ 'Invalid character in chunk extensions quote value'));
+
+ if (this.mode === 'strict') {
+ n('chunk_size_almost_done')
+ .match('\n', n('chunk_size_almost_done_lf'))
+ .otherwise(p.error(ERROR.STRICT, 'Expected LF after chunk size'));
+ } else {
+ n('chunk_size_almost_done')
+ .skipTo(n('chunk_size_almost_done_lf'));
+ }
+
+ const toChunk = this.isEqual('content_length', 0, {
+ equal: this.setFlag(FLAGS.TRAILING, 'header_field_start'),
+ notEqual: 'chunk_data',
+ });
+
+ n('chunk_size_almost_done_lf')
+ .otherwise(this.invokePausable('on_chunk_header',
+ ERROR.CB_CHUNK_HEADER, toChunk));
+
+ n('chunk_data')
+ .otherwise(span.body.start()
+ .otherwise(p.consume('content_length').otherwise(
+ span.body.end(n('chunk_data_almost_done')))));
+
+ if (this.mode === 'strict') {
+ n('chunk_data_almost_done')
+ .match('\r\n', n('chunk_complete'))
+ .otherwise(p.error(ERROR.STRICT, 'Expected CRLF after chunk'));
+ } else {
+ n('chunk_data_almost_done')
+ .skipTo(n('chunk_data_almost_done_skip'));
+ }
+
+ n('chunk_data_almost_done_skip')
+ .skipTo(n('chunk_complete'));
+
+ n('chunk_complete')
+ .otherwise(this.invokePausable('on_chunk_complete',
+ ERROR.CB_CHUNK_COMPLETE, 'chunk_size_start'));
+
+ const upgradeAfterDone = this.isEqual('upgrade', 1, {
+ // Exit, the rest of the message is in a different protocol.
+ equal: upgradePause,
+
+ // Restart
+ notEqual: 'cleanup',
+ });
+
+ n('message_done')
+ .otherwise(this.invokePausable('on_message_complete',
+ ERROR.CB_MESSAGE_COMPLETE, upgradeAfterDone));
+
+ const lenientClose = this.testLenientFlags(LENIENT_FLAGS.KEEP_ALIVE, {
+ 1: n('restart'),
+ }, n('closed'));
+
+ // Check if we'd like to keep-alive
+ n('cleanup')
+ .otherwise(p.invoke(callback.afterMessageComplete, {
+ 1: this.update('content_length', 0, n('restart')),
+ }, this.update('finish', FINISH.SAFE, lenientClose)));
+
+ if (this.mode === 'strict') {
+ // Error on extra data after `Connection: close`
+ n('closed')
+ .match([ '\r', '\n' ], n('closed'))
+ .skipTo(p.error(ERROR.CLOSED_CONNECTION,
+ 'Data after `Connection: close`'));
+ } else {
+ // Discard all data after `Connection: close`
+ n('closed').skipTo(n('closed'));
+ }
+
+ n('restart')
+ .otherwise(
+ this.update('initial_message_completed', 1, this.update('finish', FINISH.SAFE, n('start')),
+ ));
+ }
+
+ private node<T extends Node>(name: string | T): T {
+ if (name instanceof Node) {
+ return name;
+ }
+
+ assert(this.nodes.has(name), `Unknown node with name "${name}"`);
+ return this.nodes.get(name)! as any;
+ }
+
+ private load(field: string, map: { [key: number]: Node },
+ next?: string | Node): Node {
+ const p = this.llparse;
+
+ const res = p.invoke(p.code.load(field), map);
+ if (next !== undefined) {
+ res.otherwise(this.node(next));
+ }
+ return res;
+ }
+
+ private store(field: string, next?: string | Node): Node {
+ const p = this.llparse;
+
+ const res = p.invoke(p.code.store(field));
+ if (next !== undefined) {
+ res.otherwise(this.node(next));
+ }
+ return res;
+ }
+
+ private update(field: string, value: number, next?: string | Node): Node {
+ const p = this.llparse;
+
+ const res = p.invoke(p.code.update(field, value));
+ if (next !== undefined) {
+ res.otherwise(this.node(next));
+ }
+ return res;
+ }
+
+ private resetHeaderState(next: string | Node): Node {
+ return this.update('header_state', HEADER_STATE.GENERAL, next);
+ }
+
+ private emptySpan(span: source.Span, next: string | Node): Node {
+ return span.start(span.end(this.node(next)));
+ }
+
+ private unsetFlag(flag: FLAGS, next: string | Node): Node {
+ const p = this.llparse;
+ return p.invoke(p.code.and('flags', ~flag), this.node(next));
+ }
+
+ private setFlag(flag: FLAGS, next: string | Node): Node {
+ const p = this.llparse;
+ return p.invoke(p.code.or('flags', flag), this.node(next));
+ }
+
+ private testFlags(flag: FLAGS, map: { [key: number]: Node },
+ next?: string | Node): Node {
+ const p = this.llparse;
+ const res = p.invoke(p.code.test('flags', flag), map);
+ if (next !== undefined) {
+ res.otherwise(this.node(next));
+ }
+ return res;
+ }
+
+ private testLenientFlags(flag: LENIENT_FLAGS, map: { [key: number]: Node },
+ next?: string | Node): Node {
+ const p = this.llparse;
+ const res = p.invoke(p.code.test('lenient_flags', flag), map);
+ if (next !== undefined) {
+ res.otherwise(this.node(next));
+ }
+ return res;
+ }
+
+ private setHeaderFlags(next: string | Node): Node {
+ const HS = HEADER_STATE;
+ const F = FLAGS;
+
+ const toConnection =
+ this.update('header_state', HEADER_STATE.CONNECTION, next);
+
+ return this.load('header_state', {
+ [HS.CONNECTION_KEEP_ALIVE]:
+ this.setFlag(F.CONNECTION_KEEP_ALIVE, toConnection),
+ [HS.CONNECTION_CLOSE]: this.setFlag(F.CONNECTION_CLOSE, toConnection),
+ [HS.CONNECTION_UPGRADE]: this.setFlag(F.CONNECTION_UPGRADE, toConnection),
+ [HS.TRANSFER_ENCODING_CHUNKED]: this.setFlag(F.CHUNKED, next),
+ }, this.node(next));
+ }
+
+ private mulAdd(field: string, targets: IMulTargets,
+ options: IMulOptions = { base: 10, signed: false }): Node {
+ const p = this.llparse;
+
+ return p.invoke(p.code.mulAdd(field, options), {
+ 1: this.node(targets.overflow),
+ }, this.node(targets.success));
+ }
+
+ private isEqual(field: string, value: number, map: IIsEqualTargets) {
+ const p = this.llparse;
+ return p.invoke(p.code.isEqual(field, value), {
+ 0: this.node(map.notEqual),
+ }, this.node(map.equal));
+ }
+
+ private pause(msg: string, next?: string | Node) {
+ const p = this.llparse;
+ const res = p.pause(ERROR.PAUSED, msg);
+ if (next !== undefined) {
+ res.otherwise(this.node(next));
+ }
+ return res;
+ }
+
+ private invokePausable(name: string, errorCode: ERROR, next: string | Node)
+ : Node {
+ let cb;
+
+ switch (name) {
+ case 'on_message_begin':
+ cb = this.callback.onMessageBegin;
+ break;
+ case 'on_url_complete':
+ cb = this.callback.onUrlComplete;
+ break;
+ case 'on_status_complete':
+ cb = this.callback.onStatusComplete;
+ break;
+ case 'on_method_complete':
+ cb = this.callback.onMethodComplete;
+ break;
+ case 'on_version_complete':
+ cb = this.callback.onVersionComplete;
+ break;
+ case 'on_header_field_complete':
+ cb = this.callback.onHeaderFieldComplete;
+ break;
+ case 'on_header_value_complete':
+ cb = this.callback.onHeaderValueComplete;
+ break;
+ case 'on_message_complete':
+ cb = this.callback.onMessageComplete;
+ break;
+ case 'on_chunk_header':
+ cb = this.callback.onChunkHeader;
+ break;
+ case 'on_chunk_extension_name':
+ cb = this.callback.onChunkExtensionName;
+ break;
+ case 'on_chunk_extension_value':
+ cb = this.callback.onChunkExtensionValue;
+ break;
+ case 'on_chunk_complete':
+ cb = this.callback.onChunkComplete;
+ break;
+ case 'on_reset':
+ cb = this.callback.onReset;
+ break;
+ default:
+ throw new Error('Unknown callback: ' + name);
+ }
+
+ const p = this.llparse;
+ return p.invoke(cb, {
+ 0: this.node(next),
+ [ERROR.PAUSED]: this.pause(`${name} pause`, next),
+ }, p.error(errorCode, `\`${name}\` callback error`));
+ }
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/llhttp/url.ts b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/url.ts
new file mode 100644
index 0000000000..49f816c847
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/url.ts
@@ -0,0 +1,230 @@
+import { LLParse, source } from 'llparse';
+
+import Match = source.node.Match;
+import Node = source.node.Node;
+
+import {
+ ALPHA,
+ CharList,
+ ERROR,
+ HTTPMode,
+ STRICT_URL_CHAR,
+ URL_CHAR,
+ USERINFO_CHARS,
+} from './constants';
+
+type SpanName = 'schema' | 'host' | 'path' | 'query' | 'fragment' | 'url';
+
+export interface IURLResult {
+ readonly entry: {
+ readonly normal: Node;
+ readonly connect: Node;
+ };
+ readonly exit: {
+ readonly toHTTP: Node;
+ readonly toHTTP09: Node;
+ };
+}
+
+type SpanTable = Map<SpanName, source.Span>;
+
+export class URL {
+ private readonly span: source.Span | undefined;
+ private readonly spanTable: SpanTable = new Map();
+ private readonly errorInvalid: Node;
+ private readonly errorStrictInvalid: Node;
+ private readonly URL_CHAR: CharList;
+
+ constructor(private readonly llparse: LLParse,
+ private readonly mode: HTTPMode = 'loose',
+ separateSpans: boolean = false) {
+ const p = this.llparse;
+
+ this.errorInvalid = p.error(ERROR.INVALID_URL, 'Invalid characters in url');
+ this.errorStrictInvalid =
+ p.error(ERROR.INVALID_URL, 'Invalid characters in url (strict mode)');
+
+ this.URL_CHAR = mode === 'strict' ? STRICT_URL_CHAR : URL_CHAR;
+
+ const table = this.spanTable;
+ if (separateSpans) {
+ table.set('schema', p.span(p.code.span('llhttp__on_url_schema')));
+ table.set('host', p.span(p.code.span('llhttp__on_url_host')));
+ table.set('path', p.span(p.code.span('llhttp__on_url_path')));
+ table.set('query', p.span(p.code.span('llhttp__on_url_query')));
+ table.set('fragment',
+ p.span(p.code.span('llhttp__on_url_fragment')));
+ } else {
+ table.set('url', p.span(p.code.span('llhttp__on_url')));
+ }
+ }
+
+ public build(): IURLResult {
+ const p = this.llparse;
+
+ const entry = {
+ connect: this.node('entry_connect'),
+ normal: this.node('entry_normal'),
+ };
+
+ const start = this.node('start');
+ const path = this.node('path');
+ const queryOrFragment = this.node('query_or_fragment');
+ const schema = this.node('schema');
+ const schemaDelim = this.node('schema_delim');
+ const server = this.node('server');
+ const queryStart = this.node('query_start');
+ const query = this.node('query');
+ const fragment = this.node('fragment');
+ const serverWithAt = this.node('server_with_at');
+
+ entry.normal
+ .otherwise(this.spanStart('url', start));
+
+ entry.connect
+ .otherwise(this.spanStart('url', this.spanStart('host', server)));
+
+ start
+ .peek([ '/', '*' ], this.spanStart('path').skipTo(path))
+ .peek(ALPHA, this.spanStart('schema', schema))
+ .otherwise(p.error(ERROR.INVALID_URL, 'Unexpected start char in url'));
+
+ schema
+ .match(ALPHA, schema)
+ .peek(':', this.spanEnd('schema').skipTo(schemaDelim))
+ .otherwise(p.error(ERROR.INVALID_URL, 'Unexpected char in url schema'));
+
+ schemaDelim
+ .match('//', this.spanStart('host', server))
+ .otherwise(p.error(ERROR.INVALID_URL, 'Unexpected char in url schema'));
+
+ for (const node of [server, serverWithAt]) {
+ node
+ .peek('/', this.spanEnd('host', this.spanStart('path').skipTo(path)))
+ .match('?', this.spanEnd('host', this.spanStart('query', query)))
+ .match(USERINFO_CHARS, server)
+ .match([ '[', ']' ], server)
+ .otherwise(p.error(ERROR.INVALID_URL, 'Unexpected char in url server'));
+
+ if (node !== serverWithAt) {
+ node.match('@', serverWithAt);
+ }
+ }
+
+ serverWithAt
+ .match('@', p.error(ERROR.INVALID_URL, 'Double @ in url'));
+
+ path
+ .match(this.URL_CHAR, path)
+ .otherwise(this.spanEnd('path', queryOrFragment));
+
+ // Performance optimization, split `path` so that the fast case remains
+ // there
+ queryOrFragment
+ .match('?', this.spanStart('query', query))
+ .match('#', this.spanStart('fragment', fragment))
+ .otherwise(p.error(ERROR.INVALID_URL, 'Invalid char in url path'));
+
+ query
+ .match(this.URL_CHAR, query)
+ // Allow extra '?' in query string
+ .match('?', query)
+ .peek('#', this.spanEnd('query')
+ .skipTo(this.spanStart('fragment', fragment)))
+ .otherwise(p.error(ERROR.INVALID_URL, 'Invalid char in url query'));
+
+ fragment
+ .match(this.URL_CHAR, fragment)
+ .match([ '?', '#' ], fragment)
+ .otherwise(
+ p.error(ERROR.INVALID_URL, 'Invalid char in url fragment start'));
+
+ for (const node of [ start, schema, schemaDelim ]) {
+ /* No whitespace allowed here */
+ node.match([ ' ', '\r', '\n' ], this.errorInvalid);
+ }
+
+ // Adaptors
+ const toHTTP = this.node('to_http');
+ const toHTTP09 = this.node('to_http_09');
+
+ const skipToHTTP = this.node('skip_to_http')
+ .skipTo(toHTTP);
+
+ const skipToHTTP09 = this.node('skip_to_http09')
+ .skipTo(toHTTP09);
+
+ const skipCRLF = this.node('skip_lf_to_http09')
+ .match('\r\n', toHTTP09)
+ .otherwise(p.error(ERROR.INVALID_URL, 'Expected CRLF'));
+
+ for (const node of [server, serverWithAt, queryOrFragment, queryStart, query, fragment]) {
+ let spanName: SpanName | undefined;
+
+ if (node === server || node === serverWithAt) {
+ spanName = 'host';
+ } else if (node === queryStart || node === query) {
+ spanName = 'query';
+ } else if (node === fragment) {
+ spanName = 'fragment';
+ }
+
+ const endTo = (target: Node): Node => {
+ let res: Node = this.spanEnd('url', target);
+ if (spanName !== undefined) {
+ res = this.spanEnd(spanName, res);
+ }
+ return res;
+ };
+
+ node.peek(' ', endTo(skipToHTTP));
+
+ node.peek('\r', endTo(skipCRLF));
+ node.peek('\n', endTo(skipToHTTP09));
+ }
+
+ return {
+ entry,
+ exit: {
+ toHTTP,
+ toHTTP09,
+ },
+ };
+ }
+
+ private spanStart(name: SpanName, otherwise?: Node): Node {
+ let res: Node;
+ if (this.spanTable.has(name)) {
+ res = this.spanTable.get(name)!.start();
+ } else {
+ res = this.llparse.node('span_start_stub_' + name);
+ }
+ if (otherwise !== undefined) {
+ res.otherwise(otherwise);
+ }
+ return res;
+ }
+
+ private spanEnd(name: SpanName, otherwise?: Node): Node {
+ let res: Node;
+ if (this.spanTable.has(name)) {
+ res = this.spanTable.get(name)!.end();
+ } else {
+ res = this.llparse.node('span_end_stub_' + name);
+ }
+ if (otherwise !== undefined) {
+ res.otherwise(otherwise);
+ }
+ return res;
+ }
+
+ private node(name: string): Match {
+ const res = this.llparse.node('url_' + name);
+
+ if (this.mode === 'strict') {
+ res.match([ '\t', '\f' ], this.errorStrictInvalid);
+ }
+
+ return res;
+ }
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/llhttp/utils.ts b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/utils.ts
new file mode 100644
index 0000000000..7c01d66374
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/llhttp/utils.ts
@@ -0,0 +1,27 @@
+export interface IEnumMap {
+ [key: string]: number;
+}
+
+export function enumToMap(
+ obj: any,
+ filter?: ReadonlyArray<number>,
+ exceptions?: ReadonlyArray<number>,
+): IEnumMap {
+ const res: IEnumMap = {};
+
+ for (const key of Object.keys(obj)) {
+ const value = obj[key];
+ if (typeof value !== 'number') {
+ continue;
+ }
+ if (filter && !filter.includes(value)) {
+ continue;
+ }
+ if (exceptions && exceptions.includes(value)) {
+ continue;
+ }
+ res[key] = value;
+ }
+
+ return res;
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/native/api.c b/third_party/python/aiohttp/vendor/llhttp/src/native/api.c
new file mode 100644
index 0000000000..4b687a5d99
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/native/api.c
@@ -0,0 +1,462 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "llhttp.h"
+
+#define CALLBACK_MAYBE(PARSER, NAME) \
+ do { \
+ const llhttp_settings_t* settings; \
+ settings = (const llhttp_settings_t*) (PARSER)->settings; \
+ if (settings == NULL || settings->NAME == NULL) { \
+ err = 0; \
+ break; \
+ } \
+ err = settings->NAME((PARSER)); \
+ } while (0)
+
+#define SPAN_CALLBACK_MAYBE(PARSER, NAME, START, LEN) \
+ do { \
+ const llhttp_settings_t* settings; \
+ settings = (const llhttp_settings_t*) (PARSER)->settings; \
+ if (settings == NULL || settings->NAME == NULL) { \
+ err = 0; \
+ break; \
+ } \
+ err = settings->NAME((PARSER), (START), (LEN)); \
+ if (err == -1) { \
+ err = HPE_USER; \
+ llhttp_set_error_reason((PARSER), "Span callback error in " #NAME); \
+ } \
+ } while (0)
+
+void llhttp_init(llhttp_t* parser, llhttp_type_t type,
+ const llhttp_settings_t* settings) {
+ llhttp__internal_init(parser);
+
+ parser->type = type;
+ parser->settings = (void*) settings;
+}
+
+
+#if defined(__wasm__)
+
+extern int wasm_on_message_begin(llhttp_t * p);
+extern int wasm_on_url(llhttp_t* p, const char* at, size_t length);
+extern int wasm_on_status(llhttp_t* p, const char* at, size_t length);
+extern int wasm_on_header_field(llhttp_t* p, const char* at, size_t length);
+extern int wasm_on_header_value(llhttp_t* p, const char* at, size_t length);
+extern int wasm_on_headers_complete(llhttp_t * p, int status_code,
+ uint8_t upgrade, int should_keep_alive);
+extern int wasm_on_body(llhttp_t* p, const char* at, size_t length);
+extern int wasm_on_message_complete(llhttp_t * p);
+
+static int wasm_on_headers_complete_wrap(llhttp_t* p) {
+ return wasm_on_headers_complete(p, p->status_code, p->upgrade,
+ llhttp_should_keep_alive(p));
+}
+
+const llhttp_settings_t wasm_settings = {
+ wasm_on_message_begin,
+ wasm_on_url,
+ wasm_on_status,
+ NULL,
+ NULL,
+ wasm_on_header_field,
+ wasm_on_header_value,
+ NULL,
+ NULL,
+ wasm_on_headers_complete_wrap,
+ wasm_on_body,
+ wasm_on_message_complete,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+};
+
+
+llhttp_t* llhttp_alloc(llhttp_type_t type) {
+ llhttp_t* parser = malloc(sizeof(llhttp_t));
+ llhttp_init(parser, type, &wasm_settings);
+ return parser;
+}
+
+void llhttp_free(llhttp_t* parser) {
+ free(parser);
+}
+
+#endif // defined(__wasm__)
+
+/* Some getters required to get stuff from the parser */
+
+uint8_t llhttp_get_type(llhttp_t* parser) {
+ return parser->type;
+}
+
+uint8_t llhttp_get_http_major(llhttp_t* parser) {
+ return parser->http_major;
+}
+
+uint8_t llhttp_get_http_minor(llhttp_t* parser) {
+ return parser->http_minor;
+}
+
+uint8_t llhttp_get_method(llhttp_t* parser) {
+ return parser->method;
+}
+
+int llhttp_get_status_code(llhttp_t* parser) {
+ return parser->status_code;
+}
+
+uint8_t llhttp_get_upgrade(llhttp_t* parser) {
+ return parser->upgrade;
+}
+
+
+void llhttp_reset(llhttp_t* parser) {
+ llhttp_type_t type = parser->type;
+ const llhttp_settings_t* settings = parser->settings;
+ void* data = parser->data;
+ uint8_t lenient_flags = parser->lenient_flags;
+
+ llhttp__internal_init(parser);
+
+ parser->type = type;
+ parser->settings = (void*) settings;
+ parser->data = data;
+ parser->lenient_flags = lenient_flags;
+}
+
+
+llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len) {
+ return llhttp__internal_execute(parser, data, data + len);
+}
+
+
+void llhttp_settings_init(llhttp_settings_t* settings) {
+ memset(settings, 0, sizeof(*settings));
+}
+
+
+llhttp_errno_t llhttp_finish(llhttp_t* parser) {
+ int err;
+
+ /* We're in an error state. Don't bother doing anything. */
+ if (parser->error != 0) {
+ return 0;
+ }
+
+ switch (parser->finish) {
+ case HTTP_FINISH_SAFE_WITH_CB:
+ CALLBACK_MAYBE(parser, on_message_complete);
+ if (err != HPE_OK) return err;
+
+ /* FALLTHROUGH */
+ case HTTP_FINISH_SAFE:
+ return HPE_OK;
+ case HTTP_FINISH_UNSAFE:
+ parser->reason = "Invalid EOF state";
+ return HPE_INVALID_EOF_STATE;
+ default:
+ abort();
+ }
+}
+
+
+void llhttp_pause(llhttp_t* parser) {
+ if (parser->error != HPE_OK) {
+ return;
+ }
+
+ parser->error = HPE_PAUSED;
+ parser->reason = "Paused";
+}
+
+
+void llhttp_resume(llhttp_t* parser) {
+ if (parser->error != HPE_PAUSED) {
+ return;
+ }
+
+ parser->error = 0;
+}
+
+
+void llhttp_resume_after_upgrade(llhttp_t* parser) {
+ if (parser->error != HPE_PAUSED_UPGRADE) {
+ return;
+ }
+
+ parser->error = 0;
+}
+
+
+llhttp_errno_t llhttp_get_errno(const llhttp_t* parser) {
+ return parser->error;
+}
+
+
+const char* llhttp_get_error_reason(const llhttp_t* parser) {
+ return parser->reason;
+}
+
+
+void llhttp_set_error_reason(llhttp_t* parser, const char* reason) {
+ parser->reason = reason;
+}
+
+
+const char* llhttp_get_error_pos(const llhttp_t* parser) {
+ return parser->error_pos;
+}
+
+
+const char* llhttp_errno_name(llhttp_errno_t err) {
+#define HTTP_ERRNO_GEN(CODE, NAME, _) case HPE_##NAME: return "HPE_" #NAME;
+ switch (err) {
+ HTTP_ERRNO_MAP(HTTP_ERRNO_GEN)
+ default: abort();
+ }
+#undef HTTP_ERRNO_GEN
+}
+
+
+const char* llhttp_method_name(llhttp_method_t method) {
+#define HTTP_METHOD_GEN(NUM, NAME, STRING) case HTTP_##NAME: return #STRING;
+ switch (method) {
+ HTTP_ALL_METHOD_MAP(HTTP_METHOD_GEN)
+ default: abort();
+ }
+#undef HTTP_METHOD_GEN
+}
+
+const char* llhttp_status_name(llhttp_status_t status) {
+#define HTTP_STATUS_GEN(NUM, NAME, STRING) case HTTP_STATUS_##NAME: return #STRING;
+ switch (status) {
+ HTTP_STATUS_MAP(HTTP_STATUS_GEN)
+ default: abort();
+ }
+#undef HTTP_STATUS_GEN
+}
+
+
+void llhttp_set_lenient_headers(llhttp_t* parser, int enabled) {
+ if (enabled) {
+ parser->lenient_flags |= LENIENT_HEADERS;
+ } else {
+ parser->lenient_flags &= ~LENIENT_HEADERS;
+ }
+}
+
+
+void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled) {
+ if (enabled) {
+ parser->lenient_flags |= LENIENT_CHUNKED_LENGTH;
+ } else {
+ parser->lenient_flags &= ~LENIENT_CHUNKED_LENGTH;
+ }
+}
+
+
+void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled) {
+ if (enabled) {
+ parser->lenient_flags |= LENIENT_KEEP_ALIVE;
+ } else {
+ parser->lenient_flags &= ~LENIENT_KEEP_ALIVE;
+ }
+}
+
+void llhttp_set_lenient_transfer_encoding(llhttp_t* parser, int enabled) {
+ if (enabled) {
+ parser->lenient_flags |= LENIENT_TRANSFER_ENCODING;
+ } else {
+ parser->lenient_flags &= ~LENIENT_TRANSFER_ENCODING;
+ }
+}
+
+/* Callbacks */
+
+
+int llhttp__on_message_begin(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_message_begin);
+ return err;
+}
+
+
+int llhttp__on_url(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_url, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_url_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_url_complete);
+ return err;
+}
+
+
+int llhttp__on_status(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_status, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_status_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_status_complete);
+ return err;
+}
+
+
+int llhttp__on_method(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_method, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_method_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_method_complete);
+ return err;
+}
+
+
+int llhttp__on_version(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_version, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_version_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_version_complete);
+ return err;
+}
+
+
+int llhttp__on_header_field(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_header_field, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_header_field_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_header_field_complete);
+ return err;
+}
+
+
+int llhttp__on_header_value(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_header_value, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_header_value_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_header_value_complete);
+ return err;
+}
+
+
+int llhttp__on_headers_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_headers_complete);
+ return err;
+}
+
+
+int llhttp__on_message_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_message_complete);
+ return err;
+}
+
+
+int llhttp__on_body(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_body, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_chunk_header(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_chunk_header);
+ return err;
+}
+
+
+int llhttp__on_chunk_extension_name(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_chunk_extension_name, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_chunk_extension_name_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_chunk_extension_name_complete);
+ return err;
+}
+
+
+int llhttp__on_chunk_extension_value(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ SPAN_CALLBACK_MAYBE(s, on_chunk_extension_value, p, endp - p);
+ return err;
+}
+
+
+int llhttp__on_chunk_extension_value_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_chunk_extension_value_complete);
+ return err;
+}
+
+
+int llhttp__on_chunk_complete(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_chunk_complete);
+ return err;
+}
+
+
+int llhttp__on_reset(llhttp_t* s, const char* p, const char* endp) {
+ int err;
+ CALLBACK_MAYBE(s, on_reset);
+ return err;
+}
+
+
+/* Private */
+
+
+void llhttp__debug(llhttp_t* s, const char* p, const char* endp,
+ const char* msg) {
+ if (p == endp) {
+ fprintf(stderr, "p=%p type=%d flags=%02x next=null debug=%s\n", s, s->type,
+ s->flags, msg);
+ } else {
+ fprintf(stderr, "p=%p type=%d flags=%02x next=%02x debug=%s\n", s,
+ s->type, s->flags, *p, msg);
+ }
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/native/api.h b/third_party/python/aiohttp/vendor/llhttp/src/native/api.h
new file mode 100644
index 0000000000..50a7a2e2a7
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/native/api.h
@@ -0,0 +1,277 @@
+#ifndef INCLUDE_LLHTTP_API_H_
+#define INCLUDE_LLHTTP_API_H_
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <stddef.h>
+
+#if defined(__wasm__)
+#define LLHTTP_EXPORT __attribute__((visibility("default")))
+#else
+#define LLHTTP_EXPORT
+#endif
+
+typedef llhttp__internal_t llhttp_t;
+typedef struct llhttp_settings_s llhttp_settings_t;
+
+typedef int (*llhttp_data_cb)(llhttp_t*, const char *at, size_t length);
+typedef int (*llhttp_cb)(llhttp_t*);
+
+struct llhttp_settings_s {
+ /* Possible return values 0, -1, `HPE_PAUSED` */
+ llhttp_cb on_message_begin;
+
+ /* Possible return values 0, -1, HPE_USER */
+ llhttp_data_cb on_url;
+ llhttp_data_cb on_status;
+ llhttp_data_cb on_method;
+ llhttp_data_cb on_version;
+ llhttp_data_cb on_header_field;
+ llhttp_data_cb on_header_value;
+ llhttp_data_cb on_chunk_extension_name;
+ llhttp_data_cb on_chunk_extension_value;
+
+ /* Possible return values:
+ * 0 - Proceed normally
+ * 1 - Assume that request/response has no body, and proceed to parsing the
+ * next message
+ * 2 - Assume absence of body (as above) and make `llhttp_execute()` return
+ * `HPE_PAUSED_UPGRADE`
+ * -1 - Error
+ * `HPE_PAUSED`
+ */
+ llhttp_cb on_headers_complete;
+
+ /* Possible return values 0, -1, HPE_USER */
+ llhttp_data_cb on_body;
+
+ /* Possible return values 0, -1, `HPE_PAUSED` */
+ llhttp_cb on_message_complete;
+ llhttp_cb on_url_complete;
+ llhttp_cb on_status_complete;
+ llhttp_cb on_method_complete;
+ llhttp_cb on_version_complete;
+ llhttp_cb on_header_field_complete;
+ llhttp_cb on_header_value_complete;
+ llhttp_cb on_chunk_extension_name_complete;
+ llhttp_cb on_chunk_extension_value_complete;
+
+ /* When on_chunk_header is called, the current chunk length is stored
+ * in parser->content_length.
+ * Possible return values 0, -1, `HPE_PAUSED`
+ */
+ llhttp_cb on_chunk_header;
+ llhttp_cb on_chunk_complete;
+ llhttp_cb on_reset;
+};
+
+/* Initialize the parser with specific type and user settings.
+ *
+ * NOTE: lifetime of `settings` has to be at least the same as the lifetime of
+ * the `parser` here. In practice, `settings` has to be either a static
+ * variable or be allocated with `malloc`, `new`, etc.
+ */
+LLHTTP_EXPORT
+void llhttp_init(llhttp_t* parser, llhttp_type_t type,
+ const llhttp_settings_t* settings);
+
+LLHTTP_EXPORT
+llhttp_t* llhttp_alloc(llhttp_type_t type);
+
+LLHTTP_EXPORT
+void llhttp_free(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_type(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_http_major(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_http_minor(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_method(llhttp_t* parser);
+
+LLHTTP_EXPORT
+int llhttp_get_status_code(llhttp_t* parser);
+
+LLHTTP_EXPORT
+uint8_t llhttp_get_upgrade(llhttp_t* parser);
+
+/* Reset an already initialized parser back to the start state, preserving the
+ * existing parser type, callback settings, user data, and lenient flags.
+ */
+LLHTTP_EXPORT
+void llhttp_reset(llhttp_t* parser);
+
+/* Initialize the settings object */
+LLHTTP_EXPORT
+void llhttp_settings_init(llhttp_settings_t* settings);
+
+/* Parse full or partial request/response, invoking user callbacks along the
+ * way.
+ *
+ * If any of `llhttp_data_cb` returns errno not equal to `HPE_OK` - the parsing
+ * interrupts, and such errno is returned from `llhttp_execute()`. If
+ * `HPE_PAUSED` was used as a errno, the execution can be resumed with
+ * `llhttp_resume()` call.
+ *
+ * In a special case of CONNECT/Upgrade request/response `HPE_PAUSED_UPGRADE`
+ * is returned after fully parsing the request/response. If the user wishes to
+ * continue parsing, they need to invoke `llhttp_resume_after_upgrade()`.
+ *
+ * NOTE: if this function ever returns a non-pause type error, it will continue
+ * to return the same error upon each successive call up until `llhttp_init()`
+ * is called.
+ */
+LLHTTP_EXPORT
+llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len);
+
+/* This method should be called when the other side has no further bytes to
+ * send (e.g. shutdown of readable side of the TCP connection.)
+ *
+ * Requests without `Content-Length` and other messages might require treating
+ * all incoming bytes as the part of the body, up to the last byte of the
+ * connection. This method will invoke `on_message_complete()` callback if the
+ * request was terminated safely. Otherwise a error code would be returned.
+ */
+LLHTTP_EXPORT
+llhttp_errno_t llhttp_finish(llhttp_t* parser);
+
+/* Returns `1` if the incoming message is parsed until the last byte, and has
+ * to be completed by calling `llhttp_finish()` on EOF
+ */
+LLHTTP_EXPORT
+int llhttp_message_needs_eof(const llhttp_t* parser);
+
+/* Returns `1` if there might be any other messages following the last that was
+ * successfully parsed.
+ */
+LLHTTP_EXPORT
+int llhttp_should_keep_alive(const llhttp_t* parser);
+
+/* Make further calls of `llhttp_execute()` return `HPE_PAUSED` and set
+ * appropriate error reason.
+ *
+ * Important: do not call this from user callbacks! User callbacks must return
+ * `HPE_PAUSED` if pausing is required.
+ */
+LLHTTP_EXPORT
+void llhttp_pause(llhttp_t* parser);
+
+/* Might be called to resume the execution after the pause in user's callback.
+ * See `llhttp_execute()` above for details.
+ *
+ * Call this only if `llhttp_execute()` returns `HPE_PAUSED`.
+ */
+LLHTTP_EXPORT
+void llhttp_resume(llhttp_t* parser);
+
+/* Might be called to resume the execution after the pause in user's callback.
+ * See `llhttp_execute()` above for details.
+ *
+ * Call this only if `llhttp_execute()` returns `HPE_PAUSED_UPGRADE`
+ */
+LLHTTP_EXPORT
+void llhttp_resume_after_upgrade(llhttp_t* parser);
+
+/* Returns the latest return error */
+LLHTTP_EXPORT
+llhttp_errno_t llhttp_get_errno(const llhttp_t* parser);
+
+/* Returns the verbal explanation of the latest returned error.
+ *
+ * Note: User callback should set error reason when returning the error. See
+ * `llhttp_set_error_reason()` for details.
+ */
+LLHTTP_EXPORT
+const char* llhttp_get_error_reason(const llhttp_t* parser);
+
+/* Assign verbal description to the returned error. Must be called in user
+ * callbacks right before returning the errno.
+ *
+ * Note: `HPE_USER` error code might be useful in user callbacks.
+ */
+LLHTTP_EXPORT
+void llhttp_set_error_reason(llhttp_t* parser, const char* reason);
+
+/* Returns the pointer to the last parsed byte before the returned error. The
+ * pointer is relative to the `data` argument of `llhttp_execute()`.
+ *
+ * Note: this method might be useful for counting the number of parsed bytes.
+ */
+LLHTTP_EXPORT
+const char* llhttp_get_error_pos(const llhttp_t* parser);
+
+/* Returns textual name of error code */
+LLHTTP_EXPORT
+const char* llhttp_errno_name(llhttp_errno_t err);
+
+/* Returns textual name of HTTP method */
+LLHTTP_EXPORT
+const char* llhttp_method_name(llhttp_method_t method);
+
+/* Returns textual name of HTTP status */
+LLHTTP_EXPORT
+const char* llhttp_status_name(llhttp_status_t status);
+
+/* Enables/disables lenient header value parsing (disabled by default).
+ *
+ * Lenient parsing disables header value token checks, extending llhttp's
+ * protocol support to highly non-compliant clients/server. No
+ * `HPE_INVALID_HEADER_TOKEN` will be raised for incorrect header values when
+ * lenient parsing is "on".
+ *
+ * **(USE AT YOUR OWN RISK)**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_headers(llhttp_t* parser, int enabled);
+
+
+/* Enables/disables lenient handling of conflicting `Transfer-Encoding` and
+ * `Content-Length` headers (disabled by default).
+ *
+ * Normally `llhttp` would error when `Transfer-Encoding` is present in
+ * conjunction with `Content-Length`. This error is important to prevent HTTP
+ * request smuggling, but may be less desirable for small number of cases
+ * involving legacy servers.
+ *
+ * **(USE AT YOUR OWN RISK)**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled);
+
+
+/* Enables/disables lenient handling of `Connection: close` and HTTP/1.0
+ * requests responses.
+ *
+ * Normally `llhttp` would error on (in strict mode) or discard (in loose mode)
+ * the HTTP request/response after the request/response with `Connection: close`
+ * and `Content-Length`. This is important to prevent cache poisoning attacks,
+ * but might interact badly with outdated and insecure clients. With this flag
+ * the extra request/response will be parsed normally.
+ *
+ * **(USE AT YOUR OWN RISK)**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled);
+
+/* Enables/disables lenient handling of `Transfer-Encoding` header.
+ *
+ * Normally `llhttp` would error when a `Transfer-Encoding` has `chunked` value
+ * and another value after it (either in a single header or in multiple
+ * headers whose value are internally joined using `, `).
+ * This is mandated by the spec to reliably determine request body size and thus
+ * avoid request smuggling.
+ * With this flag the extra value will be parsed normally.
+ *
+ * **(USE AT YOUR OWN RISK)**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_transfer_encoding(llhttp_t* parser, int enabled);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+#endif /* INCLUDE_LLHTTP_API_H_ */
diff --git a/third_party/python/aiohttp/vendor/llhttp/src/native/http.c b/third_party/python/aiohttp/vendor/llhttp/src/native/http.c
new file mode 100644
index 0000000000..3a66044f5f
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/src/native/http.c
@@ -0,0 +1,150 @@
+#include <stdio.h>
+#ifndef LLHTTP__TEST
+# include "llhttp.h"
+#else
+# define llhttp_t llparse_t
+#endif /* */
+
+int llhttp_message_needs_eof(const llhttp_t* parser);
+int llhttp_should_keep_alive(const llhttp_t* parser);
+
+int llhttp__before_headers_complete(llhttp_t* parser, const char* p,
+ const char* endp) {
+ /* Set this here so that on_headers_complete() callbacks can see it */
+ if ((parser->flags & F_UPGRADE) &&
+ (parser->flags & F_CONNECTION_UPGRADE)) {
+ /* For responses, "Upgrade: foo" and "Connection: upgrade" are
+ * mandatory only when it is a 101 Switching Protocols response,
+ * otherwise it is purely informational, to announce support.
+ */
+ parser->upgrade =
+ (parser->type == HTTP_REQUEST || parser->status_code == 101);
+ } else {
+ parser->upgrade = (parser->method == HTTP_CONNECT);
+ }
+ return 0;
+}
+
+
+/* Return values:
+ * 0 - No body, `restart`, message_complete
+ * 1 - CONNECT request, `restart`, message_complete, and pause
+ * 2 - chunk_size_start
+ * 3 - body_identity
+ * 4 - body_identity_eof
+ * 5 - invalid transfer-encoding for request
+ */
+int llhttp__after_headers_complete(llhttp_t* parser, const char* p,
+ const char* endp) {
+ int hasBody;
+
+ hasBody = parser->flags & F_CHUNKED || parser->content_length > 0;
+ if (parser->upgrade && (parser->method == HTTP_CONNECT ||
+ (parser->flags & F_SKIPBODY) || !hasBody)) {
+ /* Exit, the rest of the message is in a different protocol. */
+ return 1;
+ }
+
+ if (parser->flags & F_SKIPBODY) {
+ return 0;
+ } else if (parser->flags & F_CHUNKED) {
+ /* chunked encoding - ignore Content-Length header, prepare for a chunk */
+ return 2;
+ } else if (parser->flags & F_TRANSFER_ENCODING) {
+ if (parser->type == HTTP_REQUEST &&
+ (parser->lenient_flags & LENIENT_CHUNKED_LENGTH) == 0 &&
+ (parser->lenient_flags & LENIENT_TRANSFER_ENCODING) == 0) {
+ /* RFC 7230 3.3.3 */
+
+ /* If a Transfer-Encoding header field
+ * is present in a request and the chunked transfer coding is not
+ * the final encoding, the message body length cannot be determined
+ * reliably; the server MUST respond with the 400 (Bad Request)
+ * status code and then close the connection.
+ */
+ return 5;
+ } else {
+ /* RFC 7230 3.3.3 */
+
+ /* If a Transfer-Encoding header field is present in a response and
+ * the chunked transfer coding is not the final encoding, the
+ * message body length is determined by reading the connection until
+ * it is closed by the server.
+ */
+ return 4;
+ }
+ } else {
+ if (!(parser->flags & F_CONTENT_LENGTH)) {
+ if (!llhttp_message_needs_eof(parser)) {
+ /* Assume content-length 0 - read the next */
+ return 0;
+ } else {
+ /* Read body until EOF */
+ return 4;
+ }
+ } else if (parser->content_length == 0) {
+ /* Content-Length header given but zero: Content-Length: 0\r\n */
+ return 0;
+ } else {
+ /* Content-Length header given and non-zero */
+ return 3;
+ }
+ }
+}
+
+
+int llhttp__after_message_complete(llhttp_t* parser, const char* p,
+ const char* endp) {
+ int should_keep_alive;
+
+ should_keep_alive = llhttp_should_keep_alive(parser);
+ parser->finish = HTTP_FINISH_SAFE;
+ parser->flags = 0;
+
+ /* NOTE: this is ignored in loose parsing mode */
+ return should_keep_alive;
+}
+
+
+int llhttp_message_needs_eof(const llhttp_t* parser) {
+ if (parser->type == HTTP_REQUEST) {
+ return 0;
+ }
+
+ /* See RFC 2616 section 4.4 */
+ if (parser->status_code / 100 == 1 || /* 1xx e.g. Continue */
+ parser->status_code == 204 || /* No Content */
+ parser->status_code == 304 || /* Not Modified */
+ (parser->flags & F_SKIPBODY)) { /* response to a HEAD request */
+ return 0;
+ }
+
+ /* RFC 7230 3.3.3, see `llhttp__after_headers_complete` */
+ if ((parser->flags & F_TRANSFER_ENCODING) &&
+ (parser->flags & F_CHUNKED) == 0) {
+ return 1;
+ }
+
+ if (parser->flags & (F_CHUNKED | F_CONTENT_LENGTH)) {
+ return 0;
+ }
+
+ return 1;
+}
+
+
+int llhttp_should_keep_alive(const llhttp_t* parser) {
+ if (parser->http_major > 0 && parser->http_minor > 0) {
+ /* HTTP/1.1 */
+ if (parser->flags & F_CONNECTION_CLOSE) {
+ return 0;
+ }
+ } else {
+ /* HTTP/1.0 or earlier */
+ if (!(parser->flags & F_CONNECTION_KEEP_ALIVE)) {
+ return 0;
+ }
+ }
+
+ return !llhttp_message_needs_eof(parser);
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/fixtures/extra.c b/third_party/python/aiohttp/vendor/llhttp/test/fixtures/extra.c
new file mode 100644
index 0000000000..c0efa3731d
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/fixtures/extra.c
@@ -0,0 +1,387 @@
+#include <stdlib.h>
+
+#include "fixture.h"
+
+int llhttp__on_url(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("url", p, endp);
+}
+
+
+int llhttp__on_url_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "url complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_URL_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_url_schema(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("url.schema", p, endp);
+}
+
+
+int llhttp__on_url_host(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("url.host", p, endp);
+}
+
+
+int llhttp__on_url_path(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("url.path", p, endp);
+}
+
+
+int llhttp__on_url_query(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("url.query", p, endp);
+}
+
+
+int llhttp__on_url_fragment(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("url.fragment", p, endp);
+}
+
+
+#ifdef LLHTTP__TEST_HTTP
+
+void llhttp__test_init_request(llparse_t* s) {
+ s->type = HTTP_REQUEST;
+}
+
+
+void llhttp__test_init_response(llparse_t* s) {
+ s->type = HTTP_RESPONSE;
+}
+
+
+void llhttp__test_init_request_lenient_headers(llparse_t* s) {
+ llhttp__test_init_request(s);
+ s->lenient_flags |= LENIENT_HEADERS;
+}
+
+
+void llhttp__test_init_request_lenient_chunked_length(llparse_t* s) {
+ llhttp__test_init_request(s);
+ s->lenient_flags |= LENIENT_CHUNKED_LENGTH;
+}
+
+
+void llhttp__test_init_request_lenient_keep_alive(llparse_t* s) {
+ llhttp__test_init_request(s);
+ s->lenient_flags |= LENIENT_KEEP_ALIVE;
+}
+
+void llhttp__test_init_request_lenient_transfer_encoding(llparse_t* s) {
+ llhttp__test_init_request(s);
+ s->lenient_flags |= LENIENT_TRANSFER_ENCODING;
+}
+
+
+void llhttp__test_init_request_lenient_version(llparse_t* s) {
+ llhttp__test_init_request(s);
+ s->lenient_flags |= LENIENT_VERSION;
+}
+
+
+void llhttp__test_init_response_lenient_keep_alive(llparse_t* s) {
+ llhttp__test_init_response(s);
+ s->lenient_flags |= LENIENT_KEEP_ALIVE;
+}
+
+void llhttp__test_init_response_lenient_version(llparse_t* s) {
+ llhttp__test_init_response(s);
+ s->lenient_flags |= LENIENT_VERSION;
+}
+
+
+void llhttp__test_init_response_lenient_headers(llparse_t* s) {
+ llhttp__test_init_response(s);
+ s->lenient_flags |= LENIENT_HEADERS;
+}
+
+
+void llhttp__test_finish(llparse_t* s) {
+ llparse__print(NULL, NULL, "finish=%d", s->finish);
+}
+
+
+int llhttp__on_message_begin(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "message begin");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_MESSAGE_BEGIN
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_message_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "message complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_MESSAGE_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_status(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("status", p, endp);
+}
+
+
+int llhttp__on_status_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "status complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_STATUS_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_method(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench || s->type != HTTP_REQUEST)
+ return 0;
+
+ return llparse__print_span("method", p, endp);
+}
+
+
+int llhttp__on_method_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "method complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_METHOD_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_version(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("version", p, endp);
+}
+
+
+int llhttp__on_version_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "version complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_VERSION_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+int llhttp__on_header_field(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("header_field", p, endp);
+}
+
+
+int llhttp__on_header_field_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "header_field complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_HEADER_FIELD_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_header_value(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("header_value", p, endp);
+}
+
+
+int llhttp__on_header_value_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "header_value complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_HEADER_VALUE_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_headers_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ if (s->type == HTTP_REQUEST) {
+ llparse__print(p, endp,
+ "headers complete method=%d v=%d/%d flags=%x content_length=%llu",
+ s->method, s->http_major, s->http_minor, s->flags, s->content_length);
+ } else if (s->type == HTTP_RESPONSE) {
+ llparse__print(p, endp,
+ "headers complete status=%d v=%d/%d flags=%x content_length=%llu",
+ s->status_code, s->http_major, s->http_minor, s->flags,
+ s->content_length);
+ } else {
+ llparse__print(p, endp, "invalid headers complete");
+ }
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_HEADERS_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #elif defined(LLHTTP__TEST_SKIP_BODY)
+ llparse__print(p, endp, "skip body");
+ return 1;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_body(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("body", p, endp);
+}
+
+
+int llhttp__on_chunk_header(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "chunk header len=%d", (int) s->content_length);
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_CHUNK_HEADER
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_chunk_extension_name(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("chunk_extension_name", p, endp);
+}
+
+
+int llhttp__on_chunk_extension_name_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "chunk_extension_name complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_CHUNK_EXTENSION_NAME
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_chunk_extension_value(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ return llparse__print_span("chunk_extension_value", p, endp);
+}
+
+
+int llhttp__on_chunk_extension_value_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "chunk_extension_value complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_CHUNK_EXTENSION_VALUE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+
+int llhttp__on_chunk_complete(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "chunk complete");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_CHUNK_COMPLETE
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+int llhttp__on_reset(llparse_t* s, const char* p, const char* endp) {
+ if (llparse__in_bench)
+ return 0;
+
+ llparse__print(p, endp, "reset");
+
+ #ifdef LLHTTP__TEST_PAUSE_ON_RESET
+ return LLPARSE__ERROR_PAUSE;
+ #else
+ return 0;
+ #endif
+}
+
+#endif /* LLHTTP__TEST_HTTP */
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/fixtures/index.ts b/third_party/python/aiohttp/vendor/llhttp/test/fixtures/index.ts
new file mode 100644
index 0000000000..a3cb1f6fcb
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/fixtures/index.ts
@@ -0,0 +1,88 @@
+import * as fs from 'fs';
+import { ICompilerResult, LLParse } from 'llparse';
+import { Dot } from 'llparse-dot';
+import {
+ Fixture, FixtureResult, IFixtureBuildOptions,
+} from 'llparse-test-fixture';
+import * as path from 'path';
+
+import * as llhttp from '../../src/llhttp';
+
+export type TestType = 'request' | 'response' | 'request-lenient-headers' |
+ 'request-lenient-chunked-length' | 'request-lenient-transfer-encoding' |
+ 'request-lenient-keep-alive' | 'response-lenient-keep-alive' |
+ 'response-lenient-headers' | 'request-lenient-version' | 'response-lenient-version' |
+ 'request-finish' | 'response-finish' |
+ 'none' | 'url';
+
+export { FixtureResult };
+
+const BUILD_DIR = path.join(__dirname, '..', 'tmp');
+const CHEADERS_FILE = path.join(BUILD_DIR, 'cheaders.h');
+
+const cheaders = new llhttp.CHeaders().build();
+try {
+ fs.mkdirSync(BUILD_DIR);
+} catch (e) {
+ // no-op
+}
+fs.writeFileSync(CHEADERS_FILE, cheaders);
+
+const fixtures = new Fixture({
+ buildDir: path.join(__dirname, '..', 'tmp'),
+ extra: [
+ '-msse4.2',
+ '-DLLHTTP__TEST',
+ '-DLLPARSE__ERROR_PAUSE=' + llhttp.constants.ERROR.PAUSED,
+ '-include', CHEADERS_FILE,
+ path.join(__dirname, 'extra.c'),
+ ],
+ maxParallel: process.env.LLPARSE_DEBUG ? 1 : undefined,
+});
+
+const cache: Map<any, ICompilerResult> = new Map();
+
+export async function build(
+ llparse: LLParse, node: any, outFile: string,
+ options: IFixtureBuildOptions = {},
+ ty: TestType = 'none'): Promise<FixtureResult> {
+ const dot = new Dot();
+ fs.writeFileSync(path.join(BUILD_DIR, outFile + '.dot'),
+ dot.build(node));
+
+ let artifacts: ICompilerResult;
+ if (cache.has(node)) {
+ artifacts = cache.get(node)!;
+ } else {
+ artifacts = llparse.build(node, {
+ c: { header: outFile },
+ debug: process.env.LLPARSE_DEBUG ? 'llparse__debug' : undefined,
+ });
+ cache.set(node, artifacts);
+ }
+
+ const extra = options.extra === undefined ? [] : options.extra.slice();
+ if (ty === 'request' || ty === 'response' ||
+ ty === 'request-lenient-headers' ||
+ ty === 'request-lenient-chunked-length' ||
+ ty === 'request-lenient-transfer-encoding' ||
+ ty === 'request-lenient-keep-alive' ||
+ ty === 'request-lenient-version' ||
+ ty === 'response-lenient-headers' ||
+ ty === 'response-lenient-keep-alive' ||
+ ty === 'response-lenient-version') {
+ extra.push(
+ `-DLLPARSE__TEST_INIT=llhttp__test_init_${ty.replace(/-/g, '_')}`);
+ } else if (ty === 'request-finish' || ty === 'response-finish') {
+ if (ty === 'request-finish') {
+ extra.push('-DLLPARSE__TEST_INIT=llhttp__test_init_request');
+ } else {
+ extra.push('-DLLPARSE__TEST_INIT=llhttp__test_init_response');
+ }
+ extra.push('-DLLPARSE__TEST_FINISH=llhttp__test_finish');
+ }
+
+ return await fixtures.build(artifacts, outFile, Object.assign(options, {
+ extra,
+ }));
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/fuzzers/fuzz_parser.c b/third_party/python/aiohttp/vendor/llhttp/test/fuzzers/fuzz_parser.c
new file mode 100644
index 0000000000..60d00ae45f
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/fuzzers/fuzz_parser.c
@@ -0,0 +1,45 @@
+#include "llhttp.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+int handle_on_message_complete(llhttp_t *arg) { return 0; }
+
+int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ llhttp_t parser;
+ llhttp_settings_t settings;
+ llhttp_type_t http_type;
+
+ /* We need four bytes to determine variable parameters */
+ if (size < 4) {
+ return 0;
+ }
+
+ int headers = (data[0] & 0x01) == 1;
+ int chunked_length = (data[1] & 0x01) == 1;
+ int keep_alive = (data[2] & 0x01) == 1;
+ if (data[0] % 3 == 0) {
+ http_type = HTTP_BOTH;
+ } else if (data[0] % 3 == 1) {
+ http_type = HTTP_REQUEST;
+ } else {
+ http_type = HTTP_RESPONSE;
+ }
+ data += 4;
+ size -= 4;
+
+ /* Initialize user callbacks and settings */
+ llhttp_settings_init(&settings);
+
+ /* Set user callback */
+ settings.on_message_complete = handle_on_message_complete;
+
+ llhttp_init(&parser, http_type, &settings);
+ llhttp_set_lenient_headers(&parser, headers);
+ llhttp_set_lenient_chunked_length(&parser, chunked_length);
+ llhttp_set_lenient_keep_alive(&parser, keep_alive);
+
+ llhttp_execute(&parser, data, size);
+
+ return 0;
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/md-test.ts b/third_party/python/aiohttp/vendor/llhttp/test/md-test.ts
new file mode 100644
index 0000000000..5588181219
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/md-test.ts
@@ -0,0 +1,322 @@
+import * as assert from 'assert';
+import * as fs from 'fs';
+import { LLParse } from 'llparse';
+import { Group, MDGator, Metadata, Test } from 'mdgator';
+import * as path from 'path';
+import * as vm from 'vm';
+
+import * as llhttp from '../src/llhttp';
+import {IHTTPResult} from '../src/llhttp/http';
+import {IURLResult} from '../src/llhttp/url';
+import { build, FixtureResult, TestType } from './fixtures';
+
+//
+// Cache nodes/llparse instances ahead of time
+// (different types of tests will re-use them)
+//
+
+interface INodeCacheEntry {
+ llparse: LLParse;
+ entry: IHTTPResult['entry'];
+}
+
+interface IUrlCacheEntry {
+ llparse: LLParse;
+ entry: IURLResult['entry']['normal'];
+}
+
+const nodeCache = new Map<llhttp.HTTPMode, INodeCacheEntry>();
+const urlCache = new Map<llhttp.HTTPMode, IUrlCacheEntry>();
+const modeCache = new Map<string, FixtureResult>();
+
+function buildNode(mode: llhttp.HTTPMode) {
+ let entry = nodeCache.get(mode);
+
+ if (entry) {
+ return entry;
+ }
+
+ const p = new LLParse();
+ const instance = new llhttp.HTTP(p, mode);
+
+ entry = { llparse: p, entry: instance.build().entry };
+ nodeCache.set(mode, entry);
+ return entry;
+}
+
+function buildURL(mode: llhttp.HTTPMode) {
+ let entry = urlCache.get(mode);
+
+ if (entry) {
+ return entry;
+ }
+
+ const p = new LLParse();
+ const instance = new llhttp.URL(p, mode, true);
+
+ const node = instance.build();
+
+ // Loop
+ node.exit.toHTTP.otherwise(node.entry.normal);
+ node.exit.toHTTP09.otherwise(node.entry.normal);
+
+ entry = { llparse: p, entry: node.entry.normal };
+ urlCache.set(mode, entry);
+ return entry;
+}
+
+//
+// Build binaries using cached nodes/llparse
+//
+
+async function buildMode(mode: llhttp.HTTPMode, ty: TestType, meta: any)
+ : Promise<FixtureResult> {
+
+ const cacheKey = `${mode}:${ty}:${JSON.stringify(meta || {})}`;
+ let entry = modeCache.get(cacheKey);
+
+ if (entry) {
+ return entry;
+ }
+
+ let node;
+ let prefix: string;
+ let extra: string[];
+ if (ty === 'url') {
+ node = buildURL(mode);
+ prefix = 'url';
+ extra = [];
+ } else {
+ node = buildNode(mode);
+ prefix = 'http';
+ extra = [
+ '-DLLHTTP__TEST_HTTP',
+ path.join(__dirname, '..', 'src', 'native', 'http.c'),
+ ];
+ }
+
+ if (meta.pause) {
+ extra.push(`-DLLHTTP__TEST_PAUSE_${meta.pause.toUpperCase()}=1`);
+ }
+
+ if (meta.skipBody) {
+ extra.push('-DLLHTTP__TEST_SKIP_BODY=1');
+ }
+
+ entry = await build(node.llparse, node.entry, `${prefix}-${mode}-${ty}`, {
+ extra,
+ }, ty);
+
+ modeCache.set(cacheKey, entry);
+ return entry;
+}
+
+interface IFixtureMap {
+ [key: string]: { [key: string]: Promise<FixtureResult> };
+}
+
+//
+// Run test suite
+//
+
+function run(name: string): void {
+ const md = new MDGator();
+
+ const raw = fs.readFileSync(path.join(__dirname, name + '.md')).toString();
+ const groups = md.parse(raw);
+
+ function runSingleTest(mode: llhttp.HTTPMode, ty: TestType, meta: any,
+ input: string,
+ expected: ReadonlyArray<string | RegExp>): void {
+ it(`should pass in mode="${mode}" and for type="${ty}"`, async () => {
+ const binary = await buildMode(mode, ty, meta);
+ await binary.check(input, expected, {
+ noScan: meta.noScan === true,
+ });
+ });
+ }
+
+ function runTest(test: Test) {
+ describe(test.name + ` at ${name}.md:${test.line + 1}`, () => {
+ let modes: llhttp.HTTPMode[] = [ 'strict', 'loose' ];
+ let types: TestType[] = [ 'none' ];
+
+ const isURL = test.values.has('url');
+ const inputKey = isURL ? 'url' : 'http';
+
+ assert(test.values.has(inputKey),
+ `Missing "${inputKey}" code in md file`);
+ assert.strictEqual(test.values.get(inputKey)!.length, 1,
+ `Expected just one "${inputKey}" input`);
+
+ let meta: Metadata;
+ if (test.meta.has(inputKey)) {
+ meta = test.meta.get(inputKey)![0]!;
+ } else {
+ assert(isURL, 'Missing required http metadata');
+ meta = {};
+ }
+
+ if (isURL) {
+ types = [ 'url' ];
+ } else {
+ assert(meta.hasOwnProperty('type'), 'Missing required `type` metadata');
+ if (meta.type === 'request') {
+ types.push('request');
+ } else if (meta.type === 'response') {
+ types.push('response');
+ } else if (meta.type === 'request-only') {
+ types = [ 'request' ];
+ } else if (meta.type === 'request-lenient-headers') {
+ types = [ 'request-lenient-headers' ];
+ } else if (meta.type === 'request-lenient-chunked-length') {
+ types = [ 'request-lenient-chunked-length' ];
+ } else if (meta.type === 'request-lenient-keep-alive') {
+ types = [ 'request-lenient-keep-alive' ];
+ } else if (meta.type === 'request-lenient-transfer-encoding') {
+ types = [ 'request-lenient-transfer-encoding' ];
+ } else if (meta.type === 'request-lenient-version') {
+ types = [ 'request-lenient-version' ];
+ } else if (meta.type === 'response-lenient-keep-alive') {
+ types = [ 'response-lenient-keep-alive' ];
+ } else if (meta.type === 'response-lenient-headers') {
+ types = [ 'response-lenient-headers' ];
+ } else if (meta.type === 'response-lenient-version') {
+ types = [ 'response-lenient-version' ];
+ } else if (meta.type === 'response-only') {
+ types = [ 'response' ];
+ } else if (meta.type === 'request-finish') {
+ types = [ 'request-finish' ];
+ } else if (meta.type === 'response-finish') {
+ types = [ 'response-finish' ];
+ } else {
+ throw new Error(`Invalid value of \`type\` metadata: "${meta.type}"`);
+ }
+ }
+
+ assert(test.values.has('log'), 'Missing `log` code in md file');
+
+ assert.strictEqual(test.values.get('log')!.length, 1,
+ 'Expected just one output');
+
+ if (meta.mode === 'strict') {
+ modes = [ 'strict' ];
+ } else if (meta.mode === 'loose') {
+ modes = [ 'loose' ];
+ } else {
+ assert(!meta.hasOwnProperty('mode'),
+ `Invalid value of \`mode\` metadata: "${meta.mode}"`);
+ }
+
+ let input: string = test.values.get(inputKey)![0];
+ let expected: string = test.values.get('log')![0];
+
+ // Remove trailing newline
+ input = input.replace(/\n$/, '');
+
+ // Remove escaped newlines
+ input = input.replace(/\\(\r\n|\r|\n)/g, '');
+
+ // Normalize all newlines
+ input = input.replace(/\r\n|\r|\n/g, '\r\n');
+
+ // Replace escaped CRLF, tabs, form-feed
+ input = input.replace(/\\r/g, '\r');
+ input = input.replace(/\\n/g, '\n');
+ input = input.replace(/\\t/g, '\t');
+ input = input.replace(/\\f/g, '\f');
+ input = input.replace(/\\x([0-9a-fA-F]+)/g, (all, hex) => {
+ return String.fromCharCode(parseInt(hex, 16));
+ });
+
+ // Useful in token tests
+ input = input.replace(/\\([0-7]{1,3})/g, (_, digits) => {
+ return String.fromCharCode(parseInt(digits, 8));
+ });
+
+ // Evaluate inline JavaScript
+ input = input.replace(/\$\{(.+?)\}/g, (_, code) => {
+ return vm.runInNewContext(code) + '';
+ });
+
+ // Escape first symbol `\r` or `\n`, `|`, `&` for Windows
+ if (process.platform === 'win32') {
+ const firstByte = Buffer.from(input)[0];
+ if (firstByte === 0x0a || firstByte === 0x0d) {
+ input = '\\' + input;
+ }
+
+ input = input.replace(/\|/g, '^|');
+ input = input.replace(/&/g, '^&');
+ }
+
+ // Replace escaped tabs/form-feed in expected too
+ expected = expected.replace(/\\t/g, '\t');
+ expected = expected.replace(/\\f/g, '\f');
+
+ // Split
+ const expectedLines = expected.split(/\n/g).slice(0, -1);
+
+ const fullExpected = expectedLines.map((line) => {
+ if (line.startsWith('/')) {
+ return new RegExp(line.trim().slice(1, -1));
+ } else {
+ return line;
+ }
+ });
+
+ for (const mode of modes) {
+ for (const ty of types) {
+ if (meta.skip === true || (process.env.ONLY === 'true' && !meta.only)) {
+ continue;
+ }
+
+ runSingleTest(mode, ty, meta, input, fullExpected);
+ }
+ }
+ });
+ }
+
+ function runGroup(group: Group) {
+ describe(group.name + ` at ${name}.md:${group.line + 1}`, function() {
+ this.timeout(60000);
+
+ for (const child of group.children) {
+ runGroup(child);
+ }
+
+ for (const test of group.tests) {
+ runTest(test);
+ }
+ });
+ }
+
+ for (const group of groups) {
+ runGroup(group);
+ }
+}
+
+run('request/sample');
+run('request/lenient-headers');
+run('request/lenient-version');
+run('request/method');
+run('request/uri');
+run('request/connection');
+run('request/content-length');
+run('request/transfer-encoding');
+run('request/invalid');
+run('request/finish');
+run('request/pausing');
+run('request/pipelining');
+
+run('response/sample');
+run('response/connection');
+run('response/content-length');
+run('response/transfer-encoding');
+run('response/invalid');
+run('response/finish');
+run('response/lenient-version');
+run('response/pausing');
+run('response/pipelining');
+
+run('url');
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/connection.md b/third_party/python/aiohttp/vendor/llhttp/test/request/connection.md
new file mode 100644
index 0000000000..3c2551e4fe
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/connection.md
@@ -0,0 +1,732 @@
+Connection header
+=================
+
+## `keep-alive`
+
+### Setting flag
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection: keep-alive
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=10 span[header_value]="keep-alive"
+off=43 header_value complete
+off=45 headers complete method=4 v=1/1 flags=1 content_length=0
+off=45 message complete
+```
+
+### Restarting when keep-alive is explicitly
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection: keep-alive
+
+PUT /url HTTP/1.1
+Connection: keep-alive
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=10 span[header_value]="keep-alive"
+off=43 header_value complete
+off=45 headers complete method=4 v=1/1 flags=1 content_length=0
+off=45 message complete
+off=45 reset
+off=45 message begin
+off=45 len=3 span[method]="PUT"
+off=48 method complete
+off=49 len=4 span[url]="/url"
+off=54 url complete
+off=59 len=3 span[version]="1.1"
+off=62 version complete
+off=64 len=10 span[header_field]="Connection"
+off=75 header_field complete
+off=76 len=10 span[header_value]="keep-alive"
+off=88 header_value complete
+off=90 headers complete method=4 v=1/1 flags=1 content_length=0
+off=90 message complete
+```
+
+### No restart when keep-alive is off (1.0) and parser is in strict mode
+
+<!-- meta={"type": "request", "mode": "strict"} -->
+```http
+PUT /url HTTP/1.0
+
+PUT /url HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.0"
+off=17 version complete
+off=21 headers complete method=4 v=1/0 flags=0 content_length=0
+off=21 message complete
+off=22 error code=5 reason="Data after `Connection: close`"
+```
+
+### Resetting flags when keep-alive is off (1.0) and parser is in lenient mode
+
+Even though we allow restarts in loose mode, the flags should be still set to
+`0` upon restart.
+
+<!-- meta={"type": "request-lenient-keep-alive"} -->
+```http
+PUT /url HTTP/1.0
+Content-Length: 0
+
+PUT /url HTTP/1.1
+Transfer-Encoding: chunked
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.0"
+off=17 version complete
+off=19 len=14 span[header_field]="Content-Length"
+off=34 header_field complete
+off=35 len=1 span[header_value]="0"
+off=38 header_value complete
+off=40 headers complete method=4 v=1/0 flags=20 content_length=0
+off=40 message complete
+off=40 reset
+off=40 message begin
+off=40 len=3 span[method]="PUT"
+off=43 method complete
+off=44 len=4 span[url]="/url"
+off=49 url complete
+off=54 len=3 span[version]="1.1"
+off=57 version complete
+off=59 len=17 span[header_field]="Transfer-Encoding"
+off=77 header_field complete
+off=78 len=7 span[header_value]="chunked"
+off=87 header_value complete
+off=89 headers complete method=4 v=1/1 flags=208 content_length=0
+```
+
+### CRLF between requests, implicit `keep-alive`
+
+<!-- meta={"type": "request"} -->
+```http
+POST / HTTP/1.1
+Host: www.example.com
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 4
+
+q=42
+
+GET / HTTP/1.1
+```
+_Note the trailing CRLF above_
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=15 span[header_value]="www.example.com"
+off=40 header_value complete
+off=40 len=12 span[header_field]="Content-Type"
+off=53 header_field complete
+off=54 len=33 span[header_value]="application/x-www-form-urlencoded"
+off=89 header_value complete
+off=89 len=14 span[header_field]="Content-Length"
+off=104 header_field complete
+off=105 len=1 span[header_value]="4"
+off=108 header_value complete
+off=110 headers complete method=3 v=1/1 flags=20 content_length=4
+off=110 len=4 span[body]="q=42"
+off=114 message complete
+off=118 reset
+off=118 message begin
+off=118 len=3 span[method]="GET"
+off=121 method complete
+off=122 len=1 span[url]="/"
+off=124 url complete
+off=129 len=3 span[version]="1.1"
+off=132 version complete
+```
+
+### Not treating `\r` as `-`
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection: keep\ralive
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=4 span[header_value]="keep"
+off=36 error code=3 reason="Missing expected LF after header value"
+```
+
+## `close`
+
+### Setting flag on `close`
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection: close
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=5 span[header_value]="close"
+off=38 header_value complete
+off=40 headers complete method=4 v=1/1 flags=2 content_length=0
+off=40 message complete
+```
+
+### CRLF between requests, explicit `close` (strict mode)
+
+`close` means closed connection in strict mode.
+
+<!-- meta={"type": "request", "mode": "strict"} -->
+```http
+POST / HTTP/1.1
+Host: www.example.com
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 4
+Connection: close
+
+q=42
+
+GET / HTTP/1.1
+```
+_Note the trailing CRLF above_
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=15 span[header_value]="www.example.com"
+off=40 header_value complete
+off=40 len=12 span[header_field]="Content-Type"
+off=53 header_field complete
+off=54 len=33 span[header_value]="application/x-www-form-urlencoded"
+off=89 header_value complete
+off=89 len=14 span[header_field]="Content-Length"
+off=104 header_field complete
+off=105 len=1 span[header_value]="4"
+off=108 header_value complete
+off=108 len=10 span[header_field]="Connection"
+off=119 header_field complete
+off=120 len=5 span[header_value]="close"
+off=127 header_value complete
+off=129 headers complete method=3 v=1/1 flags=22 content_length=4
+off=129 len=4 span[body]="q=42"
+off=133 message complete
+off=138 error code=5 reason="Data after `Connection: close`"
+```
+
+### CRLF between requests, explicit `close` (lenient mode)
+
+Loose mode is more lenient, and allows further requests.
+
+<!-- meta={"type": "request-lenient-keep-alive"} -->
+```http
+POST / HTTP/1.1
+Host: www.example.com
+Content-Type: application/x-www-form-urlencoded
+Content-Length: 4
+Connection: close
+
+q=42
+
+GET / HTTP/1.1
+```
+_Note the trailing CRLF above_
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=15 span[header_value]="www.example.com"
+off=40 header_value complete
+off=40 len=12 span[header_field]="Content-Type"
+off=53 header_field complete
+off=54 len=33 span[header_value]="application/x-www-form-urlencoded"
+off=89 header_value complete
+off=89 len=14 span[header_field]="Content-Length"
+off=104 header_field complete
+off=105 len=1 span[header_value]="4"
+off=108 header_value complete
+off=108 len=10 span[header_field]="Connection"
+off=119 header_field complete
+off=120 len=5 span[header_value]="close"
+off=127 header_value complete
+off=129 headers complete method=3 v=1/1 flags=22 content_length=4
+off=129 len=4 span[body]="q=42"
+off=133 message complete
+off=137 reset
+off=137 message begin
+off=137 len=3 span[method]="GET"
+off=140 method complete
+off=141 len=1 span[url]="/"
+off=143 url complete
+off=148 len=3 span[version]="1.1"
+off=151 version complete
+```
+
+## Parsing multiple tokens
+
+### Sample
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection: close, token, upgrade, token, keep-alive
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=40 span[header_value]="close, token, upgrade, token, keep-alive"
+off=73 header_value complete
+off=75 headers complete method=4 v=1/1 flags=7 content_length=0
+off=75 message complete
+```
+
+### Multiple tokens with folding
+
+<!-- meta={"type": "request"} -->
+```http
+GET /demo HTTP/1.1
+Host: example.com
+Connection: Something,
+ Upgrade, ,Keep-Alive
+Sec-WebSocket-Key2: 12998 5 Y3 1 .P00
+Sec-WebSocket-Protocol: sample
+Upgrade: WebSocket
+Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5
+Origin: http://example.com
+
+Hot diggity dogg
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=5 span[url]="/demo"
+off=10 url complete
+off=15 len=3 span[version]="1.1"
+off=18 version complete
+off=20 len=4 span[header_field]="Host"
+off=25 header_field complete
+off=26 len=11 span[header_value]="example.com"
+off=39 header_value complete
+off=39 len=10 span[header_field]="Connection"
+off=50 header_field complete
+off=51 len=10 span[header_value]="Something,"
+off=63 len=21 span[header_value]=" Upgrade, ,Keep-Alive"
+off=86 header_value complete
+off=86 len=18 span[header_field]="Sec-WebSocket-Key2"
+off=105 header_field complete
+off=106 len=18 span[header_value]="12998 5 Y3 1 .P00"
+off=126 header_value complete
+off=126 len=22 span[header_field]="Sec-WebSocket-Protocol"
+off=149 header_field complete
+off=150 len=6 span[header_value]="sample"
+off=158 header_value complete
+off=158 len=7 span[header_field]="Upgrade"
+off=166 header_field complete
+off=167 len=9 span[header_value]="WebSocket"
+off=178 header_value complete
+off=178 len=18 span[header_field]="Sec-WebSocket-Key1"
+off=197 header_field complete
+off=198 len=20 span[header_value]="4 @1 46546xW%0l 1 5"
+off=220 header_value complete
+off=220 len=6 span[header_field]="Origin"
+off=227 header_field complete
+off=228 len=18 span[header_value]="http://example.com"
+off=248 header_value complete
+off=250 headers complete method=1 v=1/1 flags=15 content_length=0
+off=250 message complete
+off=250 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### Multiple tokens with folding and LWS
+
+<!-- meta={"type": "request"} -->
+```http
+GET /demo HTTP/1.1
+Connection: keep-alive, upgrade
+Upgrade: WebSocket
+
+Hot diggity dogg
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=5 span[url]="/demo"
+off=10 url complete
+off=15 len=3 span[version]="1.1"
+off=18 version complete
+off=20 len=10 span[header_field]="Connection"
+off=31 header_field complete
+off=32 len=19 span[header_value]="keep-alive, upgrade"
+off=53 header_value complete
+off=53 len=7 span[header_field]="Upgrade"
+off=61 header_field complete
+off=62 len=9 span[header_value]="WebSocket"
+off=73 header_value complete
+off=75 headers complete method=1 v=1/1 flags=15 content_length=0
+off=75 message complete
+off=75 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### Multiple tokens with folding, LWS, and CRLF
+
+<!-- meta={"type": "request"} -->
+```http
+GET /demo HTTP/1.1
+Connection: keep-alive, \r\n upgrade
+Upgrade: WebSocket
+
+Hot diggity dogg
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=5 span[url]="/demo"
+off=10 url complete
+off=15 len=3 span[version]="1.1"
+off=18 version complete
+off=20 len=10 span[header_field]="Connection"
+off=31 header_field complete
+off=32 len=12 span[header_value]="keep-alive, "
+off=46 len=8 span[header_value]=" upgrade"
+off=56 header_value complete
+off=56 len=7 span[header_field]="Upgrade"
+off=64 header_field complete
+off=65 len=9 span[header_value]="WebSocket"
+off=76 header_value complete
+off=78 headers complete method=1 v=1/1 flags=15 content_length=0
+off=78 message complete
+off=78 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### Invalid whitespace token with `Connection` header field
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection : upgrade
+Content-Length: 4
+Upgrade: ws
+
+abcdefgh
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 error code=10 reason="Invalid header field char"
+```
+
+### Invalid whitespace token with `Connection` header field (lenient)
+
+<!-- meta={"type": "request-lenient-headers"} -->
+```http
+PUT /url HTTP/1.1
+Connection : upgrade
+Content-Length: 4
+Upgrade: ws
+
+abcdefgh
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=11 span[header_field]="Connection "
+off=31 header_field complete
+off=32 len=7 span[header_value]="upgrade"
+off=41 header_value complete
+off=41 len=14 span[header_field]="Content-Length"
+off=56 header_field complete
+off=57 len=1 span[header_value]="4"
+off=60 header_value complete
+off=60 len=7 span[header_field]="Upgrade"
+off=68 header_field complete
+off=69 len=2 span[header_value]="ws"
+off=73 header_value complete
+off=75 headers complete method=4 v=1/1 flags=34 content_length=4
+off=75 len=4 span[body]="abcd"
+off=79 message complete
+off=79 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+## `upgrade`
+
+### Setting a flag and pausing
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection: upgrade
+Upgrade: ws
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=7 span[header_value]="upgrade"
+off=40 header_value complete
+off=40 len=7 span[header_field]="Upgrade"
+off=48 header_field complete
+off=49 len=2 span[header_value]="ws"
+off=53 header_value complete
+off=55 headers complete method=4 v=1/1 flags=14 content_length=0
+off=55 message complete
+off=55 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### Emitting part of body and pausing
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection: upgrade
+Content-Length: 4
+Upgrade: ws
+
+abcdefgh
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=7 span[header_value]="upgrade"
+off=40 header_value complete
+off=40 len=14 span[header_field]="Content-Length"
+off=55 header_field complete
+off=56 len=1 span[header_value]="4"
+off=59 header_value complete
+off=59 len=7 span[header_field]="Upgrade"
+off=67 header_field complete
+off=68 len=2 span[header_value]="ws"
+off=72 header_value complete
+off=74 headers complete method=4 v=1/1 flags=34 content_length=4
+off=74 len=4 span[body]="abcd"
+off=78 message complete
+off=78 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### Upgrade GET request
+
+<!-- meta={"type": "request"} -->
+```http
+GET /demo HTTP/1.1
+Host: example.com
+Connection: Upgrade
+Sec-WebSocket-Key2: 12998 5 Y3 1 .P00
+Sec-WebSocket-Protocol: sample
+Upgrade: WebSocket
+Sec-WebSocket-Key1: 4 @1 46546xW%0l 1 5
+Origin: http://example.com
+
+Hot diggity dogg
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=5 span[url]="/demo"
+off=10 url complete
+off=15 len=3 span[version]="1.1"
+off=18 version complete
+off=20 len=4 span[header_field]="Host"
+off=25 header_field complete
+off=26 len=11 span[header_value]="example.com"
+off=39 header_value complete
+off=39 len=10 span[header_field]="Connection"
+off=50 header_field complete
+off=51 len=7 span[header_value]="Upgrade"
+off=60 header_value complete
+off=60 len=18 span[header_field]="Sec-WebSocket-Key2"
+off=79 header_field complete
+off=80 len=18 span[header_value]="12998 5 Y3 1 .P00"
+off=100 header_value complete
+off=100 len=22 span[header_field]="Sec-WebSocket-Protocol"
+off=123 header_field complete
+off=124 len=6 span[header_value]="sample"
+off=132 header_value complete
+off=132 len=7 span[header_field]="Upgrade"
+off=140 header_field complete
+off=141 len=9 span[header_value]="WebSocket"
+off=152 header_value complete
+off=152 len=18 span[header_field]="Sec-WebSocket-Key1"
+off=171 header_field complete
+off=172 len=20 span[header_value]="4 @1 46546xW%0l 1 5"
+off=194 header_value complete
+off=194 len=6 span[header_field]="Origin"
+off=201 header_field complete
+off=202 len=18 span[header_value]="http://example.com"
+off=222 header_value complete
+off=224 headers complete method=1 v=1/1 flags=14 content_length=0
+off=224 message complete
+off=224 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### Upgrade POST request
+
+<!-- meta={"type": "request"} -->
+```http
+POST /demo HTTP/1.1
+Host: example.com
+Connection: Upgrade
+Upgrade: HTTP/2.0
+Content-Length: 15
+
+sweet post body\
+Hot diggity dogg
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=5 span[url]="/demo"
+off=11 url complete
+off=16 len=3 span[version]="1.1"
+off=19 version complete
+off=21 len=4 span[header_field]="Host"
+off=26 header_field complete
+off=27 len=11 span[header_value]="example.com"
+off=40 header_value complete
+off=40 len=10 span[header_field]="Connection"
+off=51 header_field complete
+off=52 len=7 span[header_value]="Upgrade"
+off=61 header_value complete
+off=61 len=7 span[header_field]="Upgrade"
+off=69 header_field complete
+off=70 len=8 span[header_value]="HTTP/2.0"
+off=80 header_value complete
+off=80 len=14 span[header_field]="Content-Length"
+off=95 header_field complete
+off=96 len=2 span[header_value]="15"
+off=100 header_value complete
+off=102 headers complete method=3 v=1/1 flags=34 content_length=15
+off=102 len=15 span[body]="sweet post body"
+off=117 message complete
+off=117 error code=22 reason="Pause on CONNECT/Upgrade"
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/content-length.md b/third_party/python/aiohttp/vendor/llhttp/test/request/content-length.md
new file mode 100644
index 0000000000..c8fa9daad6
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/content-length.md
@@ -0,0 +1,434 @@
+Content-Length header
+=====================
+
+## `Content-Length` with zeroes
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Content-Length: 003
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=14 span[header_field]="Content-Length"
+off=34 header_field complete
+off=35 len=3 span[header_value]="003"
+off=40 header_value complete
+off=42 headers complete method=4 v=1/1 flags=20 content_length=3
+off=42 len=3 span[body]="abc"
+off=45 message complete
+```
+
+## `Content-Length` with follow-up headers
+
+The way the parser works is that special headers (like `Content-Length`) first
+set `header_state` to appropriate value, and then apply custom parsing using
+that value. For `Content-Length`, in particular, the `header_state` is used for
+setting the flag too.
+
+Make sure that `header_state` is reset to `0`, so that the flag won't be
+attempted to set twice (and error).
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Content-Length: 003
+Ohai: world
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=14 span[header_field]="Content-Length"
+off=34 header_field complete
+off=35 len=3 span[header_value]="003"
+off=40 header_value complete
+off=40 len=4 span[header_field]="Ohai"
+off=45 header_field complete
+off=46 len=5 span[header_value]="world"
+off=53 header_value complete
+off=55 headers complete method=4 v=1/1 flags=20 content_length=3
+off=55 len=3 span[body]="abc"
+off=58 message complete
+```
+
+## Error on `Content-Length` overflow
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Content-Length: 1000000000000000000000
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=14 span[header_field]="Content-Length"
+off=34 header_field complete
+off=35 len=21 span[header_value]="100000000000000000000"
+off=56 error code=11 reason="Content-Length overflow"
+```
+
+## Error on duplicate `Content-Length`
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Content-Length: 1
+Content-Length: 2
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=14 span[header_field]="Content-Length"
+off=34 header_field complete
+off=35 len=1 span[header_value]="1"
+off=38 header_value complete
+off=38 len=14 span[header_field]="Content-Length"
+off=53 header_field complete
+off=54 error code=4 reason="Duplicate Content-Length"
+```
+
+## Error on simultaneous `Content-Length` and `Transfer-Encoding: identity`
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Content-Length: 1
+Transfer-Encoding: identity
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=14 span[header_field]="Content-Length"
+off=34 header_field complete
+off=35 len=1 span[header_value]="1"
+off=38 header_value complete
+off=38 len=17 span[header_field]="Transfer-Encoding"
+off=56 header_field complete
+off=57 len=8 span[header_value]="identity"
+off=67 header_value complete
+off=69 error code=4 reason="Content-Length can't be present with Transfer-Encoding"
+```
+
+## Invalid whitespace token with `Content-Length` header field
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Connection: upgrade
+Content-Length : 4
+Upgrade: ws
+
+abcdefgh
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=7 span[header_value]="upgrade"
+off=40 header_value complete
+off=40 len=14 span[header_field]="Content-Length"
+off=55 error code=10 reason="Invalid header field char"
+```
+
+## Invalid whitespace token with `Content-Length` header field (lenient)
+
+<!-- meta={"type": "request-lenient-headers"} -->
+```http
+PUT /url HTTP/1.1
+Connection: upgrade
+Content-Length : 4
+Upgrade: ws
+
+abcdefgh
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=10 span[header_field]="Connection"
+off=30 header_field complete
+off=31 len=7 span[header_value]="upgrade"
+off=40 header_value complete
+off=40 len=15 span[header_field]="Content-Length "
+off=56 header_field complete
+off=57 len=1 span[header_value]="4"
+off=60 header_value complete
+off=60 len=7 span[header_field]="Upgrade"
+off=68 header_field complete
+off=69 len=2 span[header_value]="ws"
+off=73 header_value complete
+off=75 headers complete method=4 v=1/1 flags=34 content_length=4
+off=75 len=4 span[body]="abcd"
+off=79 message complete
+off=79 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+## No error on simultaneous `Content-Length` and `Transfer-Encoding: identity` (lenient)
+
+<!-- meta={"type": "request-lenient-chunked-length"} -->
+```http
+PUT /url HTTP/1.1
+Content-Length: 1
+Transfer-Encoding: chunked
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=14 span[header_field]="Content-Length"
+off=34 header_field complete
+off=35 len=1 span[header_value]="1"
+off=38 header_value complete
+off=38 len=17 span[header_field]="Transfer-Encoding"
+off=56 header_field complete
+off=57 len=7 span[header_value]="chunked"
+off=66 header_value complete
+off=68 headers complete method=4 v=1/1 flags=228 content_length=1
+```
+
+## Funky `Content-Length` with body
+
+<!-- meta={"type": "request"} -->
+```http
+GET /get_funky_content_length_body_hello HTTP/1.0
+conTENT-Length: 5
+
+HELLO
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=36 span[url]="/get_funky_content_length_body_hello"
+off=41 url complete
+off=46 len=3 span[version]="1.0"
+off=49 version complete
+off=51 len=14 span[header_field]="conTENT-Length"
+off=66 header_field complete
+off=67 len=1 span[header_value]="5"
+off=70 header_value complete
+off=72 headers complete method=1 v=1/0 flags=20 content_length=5
+off=72 len=5 span[body]="HELLO"
+off=77 message complete
+```
+
+## Spaces in `Content-Length` (surrounding)
+
+<!-- meta={"type": "request"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 42
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=34 len=3 span[header_value]="42 "
+off=39 header_value complete
+off=41 headers complete method=3 v=1/1 flags=20 content_length=42
+```
+
+### Spaces in `Content-Length` #2
+
+<!-- meta={"type": "request"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 4 2
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=2 span[header_value]="4 "
+off=35 error code=11 reason="Invalid character in Content-Length"
+```
+
+### Spaces in `Content-Length` #3
+
+<!-- meta={"type": "request"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 13 37
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=3 span[header_value]="13 "
+off=36 error code=11 reason="Invalid character in Content-Length"
+```
+
+### Empty `Content-Length`
+
+<!-- meta={"type": "request"} -->
+```http
+POST / HTTP/1.1
+Content-Length:
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=34 error code=11 reason="Empty Content-Length"
+```
+
+## `Content-Length` with CR instead of dash
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+PUT /url HTTP/1.1
+Content\rLength: 003
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=26 error code=10 reason="Invalid header token"
+```
+
+## Content-Length reset when no body is received
+
+<!-- meta={"type": "request", "skipBody": true} -->
+```http
+PUT /url HTTP/1.1
+Content-Length: 123
+
+POST /url HTTP/1.1
+Content-Length: 456
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=14 span[header_field]="Content-Length"
+off=34 header_field complete
+off=35 len=3 span[header_value]="123"
+off=40 header_value complete
+off=42 headers complete method=4 v=1/1 flags=20 content_length=123
+off=42 skip body
+off=42 message complete
+off=42 reset
+off=42 message begin
+off=42 len=4 span[method]="POST"
+off=46 method complete
+off=47 len=4 span[url]="/url"
+off=52 url complete
+off=57 len=3 span[version]="1.1"
+off=60 version complete
+off=62 len=14 span[header_field]="Content-Length"
+off=77 header_field complete
+off=78 len=3 span[header_value]="456"
+off=83 header_value complete
+off=85 headers complete method=3 v=1/1 flags=20 content_length=456
+off=85 skip body
+off=85 message complete
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/finish.md b/third_party/python/aiohttp/vendor/llhttp/test/request/finish.md
new file mode 100644
index 0000000000..710daa5471
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/finish.md
@@ -0,0 +1,69 @@
+Finish
+======
+
+Those tests check the return codes and the behavior of `llhttp_finish()` C API.
+
+## It should be safe to finish after GET request
+
+<!-- meta={"type": "request-finish"} -->
+```http
+GET / HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=18 headers complete method=1 v=1/1 flags=0 content_length=0
+off=18 message complete
+off=NULL finish=0
+```
+
+## It should be unsafe to finish after incomplete PUT request
+
+<!-- meta={"type": "request-finish"} -->
+```http
+PUT / HTTP/1.1
+Content-Length: 100
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=14 span[header_field]="Content-Length"
+off=31 header_field complete
+off=32 len=3 span[header_value]="100"
+off=NULL finish=2
+```
+
+## It should be unsafe to finish inside of the header
+
+<!-- meta={"type": "request-finish"} -->
+```http
+PUT / HTTP/1.1
+Content-Leng
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=12 span[header_field]="Content-Leng"
+off=NULL finish=2
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/invalid.md b/third_party/python/aiohttp/vendor/llhttp/test/request/invalid.md
new file mode 100644
index 0000000000..4bdbeb1b3f
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/invalid.md
@@ -0,0 +1,405 @@
+Invalid requests
+================
+
+### ICE protocol and GET method
+
+<!-- meta={"type": "request"} -->
+```http
+GET /music/sweet/music ICE/1.0
+Host: example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=18 span[url]="/music/sweet/music"
+off=23 url complete
+off=27 error code=8 reason="Expected SOURCE method for ICE/x.x request"
+```
+
+### ICE protocol, but not really
+
+<!-- meta={"type": "request"} -->
+```http
+GET /music/sweet/music IHTTP/1.0
+Host: example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=18 span[url]="/music/sweet/music"
+off=23 url complete
+off=24 error code=8 reason="Expected HTTP/"
+```
+
+### RTSP protocol and PUT method
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /music/sweet/music RTSP/1.0
+Host: example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=18 span[url]="/music/sweet/music"
+off=23 url complete
+off=28 error code=8 reason="Invalid method for RTSP/x.x request"
+```
+
+### HTTP protocol and ANNOUNCE method
+
+<!-- meta={"type": "request"} -->
+```http
+ANNOUNCE /music/sweet/music HTTP/1.0
+Host: example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=8 span[method]="ANNOUNCE"
+off=8 method complete
+off=9 len=18 span[url]="/music/sweet/music"
+off=28 url complete
+off=33 error code=8 reason="Invalid method for HTTP/x.x request"
+```
+
+### Headers separated by CR
+
+<!-- meta={"type": "request"} -->
+```http
+GET / HTTP/1.1
+Foo: 1\rBar: 2
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=3 span[header_field]="Foo"
+off=20 header_field complete
+off=21 len=1 span[header_value]="1"
+off=23 error code=3 reason="Missing expected LF after header value"
+```
+
+### Headers separated by LF
+
+<!-- meta={"type": "request"} -->
+```http
+POST / HTTP/1.1
+Host: localhost:5000
+x:x\nTransfer-Encoding: chunked
+
+1
+A
+0
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=14 span[header_value]="localhost:5000"
+off=39 header_value complete
+off=39 len=1 span[header_field]="x"
+off=41 header_field complete
+off=41 len=1 span[header_value]="x"
+off=42 error code=10 reason="Invalid header value char"
+```
+
+### Empty headers separated by CR
+
+<!-- meta={"type": "request" } -->
+```http
+POST / HTTP/1.1
+Connection: Close
+Host: localhost:5000
+x:\rTransfer-Encoding: chunked
+
+1
+A
+0
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=10 span[header_field]="Connection"
+off=28 header_field complete
+off=29 len=5 span[header_value]="Close"
+off=36 header_value complete
+off=36 len=4 span[header_field]="Host"
+off=41 header_field complete
+off=42 len=14 span[header_value]="localhost:5000"
+off=58 header_value complete
+off=58 len=1 span[header_field]="x"
+off=60 header_field complete
+off=61 error code=2 reason="Expected LF after CR"
+```
+
+### Empty headers separated by LF
+
+<!-- meta={"type": "request"} -->
+```http
+POST / HTTP/1.1
+Host: localhost:5000
+x:\nTransfer-Encoding: chunked
+
+1
+A
+0
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=14 span[header_value]="localhost:5000"
+off=39 header_value complete
+off=39 len=1 span[header_field]="x"
+off=41 header_field complete
+off=42 error code=10 reason="Invalid header value char"
+```
+
+### Invalid header token #1
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+GET / HTTP/1.1
+Fo@: Failure
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=18 error code=10 reason="Invalid header token"
+```
+
+### Invalid header token #2
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+GET / HTTP/1.1
+Foo\01\test: Bar
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=19 error code=10 reason="Invalid header token"
+```
+
+### Invalid method
+
+<!-- meta={"type": "request"} -->
+```http
+MKCOLA / HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=5 span[method]="MKCOL"
+off=5 method complete
+off=5 error code=6 reason="Expected space after method"
+```
+
+### Illegal header field name line folding
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+GET / HTTP/1.1
+name
+ : value
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=20 error code=10 reason="Invalid header token"
+```
+
+### Corrupted Connection header
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+GET / HTTP/1.1
+Host: www.example.com
+Connection\r\033\065\325eep-Alive
+Accept-Encoding: gzip
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=4 span[header_field]="Host"
+off=21 header_field complete
+off=22 len=15 span[header_value]="www.example.com"
+off=39 header_value complete
+off=49 error code=10 reason="Invalid header token"
+```
+
+### Corrupted header name
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+GET / HTTP/1.1
+Host: www.example.com
+X-Some-Header\r\033\065\325eep-Alive
+Accept-Encoding: gzip
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=4 span[header_field]="Host"
+off=21 header_field complete
+off=22 len=15 span[header_value]="www.example.com"
+off=39 header_value complete
+off=52 error code=10 reason="Invalid header token"
+```
+
+### Missing CR between headers
+
+<!-- meta={"type": "request", "noScan": true} -->
+
+```http
+GET / HTTP/1.1
+Host: localhost
+Dummy: x\nContent-Length: 23
+
+GET / HTTP/1.1
+Dummy: GET /admin HTTP/1.1
+Host: localhost
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=4 span[header_field]="Host"
+off=21 header_field complete
+off=22 len=9 span[header_value]="localhost"
+off=33 header_value complete
+off=33 len=5 span[header_field]="Dummy"
+off=39 header_field complete
+off=40 len=1 span[header_value]="x"
+off=41 error code=10 reason="Invalid header value char"
+```
+
+### Invalid HTTP version
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+GET / HTTP/5.6
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="5.6"
+off=14 error code=9 reason="Invalid HTTP version"
+```
+
+## Invalid space after start line
+
+<!-- meta={"type": "request"} -->
+```http
+GET / HTTP/1.1
+ Host: foo
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=17 error code=30 reason="Unexpected space after start line"
+``` \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/lenient-headers.md b/third_party/python/aiohttp/vendor/llhttp/test/request/lenient-headers.md
new file mode 100644
index 0000000000..114d2163c7
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/lenient-headers.md
@@ -0,0 +1,145 @@
+Lenient header value parsing
+============================
+
+Parsing with header value token checks off.
+
+## Header value with lenient
+
+<!-- meta={"type": "request-lenient-headers"} -->
+```http
+GET /url HTTP/1.1
+Header1: \f
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=7 span[header_field]="Header1"
+off=27 header_field complete
+off=28 len=1 span[header_value]="\f"
+off=31 header_value complete
+off=33 headers complete method=1 v=1/1 flags=0 content_length=0
+off=33 message complete
+```
+
+## Second request header value with lenient
+
+<!-- meta={"type": "request-lenient-headers"} -->
+```http
+GET /url HTTP/1.1
+Header1: Okay
+
+
+GET /url HTTP/1.1
+Header1: \f
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=7 span[header_field]="Header1"
+off=27 header_field complete
+off=28 len=4 span[header_value]="Okay"
+off=34 header_value complete
+off=36 headers complete method=1 v=1/1 flags=0 content_length=0
+off=36 message complete
+off=38 reset
+off=38 message begin
+off=38 len=3 span[method]="GET"
+off=41 method complete
+off=42 len=4 span[url]="/url"
+off=47 url complete
+off=52 len=3 span[version]="1.1"
+off=55 version complete
+off=57 len=7 span[header_field]="Header1"
+off=65 header_field complete
+off=66 len=1 span[header_value]="\f"
+off=69 header_value complete
+off=71 headers complete method=1 v=1/1 flags=0 content_length=0
+off=71 message complete
+```
+
+## Header value without lenient
+
+<!-- meta={"type": "request"} -->
+```http
+GET /url HTTP/1.1
+Header1: \f
+
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=7 span[header_field]="Header1"
+off=27 header_field complete
+off=28 len=0 span[header_value]=""
+off=28 error code=10 reason="Invalid header value char"
+```
+
+### Empty headers separated by CR (Lenient)
+
+<!-- meta={"type": "request-lenient-headers"} -->
+```http
+POST / HTTP/1.1
+Connection: Close
+Host: localhost:5000
+x:\rTransfer-Encoding: chunked
+
+1
+A
+0
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=10 span[header_field]="Connection"
+off=28 header_field complete
+off=29 len=5 span[header_value]="Close"
+off=36 header_value complete
+off=36 len=4 span[header_field]="Host"
+off=41 header_field complete
+off=42 len=14 span[header_value]="localhost:5000"
+off=58 header_value complete
+off=58 len=1 span[header_field]="x"
+off=60 header_field complete
+off=61 len=0 span[header_value]=""
+off=61 header_value complete
+off=61 len=17 span[header_field]="Transfer-Encoding"
+off=79 header_field complete
+off=80 len=7 span[header_value]="chunked"
+off=89 header_value complete
+off=91 headers complete method=3 v=1/1 flags=20a content_length=0
+off=94 chunk header len=1
+off=94 len=1 span[body]="A"
+off=97 chunk complete
+off=100 chunk header len=0
+``` \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/lenient-version.md b/third_party/python/aiohttp/vendor/llhttp/test/request/lenient-version.md
new file mode 100644
index 0000000000..dbe360c68a
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/lenient-version.md
@@ -0,0 +1,23 @@
+Lenient HTTP version parsing
+============================
+
+### Invalid HTTP version with lenient
+
+<!-- meta={"type": "request-lenient-version"} -->
+```http
+GET / HTTP/5.6
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="5.6"
+off=14 version complete
+off=18 headers complete method=1 v=5/6 flags=0 content_length=0
+off=18 message complete
+``` \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/method.md b/third_party/python/aiohttp/vendor/llhttp/test/request/method.md
new file mode 100644
index 0000000000..dce262e6ca
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/method.md
@@ -0,0 +1,450 @@
+Methods
+=======
+
+### REPORT request
+
+<!-- meta={"type": "request"} -->
+```http
+REPORT /test HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=6 span[method]="REPORT"
+off=6 method complete
+off=7 len=5 span[url]="/test"
+off=13 url complete
+off=18 len=3 span[version]="1.1"
+off=21 version complete
+off=25 headers complete method=20 v=1/1 flags=0 content_length=0
+off=25 message complete
+```
+
+### CONNECT request
+
+<!-- meta={"type": "request"} -->
+```http
+CONNECT 0-home0.netscape.com:443 HTTP/1.0
+User-agent: Mozilla/1.1N
+Proxy-authorization: basic aGVsbG86d29ybGQ=
+
+some data
+and yet even more data
+```
+
+```log
+off=0 message begin
+off=0 len=7 span[method]="CONNECT"
+off=7 method complete
+off=8 len=24 span[url]="0-home0.netscape.com:443"
+off=33 url complete
+off=38 len=3 span[version]="1.0"
+off=41 version complete
+off=43 len=10 span[header_field]="User-agent"
+off=54 header_field complete
+off=55 len=12 span[header_value]="Mozilla/1.1N"
+off=69 header_value complete
+off=69 len=19 span[header_field]="Proxy-authorization"
+off=89 header_field complete
+off=90 len=22 span[header_value]="basic aGVsbG86d29ybGQ="
+off=114 header_value complete
+off=116 headers complete method=5 v=1/0 flags=0 content_length=0
+off=116 message complete
+off=116 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### CONNECT request with CAPS
+
+<!-- meta={"type": "request"} -->
+```http
+CONNECT HOME0.NETSCAPE.COM:443 HTTP/1.0
+User-agent: Mozilla/1.1N
+Proxy-authorization: basic aGVsbG86d29ybGQ=
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=7 span[method]="CONNECT"
+off=7 method complete
+off=8 len=22 span[url]="HOME0.NETSCAPE.COM:443"
+off=31 url complete
+off=36 len=3 span[version]="1.0"
+off=39 version complete
+off=41 len=10 span[header_field]="User-agent"
+off=52 header_field complete
+off=53 len=12 span[header_value]="Mozilla/1.1N"
+off=67 header_value complete
+off=67 len=19 span[header_field]="Proxy-authorization"
+off=87 header_field complete
+off=88 len=22 span[header_value]="basic aGVsbG86d29ybGQ="
+off=112 header_value complete
+off=114 headers complete method=5 v=1/0 flags=0 content_length=0
+off=114 message complete
+off=114 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### CONNECT with body
+
+<!-- meta={"type": "request"} -->
+```http
+CONNECT foo.bar.com:443 HTTP/1.0
+User-agent: Mozilla/1.1N
+Proxy-authorization: basic aGVsbG86d29ybGQ=
+Content-Length: 10
+
+blarfcicle"
+```
+
+```log
+off=0 message begin
+off=0 len=7 span[method]="CONNECT"
+off=7 method complete
+off=8 len=15 span[url]="foo.bar.com:443"
+off=24 url complete
+off=29 len=3 span[version]="1.0"
+off=32 version complete
+off=34 len=10 span[header_field]="User-agent"
+off=45 header_field complete
+off=46 len=12 span[header_value]="Mozilla/1.1N"
+off=60 header_value complete
+off=60 len=19 span[header_field]="Proxy-authorization"
+off=80 header_field complete
+off=81 len=22 span[header_value]="basic aGVsbG86d29ybGQ="
+off=105 header_value complete
+off=105 len=14 span[header_field]="Content-Length"
+off=120 header_field complete
+off=121 len=2 span[header_value]="10"
+off=125 header_value complete
+off=127 headers complete method=5 v=1/0 flags=20 content_length=10
+off=127 message complete
+off=127 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+### M-SEARCH request
+
+<!-- meta={"type": "request"} -->
+```http
+M-SEARCH * HTTP/1.1
+HOST: 239.255.255.250:1900
+MAN: "ssdp:discover"
+ST: "ssdp:all"
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=8 span[method]="M-SEARCH"
+off=8 method complete
+off=9 len=1 span[url]="*"
+off=11 url complete
+off=16 len=3 span[version]="1.1"
+off=19 version complete
+off=21 len=4 span[header_field]="HOST"
+off=26 header_field complete
+off=27 len=20 span[header_value]="239.255.255.250:1900"
+off=49 header_value complete
+off=49 len=3 span[header_field]="MAN"
+off=53 header_field complete
+off=54 len=15 span[header_value]=""ssdp:discover""
+off=71 header_value complete
+off=71 len=2 span[header_field]="ST"
+off=74 header_field complete
+off=75 len=10 span[header_value]=""ssdp:all""
+off=87 header_value complete
+off=89 headers complete method=24 v=1/1 flags=0 content_length=0
+off=89 message complete
+```
+
+### PATCH request
+
+<!-- meta={"type": "request"} -->
+```http
+PATCH /file.txt HTTP/1.1
+Host: www.example.com
+Content-Type: application/example
+If-Match: "e0023aa4e"
+Content-Length: 10
+
+cccccccccc
+```
+
+```log
+off=0 message begin
+off=0 len=5 span[method]="PATCH"
+off=5 method complete
+off=6 len=9 span[url]="/file.txt"
+off=16 url complete
+off=21 len=3 span[version]="1.1"
+off=24 version complete
+off=26 len=4 span[header_field]="Host"
+off=31 header_field complete
+off=32 len=15 span[header_value]="www.example.com"
+off=49 header_value complete
+off=49 len=12 span[header_field]="Content-Type"
+off=62 header_field complete
+off=63 len=19 span[header_value]="application/example"
+off=84 header_value complete
+off=84 len=8 span[header_field]="If-Match"
+off=93 header_field complete
+off=94 len=11 span[header_value]=""e0023aa4e""
+off=107 header_value complete
+off=107 len=14 span[header_field]="Content-Length"
+off=122 header_field complete
+off=123 len=2 span[header_value]="10"
+off=127 header_value complete
+off=129 headers complete method=28 v=1/1 flags=20 content_length=10
+off=129 len=10 span[body]="cccccccccc"
+off=139 message complete
+```
+
+### PURGE request
+
+<!-- meta={"type": "request"} -->
+```http
+PURGE /file.txt HTTP/1.1
+Host: www.example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=5 span[method]="PURGE"
+off=5 method complete
+off=6 len=9 span[url]="/file.txt"
+off=16 url complete
+off=21 len=3 span[version]="1.1"
+off=24 version complete
+off=26 len=4 span[header_field]="Host"
+off=31 header_field complete
+off=32 len=15 span[header_value]="www.example.com"
+off=49 header_value complete
+off=51 headers complete method=29 v=1/1 flags=0 content_length=0
+off=51 message complete
+```
+
+### SEARCH request
+
+<!-- meta={"type": "request"} -->
+```http
+SEARCH / HTTP/1.1
+Host: www.example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=6 span[method]="SEARCH"
+off=6 method complete
+off=7 len=1 span[url]="/"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=4 span[header_field]="Host"
+off=24 header_field complete
+off=25 len=15 span[header_value]="www.example.com"
+off=42 header_value complete
+off=44 headers complete method=14 v=1/1 flags=0 content_length=0
+off=44 message complete
+```
+
+### LINK request
+
+<!-- meta={"type": "request"} -->
+```http
+LINK /images/my_dog.jpg HTTP/1.1
+Host: example.com
+Link: <http://example.com/profiles/joe>; rel="tag"
+Link: <http://example.com/profiles/sally>; rel="tag"
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="LINK"
+off=4 method complete
+off=5 len=18 span[url]="/images/my_dog.jpg"
+off=24 url complete
+off=29 len=3 span[version]="1.1"
+off=32 version complete
+off=34 len=4 span[header_field]="Host"
+off=39 header_field complete
+off=40 len=11 span[header_value]="example.com"
+off=53 header_value complete
+off=53 len=4 span[header_field]="Link"
+off=58 header_field complete
+off=59 len=44 span[header_value]="<http://example.com/profiles/joe>; rel="tag""
+off=105 header_value complete
+off=105 len=4 span[header_field]="Link"
+off=110 header_field complete
+off=111 len=46 span[header_value]="<http://example.com/profiles/sally>; rel="tag""
+off=159 header_value complete
+off=161 headers complete method=31 v=1/1 flags=0 content_length=0
+off=161 message complete
+```
+
+### LINK request
+
+<!-- meta={"type": "request"} -->
+```http
+UNLINK /images/my_dog.jpg HTTP/1.1
+Host: example.com
+Link: <http://example.com/profiles/sally>; rel="tag"
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=6 span[method]="UNLINK"
+off=6 method complete
+off=7 len=18 span[url]="/images/my_dog.jpg"
+off=26 url complete
+off=31 len=3 span[version]="1.1"
+off=34 version complete
+off=36 len=4 span[header_field]="Host"
+off=41 header_field complete
+off=42 len=11 span[header_value]="example.com"
+off=55 header_value complete
+off=55 len=4 span[header_field]="Link"
+off=60 header_field complete
+off=61 len=46 span[header_value]="<http://example.com/profiles/sally>; rel="tag""
+off=109 header_value complete
+off=111 headers complete method=32 v=1/1 flags=0 content_length=0
+off=111 message complete
+```
+
+### SOURCE request
+
+<!-- meta={"type": "request"} -->
+```http
+SOURCE /music/sweet/music HTTP/1.1
+Host: example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=6 span[method]="SOURCE"
+off=6 method complete
+off=7 len=18 span[url]="/music/sweet/music"
+off=26 url complete
+off=31 len=3 span[version]="1.1"
+off=34 version complete
+off=36 len=4 span[header_field]="Host"
+off=41 header_field complete
+off=42 len=11 span[header_value]="example.com"
+off=55 header_value complete
+off=57 headers complete method=33 v=1/1 flags=0 content_length=0
+off=57 message complete
+```
+
+### SOURCE request with ICE
+
+<!-- meta={"type": "request"} -->
+```http
+SOURCE /music/sweet/music ICE/1.0
+Host: example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=6 span[method]="SOURCE"
+off=6 method complete
+off=7 len=18 span[url]="/music/sweet/music"
+off=26 url complete
+off=30 len=3 span[version]="1.0"
+off=33 version complete
+off=35 len=4 span[header_field]="Host"
+off=40 header_field complete
+off=41 len=11 span[header_value]="example.com"
+off=54 header_value complete
+off=56 headers complete method=33 v=1/0 flags=0 content_length=0
+off=56 message complete
+```
+
+### OPTIONS request with RTSP
+
+NOTE: `OPTIONS` is a valid HTTP metho too.
+
+<!-- meta={"type": "request"} -->
+```http
+OPTIONS /music/sweet/music RTSP/1.0
+Host: example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=7 span[method]="OPTIONS"
+off=7 method complete
+off=8 len=18 span[url]="/music/sweet/music"
+off=27 url complete
+off=32 len=3 span[version]="1.0"
+off=35 version complete
+off=37 len=4 span[header_field]="Host"
+off=42 header_field complete
+off=43 len=11 span[header_value]="example.com"
+off=56 header_value complete
+off=58 headers complete method=6 v=1/0 flags=0 content_length=0
+off=58 message complete
+```
+
+### ANNOUNCE request with RTSP
+
+<!-- meta={"type": "request"} -->
+```http
+ANNOUNCE /music/sweet/music RTSP/1.0
+Host: example.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=8 span[method]="ANNOUNCE"
+off=8 method complete
+off=9 len=18 span[url]="/music/sweet/music"
+off=28 url complete
+off=33 len=3 span[version]="1.0"
+off=36 version complete
+off=38 len=4 span[header_field]="Host"
+off=43 header_field complete
+off=44 len=11 span[header_value]="example.com"
+off=57 header_value complete
+off=59 headers complete method=36 v=1/0 flags=0 content_length=0
+off=59 message complete
+```
+
+### PRI request HTTP2
+
+<!-- meta={"type": "request"} -->
+```http
+PRI * HTTP/1.1
+
+SM
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PRI"
+off=3 method complete
+off=4 len=1 span[url]="*"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=24 error code=23 reason="Pause on PRI/Upgrade"
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/pausing.md b/third_party/python/aiohttp/vendor/llhttp/test/request/pausing.md
new file mode 100644
index 0000000000..8e501e32d4
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/pausing.md
@@ -0,0 +1,381 @@
+Pausing
+=======
+
+### on_message_begin
+
+<!-- meta={"type": "request", "pause": "on_message_begin"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 pause
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete method=3 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_message_complete
+
+<!-- meta={"type": "request", "pause": "on_message_complete"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete method=3 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+off=41 pause
+```
+
+### on_method_complete
+
+<!-- meta={"type": "request", "pause": "on_method_complete"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=4 pause
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete method=3 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_url_complete
+
+<!-- meta={"type": "request", "pause": "on_url_complete"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=7 pause
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete method=3 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_version_complete
+
+<!-- meta={"type": "request", "pause": "on_version_complete"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=15 pause
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete method=3 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_header_field_complete
+
+<!-- meta={"type": "request", "pause": "on_header_field_complete"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=32 pause
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete method=3 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_header_value_complete
+
+<!-- meta={"type": "request", "pause": "on_header_value_complete"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=36 pause
+off=38 headers complete method=3 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_headers_complete
+
+<!-- meta={"type": "request", "pause": "on_headers_complete"} -->
+```http
+POST / HTTP/1.1
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=1 span[url]="/"
+off=7 url complete
+off=12 len=3 span[version]="1.1"
+off=15 version complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete method=3 v=1/1 flags=20 content_length=3
+off=38 pause
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_chunk_header
+
+<!-- meta={"type": "request", "pause": "on_chunk_header"} -->
+```http
+PUT / HTTP/1.1
+Transfer-Encoding: chunked
+
+a
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=17 span[header_field]="Transfer-Encoding"
+off=34 header_field complete
+off=35 len=7 span[header_value]="chunked"
+off=44 header_value complete
+off=46 headers complete method=4 v=1/1 flags=208 content_length=0
+off=49 chunk header len=10
+off=49 pause
+off=49 len=10 span[body]="0123456789"
+off=61 chunk complete
+off=64 chunk header len=0
+off=64 pause
+off=66 chunk complete
+off=66 message complete
+```
+
+### on_chunk_extension_name
+
+<!-- meta={"type": "request", "pause": "on_chunk_extension_name"} -->
+```http
+PUT / HTTP/1.1
+Transfer-Encoding: chunked
+
+a;foo=bar
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=17 span[header_field]="Transfer-Encoding"
+off=34 header_field complete
+off=35 len=7 span[header_value]="chunked"
+off=44 header_value complete
+off=46 headers complete method=4 v=1/1 flags=208 content_length=0
+off=48 len=3 span[chunk_extension_name]="foo"
+off=52 chunk_extension_name complete
+off=52 pause
+off=52 len=3 span[chunk_extension_value]="bar"
+off=56 chunk_extension_value complete
+off=57 chunk header len=10
+off=57 len=10 span[body]="0123456789"
+off=69 chunk complete
+off=72 chunk header len=0
+off=74 chunk complete
+off=74 message complete
+```
+
+### on_chunk_extension_value
+
+<!-- meta={"type": "request", "pause": "on_chunk_extension_value"} -->
+```http
+PUT / HTTP/1.1
+Transfer-Encoding: chunked
+
+a;foo=bar
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=17 span[header_field]="Transfer-Encoding"
+off=34 header_field complete
+off=35 len=7 span[header_value]="chunked"
+off=44 header_value complete
+off=46 headers complete method=4 v=1/1 flags=208 content_length=0
+off=48 len=3 span[chunk_extension_name]="foo"
+off=52 chunk_extension_name complete
+off=52 len=3 span[chunk_extension_value]="bar"
+off=56 chunk_extension_value complete
+off=56 pause
+off=57 chunk header len=10
+off=57 len=10 span[body]="0123456789"
+off=69 chunk complete
+off=72 chunk header len=0
+off=74 chunk complete
+off=74 message complete
+```
+
+
+### on_chunk_complete
+
+<!-- meta={"type": "request", "pause": "on_chunk_complete"} -->
+```http
+PUT / HTTP/1.1
+Transfer-Encoding: chunked
+
+a
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=17 span[header_field]="Transfer-Encoding"
+off=34 header_field complete
+off=35 len=7 span[header_value]="chunked"
+off=44 header_value complete
+off=46 headers complete method=4 v=1/1 flags=208 content_length=0
+off=49 chunk header len=10
+off=49 len=10 span[body]="0123456789"
+off=61 chunk complete
+off=61 pause
+off=64 chunk header len=0
+off=66 chunk complete
+off=66 pause
+off=66 message complete
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/pipelining.md b/third_party/python/aiohttp/vendor/llhttp/test/request/pipelining.md
new file mode 100644
index 0000000000..bdfe6ab149
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/pipelining.md
@@ -0,0 +1,66 @@
+Pipelining
+==========
+
+## Should parse multiple events
+
+<!-- meta={"type": "request"} -->
+```http
+POST /aaa HTTP/1.1
+Content-Length: 3
+
+AAA
+PUT /bbb HTTP/1.1
+Content-Length: 4
+
+BBBB
+PATCH /ccc HTTP/1.1
+Content-Length: 5
+
+CCCC
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=4 span[url]="/aaa"
+off=10 url complete
+off=15 len=3 span[version]="1.1"
+off=18 version complete
+off=20 len=14 span[header_field]="Content-Length"
+off=35 header_field complete
+off=36 len=1 span[header_value]="3"
+off=39 header_value complete
+off=41 headers complete method=3 v=1/1 flags=20 content_length=3
+off=41 len=3 span[body]="AAA"
+off=44 message complete
+off=46 reset
+off=46 message begin
+off=46 len=3 span[method]="PUT"
+off=49 method complete
+off=50 len=4 span[url]="/bbb"
+off=55 url complete
+off=60 len=3 span[version]="1.1"
+off=63 version complete
+off=65 len=14 span[header_field]="Content-Length"
+off=80 header_field complete
+off=81 len=1 span[header_value]="4"
+off=84 header_value complete
+off=86 headers complete method=4 v=1/1 flags=20 content_length=4
+off=86 len=4 span[body]="BBBB"
+off=90 message complete
+off=92 reset
+off=92 message begin
+off=92 len=5 span[method]="PATCH"
+off=97 method complete
+off=98 len=4 span[url]="/ccc"
+off=103 url complete
+off=108 len=3 span[version]="1.1"
+off=111 version complete
+off=113 len=14 span[header_field]="Content-Length"
+off=128 header_field complete
+off=129 len=1 span[header_value]="5"
+off=132 header_value complete
+off=134 headers complete method=28 v=1/1 flags=20 content_length=5
+off=134 len=4 span[body]="CCCC"
+``` \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/sample.md b/third_party/python/aiohttp/vendor/llhttp/test/request/sample.md
new file mode 100644
index 0000000000..32ba30695b
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/sample.md
@@ -0,0 +1,586 @@
+Sample requests
+===============
+
+Lots of sample requests, most ported from [http_parser][0] test suite.
+
+## Simple request
+
+<!-- meta={"type": "request"} -->
+```http
+OPTIONS /url HTTP/1.1
+Header1: Value1
+Header2:\t Value2
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=7 span[method]="OPTIONS"
+off=7 method complete
+off=8 len=4 span[url]="/url"
+off=13 url complete
+off=18 len=3 span[version]="1.1"
+off=21 version complete
+off=23 len=7 span[header_field]="Header1"
+off=31 header_field complete
+off=32 len=6 span[header_value]="Value1"
+off=40 header_value complete
+off=40 len=7 span[header_field]="Header2"
+off=48 header_field complete
+off=50 len=6 span[header_value]="Value2"
+off=58 header_value complete
+off=60 headers complete method=6 v=1/1 flags=0 content_length=0
+off=60 message complete
+```
+
+## Request with method starting with `H`
+
+There's a optimization in `start_req_or_res` that passes execution to
+`start_req` when the first character is not `H` (because response must start
+with `HTTP/`). However, there're still methods like `HEAD` that should get
+to `start_req`. Verify that it still works after optimization.
+
+<!-- meta={"type": "request", "noScan": true } -->
+```http
+HEAD /url HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="HEAD"
+off=4 method complete
+off=5 len=4 span[url]="/url"
+off=10 url complete
+off=15 len=3 span[version]="1.1"
+off=18 version complete
+off=22 headers complete method=2 v=1/1 flags=0 content_length=0
+off=22 message complete
+```
+
+## curl GET
+
+<!-- meta={"type": "request"} -->
+```http
+GET /test HTTP/1.1
+User-Agent: curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1
+Host: 0.0.0.0=5000
+Accept: */*
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=5 span[url]="/test"
+off=10 url complete
+off=15 len=3 span[version]="1.1"
+off=18 version complete
+off=20 len=10 span[header_field]="User-Agent"
+off=31 header_field complete
+off=32 len=85 span[header_value]="curl/7.18.0 (i486-pc-linux-gnu) libcurl/7.18.0 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.1"
+off=119 header_value complete
+off=119 len=4 span[header_field]="Host"
+off=124 header_field complete
+off=125 len=12 span[header_value]="0.0.0.0=5000"
+off=139 header_value complete
+off=139 len=6 span[header_field]="Accept"
+off=146 header_field complete
+off=147 len=3 span[header_value]="*/*"
+off=152 header_value complete
+off=154 headers complete method=1 v=1/1 flags=0 content_length=0
+off=154 message complete
+```
+
+## Firefox GET
+
+<!-- meta={"type": "request"} -->
+```http
+GET /favicon.ico HTTP/1.1
+Host: 0.0.0.0=5000
+User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0
+Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
+Accept-Language: en-us,en;q=0.5
+Accept-Encoding: gzip,deflate
+Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
+Keep-Alive: 300
+Connection: keep-alive
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=12 span[url]="/favicon.ico"
+off=17 url complete
+off=22 len=3 span[version]="1.1"
+off=25 version complete
+off=27 len=4 span[header_field]="Host"
+off=32 header_field complete
+off=33 len=12 span[header_value]="0.0.0.0=5000"
+off=47 header_value complete
+off=47 len=10 span[header_field]="User-Agent"
+off=58 header_field complete
+off=59 len=76 span[header_value]="Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061015 Firefox/3.0"
+off=137 header_value complete
+off=137 len=6 span[header_field]="Accept"
+off=144 header_field complete
+off=145 len=63 span[header_value]="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
+off=210 header_value complete
+off=210 len=15 span[header_field]="Accept-Language"
+off=226 header_field complete
+off=227 len=14 span[header_value]="en-us,en;q=0.5"
+off=243 header_value complete
+off=243 len=15 span[header_field]="Accept-Encoding"
+off=259 header_field complete
+off=260 len=12 span[header_value]="gzip,deflate"
+off=274 header_value complete
+off=274 len=14 span[header_field]="Accept-Charset"
+off=289 header_field complete
+off=290 len=30 span[header_value]="ISO-8859-1,utf-8;q=0.7,*;q=0.7"
+off=322 header_value complete
+off=322 len=10 span[header_field]="Keep-Alive"
+off=333 header_field complete
+off=334 len=3 span[header_value]="300"
+off=339 header_value complete
+off=339 len=10 span[header_field]="Connection"
+off=350 header_field complete
+off=351 len=10 span[header_value]="keep-alive"
+off=363 header_value complete
+off=365 headers complete method=1 v=1/1 flags=1 content_length=0
+off=365 message complete
+```
+
+## DUMBPACK
+
+<!-- meta={"type": "request"} -->
+```http
+GET /dumbpack HTTP/1.1
+aaaaaaaaaaaaa:++++++++++
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=9 span[url]="/dumbpack"
+off=14 url complete
+off=19 len=3 span[version]="1.1"
+off=22 version complete
+off=24 len=13 span[header_field]="aaaaaaaaaaaaa"
+off=38 header_field complete
+off=38 len=10 span[header_value]="++++++++++"
+off=50 header_value complete
+off=52 headers complete method=1 v=1/1 flags=0 content_length=0
+off=52 message complete
+```
+
+## No headers and no body
+
+<!-- meta={"type": "request"} -->
+```http
+GET /get_no_headers_no_body/world HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=29 span[url]="/get_no_headers_no_body/world"
+off=34 url complete
+off=39 len=3 span[version]="1.1"
+off=42 version complete
+off=46 headers complete method=1 v=1/1 flags=0 content_length=0
+off=46 message complete
+```
+
+## One header and no body
+
+<!-- meta={"type": "request"} -->
+```http
+GET /get_one_header_no_body HTTP/1.1
+Accept: */*
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=23 span[url]="/get_one_header_no_body"
+off=28 url complete
+off=33 len=3 span[version]="1.1"
+off=36 version complete
+off=38 len=6 span[header_field]="Accept"
+off=45 header_field complete
+off=46 len=3 span[header_value]="*/*"
+off=51 header_value complete
+off=53 headers complete method=1 v=1/1 flags=0 content_length=0
+off=53 message complete
+```
+
+## Apache bench GET
+
+The server receiving this request SHOULD NOT wait for EOF to know that
+`Content-Length == 0`.
+
+<!-- meta={"type": "request"} -->
+```http
+GET /test HTTP/1.0
+Host: 0.0.0.0:5000
+User-Agent: ApacheBench/2.3
+Accept: */*
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=5 span[url]="/test"
+off=10 url complete
+off=15 len=3 span[version]="1.0"
+off=18 version complete
+off=20 len=4 span[header_field]="Host"
+off=25 header_field complete
+off=26 len=12 span[header_value]="0.0.0.0:5000"
+off=40 header_value complete
+off=40 len=10 span[header_field]="User-Agent"
+off=51 header_field complete
+off=52 len=15 span[header_value]="ApacheBench/2.3"
+off=69 header_value complete
+off=69 len=6 span[header_field]="Accept"
+off=76 header_field complete
+off=77 len=3 span[header_value]="*/*"
+off=82 header_value complete
+off=84 headers complete method=1 v=1/0 flags=0 content_length=0
+off=84 message complete
+```
+
+## Prefix newline
+
+Some clients, especially after a POST in a keep-alive connection,
+will send an extra CRLF before the next request.
+
+<!-- meta={"type": "request"} -->
+```http
+\r\nGET /test HTTP/1.1
+
+
+```
+
+```log
+off=2 message begin
+off=2 len=3 span[method]="GET"
+off=5 method complete
+off=6 len=5 span[url]="/test"
+off=12 url complete
+off=17 len=3 span[version]="1.1"
+off=20 version complete
+off=24 headers complete method=1 v=1/1 flags=0 content_length=0
+off=24 message complete
+```
+
+## No HTTP version
+
+<!-- meta={"type": "request"} -->
+```http
+GET /
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=7 url complete
+off=9 headers complete method=1 v=0/9 flags=0 content_length=0
+off=9 message complete
+```
+
+## Line folding in header value with CRLF
+
+<!-- meta={"type": "request-lenient-headers"} -->
+```http
+GET / HTTP/1.1
+Line1: abc
+\tdef
+ ghi
+\t\tjkl
+ mno
+\t \tqrs
+Line2: \t line2\t
+Line3:
+ line3
+Line4:
+
+Connection:
+ close
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=5 span[header_field]="Line1"
+off=22 header_field complete
+off=25 len=3 span[header_value]="abc"
+off=30 len=4 span[header_value]="\tdef"
+off=36 len=4 span[header_value]=" ghi"
+off=42 len=5 span[header_value]="\t\tjkl"
+off=49 len=6 span[header_value]=" mno "
+off=57 len=6 span[header_value]="\t \tqrs"
+off=65 header_value complete
+off=65 len=5 span[header_field]="Line2"
+off=71 header_field complete
+off=74 len=6 span[header_value]="line2\t"
+off=82 header_value complete
+off=82 len=5 span[header_field]="Line3"
+off=88 header_field complete
+off=91 len=5 span[header_value]="line3"
+off=98 header_value complete
+off=98 len=5 span[header_field]="Line4"
+off=104 header_field complete
+off=110 len=0 span[header_value]=""
+off=110 header_value complete
+off=110 len=10 span[header_field]="Connection"
+off=121 header_field complete
+off=124 len=5 span[header_value]="close"
+off=131 header_value complete
+off=133 headers complete method=1 v=1/1 flags=2 content_length=0
+off=133 message complete
+```
+
+## Line folding in header value with LF
+
+<!-- meta={"type": "request"} -->
+```http
+GET / HTTP/1.1\n\
+Line1: abc\n\
+\tdef\n\
+ ghi\n\
+\t\tjkl\n\
+ mno \n\
+\t \tqrs\n\
+Line2: \t line2\t\n\
+Line3:\n\
+ line3\n\
+Line4: \n\
+ \n\
+Connection:\n\
+ close\n\
+\n
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=15 len=5 span[header_field]="Line1"
+off=21 header_field complete
+off=24 len=3 span[header_value]="abc"
+off=27 error code=10 reason="Invalid header value char"
+```
+
+## Request starting with CRLF
+
+<!-- meta={"type": "request"} -->
+```http
+\r\nGET /url HTTP/1.1
+Header1: Value1
+
+
+```
+
+```log
+off=2 message begin
+off=2 len=3 span[method]="GET"
+off=5 method complete
+off=6 len=4 span[url]="/url"
+off=11 url complete
+off=16 len=3 span[version]="1.1"
+off=19 version complete
+off=21 len=7 span[header_field]="Header1"
+off=29 header_field complete
+off=30 len=6 span[header_value]="Value1"
+off=38 header_value complete
+off=40 headers complete method=1 v=1/1 flags=0 content_length=0
+off=40 message complete
+```
+
+## Extended Characters
+
+See nodejs/test/parallel/test-http-headers-obstext.js
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+GET / HTTP/1.1
+Test: DĆ¼sseldorf
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=4 span[header_field]="Test"
+off=21 header_field complete
+off=22 len=11 span[header_value]="DĆ¼sseldorf"
+off=35 header_value complete
+off=37 headers complete method=1 v=1/1 flags=0 content_length=0
+off=37 message complete
+```
+
+## 255 ASCII in header value
+
+Note: `Buffer.from([ 0xff ]).toString('latin1') === 'Ćæ'`.
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+OPTIONS /url HTTP/1.1
+Header1: Value1
+Header2: \xffValue2
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=7 span[method]="OPTIONS"
+off=7 method complete
+off=8 len=4 span[url]="/url"
+off=13 url complete
+off=18 len=3 span[version]="1.1"
+off=21 version complete
+off=23 len=7 span[header_field]="Header1"
+off=31 header_field complete
+off=32 len=6 span[header_value]="Value1"
+off=40 header_value complete
+off=40 len=7 span[header_field]="Header2"
+off=48 header_field complete
+off=49 len=8 span[header_value]="ĆæValue2"
+off=59 header_value complete
+off=61 headers complete method=6 v=1/1 flags=0 content_length=0
+off=61 message complete
+```
+
+## X-SSL-Nonsense
+
+See nodejs/test/parallel/test-http-headers-obstext.js
+
+<!-- meta={"type": "request"} -->
+```http
+GET / HTTP/1.1
+X-SSL-Nonsense: -----BEGIN CERTIFICATE-----
+\tMIIFbTCCBFWgAwIBAgICH4cwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVUsx
+\tETAPBgNVBAoTCGVTY2llbmNlMRIwEAYDVQQLEwlBdXRob3JpdHkxCzAJBgNVBAMT
+\tAkNBMS0wKwYJKoZIhvcNAQkBFh5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMu
+\tdWswHhcNMDYwNzI3MTQxMzI4WhcNMDcwNzI3MTQxMzI4WjBbMQswCQYDVQQGEwJV
+\tSzERMA8GA1UEChMIZVNjaWVuY2UxEzARBgNVBAsTCk1hbmNoZXN0ZXIxCzAJBgNV
+\tBAcTmrsogriqMWLAk1DMRcwFQYDVQQDEw5taWNoYWVsIHBhcmQYJKoZIhvcNAQEB
+\tBQADggEPADCCAQoCggEBANPEQBgl1IaKdSS1TbhF3hEXSl72G9J+WC/1R64fAcEF
+\tW51rEyFYiIeZGx/BVzwXbeBoNUK41OK65sxGuflMo5gLflbwJtHBRIEKAfVVp3YR
+\tgW7cMA/s/XKgL1GEC7rQw8lIZT8RApukCGqOVHSi/F1SiFlPDxuDfmdiNzL31+sL
+\t0iwHDdNkGjy5pyBSB8Y79dsSJtCW/iaLB0/n8Sj7HgvvZJ7x0fr+RQjYOUUfrePP
+\tu2MSpFyf+9BbC/aXgaZuiCvSR+8Snv3xApQY+fULK/xY8h8Ua51iXoQ5jrgu2SqR
+\twgA7BUi3G8LFzMBl8FRCDYGUDy7M6QaHXx1ZWIPWNKsCAwEAAaOCAiQwggIgMAwG
+\tA1UdEwEB/wQCMAAwEQYJYIZIAYb4QgHTTPAQDAgWgMA4GA1UdDwEB/wQEAwID6DAs
+\tBglghkgBhvhCAQ0EHxYdVUsgZS1TY2llbmNlIFVzZXIgQ2VydGlmaWNhdGUwHQYD
+\tVR0OBBYEFDTt/sf9PeMaZDHkUIldrDYMNTBZMIGaBgNVHSMEgZIwgY+AFAI4qxGj
+\tloCLDdMVKwiljjDastqooXSkcjBwMQswCQYDVQQGEwJVSzERMA8GA1UEChMIZVNj
+\taWVuY2UxEjAQBgNVBAsTCUF1dGhvcml0eTELMAkGA1UEAxMCQ0ExLTArBgkqhkiG
+\t9w0BCQEWHmNhLW9wZXJhdG9yQGdyaWQtc3VwcG9ydC5hYy51a4IBADApBgNVHRIE
+\tIjAggR5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMudWswGQYDVR0gBBIwEDAO
+\tBgwrBgEEAdkvAQEBAQYwPQYJYIZIAYb4QgEEBDAWLmh0dHA6Ly9jYS5ncmlkLXN1
+\tcHBvcnQuYWMudmT4sopwqlBWsvcHViL2NybC9jYWNybC5jcmwwPQYJYIZIAYb4QgEDBDAWLmh0
+\tdHA6Ly9jYS5ncmlkLXN1cHBvcnQuYWMudWsvcHViL2NybC9jYWNybC5jcmwwPwYD
+\tVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NhLmdyaWQt5hYy51ay9wdWIv
+\tY3JsL2NhY3JsLmNybDANBgkqhkiG9w0BAQUFAAOCAQEAS/U4iiooBENGW/Hwmmd3
+\tXCy6Zrt08YjKCzGNjorT98g8uGsqYjSxv/hmi0qlnlHs+k/3Iobc3LjS5AMYr5L8
+\tUO7OSkgFFlLHQyC9JzPfmLCAugvzEbyv4Olnsr8hbxF1MbKZoQxUZtMVu29wjfXk
+\thTeApBv7eaKCWpSp7MCbvgzm74izKhu3vlDk9w6qVrxePfGgpKPqfHiOoGhFnbTK
+\twTC6o2xq5y0qZ03JonF7OJspEd3I5zKY3E+ov7/ZhW6DqT8UFvsAdjvQbXyhV8Eu
+\tYhixw1aKEPzNjNowuIseVogKOLXxWI5vAi5HgXdS0/ES5gDGsABo4fqovUKlgop3
+\tRA==
+\t-----END CERTIFICATE-----
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=1 span[url]="/"
+off=6 url complete
+off=11 len=3 span[version]="1.1"
+off=14 version complete
+off=16 len=14 span[header_field]="X-SSL-Nonsense"
+off=31 header_field complete
+off=34 len=27 span[header_value]="-----BEGIN CERTIFICATE-----"
+off=63 len=65 span[header_value]="\tMIIFbTCCBFWgAwIBAgICH4cwDQYJKoZIhvcNAQEFBQAwcDELMAkGA1UEBhMCVUsx"
+off=130 len=65 span[header_value]="\tETAPBgNVBAoTCGVTY2llbmNlMRIwEAYDVQQLEwlBdXRob3JpdHkxCzAJBgNVBAMT"
+off=197 len=65 span[header_value]="\tAkNBMS0wKwYJKoZIhvcNAQkBFh5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMu"
+off=264 len=65 span[header_value]="\tdWswHhcNMDYwNzI3MTQxMzI4WhcNMDcwNzI3MTQxMzI4WjBbMQswCQYDVQQGEwJV"
+off=331 len=65 span[header_value]="\tSzERMA8GA1UEChMIZVNjaWVuY2UxEzARBgNVBAsTCk1hbmNoZXN0ZXIxCzAJBgNV"
+off=398 len=65 span[header_value]="\tBAcTmrsogriqMWLAk1DMRcwFQYDVQQDEw5taWNoYWVsIHBhcmQYJKoZIhvcNAQEB"
+off=465 len=65 span[header_value]="\tBQADggEPADCCAQoCggEBANPEQBgl1IaKdSS1TbhF3hEXSl72G9J+WC/1R64fAcEF"
+off=532 len=65 span[header_value]="\tW51rEyFYiIeZGx/BVzwXbeBoNUK41OK65sxGuflMo5gLflbwJtHBRIEKAfVVp3YR"
+off=599 len=65 span[header_value]="\tgW7cMA/s/XKgL1GEC7rQw8lIZT8RApukCGqOVHSi/F1SiFlPDxuDfmdiNzL31+sL"
+off=666 len=65 span[header_value]="\t0iwHDdNkGjy5pyBSB8Y79dsSJtCW/iaLB0/n8Sj7HgvvZJ7x0fr+RQjYOUUfrePP"
+off=733 len=65 span[header_value]="\tu2MSpFyf+9BbC/aXgaZuiCvSR+8Snv3xApQY+fULK/xY8h8Ua51iXoQ5jrgu2SqR"
+off=800 len=65 span[header_value]="\twgA7BUi3G8LFzMBl8FRCDYGUDy7M6QaHXx1ZWIPWNKsCAwEAAaOCAiQwggIgMAwG"
+off=867 len=66 span[header_value]="\tA1UdEwEB/wQCMAAwEQYJYIZIAYb4QgHTTPAQDAgWgMA4GA1UdDwEB/wQEAwID6DAs"
+off=935 len=65 span[header_value]="\tBglghkgBhvhCAQ0EHxYdVUsgZS1TY2llbmNlIFVzZXIgQ2VydGlmaWNhdGUwHQYD"
+off=1002 len=65 span[header_value]="\tVR0OBBYEFDTt/sf9PeMaZDHkUIldrDYMNTBZMIGaBgNVHSMEgZIwgY+AFAI4qxGj"
+off=1069 len=65 span[header_value]="\tloCLDdMVKwiljjDastqooXSkcjBwMQswCQYDVQQGEwJVSzERMA8GA1UEChMIZVNj"
+off=1136 len=65 span[header_value]="\taWVuY2UxEjAQBgNVBAsTCUF1dGhvcml0eTELMAkGA1UEAxMCQ0ExLTArBgkqhkiG"
+off=1203 len=65 span[header_value]="\t9w0BCQEWHmNhLW9wZXJhdG9yQGdyaWQtc3VwcG9ydC5hYy51a4IBADApBgNVHRIE"
+off=1270 len=65 span[header_value]="\tIjAggR5jYS1vcGVyYXRvckBncmlkLXN1cHBvcnQuYWMudWswGQYDVR0gBBIwEDAO"
+off=1337 len=65 span[header_value]="\tBgwrBgEEAdkvAQEBAQYwPQYJYIZIAYb4QgEEBDAWLmh0dHA6Ly9jYS5ncmlkLXN1"
+off=1404 len=75 span[header_value]="\tcHBvcnQuYWMudmT4sopwqlBWsvcHViL2NybC9jYWNybC5jcmwwPQYJYIZIAYb4QgEDBDAWLmh0"
+off=1481 len=65 span[header_value]="\tdHA6Ly9jYS5ncmlkLXN1cHBvcnQuYWMudWsvcHViL2NybC9jYWNybC5jcmwwPwYD"
+off=1548 len=55 span[header_value]="\tVR0fBDgwNjA0oDKgMIYuaHR0cDovL2NhLmdyaWQt5hYy51ay9wdWIv"
+off=1605 len=65 span[header_value]="\tY3JsL2NhY3JsLmNybDANBgkqhkiG9w0BAQUFAAOCAQEAS/U4iiooBENGW/Hwmmd3"
+off=1672 len=65 span[header_value]="\tXCy6Zrt08YjKCzGNjorT98g8uGsqYjSxv/hmi0qlnlHs+k/3Iobc3LjS5AMYr5L8"
+off=1739 len=65 span[header_value]="\tUO7OSkgFFlLHQyC9JzPfmLCAugvzEbyv4Olnsr8hbxF1MbKZoQxUZtMVu29wjfXk"
+off=1806 len=65 span[header_value]="\thTeApBv7eaKCWpSp7MCbvgzm74izKhu3vlDk9w6qVrxePfGgpKPqfHiOoGhFnbTK"
+off=1873 len=65 span[header_value]="\twTC6o2xq5y0qZ03JonF7OJspEd3I5zKY3E+ov7/ZhW6DqT8UFvsAdjvQbXyhV8Eu"
+off=1940 len=65 span[header_value]="\tYhixw1aKEPzNjNowuIseVogKOLXxWI5vAi5HgXdS0/ES5gDGsABo4fqovUKlgop3"
+off=2007 len=5 span[header_value]="\tRA=="
+off=2014 len=26 span[header_value]="\t-----END CERTIFICATE-----"
+off=2042 header_value complete
+off=2044 headers complete method=1 v=1/1 flags=0 content_length=0
+off=2044 message complete
+```
+
+[0]: https://github.com/nodejs/http-parser
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/transfer-encoding.md b/third_party/python/aiohttp/vendor/llhttp/test/request/transfer-encoding.md
new file mode 100644
index 0000000000..9fd99742eb
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/transfer-encoding.md
@@ -0,0 +1,885 @@
+Transfer-Encoding header
+========================
+
+## `chunked`
+
+### Parsing and setting flag
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Transfer-Encoding: chunked
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=17 span[header_field]="Transfer-Encoding"
+off=37 header_field complete
+off=38 len=7 span[header_value]="chunked"
+off=47 header_value complete
+off=49 headers complete method=4 v=1/1 flags=208 content_length=0
+```
+
+### Parse chunks with lowercase size
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Transfer-Encoding: chunked
+
+a
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=17 span[header_field]="Transfer-Encoding"
+off=37 header_field complete
+off=38 len=7 span[header_value]="chunked"
+off=47 header_value complete
+off=49 headers complete method=4 v=1/1 flags=208 content_length=0
+off=52 chunk header len=10
+off=52 len=10 span[body]="0123456789"
+off=64 chunk complete
+off=67 chunk header len=0
+off=69 chunk complete
+off=69 message complete
+```
+
+### Parse chunks with uppercase size
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Transfer-Encoding: chunked
+
+A
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=17 span[header_field]="Transfer-Encoding"
+off=37 header_field complete
+off=38 len=7 span[header_value]="chunked"
+off=47 header_value complete
+off=49 headers complete method=4 v=1/1 flags=208 content_length=0
+off=52 chunk header len=10
+off=52 len=10 span[body]="0123456789"
+off=64 chunk complete
+off=67 chunk header len=0
+off=69 chunk complete
+off=69 message complete
+```
+
+### POST with `Transfer-Encoding: chunked`
+
+<!-- meta={"type": "request"} -->
+```http
+POST /post_chunked_all_your_base HTTP/1.1
+Transfer-Encoding: chunked
+
+1e
+all your base are belong to us
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=27 span[url]="/post_chunked_all_your_base"
+off=33 url complete
+off=38 len=3 span[version]="1.1"
+off=41 version complete
+off=43 len=17 span[header_field]="Transfer-Encoding"
+off=61 header_field complete
+off=62 len=7 span[header_value]="chunked"
+off=71 header_value complete
+off=73 headers complete method=3 v=1/1 flags=208 content_length=0
+off=77 chunk header len=30
+off=77 len=30 span[body]="all your base are belong to us"
+off=109 chunk complete
+off=112 chunk header len=0
+off=114 chunk complete
+off=114 message complete
+```
+
+### Two chunks and triple zero prefixed end chunk
+
+<!-- meta={"type": "request"} -->
+```http
+POST /two_chunks_mult_zero_end HTTP/1.1
+Transfer-Encoding: chunked
+
+5
+hello
+6
+ world
+000
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=25 span[url]="/two_chunks_mult_zero_end"
+off=31 url complete
+off=36 len=3 span[version]="1.1"
+off=39 version complete
+off=41 len=17 span[header_field]="Transfer-Encoding"
+off=59 header_field complete
+off=60 len=7 span[header_value]="chunked"
+off=69 header_value complete
+off=71 headers complete method=3 v=1/1 flags=208 content_length=0
+off=74 chunk header len=5
+off=74 len=5 span[body]="hello"
+off=81 chunk complete
+off=84 chunk header len=6
+off=84 len=6 span[body]=" world"
+off=92 chunk complete
+off=97 chunk header len=0
+off=99 chunk complete
+off=99 message complete
+```
+
+### Trailing headers
+
+<!-- meta={"type": "request"} -->
+```http
+POST /chunked_w_trailing_headers HTTP/1.1
+Transfer-Encoding: chunked
+
+5
+hello
+6
+ world
+0
+Vary: *
+Content-Type: text/plain
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=27 span[url]="/chunked_w_trailing_headers"
+off=33 url complete
+off=38 len=3 span[version]="1.1"
+off=41 version complete
+off=43 len=17 span[header_field]="Transfer-Encoding"
+off=61 header_field complete
+off=62 len=7 span[header_value]="chunked"
+off=71 header_value complete
+off=73 headers complete method=3 v=1/1 flags=208 content_length=0
+off=76 chunk header len=5
+off=76 len=5 span[body]="hello"
+off=83 chunk complete
+off=86 chunk header len=6
+off=86 len=6 span[body]=" world"
+off=94 chunk complete
+off=97 chunk header len=0
+off=97 len=4 span[header_field]="Vary"
+off=102 header_field complete
+off=103 len=1 span[header_value]="*"
+off=106 header_value complete
+off=106 len=12 span[header_field]="Content-Type"
+off=119 header_field complete
+off=120 len=10 span[header_value]="text/plain"
+off=132 header_value complete
+off=134 chunk complete
+off=134 message complete
+```
+
+### Chunk extensions
+
+<!-- meta={"type": "request"} -->
+```http
+POST /chunked_w_unicorns_after_length HTTP/1.1
+Transfer-Encoding: chunked
+
+5;ilovew3;somuchlove=aretheseparametersfor
+hello
+6;blahblah;blah
+ world
+0
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=32 span[url]="/chunked_w_unicorns_after_length"
+off=38 url complete
+off=43 len=3 span[version]="1.1"
+off=46 version complete
+off=48 len=17 span[header_field]="Transfer-Encoding"
+off=66 header_field complete
+off=67 len=7 span[header_value]="chunked"
+off=76 header_value complete
+off=78 headers complete method=3 v=1/1 flags=208 content_length=0
+off=80 len=7 span[chunk_extension_name]="ilovew3"
+off=88 chunk_extension_name complete
+off=88 len=10 span[chunk_extension_name]="somuchlove"
+off=99 chunk_extension_name complete
+off=99 len=21 span[chunk_extension_value]="aretheseparametersfor"
+off=121 chunk_extension_value complete
+off=122 chunk header len=5
+off=122 len=5 span[body]="hello"
+off=129 chunk complete
+off=131 len=8 span[chunk_extension_name]="blahblah"
+off=140 chunk_extension_name complete
+off=140 len=4 span[chunk_extension_name]="blah"
+off=145 chunk_extension_name complete
+off=146 chunk header len=6
+off=146 len=6 span[body]=" world"
+off=154 chunk complete
+off=157 chunk header len=0
+```
+
+### No semicolon before chunk extensions
+
+<!-- meta={"type": "request"} -->
+```http
+POST /chunked_w_unicorns_after_length HTTP/1.1
+Host: localhost
+Transfer-encoding: chunked
+
+2 erfrferferf
+aa
+0 rrrr
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=32 span[url]="/chunked_w_unicorns_after_length"
+off=38 url complete
+off=43 len=3 span[version]="1.1"
+off=46 version complete
+off=48 len=4 span[header_field]="Host"
+off=53 header_field complete
+off=54 len=9 span[header_value]="localhost"
+off=65 header_value complete
+off=65 len=17 span[header_field]="Transfer-encoding"
+off=83 header_field complete
+off=84 len=7 span[header_value]="chunked"
+off=93 header_value complete
+off=95 headers complete method=3 v=1/1 flags=208 content_length=0
+off=96 error code=12 reason="Invalid character in chunk size"
+```
+
+### No extension after semicolon
+
+<!-- meta={"type": "request"} -->
+```http
+POST /chunked_w_unicorns_after_length HTTP/1.1
+Host: localhost
+Transfer-encoding: chunked
+
+2;
+aa
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=32 span[url]="/chunked_w_unicorns_after_length"
+off=38 url complete
+off=43 len=3 span[version]="1.1"
+off=46 version complete
+off=48 len=4 span[header_field]="Host"
+off=53 header_field complete
+off=54 len=9 span[header_value]="localhost"
+off=65 header_value complete
+off=65 len=17 span[header_field]="Transfer-encoding"
+off=83 header_field complete
+off=84 len=7 span[header_value]="chunked"
+off=93 header_value complete
+off=95 headers complete method=3 v=1/1 flags=208 content_length=0
+off=98 error code=2 reason="Invalid character in chunk extensions"
+```
+
+
+### Chunk extensions quoting
+
+<!-- meta={"type": "request"} -->
+```http
+POST /chunked_w_unicorns_after_length HTTP/1.1
+Transfer-Encoding: chunked
+
+5;ilovew3="I love; extensions";somuchlove="aretheseparametersfor";blah;foo=bar
+hello
+6;blahblah;blah
+ world
+0
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=32 span[url]="/chunked_w_unicorns_after_length"
+off=38 url complete
+off=43 len=3 span[version]="1.1"
+off=46 version complete
+off=48 len=17 span[header_field]="Transfer-Encoding"
+off=66 header_field complete
+off=67 len=7 span[header_value]="chunked"
+off=76 header_value complete
+off=78 headers complete method=3 v=1/1 flags=208 content_length=0
+off=80 len=7 span[chunk_extension_name]="ilovew3"
+off=88 chunk_extension_name complete
+off=88 len=20 span[chunk_extension_value]=""I love; extensions""
+off=108 chunk_extension_value complete
+off=109 len=10 span[chunk_extension_name]="somuchlove"
+off=120 chunk_extension_name complete
+off=120 len=23 span[chunk_extension_value]=""aretheseparametersfor""
+off=143 chunk_extension_value complete
+off=144 len=4 span[chunk_extension_name]="blah"
+off=149 chunk_extension_name complete
+off=149 len=3 span[chunk_extension_name]="foo"
+off=153 chunk_extension_name complete
+off=153 len=3 span[chunk_extension_value]="bar"
+off=157 chunk_extension_value complete
+off=158 chunk header len=5
+off=158 len=5 span[body]="hello"
+off=165 chunk complete
+off=167 len=8 span[chunk_extension_name]="blahblah"
+off=176 chunk_extension_name complete
+off=176 len=4 span[chunk_extension_name]="blah"
+off=181 chunk_extension_name complete
+off=182 chunk header len=6
+off=182 len=6 span[body]=" world"
+off=190 chunk complete
+off=193 chunk header len=0
+```
+
+
+### Unbalanced chunk extensions quoting
+
+<!-- meta={"type": "request"} -->
+```http
+POST /chunked_w_unicorns_after_length HTTP/1.1
+Transfer-Encoding: chunked
+
+5;ilovew3="abc";somuchlove="def; ghi
+hello
+6;blahblah;blah
+ world
+0
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=32 span[url]="/chunked_w_unicorns_after_length"
+off=38 url complete
+off=43 len=3 span[version]="1.1"
+off=46 version complete
+off=48 len=17 span[header_field]="Transfer-Encoding"
+off=66 header_field complete
+off=67 len=7 span[header_value]="chunked"
+off=76 header_value complete
+off=78 headers complete method=3 v=1/1 flags=208 content_length=0
+off=80 len=7 span[chunk_extension_name]="ilovew3"
+off=88 chunk_extension_name complete
+off=88 len=5 span[chunk_extension_value]=""abc""
+off=93 chunk_extension_value complete
+off=94 len=10 span[chunk_extension_name]="somuchlove"
+off=105 chunk_extension_name complete
+off=105 len=9 span[chunk_extension_value]=""def; ghi"
+off=115 error code=2 reason="Invalid character in chunk extensions quoted value"
+```
+
+## Ignoring `pigeons`
+
+Requests cannot have invalid `Transfer-Encoding`. It is impossible to determine
+their body size. Not erroring would make HTTP smuggling attacks possible.
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+PUT /url HTTP/1.1
+Transfer-Encoding: pigeons
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=17 span[header_field]="Transfer-Encoding"
+off=37 header_field complete
+off=38 len=7 span[header_value]="pigeons"
+off=47 header_value complete
+off=49 headers complete method=4 v=1/1 flags=200 content_length=0
+off=49 error code=15 reason="Request has invalid `Transfer-Encoding`"
+```
+
+## POST with `Transfer-Encoding` and `Content-Length`
+
+<!-- meta={"type": "request"} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: identity
+Content-Length: 5
+
+World
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=8 span[header_value]="identity"
+off=96 header_value complete
+off=96 len=14 span[header_field]="Content-Length"
+off=111 header_field complete
+off=112 len=1 span[header_value]="5"
+off=115 header_value complete
+off=117 error code=4 reason="Content-Length can't be present with Transfer-Encoding"
+```
+
+## POST with `Transfer-Encoding` and `Content-Length` (lenient)
+
+TODO(indutny): should we allow it even in lenient mode? (Consider disabling
+this).
+
+NOTE: `Content-Length` is ignored when `Transfer-Encoding` is present. Messages
+(in lenient mode) are read until EOF.
+
+<!-- meta={"type": "request-lenient-chunked-length"} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: identity
+Content-Length: 1
+
+World
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=8 span[header_value]="identity"
+off=96 header_value complete
+off=96 len=14 span[header_field]="Content-Length"
+off=111 header_field complete
+off=112 len=1 span[header_value]="1"
+off=115 header_value complete
+off=117 headers complete method=3 v=1/1 flags=220 content_length=1
+off=117 len=5 span[body]="World"
+```
+
+## POST with `chunked` before other transfer coding names
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: chunked, deflate
+
+World
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=7 span[header_value]="chunked"
+off=94 error code=15 reason="Invalid `Transfer-Encoding` header value"
+```
+
+## POST with `chunked` and duplicate transfer-encoding
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: chunked
+Transfer-Encoding: deflate
+
+World
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=7 span[header_value]="chunked"
+off=95 header_value complete
+off=95 len=17 span[header_field]="Transfer-Encoding"
+off=113 header_field complete
+off=114 len=0 span[header_value]=""
+off=115 error code=15 reason="Invalid `Transfer-Encoding` header value"
+```
+
+## POST with `chunked` before other transfer-coding (lenient)
+
+<!-- meta={"type": "request-lenient-transfer-encoding"} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: chunked, deflate
+
+World
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=16 span[header_value]="chunked, deflate"
+off=104 header_value complete
+off=106 headers complete method=3 v=1/1 flags=200 content_length=0
+off=106 len=5 span[body]="World"
+```
+
+## POST with `chunked` and duplicate transfer-encoding (lenient)
+
+<!-- meta={"type": "request-lenient-transfer-encoding"} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: chunked
+Transfer-Encoding: deflate
+
+World
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=7 span[header_value]="chunked"
+off=95 header_value complete
+off=95 len=17 span[header_field]="Transfer-Encoding"
+off=113 header_field complete
+off=114 len=7 span[header_value]="deflate"
+off=123 header_value complete
+off=125 headers complete method=3 v=1/1 flags=200 content_length=0
+off=125 len=5 span[body]="World"
+```
+
+## POST with `chunked` as last transfer-encoding
+
+<!-- meta={"type": "request"} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: deflate, chunked
+
+5
+World
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=16 span[header_value]="deflate, chunked"
+off=104 header_value complete
+off=106 headers complete method=3 v=1/1 flags=208 content_length=0
+off=109 chunk header len=5
+off=109 len=5 span[body]="World"
+off=116 chunk complete
+off=119 chunk header len=0
+off=121 chunk complete
+off=121 message complete
+```
+
+## POST with `chunked` as last transfer-encoding (multiple headers)
+
+<!-- meta={"type": "request"} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: deflate
+Transfer-Encoding: chunked
+
+5
+World
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=7 span[header_value]="deflate"
+off=95 header_value complete
+off=95 len=17 span[header_field]="Transfer-Encoding"
+off=113 header_field complete
+off=114 len=7 span[header_value]="chunked"
+off=123 header_value complete
+off=125 headers complete method=3 v=1/1 flags=208 content_length=0
+off=128 chunk header len=5
+off=128 len=5 span[body]="World"
+off=135 chunk complete
+off=138 chunk header len=0
+off=140 chunk complete
+off=140 message complete
+```
+
+## POST with `chunkedchunked` as transfer-encoding
+
+<!-- meta={"type": "request"} -->
+```http
+POST /post_identity_body_world?q=search#hey HTTP/1.1
+Accept: */*
+Transfer-Encoding: chunkedchunked
+
+5
+World
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=4 span[method]="POST"
+off=4 method complete
+off=5 len=38 span[url]="/post_identity_body_world?q=search#hey"
+off=44 url complete
+off=49 len=3 span[version]="1.1"
+off=52 version complete
+off=54 len=6 span[header_field]="Accept"
+off=61 header_field complete
+off=62 len=3 span[header_value]="*/*"
+off=67 header_value complete
+off=67 len=17 span[header_field]="Transfer-Encoding"
+off=85 header_field complete
+off=86 len=14 span[header_value]="chunkedchunked"
+off=102 header_value complete
+off=104 headers complete method=3 v=1/1 flags=200 content_length=0
+off=104 error code=15 reason="Request has invalid `Transfer-Encoding`"
+```
+
+## Missing last-chunk
+
+<!-- meta={"type": "request"} -->
+```http
+PUT /url HTTP/1.1
+Transfer-Encoding: chunked
+
+3
+foo
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=17 span[header_field]="Transfer-Encoding"
+off=37 header_field complete
+off=38 len=7 span[header_value]="chunked"
+off=47 header_value complete
+off=49 headers complete method=4 v=1/1 flags=208 content_length=0
+off=52 chunk header len=3
+off=52 len=3 span[body]="foo"
+off=57 chunk complete
+off=57 error code=12 reason="Invalid character in chunk size"
+```
+
+## Validate chunk parameters
+
+<!-- meta={"type": "request", "mode": "strict"} -->
+```http
+PUT /url HTTP/1.1
+Transfer-Encoding: chunked
+
+3 \n \r\n\
+foo
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=17 span[header_field]="Transfer-Encoding"
+off=37 header_field complete
+off=38 len=7 span[header_value]="chunked"
+off=47 header_value complete
+off=49 headers complete method=4 v=1/1 flags=208 content_length=0
+off=50 error code=12 reason="Invalid character in chunk size"
+```
+
+## Invalid OBS fold after chunked value
+
+<!-- meta={"type": "request", "mode": "strict"} -->
+```http
+PUT /url HTTP/1.1
+Transfer-Encoding: chunked
+ abc
+
+5
+World
+0
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="PUT"
+off=3 method complete
+off=4 len=4 span[url]="/url"
+off=9 url complete
+off=14 len=3 span[version]="1.1"
+off=17 version complete
+off=19 len=17 span[header_field]="Transfer-Encoding"
+off=37 header_field complete
+off=38 len=7 span[header_value]="chunked"
+off=47 len=5 span[header_value]=" abc"
+off=54 header_value complete
+off=56 headers complete method=4 v=1/1 flags=200 content_length=0
+off=56 error code=15 reason="Request has invalid `Transfer-Encoding`"
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/request/uri.md b/third_party/python/aiohttp/vendor/llhttp/test/request/uri.md
new file mode 100644
index 0000000000..356863e654
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/request/uri.md
@@ -0,0 +1,269 @@
+URI
+===
+
+## Quotes in URI
+
+<!-- meta={"type": "request"} -->
+```http
+GET /with_"lovely"_quotes?foo=\"bar\" HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=33 span[url]="/with_"lovely"_quotes?foo=\"bar\""
+off=38 url complete
+off=43 len=3 span[version]="1.1"
+off=46 version complete
+off=50 headers complete method=1 v=1/1 flags=0 content_length=0
+off=50 message complete
+```
+
+## Query URL with question mark
+
+Some clients include `?` characters in query strings.
+
+<!-- meta={"type": "request"} -->
+```http
+GET /test.cgi?foo=bar?baz HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=21 span[url]="/test.cgi?foo=bar?baz"
+off=26 url complete
+off=31 len=3 span[version]="1.1"
+off=34 version complete
+off=38 headers complete method=1 v=1/1 flags=0 content_length=0
+off=38 message complete
+```
+
+## Host terminated by a query string
+
+<!-- meta={"type": "request"} -->
+```http
+GET http://hypnotoad.org?hail=all HTTP/1.1\r\n
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=29 span[url]="http://hypnotoad.org?hail=all"
+off=34 url complete
+off=39 len=3 span[version]="1.1"
+off=42 version complete
+off=46 headers complete method=1 v=1/1 flags=0 content_length=0
+off=46 message complete
+```
+
+## `host:port` terminated by a query string
+
+<!-- meta={"type": "request"} -->
+```http
+GET http://hypnotoad.org:1234?hail=all HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=34 span[url]="http://hypnotoad.org:1234?hail=all"
+off=39 url complete
+off=44 len=3 span[version]="1.1"
+off=47 version complete
+off=51 headers complete method=1 v=1/1 flags=0 content_length=0
+off=51 message complete
+```
+
+## Query URL with vertical bar character
+
+It should be allowed to have vertical bar symbol in URI: `|`.
+
+See: https://github.com/nodejs/node/issues/27584
+
+<!-- meta={"type": "request"} -->
+```http
+GET /test.cgi?query=| HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=17 span[url]="/test.cgi?query=|"
+off=22 url complete
+off=27 len=3 span[version]="1.1"
+off=30 version complete
+off=34 headers complete method=1 v=1/1 flags=0 content_length=0
+off=34 message complete
+```
+
+## `host:port` terminated by a space
+
+<!-- meta={"type": "request"} -->
+```http
+GET http://hypnotoad.org:1234 HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=25 span[url]="http://hypnotoad.org:1234"
+off=30 url complete
+off=35 len=3 span[version]="1.1"
+off=38 version complete
+off=42 headers complete method=1 v=1/1 flags=0 content_length=0
+off=42 message complete
+```
+
+## UTF-8 in URI path in loose mode
+
+<!-- meta={"type": "request", "mode": "loose", "noScan": true} -->
+```http
+GET /Ī“Ā¶/Ī“t/ŠŗŠ¾ŃŠ¼Š¾Ń/pope?q=1#narf HTTP/1.1
+Host: github.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=36 span[url]="/Ī“Ā¶/Ī“t/ŠŗŠ¾ŃŠ¼Š¾Ń/pope?q=1#narf"
+off=41 url complete
+off=46 len=3 span[version]="1.1"
+off=49 version complete
+off=51 len=4 span[header_field]="Host"
+off=56 header_field complete
+off=57 len=10 span[header_value]="github.com"
+off=69 header_value complete
+off=71 headers complete method=1 v=1/1 flags=0 content_length=0
+off=71 message complete
+```
+
+## Disallow UTF-8 in URI path in strict mode
+
+<!-- meta={"type": "request", "mode": "strict", "noScan": true} -->
+```http
+GET /Ī“Ā¶/Ī“t/pope?q=1#narf HTTP/1.1
+Host: github.com
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=5 error code=7 reason="Invalid char in url path"
+```
+
+## Fragment in URI
+
+<!-- meta={"type": "request"} -->
+```http
+GET /forums/1/topics/2375?page=1#posts-17408 HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=40 span[url]="/forums/1/topics/2375?page=1#posts-17408"
+off=45 url complete
+off=50 len=3 span[version]="1.1"
+off=53 version complete
+off=57 headers complete method=1 v=1/1 flags=0 content_length=0
+off=57 message complete
+```
+
+## Underscore in hostname
+
+<!-- meta={"type": "request"} -->
+```http
+CONNECT home_0.netscape.com:443 HTTP/1.0
+User-agent: Mozilla/1.1N
+Proxy-authorization: basic aGVsbG86d29ybGQ=
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=7 span[method]="CONNECT"
+off=7 method complete
+off=8 len=23 span[url]="home_0.netscape.com:443"
+off=32 url complete
+off=37 len=3 span[version]="1.0"
+off=40 version complete
+off=42 len=10 span[header_field]="User-agent"
+off=53 header_field complete
+off=54 len=12 span[header_value]="Mozilla/1.1N"
+off=68 header_value complete
+off=68 len=19 span[header_field]="Proxy-authorization"
+off=88 header_field complete
+off=89 len=22 span[header_value]="basic aGVsbG86d29ybGQ="
+off=113 header_value complete
+off=115 headers complete method=5 v=1/0 flags=0 content_length=0
+off=115 message complete
+off=115 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+## `host:port` and basic auth
+
+<!-- meta={"type": "request"} -->
+```http
+GET http://a%12:b!&*$@hypnotoad.org:1234/toto HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=41 span[url]="http://a%12:b!&*$@hypnotoad.org:1234/toto"
+off=46 url complete
+off=51 len=3 span[version]="1.1"
+off=54 version complete
+off=58 headers complete method=1 v=1/1 flags=0 content_length=0
+off=58 message complete
+```
+
+## Space in URI
+
+<!-- meta={"type": "request", "noScan": true} -->
+```http
+GET /foo bar/ HTTP/1.1
+
+
+```
+
+```log
+off=0 message begin
+off=0 len=3 span[method]="GET"
+off=3 method complete
+off=4 len=4 span[url]="/foo"
+off=9 url complete
+off=9 error code=8 reason="Expected HTTP/"
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/connection.md b/third_party/python/aiohttp/vendor/llhttp/test/response/connection.md
new file mode 100644
index 0000000000..4457743a1b
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/connection.md
@@ -0,0 +1,502 @@
+Connection header
+=================
+
+## Proxy-Connection
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Content-Type: text/html; charset=UTF-8
+Content-Length: 11
+Proxy-Connection: close
+Date: Thu, 31 Dec 2009 20:55:48 +0000
+
+hello world
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=12 span[header_field]="Content-Type"
+off=30 header_field complete
+off=31 len=24 span[header_value]="text/html; charset=UTF-8"
+off=57 header_value complete
+off=57 len=14 span[header_field]="Content-Length"
+off=72 header_field complete
+off=73 len=2 span[header_value]="11"
+off=77 header_value complete
+off=77 len=16 span[header_field]="Proxy-Connection"
+off=94 header_field complete
+off=95 len=5 span[header_value]="close"
+off=102 header_value complete
+off=102 len=4 span[header_field]="Date"
+off=107 header_field complete
+off=108 len=31 span[header_value]="Thu, 31 Dec 2009 20:55:48 +0000"
+off=141 header_value complete
+off=143 headers complete status=200 v=1/1 flags=22 content_length=11
+off=143 len=11 span[body]="hello world"
+off=154 message complete
+```
+
+## HTTP/1.0 with keep-alive and EOF-terminated 200 status
+
+There is no `Content-Length` in this response, so even though the
+`keep-alive` is on - it should read until EOF.
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.0 200 OK
+Connection: keep-alive
+
+HTTP/1.0 200 OK
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.0"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=10 span[header_field]="Connection"
+off=28 header_field complete
+off=29 len=10 span[header_value]="keep-alive"
+off=41 header_value complete
+off=43 headers complete status=200 v=1/0 flags=1 content_length=0
+off=43 len=15 span[body]="HTTP/1.0 200 OK"
+```
+
+## HTTP/1.0 with keep-alive and 204 status
+
+Responses with `204` status cannot have a body.
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.0 204 No content
+Connection: keep-alive
+
+HTTP/1.0 200 OK
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.0"
+off=8 version complete
+off=13 len=10 span[status]="No content"
+off=25 status complete
+off=25 len=10 span[header_field]="Connection"
+off=36 header_field complete
+off=37 len=10 span[header_value]="keep-alive"
+off=49 header_value complete
+off=51 headers complete status=204 v=1/0 flags=1 content_length=0
+off=51 message complete
+off=51 reset
+off=51 message begin
+off=56 len=3 span[version]="1.0"
+off=59 version complete
+off=64 len=2 span[status]="OK"
+```
+
+## HTTP/1.1 with EOF-terminated 200 status
+
+There is no `Content-Length` in this response, so even though the
+`keep-alive` is on (implicitly in HTTP 1.1) - it should read until EOF.
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+
+HTTP/1.1 200 OK
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=19 headers complete status=200 v=1/1 flags=0 content_length=0
+off=19 len=15 span[body]="HTTP/1.1 200 OK"
+```
+
+## HTTP/1.1 with 204 status
+
+Responses with `204` status cannot have a body.
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 204 No content
+
+HTTP/1.1 200 OK
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=10 span[status]="No content"
+off=25 status complete
+off=27 headers complete status=204 v=1/1 flags=0 content_length=0
+off=27 message complete
+off=27 reset
+off=27 message begin
+off=32 len=3 span[version]="1.1"
+off=35 version complete
+off=40 len=2 span[status]="OK"
+```
+
+## HTTP/1.1 with keep-alive disabled and 204 status in strict mode
+
+<!-- meta={"type": "response", "mode": "strict"} -->
+```http
+HTTP/1.1 204 No content
+Connection: close
+
+HTTP/1.1 200 OK
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=10 span[status]="No content"
+off=25 status complete
+off=25 len=10 span[header_field]="Connection"
+off=36 header_field complete
+off=37 len=5 span[header_value]="close"
+off=44 header_value complete
+off=46 headers complete status=204 v=1/1 flags=2 content_length=0
+off=46 message complete
+off=47 error code=5 reason="Data after `Connection: close`"
+```
+
+## HTTP/1.1 with keep-alive disabled, content-length, and in loose mode
+
+Parser should discard extra request in loose mode.
+
+<!-- meta={"type": "response", "mode": "loose"} -->
+```http
+HTTP/1.1 200 No content
+Content-Length: 5
+Connection: close
+
+2ad731e3-4dcd-4f70-b871-0ad284b29ffc
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=10 span[status]="No content"
+off=25 status complete
+off=25 len=14 span[header_field]="Content-Length"
+off=40 header_field complete
+off=41 len=1 span[header_value]="5"
+off=44 header_value complete
+off=44 len=10 span[header_field]="Connection"
+off=55 header_field complete
+off=56 len=5 span[header_value]="close"
+off=63 header_value complete
+off=65 headers complete status=200 v=1/1 flags=22 content_length=5
+off=65 len=5 span[body]="2ad73"
+off=70 message complete
+```
+
+## HTTP/1.1 with keep-alive disabled, content-length, and in strict mode
+
+Parser should discard extra request in strict mode.
+
+<!-- meta={"type": "response", "mode": "strict"} -->
+```http
+HTTP/1.1 200 No content
+Content-Length: 5
+Connection: close
+
+2ad731e3-4dcd-4f70-b871-0ad284b29ffc
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=10 span[status]="No content"
+off=25 status complete
+off=25 len=14 span[header_field]="Content-Length"
+off=40 header_field complete
+off=41 len=1 span[header_value]="5"
+off=44 header_value complete
+off=44 len=10 span[header_field]="Connection"
+off=55 header_field complete
+off=56 len=5 span[header_value]="close"
+off=63 header_value complete
+off=65 headers complete status=200 v=1/1 flags=22 content_length=5
+off=65 len=5 span[body]="2ad73"
+off=70 message complete
+off=71 error code=5 reason="Data after `Connection: close`"
+```
+
+## HTTP/1.1 with keep-alive disabled, content-length, and in lenient mode
+
+Parser should process extra request in lenient mode.
+
+<!-- meta={"type": "response-lenient-keep-alive"} -->
+```http
+HTTP/1.1 200 No content
+Content-Length: 5
+Connection: close
+
+2ad73HTTP/1.1 200 OK
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=10 span[status]="No content"
+off=25 status complete
+off=25 len=14 span[header_field]="Content-Length"
+off=40 header_field complete
+off=41 len=1 span[header_value]="5"
+off=44 header_value complete
+off=44 len=10 span[header_field]="Connection"
+off=55 header_field complete
+off=56 len=5 span[header_value]="close"
+off=63 header_value complete
+off=65 headers complete status=200 v=1/1 flags=22 content_length=5
+off=65 len=5 span[body]="2ad73"
+off=70 message complete
+off=70 reset
+off=70 message begin
+off=75 len=3 span[version]="1.1"
+off=78 version complete
+off=83 len=2 span[status]="OK"
+```
+
+## HTTP/1.1 with keep-alive disabled and 204 status in lenient mode
+
+<!-- meta={"type": "response-lenient-keep-alive"} -->
+```http
+HTTP/1.1 204 No content
+Connection: close
+
+HTTP/1.1 200 OK
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=10 span[status]="No content"
+off=25 status complete
+off=25 len=10 span[header_field]="Connection"
+off=36 header_field complete
+off=37 len=5 span[header_value]="close"
+off=44 header_value complete
+off=46 headers complete status=204 v=1/1 flags=2 content_length=0
+off=46 message complete
+off=46 reset
+off=46 message begin
+off=51 len=3 span[version]="1.1"
+off=54 version complete
+off=59 len=2 span[status]="OK"
+```
+
+## HTTP 101 response with Upgrade and Content-Length header
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 101 Switching Protocols
+Connection: upgrade
+Upgrade: h2c
+Content-Length: 4
+
+body\
+proto
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=19 span[status]="Switching Protocols"
+off=34 status complete
+off=34 len=10 span[header_field]="Connection"
+off=45 header_field complete
+off=46 len=7 span[header_value]="upgrade"
+off=55 header_value complete
+off=55 len=7 span[header_field]="Upgrade"
+off=63 header_field complete
+off=64 len=3 span[header_value]="h2c"
+off=69 header_value complete
+off=69 len=14 span[header_field]="Content-Length"
+off=84 header_field complete
+off=85 len=1 span[header_value]="4"
+off=88 header_value complete
+off=90 headers complete status=101 v=1/1 flags=34 content_length=4
+off=90 len=4 span[body]="body"
+off=94 message complete
+off=94 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+## HTTP 101 response with Upgrade and Transfer-Encoding header
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 101 Switching Protocols
+Connection: upgrade
+Upgrade: h2c
+Transfer-Encoding: chunked
+
+2
+bo
+2
+dy
+0
+
+proto
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=19 span[status]="Switching Protocols"
+off=34 status complete
+off=34 len=10 span[header_field]="Connection"
+off=45 header_field complete
+off=46 len=7 span[header_value]="upgrade"
+off=55 header_value complete
+off=55 len=7 span[header_field]="Upgrade"
+off=63 header_field complete
+off=64 len=3 span[header_value]="h2c"
+off=69 header_value complete
+off=69 len=17 span[header_field]="Transfer-Encoding"
+off=87 header_field complete
+off=88 len=7 span[header_value]="chunked"
+off=97 header_value complete
+off=99 headers complete status=101 v=1/1 flags=21c content_length=0
+off=102 chunk header len=2
+off=102 len=2 span[body]="bo"
+off=106 chunk complete
+off=109 chunk header len=2
+off=109 len=2 span[body]="dy"
+off=113 chunk complete
+off=116 chunk header len=0
+off=118 chunk complete
+off=118 message complete
+off=118 error code=22 reason="Pause on CONNECT/Upgrade"
+```
+
+## HTTP 200 response with Upgrade header
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Connection: upgrade
+Upgrade: h2c
+
+body
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=10 span[header_field]="Connection"
+off=28 header_field complete
+off=29 len=7 span[header_value]="upgrade"
+off=38 header_value complete
+off=38 len=7 span[header_field]="Upgrade"
+off=46 header_field complete
+off=47 len=3 span[header_value]="h2c"
+off=52 header_value complete
+off=54 headers complete status=200 v=1/1 flags=14 content_length=0
+off=54 len=4 span[body]="body"
+```
+
+## HTTP 200 response with Upgrade header and Content-Length
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Connection: upgrade
+Upgrade: h2c
+Content-Length: 4
+
+body
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=10 span[header_field]="Connection"
+off=28 header_field complete
+off=29 len=7 span[header_value]="upgrade"
+off=38 header_value complete
+off=38 len=7 span[header_field]="Upgrade"
+off=46 header_field complete
+off=47 len=3 span[header_value]="h2c"
+off=52 header_value complete
+off=52 len=14 span[header_field]="Content-Length"
+off=67 header_field complete
+off=68 len=1 span[header_value]="4"
+off=71 header_value complete
+off=73 headers complete status=200 v=1/1 flags=34 content_length=4
+off=73 len=4 span[body]="body"
+off=77 message complete
+```
+
+## HTTP 200 response with Upgrade header and Transfer-Encoding
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Connection: upgrade
+Upgrade: h2c
+Transfer-Encoding: chunked
+
+2
+bo
+2
+dy
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=10 span[header_field]="Connection"
+off=28 header_field complete
+off=29 len=7 span[header_value]="upgrade"
+off=38 header_value complete
+off=38 len=7 span[header_field]="Upgrade"
+off=46 header_field complete
+off=47 len=3 span[header_value]="h2c"
+off=52 header_value complete
+off=52 len=17 span[header_field]="Transfer-Encoding"
+off=70 header_field complete
+off=71 len=7 span[header_value]="chunked"
+off=80 header_value complete
+off=82 headers complete status=200 v=1/1 flags=21c content_length=0
+off=85 chunk header len=2
+off=85 len=2 span[body]="bo"
+off=89 chunk complete
+off=92 chunk header len=2
+off=92 len=2 span[body]="dy"
+off=96 chunk complete
+off=99 chunk header len=0
+off=101 chunk complete
+off=101 message complete
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/content-length.md b/third_party/python/aiohttp/vendor/llhttp/test/response/content-length.md
new file mode 100644
index 0000000000..6c3392442f
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/content-length.md
@@ -0,0 +1,158 @@
+Content-Length header
+=====================
+
+## Response without `Content-Length`, but with body
+
+The client should wait for the server's EOF. That is, when
+`Content-Length` is not specified, and `Connection: close`, the end of body is
+specified by the EOF.
+
+_(Compare with APACHEBENCH_GET)_
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Date: Tue, 04 Aug 2009 07:59:32 GMT
+Server: Apache
+X-Powered-By: Servlet/2.5 JSP/2.1
+Content-Type: text/xml; charset=utf-8
+Connection: close
+
+<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
+<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">\n\
+ <SOAP-ENV:Body>\n\
+ <SOAP-ENV:Fault>\n\
+ <faultcode>SOAP-ENV:Client</faultcode>\n\
+ <faultstring>Client Error</faultstring>\n\
+ </SOAP-ENV:Fault>\n\
+ </SOAP-ENV:Body>\n\
+</SOAP-ENV:Envelope>
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=4 span[header_field]="Date"
+off=22 header_field complete
+off=23 len=29 span[header_value]="Tue, 04 Aug 2009 07:59:32 GMT"
+off=54 header_value complete
+off=54 len=6 span[header_field]="Server"
+off=61 header_field complete
+off=62 len=6 span[header_value]="Apache"
+off=70 header_value complete
+off=70 len=12 span[header_field]="X-Powered-By"
+off=83 header_field complete
+off=84 len=19 span[header_value]="Servlet/2.5 JSP/2.1"
+off=105 header_value complete
+off=105 len=12 span[header_field]="Content-Type"
+off=118 header_field complete
+off=119 len=23 span[header_value]="text/xml; charset=utf-8"
+off=144 header_value complete
+off=144 len=10 span[header_field]="Connection"
+off=155 header_field complete
+off=156 len=5 span[header_value]="close"
+off=163 header_value complete
+off=165 headers complete status=200 v=1/1 flags=2 content_length=0
+off=165 len=42 span[body]="<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+off=207 len=1 span[body]=lf
+off=208 len=80 span[body]="<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\">"
+off=288 len=1 span[body]=lf
+off=289 len=17 span[body]=" <SOAP-ENV:Body>"
+off=306 len=1 span[body]=lf
+off=307 len=20 span[body]=" <SOAP-ENV:Fault>"
+off=327 len=1 span[body]=lf
+off=328 len=45 span[body]=" <faultcode>SOAP-ENV:Client</faultcode>"
+off=373 len=1 span[body]=lf
+off=374 len=46 span[body]=" <faultstring>Client Error</faultstring>"
+off=420 len=1 span[body]=lf
+off=421 len=21 span[body]=" </SOAP-ENV:Fault>"
+off=442 len=1 span[body]=lf
+off=443 len=18 span[body]=" </SOAP-ENV:Body>"
+off=461 len=1 span[body]=lf
+off=462 len=20 span[body]="</SOAP-ENV:Envelope>"
+```
+
+## Content-Length-X
+
+The header that starts with `Content-Length*` should not be treated as
+`Content-Length`.
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length-X: 0
+Transfer-Encoding: chunked
+
+2
+OK
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=16 span[header_field]="Content-Length-X"
+off=34 header_field complete
+off=35 len=1 span[header_value]="0"
+off=38 header_value complete
+off=38 len=17 span[header_field]="Transfer-Encoding"
+off=56 header_field complete
+off=57 len=7 span[header_value]="chunked"
+off=66 header_value complete
+off=68 headers complete status=200 v=1/1 flags=208 content_length=0
+off=71 chunk header len=2
+off=71 len=2 span[body]="OK"
+off=75 chunk complete
+off=78 chunk header len=0
+off=80 chunk complete
+off=80 message complete
+```
+
+## Content-Length reset when no body is received
+
+<!-- meta={"type": "response", "skipBody": true} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 123
+
+HTTP/1.1 200 OK
+Content-Length: 456
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=3 span[header_value]="123"
+off=38 header_value complete
+off=40 headers complete status=200 v=1/1 flags=20 content_length=123
+off=40 skip body
+off=40 message complete
+off=40 reset
+off=40 message begin
+off=45 len=3 span[version]="1.1"
+off=48 version complete
+off=53 len=2 span[status]="OK"
+off=57 status complete
+off=57 len=14 span[header_field]="Content-Length"
+off=72 header_field complete
+off=73 len=3 span[header_value]="456"
+off=78 header_value complete
+off=80 headers complete status=200 v=1/1 flags=20 content_length=456
+off=80 skip body
+off=80 message complete
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/finish.md b/third_party/python/aiohttp/vendor/llhttp/test/response/finish.md
new file mode 100644
index 0000000000..2938b83bed
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/finish.md
@@ -0,0 +1,23 @@
+Finish
+======
+
+Those tests check the return codes and the behavior of `llhttp_finish()` C API.
+
+## It should be safe to finish with cb after empty response
+
+<!-- meta={"type": "response-finish"} -->
+```http
+HTTP/1.1 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=19 headers complete status=200 v=1/1 flags=0 content_length=0
+off=NULL finish=1
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/invalid.md b/third_party/python/aiohttp/vendor/llhttp/test/response/invalid.md
new file mode 100644
index 0000000000..40eee9b12b
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/invalid.md
@@ -0,0 +1,201 @@
+Invalid responses
+=================
+
+### Incomplete HTTP protocol
+
+*TODO(indutny): test `req_or_res` mode too*
+
+<!-- meta={"type": "response-only"} -->
+```http
+HTP/1.1 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=2 error code=8 reason="Expected HTTP/"
+```
+
+### Extra digit in HTTP major version
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/01.1 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=1 span[version]="0"
+off=6 error code=9 reason="Expected dot"
+```
+
+### Extra digit in HTTP major version #2
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/11.1 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=1 span[version]="1"
+off=6 error code=9 reason="Expected dot"
+```
+
+### Extra digit in HTTP minor version
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.01 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.0"
+off=8 version complete
+off=8 error code=9 reason="Expected space after version"
+```
+-->
+
+### Tab after HTTP version
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1\t200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=8 error code=9 reason="Expected space after version"
+```
+
+### CR before response and tab after HTTP version
+
+<!-- meta={"type": "response"} -->
+```http
+\rHTTP/1.1\t200 OK
+
+
+```
+
+```log
+off=1 message begin
+off=6 len=3 span[version]="1.1"
+off=9 version complete
+off=9 error code=9 reason="Expected space after version"
+```
+
+### Headers separated by CR
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Foo: 1\rBar: 2
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=3 span[header_field]="Foo"
+off=21 header_field complete
+off=22 len=1 span[header_value]="1"
+off=24 error code=3 reason="Missing expected LF after header value"
+```
+
+### Invalid HTTP version
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/5.6 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="5.6"
+off=8 error code=9 reason="Invalid HTTP version"
+```
+
+## Invalid space after start line
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+ Host: foo
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=18 error code=30 reason="Unexpected space after start line"
+```
+
+### Extra space between HTTP version and status code
+
+<!-- meta={"type": "response-only"} -->
+```http
+HTTP/1.1 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=9 error code=13 reason="Invalid status code"
+```
+
+### Extra space between status code and reason
+
+<!-- meta={"type": "response-only"} -->
+```http
+HTTP/1.1 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=3 span[status]=" OK"
+off=18 status complete
+off=20 headers complete status=200 v=1/1 flags=0 content_length=0
+```
+
+### One-digit status code
+
+<!-- meta={"type": "response-only"} -->
+```http
+HTTP/1.1 2 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=10 error code=13 reason="Invalid status code"
+``` \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/lenient-version.md b/third_party/python/aiohttp/vendor/llhttp/test/response/lenient-version.md
new file mode 100644
index 0000000000..e0d154ab47
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/lenient-version.md
@@ -0,0 +1,20 @@
+Lenient HTTP version parsing
+============================
+
+### Invalid HTTP version with lenient
+
+<!-- meta={"type": "response-lenient-version"} -->
+```http
+HTTP/5.6 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="5.6"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=19 headers complete status=200 v=5/6 flags=0 content_length=0
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/pausing.md b/third_party/python/aiohttp/vendor/llhttp/test/response/pausing.md
new file mode 100644
index 0000000000..d2e870b88a
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/pausing.md
@@ -0,0 +1,330 @@
+Pausing
+=======
+
+### on_message_begin
+
+<!-- meta={"type": "response", "pause": "on_message_begin"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=0 pause
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete status=200 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_message_complete
+
+<!-- meta={"type": "response", "pause": "on_message_complete"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete status=200 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+off=41 pause
+```
+
+### on_version_complete
+
+<!-- meta={"type": "response", "pause": "on_version_complete"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=8 pause
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete status=200 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_status_complete
+
+<!-- meta={"type": "response", "pause": "on_status_complete"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 pause
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete status=200 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_header_field_complete
+
+<!-- meta={"type": "response", "pause": "on_header_field_complete"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=32 pause
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete status=200 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_header_value_complete
+
+<!-- meta={"type": "response", "pause": "on_header_value_complete"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=36 pause
+off=38 headers complete status=200 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_headers_complete
+
+<!-- meta={"type": "response", "pause": "on_headers_complete"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 3
+
+abc
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete status=200 v=1/1 flags=20 content_length=3
+off=38 pause
+off=38 len=3 span[body]="abc"
+off=41 message complete
+```
+
+### on_chunk_header
+
+<!-- meta={"type": "response", "pause": "on_chunk_header"} -->
+```http
+HTTP/1.1 200 OK
+Transfer-Encoding: chunked
+
+a
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=17 span[header_field]="Transfer-Encoding"
+off=35 header_field complete
+off=36 len=7 span[header_value]="chunked"
+off=45 header_value complete
+off=47 headers complete status=200 v=1/1 flags=208 content_length=0
+off=50 chunk header len=10
+off=50 pause
+off=50 len=10 span[body]="0123456789"
+off=62 chunk complete
+off=65 chunk header len=0
+off=65 pause
+off=67 chunk complete
+off=67 message complete
+```
+
+### on_chunk_extension_name
+
+<!-- meta={"type": "response", "pause": "on_chunk_extension_name"} -->
+```http
+HTTP/1.1 200 OK
+Transfer-Encoding: chunked
+
+a;foo=bar
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=17 span[header_field]="Transfer-Encoding"
+off=35 header_field complete
+off=36 len=7 span[header_value]="chunked"
+off=45 header_value complete
+off=47 headers complete status=200 v=1/1 flags=208 content_length=0
+off=49 len=3 span[chunk_extension_name]="foo"
+off=53 chunk_extension_name complete
+off=53 pause
+off=53 len=3 span[chunk_extension_value]="bar"
+off=57 chunk_extension_value complete
+off=58 chunk header len=10
+off=58 len=10 span[body]="0123456789"
+off=70 chunk complete
+off=73 chunk header len=0
+off=75 chunk complete
+off=75 message complete
+```
+
+### on_chunk_extension_value
+
+<!-- meta={"type": "response", "pause": "on_chunk_extension_value"} -->
+```http
+HTTP/1.1 200 OK
+Transfer-Encoding: chunked
+
+a;foo=bar
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=17 span[header_field]="Transfer-Encoding"
+off=35 header_field complete
+off=36 len=7 span[header_value]="chunked"
+off=45 header_value complete
+off=47 headers complete status=200 v=1/1 flags=208 content_length=0
+off=49 len=3 span[chunk_extension_name]="foo"
+off=53 chunk_extension_name complete
+off=53 len=3 span[chunk_extension_value]="bar"
+off=57 chunk_extension_value complete
+off=57 pause
+off=58 chunk header len=10
+off=58 len=10 span[body]="0123456789"
+off=70 chunk complete
+off=73 chunk header len=0
+off=75 chunk complete
+off=75 message complete
+```
+
+### on_chunk_complete
+
+<!-- meta={"type": "response", "pause": "on_chunk_complete"} -->
+```http
+HTTP/1.1 200 OK
+Transfer-Encoding: chunked
+
+a
+0123456789
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=17 span[header_field]="Transfer-Encoding"
+off=35 header_field complete
+off=36 len=7 span[header_value]="chunked"
+off=45 header_value complete
+off=47 headers complete status=200 v=1/1 flags=208 content_length=0
+off=50 chunk header len=10
+off=50 len=10 span[body]="0123456789"
+off=62 chunk complete
+off=62 pause
+off=65 chunk header len=0
+off=67 chunk complete
+off=67 pause
+off=67 message complete
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/pipelining.md b/third_party/python/aiohttp/vendor/llhttp/test/response/pipelining.md
new file mode 100644
index 0000000000..01e007a99c
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/pipelining.md
@@ -0,0 +1,60 @@
+Pipelining
+==========
+
+## Should parse multiple events
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Content-Length: 3
+
+AAA
+HTTP/1.1 201 Created
+Content-Length: 4
+
+BBBB
+HTTP/1.1 202 Accepted
+Content-Length: 5
+
+CCCC
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=14 span[header_field]="Content-Length"
+off=32 header_field complete
+off=33 len=1 span[header_value]="3"
+off=36 header_value complete
+off=38 headers complete status=200 v=1/1 flags=20 content_length=3
+off=38 len=3 span[body]="AAA"
+off=41 message complete
+off=43 reset
+off=43 message begin
+off=48 len=3 span[version]="1.1"
+off=51 version complete
+off=56 len=7 span[status]="Created"
+off=65 status complete
+off=65 len=14 span[header_field]="Content-Length"
+off=80 header_field complete
+off=81 len=1 span[header_value]="4"
+off=84 header_value complete
+off=86 headers complete status=201 v=1/1 flags=20 content_length=4
+off=86 len=4 span[body]="BBBB"
+off=90 message complete
+off=92 reset
+off=92 message begin
+off=97 len=3 span[version]="1.1"
+off=100 version complete
+off=105 len=8 span[status]="Accepted"
+off=115 status complete
+off=115 len=14 span[header_field]="Content-Length"
+off=130 header_field complete
+off=131 len=1 span[header_value]="5"
+off=134 header_value complete
+off=136 headers complete status=202 v=1/1 flags=20 content_length=5
+off=136 len=4 span[body]="CCCC"
+``` \ No newline at end of file
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/sample.md b/third_party/python/aiohttp/vendor/llhttp/test/response/sample.md
new file mode 100644
index 0000000000..e32fc5ef28
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/sample.md
@@ -0,0 +1,684 @@
+Sample responses
+================
+
+## Simple response
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Header1: Value1
+Header2:\t Value2
+Content-Length: 0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=7 span[header_field]="Header1"
+off=25 header_field complete
+off=26 len=6 span[header_value]="Value1"
+off=34 header_value complete
+off=34 len=7 span[header_field]="Header2"
+off=42 header_field complete
+off=44 len=6 span[header_value]="Value2"
+off=52 header_value complete
+off=52 len=14 span[header_field]="Content-Length"
+off=67 header_field complete
+off=68 len=1 span[header_value]="0"
+off=71 header_value complete
+off=73 headers complete status=200 v=1/1 flags=20 content_length=0
+off=73 message complete
+```
+
+## Error on invalid response start
+
+Every response must start with `HTTP/`.
+
+<!-- meta={"type": "response-only"} -->
+```http
+HTTPER/1.1 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=4 error code=8 reason="Expected HTTP/"
+```
+
+## Empty body should not trigger spurious span callbacks
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=19 headers complete status=200 v=1/1 flags=0 content_length=0
+```
+
+## Google 301
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 301 Moved Permanently
+Location: http://www.google.com/
+Content-Type: text/html; charset=UTF-8
+Date: Sun, 26 Apr 2009 11:11:49 GMT
+Expires: Tue, 26 May 2009 11:11:49 GMT
+X-$PrototypeBI-Version: 1.6.0.3
+Cache-Control: public, max-age=2592000
+Server: gws
+Content-Length: 219
+
+<HTML><HEAD><meta http-equiv=content-type content=text/html;charset=utf-8>\n\
+<TITLE>301 Moved</TITLE></HEAD><BODY>\n\
+<H1>301 Moved</H1>\n\
+The document has moved\n\
+<A HREF="http://www.google.com/">here</A>.
+</BODY></HTML>
+```
+_(Note the `$` char in header field)_
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=17 span[status]="Moved Permanently"
+off=32 status complete
+off=32 len=8 span[header_field]="Location"
+off=41 header_field complete
+off=42 len=22 span[header_value]="http://www.google.com/"
+off=66 header_value complete
+off=66 len=12 span[header_field]="Content-Type"
+off=79 header_field complete
+off=80 len=24 span[header_value]="text/html; charset=UTF-8"
+off=106 header_value complete
+off=106 len=4 span[header_field]="Date"
+off=111 header_field complete
+off=112 len=29 span[header_value]="Sun, 26 Apr 2009 11:11:49 GMT"
+off=143 header_value complete
+off=143 len=7 span[header_field]="Expires"
+off=151 header_field complete
+off=152 len=29 span[header_value]="Tue, 26 May 2009 11:11:49 GMT"
+off=183 header_value complete
+off=183 len=22 span[header_field]="X-$PrototypeBI-Version"
+off=206 header_field complete
+off=207 len=7 span[header_value]="1.6.0.3"
+off=216 header_value complete
+off=216 len=13 span[header_field]="Cache-Control"
+off=230 header_field complete
+off=231 len=23 span[header_value]="public, max-age=2592000"
+off=256 header_value complete
+off=256 len=6 span[header_field]="Server"
+off=263 header_field complete
+off=264 len=3 span[header_value]="gws"
+off=269 header_value complete
+off=269 len=14 span[header_field]="Content-Length"
+off=284 header_field complete
+off=286 len=5 span[header_value]="219 "
+off=293 header_value complete
+off=295 headers complete status=301 v=1/1 flags=20 content_length=219
+off=295 len=74 span[body]="<HTML><HEAD><meta http-equiv=content-type content=text/html;charset=utf-8>"
+off=369 len=1 span[body]=lf
+off=370 len=37 span[body]="<TITLE>301 Moved</TITLE></HEAD><BODY>"
+off=407 len=1 span[body]=lf
+off=408 len=18 span[body]="<H1>301 Moved</H1>"
+off=426 len=1 span[body]=lf
+off=427 len=22 span[body]="The document has moved"
+off=449 len=1 span[body]=lf
+off=450 len=42 span[body]="<A HREF="http://www.google.com/">here</A>."
+off=492 len=1 span[body]=cr
+off=493 len=1 span[body]=lf
+off=494 len=14 span[body]="</BODY></HTML>"
+```
+
+## amazon.com
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 301 MovedPermanently
+Date: Wed, 15 May 2013 17:06:33 GMT
+Server: Server
+x-amz-id-1: 0GPHKXSJQ826RK7GZEB2
+p3p: policyref="http://www.amazon.com/w3c/p3p.xml",CP="CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC "
+x-amz-id-2: STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD
+Location: http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846
+Vary: Accept-Encoding,User-Agent
+Content-Type: text/html; charset=ISO-8859-1
+Transfer-Encoding: chunked
+
+1
+\n
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=16 span[status]="MovedPermanently"
+off=31 status complete
+off=31 len=4 span[header_field]="Date"
+off=36 header_field complete
+off=37 len=29 span[header_value]="Wed, 15 May 2013 17:06:33 GMT"
+off=68 header_value complete
+off=68 len=6 span[header_field]="Server"
+off=75 header_field complete
+off=76 len=6 span[header_value]="Server"
+off=84 header_value complete
+off=84 len=10 span[header_field]="x-amz-id-1"
+off=95 header_field complete
+off=96 len=20 span[header_value]="0GPHKXSJQ826RK7GZEB2"
+off=118 header_value complete
+off=118 len=3 span[header_field]="p3p"
+off=122 header_field complete
+off=123 len=178 span[header_value]="policyref="http://www.amazon.com/w3c/p3p.xml",CP="CAO DSP LAW CUR ADM IVAo IVDo CONo OTPo OUR DELi PUBi OTRi BUS PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA HEA PRE LOC GOV OTC ""
+off=303 header_value complete
+off=303 len=10 span[header_field]="x-amz-id-2"
+off=314 header_field complete
+off=315 len=64 span[header_value]="STN69VZxIFSz9YJLbz1GDbxpbjG6Qjmmq5E3DxRhOUw+Et0p4hr7c/Q8qNcx4oAD"
+off=381 header_value complete
+off=381 len=8 span[header_field]="Location"
+off=390 header_field complete
+off=391 len=214 span[header_value]="http://www.amazon.com/Dan-Brown/e/B000AP9DSU/ref=s9_pop_gw_al1?_encoding=UTF8&refinementId=618073011&pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SHYY5BZXN3KR20BNFAY&pf_rd_t=101&pf_rd_p=1263340922&pf_rd_i=507846"
+off=607 header_value complete
+off=607 len=4 span[header_field]="Vary"
+off=612 header_field complete
+off=613 len=26 span[header_value]="Accept-Encoding,User-Agent"
+off=641 header_value complete
+off=641 len=12 span[header_field]="Content-Type"
+off=654 header_field complete
+off=655 len=29 span[header_value]="text/html; charset=ISO-8859-1"
+off=686 header_value complete
+off=686 len=17 span[header_field]="Transfer-Encoding"
+off=704 header_field complete
+off=705 len=7 span[header_value]="chunked"
+off=714 header_value complete
+off=716 headers complete status=301 v=1/1 flags=208 content_length=0
+off=719 chunk header len=1
+off=719 len=1 span[body]=lf
+off=722 chunk complete
+off=725 chunk header len=0
+off=727 chunk complete
+off=727 message complete
+```
+
+## No headers and no body
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 404 Not Found
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=9 span[status]="Not Found"
+off=24 status complete
+off=26 headers complete status=404 v=1/1 flags=0 content_length=0
+```
+
+## No reason phrase
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 301
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=14 status complete
+off=16 headers complete status=301 v=1/1 flags=0 content_length=0
+```
+
+## Empty reason phrase after space
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 \r\n\
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=15 status complete
+off=17 headers complete status=200 v=1/1 flags=0 content_length=0
+```
+
+## No carriage ret
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK\n\
+Content-Type: text/html; charset=utf-8\n\
+Connection: close\n\
+\n\
+these headers are from http://news.ycombinator.com/
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=16 status complete
+off=16 len=12 span[header_field]="Content-Type"
+off=29 header_field complete
+off=30 len=24 span[header_value]="text/html; charset=utf-8"
+off=54 error code=10 reason="Invalid header value char"
+```
+
+## Underscore in header key
+
+Shown by: `curl -o /dev/null -v "http://ad.doubleclick.net/pfadx/DARTSHELLCONFIGXML;dcmt=text/xml;"`
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Server: DCLK-AdSvr
+Content-Type: text/xml
+Content-Length: 0
+DCLK_imp: v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=6 span[header_field]="Server"
+off=24 header_field complete
+off=25 len=10 span[header_value]="DCLK-AdSvr"
+off=37 header_value complete
+off=37 len=12 span[header_field]="Content-Type"
+off=50 header_field complete
+off=51 len=8 span[header_value]="text/xml"
+off=61 header_value complete
+off=61 len=14 span[header_field]="Content-Length"
+off=76 header_field complete
+off=77 len=1 span[header_value]="0"
+off=80 header_value complete
+off=80 len=8 span[header_field]="DCLK_imp"
+off=89 header_field complete
+off=90 len=81 span[header_value]="v7;x;114750856;0-0;0;17820020;0/0;21603567/21621457/1;;~okv=;dcmt=text/xml;;~cs=o"
+off=173 header_value complete
+off=175 headers complete status=200 v=1/1 flags=20 content_length=0
+off=175 message complete
+```
+
+## bonjourmadame.fr
+
+The client should not merge two headers fields when the first one doesn't
+have a value.
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.0 301 Moved Permanently
+Date: Thu, 03 Jun 2010 09:56:32 GMT
+Server: Apache/2.2.3 (Red Hat)
+Cache-Control: public
+Pragma: \r\n\
+Location: http://www.bonjourmadame.fr/
+Vary: Accept-Encoding
+Content-Length: 0
+Content-Type: text/html; charset=UTF-8
+Connection: keep-alive
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.0"
+off=8 version complete
+off=13 len=17 span[status]="Moved Permanently"
+off=32 status complete
+off=32 len=4 span[header_field]="Date"
+off=37 header_field complete
+off=38 len=29 span[header_value]="Thu, 03 Jun 2010 09:56:32 GMT"
+off=69 header_value complete
+off=69 len=6 span[header_field]="Server"
+off=76 header_field complete
+off=77 len=22 span[header_value]="Apache/2.2.3 (Red Hat)"
+off=101 header_value complete
+off=101 len=13 span[header_field]="Cache-Control"
+off=115 header_field complete
+off=116 len=6 span[header_value]="public"
+off=124 header_value complete
+off=124 len=6 span[header_field]="Pragma"
+off=131 header_field complete
+off=134 len=0 span[header_value]=""
+off=134 header_value complete
+off=134 len=8 span[header_field]="Location"
+off=143 header_field complete
+off=144 len=28 span[header_value]="http://www.bonjourmadame.fr/"
+off=174 header_value complete
+off=174 len=4 span[header_field]="Vary"
+off=179 header_field complete
+off=180 len=15 span[header_value]="Accept-Encoding"
+off=197 header_value complete
+off=197 len=14 span[header_field]="Content-Length"
+off=212 header_field complete
+off=213 len=1 span[header_value]="0"
+off=216 header_value complete
+off=216 len=12 span[header_field]="Content-Type"
+off=229 header_field complete
+off=230 len=24 span[header_value]="text/html; charset=UTF-8"
+off=256 header_value complete
+off=256 len=10 span[header_field]="Connection"
+off=267 header_field complete
+off=268 len=10 span[header_value]="keep-alive"
+off=280 header_value complete
+off=282 headers complete status=301 v=1/0 flags=21 content_length=0
+off=282 message complete
+```
+
+## Spaces in header value
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Date: Tue, 28 Sep 2010 01:14:13 GMT
+Server: Apache
+Cache-Control: no-cache, must-revalidate
+Expires: Mon, 26 Jul 1997 05:00:00 GMT
+.et-Cookie: PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com
+Vary: Accept-Encoding
+_eep-Alive: timeout=45
+_onnection: Keep-Alive
+Transfer-Encoding: chunked
+Content-Type: text/html
+Connection: close
+
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=4 span[header_field]="Date"
+off=22 header_field complete
+off=23 len=29 span[header_value]="Tue, 28 Sep 2010 01:14:13 GMT"
+off=54 header_value complete
+off=54 len=6 span[header_field]="Server"
+off=61 header_field complete
+off=62 len=6 span[header_value]="Apache"
+off=70 header_value complete
+off=70 len=13 span[header_field]="Cache-Control"
+off=84 header_field complete
+off=85 len=25 span[header_value]="no-cache, must-revalidate"
+off=112 header_value complete
+off=112 len=7 span[header_field]="Expires"
+off=120 header_field complete
+off=121 len=29 span[header_value]="Mon, 26 Jul 1997 05:00:00 GMT"
+off=152 header_value complete
+off=152 len=10 span[header_field]=".et-Cookie"
+off=163 header_field complete
+off=164 len=54 span[header_value]="PlaxoCS=1274804622353690521; path=/; domain=.plaxo.com"
+off=220 header_value complete
+off=220 len=4 span[header_field]="Vary"
+off=225 header_field complete
+off=226 len=15 span[header_value]="Accept-Encoding"
+off=243 header_value complete
+off=243 len=10 span[header_field]="_eep-Alive"
+off=254 header_field complete
+off=255 len=10 span[header_value]="timeout=45"
+off=267 header_value complete
+off=267 len=10 span[header_field]="_onnection"
+off=278 header_field complete
+off=279 len=10 span[header_value]="Keep-Alive"
+off=291 header_value complete
+off=291 len=17 span[header_field]="Transfer-Encoding"
+off=309 header_field complete
+off=310 len=7 span[header_value]="chunked"
+off=319 header_value complete
+off=319 len=12 span[header_field]="Content-Type"
+off=332 header_field complete
+off=333 len=9 span[header_value]="text/html"
+off=344 header_value complete
+off=344 len=10 span[header_field]="Connection"
+off=355 header_field complete
+off=356 len=5 span[header_value]="close"
+off=363 header_value complete
+off=365 headers complete status=200 v=1/1 flags=20a content_length=0
+off=368 chunk header len=0
+off=370 chunk complete
+off=370 message complete
+```
+
+## Spaces in header name in strict mode
+
+<!-- meta={"type": "response", "mode": "strict", "noScan": true} -->
+```http
+HTTP/1.1 200 OK
+Server: Microsoft-IIS/6.0
+X-Powered-By: ASP.NET
+en-US Content-Type: text/xml
+Content-Type: text/xml
+Content-Length: 16
+Date: Fri, 23 Jul 2010 18:45:38 GMT
+Connection: keep-alive
+
+<xml>hello</xml>
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=6 span[header_field]="Server"
+off=24 header_field complete
+off=25 len=17 span[header_value]="Microsoft-IIS/6.0"
+off=44 header_value complete
+off=44 len=12 span[header_field]="X-Powered-By"
+off=57 header_field complete
+off=58 len=7 span[header_value]="ASP.NET"
+off=67 header_value complete
+off=72 error code=10 reason="Invalid header token"
+```
+
+## Spaces in header name in loose mode
+
+`en-US Content-Type` must be treated as a header name
+
+<!-- meta={"type": "response", "mode": "loose"} -->
+```http
+HTTP/1.1 200 OK
+Server: Microsoft-IIS/6.0
+X-Powered-By: ASP.NET
+en-US Content-Type: text/xml
+Content-Type: text/xml
+Content-Length: 16
+Date: Fri, 23 Jul 2010 18:45:38 GMT
+Connection: keep-alive
+
+<xml>hello</xml>
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=6 span[header_field]="Server"
+off=24 header_field complete
+off=25 len=17 span[header_value]="Microsoft-IIS/6.0"
+off=44 header_value complete
+off=44 len=12 span[header_field]="X-Powered-By"
+off=57 header_field complete
+off=58 len=7 span[header_value]="ASP.NET"
+off=67 header_value complete
+off=67 len=18 span[header_field]="en-US Content-Type"
+off=86 header_field complete
+off=87 len=8 span[header_value]="text/xml"
+off=97 header_value complete
+off=97 len=12 span[header_field]="Content-Type"
+off=110 header_field complete
+off=111 len=8 span[header_value]="text/xml"
+off=121 header_value complete
+off=121 len=14 span[header_field]="Content-Length"
+off=136 header_field complete
+off=137 len=2 span[header_value]="16"
+off=141 header_value complete
+off=141 len=4 span[header_field]="Date"
+off=146 header_field complete
+off=147 len=29 span[header_value]="Fri, 23 Jul 2010 18:45:38 GMT"
+off=178 header_value complete
+off=178 len=10 span[header_field]="Connection"
+off=189 header_field complete
+off=190 len=10 span[header_value]="keep-alive"
+off=202 header_value complete
+off=204 headers complete status=200 v=1/1 flags=21 content_length=16
+off=204 len=16 span[body]="<xml>hello</xml>"
+off=220 message complete
+```
+
+## Non ASCII in status line
+
+<!-- meta={"type": "response", "noScan": true} -->
+```http
+HTTP/1.1 500 Oriƫntatieprobleem
+Date: Fri, 5 Nov 2010 23:07:12 GMT+2
+Content-Length: 0
+Connection: close
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=19 span[status]="Oriƫntatieprobleem"
+off=34 status complete
+off=34 len=4 span[header_field]="Date"
+off=39 header_field complete
+off=40 len=30 span[header_value]="Fri, 5 Nov 2010 23:07:12 GMT+2"
+off=72 header_value complete
+off=72 len=14 span[header_field]="Content-Length"
+off=87 header_field complete
+off=88 len=1 span[header_value]="0"
+off=91 header_value complete
+off=91 len=10 span[header_field]="Connection"
+off=102 header_field complete
+off=103 len=5 span[header_value]="close"
+off=110 header_value complete
+off=112 headers complete status=500 v=1/1 flags=22 content_length=0
+off=112 message complete
+```
+
+## HTTP version 0.9
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/0.9 200 OK
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="0.9"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=19 headers complete status=200 v=0/9 flags=0 content_length=0
+```
+
+## No Content-Length, no Transfer-Encoding
+
+The client should wait for the server's EOF. That is, when neither
+content-length nor transfer-encoding is specified, the end of body
+is specified by the EOF.
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Content-Type: text/plain
+
+hello world
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=12 span[header_field]="Content-Type"
+off=30 header_field complete
+off=31 len=10 span[header_value]="text/plain"
+off=43 header_value complete
+off=45 headers complete status=200 v=1/1 flags=0 content_length=0
+off=45 len=11 span[body]="hello world"
+```
+
+## Response starting with CRLF
+
+<!-- meta={"type": "response"} -->
+```http
+\r\nHTTP/1.1 200 OK
+Header1: Value1
+Header2:\t Value2
+Content-Length: 0
+
+
+```
+
+```log
+off=2 message begin
+off=7 len=3 span[version]="1.1"
+off=10 version complete
+off=15 len=2 span[status]="OK"
+off=19 status complete
+off=19 len=7 span[header_field]="Header1"
+off=27 header_field complete
+off=28 len=6 span[header_value]="Value1"
+off=36 header_value complete
+off=36 len=7 span[header_field]="Header2"
+off=44 header_field complete
+off=46 len=6 span[header_value]="Value2"
+off=54 header_value complete
+off=54 len=14 span[header_field]="Content-Length"
+off=69 header_field complete
+off=70 len=1 span[header_value]="0"
+off=73 header_value complete
+off=75 headers complete status=200 v=1/1 flags=20 content_length=0
+off=75 message complete
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/response/transfer-encoding.md b/third_party/python/aiohttp/vendor/llhttp/test/response/transfer-encoding.md
new file mode 100644
index 0000000000..6a2252e4a0
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/response/transfer-encoding.md
@@ -0,0 +1,410 @@
+Transfer-Encoding header
+========================
+
+## Trailing space on chunked body
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Content-Type: text/plain
+Transfer-Encoding: chunked
+
+25 \r\n\
+This is the data in the first chunk
+
+1C
+and this is the second one
+
+0 \r\n\
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=12 span[header_field]="Content-Type"
+off=30 header_field complete
+off=31 len=10 span[header_value]="text/plain"
+off=43 header_value complete
+off=43 len=17 span[header_field]="Transfer-Encoding"
+off=61 header_field complete
+off=62 len=7 span[header_value]="chunked"
+off=71 header_value complete
+off=73 headers complete status=200 v=1/1 flags=208 content_length=0
+off=75 error code=12 reason="Invalid character in chunk size"
+```
+
+## `chunked` before other transfer-encoding
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Accept: */*
+Transfer-Encoding: chunked, deflate
+
+World
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=6 span[header_field]="Accept"
+off=24 header_field complete
+off=25 len=3 span[header_value]="*/*"
+off=30 header_value complete
+off=30 len=17 span[header_field]="Transfer-Encoding"
+off=48 header_field complete
+off=49 len=16 span[header_value]="chunked, deflate"
+off=67 header_value complete
+off=69 headers complete status=200 v=1/1 flags=200 content_length=0
+off=69 len=5 span[body]="World"
+```
+
+## multiple transfer-encoding where chunked is not the last one
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Accept: */*
+Transfer-Encoding: chunked
+Transfer-Encoding: identity
+
+World
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=6 span[header_field]="Accept"
+off=24 header_field complete
+off=25 len=3 span[header_value]="*/*"
+off=30 header_value complete
+off=30 len=17 span[header_field]="Transfer-Encoding"
+off=48 header_field complete
+off=49 len=7 span[header_value]="chunked"
+off=58 header_value complete
+off=58 len=17 span[header_field]="Transfer-Encoding"
+off=76 header_field complete
+off=77 len=8 span[header_value]="identity"
+off=87 header_value complete
+off=89 headers complete status=200 v=1/1 flags=200 content_length=0
+off=89 len=5 span[body]="World"
+```
+
+## `chunkedchunked` transfer-encoding does not enable chunked enconding
+
+This check that the word `chunked` repeat more than once (with or without spaces) does not mistakenly enables chunked encoding.
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Accept: */*
+Transfer-Encoding: chunkedchunked
+
+2
+OK
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=6 span[header_field]="Accept"
+off=24 header_field complete
+off=25 len=3 span[header_value]="*/*"
+off=30 header_value complete
+off=30 len=17 span[header_field]="Transfer-Encoding"
+off=48 header_field complete
+off=49 len=14 span[header_value]="chunkedchunked"
+off=65 header_value complete
+off=67 headers complete status=200 v=1/1 flags=200 content_length=0
+off=67 len=1 span[body]="2"
+off=68 len=1 span[body]=cr
+off=69 len=1 span[body]=lf
+off=70 len=2 span[body]="OK"
+off=72 len=1 span[body]=cr
+off=73 len=1 span[body]=lf
+off=74 len=1 span[body]="0"
+off=75 len=1 span[body]=cr
+off=76 len=1 span[body]=lf
+off=77 len=1 span[body]=cr
+off=78 len=1 span[body]=lf
+```
+
+## Chunk extensions
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Host: localhost
+Transfer-encoding: chunked
+
+5;ilovew3;somuchlove=aretheseparametersfor
+hello
+6;blahblah;blah
+ world
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=9 span[header_value]="localhost"
+off=34 header_value complete
+off=34 len=17 span[header_field]="Transfer-encoding"
+off=52 header_field complete
+off=53 len=7 span[header_value]="chunked"
+off=62 header_value complete
+off=64 headers complete status=200 v=1/1 flags=208 content_length=0
+off=66 len=7 span[chunk_extension_name]="ilovew3"
+off=74 chunk_extension_name complete
+off=74 len=10 span[chunk_extension_name]="somuchlove"
+off=85 chunk_extension_name complete
+off=85 len=21 span[chunk_extension_value]="aretheseparametersfor"
+off=107 chunk_extension_value complete
+off=108 chunk header len=5
+off=108 len=5 span[body]="hello"
+off=115 chunk complete
+off=117 len=8 span[chunk_extension_name]="blahblah"
+off=126 chunk_extension_name complete
+off=126 len=4 span[chunk_extension_name]="blah"
+off=131 chunk_extension_name complete
+off=132 chunk header len=6
+off=132 len=6 span[body]=" world"
+off=140 chunk complete
+off=143 chunk header len=0
+off=145 chunk complete
+off=145 message complete
+```
+
+## No semicolon before chunk extensions
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Host: localhost
+Transfer-encoding: chunked
+
+2 erfrferferf
+aa
+0 rrrr
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=9 span[header_value]="localhost"
+off=34 header_value complete
+off=34 len=17 span[header_field]="Transfer-encoding"
+off=52 header_field complete
+off=53 len=7 span[header_value]="chunked"
+off=62 header_value complete
+off=64 headers complete status=200 v=1/1 flags=208 content_length=0
+off=65 error code=12 reason="Invalid character in chunk size"
+```
+
+
+## No extension after semicolon
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Host: localhost
+Transfer-encoding: chunked
+
+2;
+aa
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=9 span[header_value]="localhost"
+off=34 header_value complete
+off=34 len=17 span[header_field]="Transfer-encoding"
+off=52 header_field complete
+off=53 len=7 span[header_value]="chunked"
+off=62 header_value complete
+off=64 headers complete status=200 v=1/1 flags=208 content_length=0
+off=67 error code=2 reason="Invalid character in chunk extensions"
+```
+
+
+## Chunk extensions quoting
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Host: localhost
+Transfer-Encoding: chunked
+
+5;ilovew3="I love; extensions";somuchlove="aretheseparametersfor";blah;foo=bar
+hello
+6;blahblah;blah
+ world
+0
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=9 span[header_value]="localhost"
+off=34 header_value complete
+off=34 len=17 span[header_field]="Transfer-Encoding"
+off=52 header_field complete
+off=53 len=7 span[header_value]="chunked"
+off=62 header_value complete
+off=64 headers complete status=200 v=1/1 flags=208 content_length=0
+off=66 len=7 span[chunk_extension_name]="ilovew3"
+off=74 chunk_extension_name complete
+off=74 len=20 span[chunk_extension_value]=""I love; extensions""
+off=94 chunk_extension_value complete
+off=95 len=10 span[chunk_extension_name]="somuchlove"
+off=106 chunk_extension_name complete
+off=106 len=23 span[chunk_extension_value]=""aretheseparametersfor""
+off=129 chunk_extension_value complete
+off=130 len=4 span[chunk_extension_name]="blah"
+off=135 chunk_extension_name complete
+off=135 len=3 span[chunk_extension_name]="foo"
+off=139 chunk_extension_name complete
+off=139 len=3 span[chunk_extension_value]="bar"
+off=143 chunk_extension_value complete
+off=144 chunk header len=5
+off=144 len=5 span[body]="hello"
+off=151 chunk complete
+off=153 len=8 span[chunk_extension_name]="blahblah"
+off=162 chunk_extension_name complete
+off=162 len=4 span[chunk_extension_name]="blah"
+off=167 chunk_extension_name complete
+off=168 chunk header len=6
+off=168 len=6 span[body]=" world"
+off=176 chunk complete
+off=179 chunk header len=0
+```
+
+
+## Unbalanced chunk extensions quoting
+
+<!-- meta={"type": "response"} -->
+```http
+HTTP/1.1 200 OK
+Host: localhost
+Transfer-Encoding: chunked
+
+5;ilovew3="abc";somuchlove="def; ghi
+hello
+6;blahblah;blah
+ world
+0
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=4 span[header_field]="Host"
+off=22 header_field complete
+off=23 len=9 span[header_value]="localhost"
+off=34 header_value complete
+off=34 len=17 span[header_field]="Transfer-Encoding"
+off=52 header_field complete
+off=53 len=7 span[header_value]="chunked"
+off=62 header_value complete
+off=64 headers complete status=200 v=1/1 flags=208 content_length=0
+off=66 len=7 span[chunk_extension_name]="ilovew3"
+off=74 chunk_extension_name complete
+off=74 len=5 span[chunk_extension_value]=""abc""
+off=79 chunk_extension_value complete
+off=80 len=10 span[chunk_extension_name]="somuchlove"
+off=91 chunk_extension_name complete
+off=91 len=9 span[chunk_extension_value]=""def; ghi"
+off=101 error code=2 reason="Invalid character in chunk extensions quoted value"
+```
+
+
+## Invalid OBS fold after chunked value
+
+<!-- meta={"type": "response" } -->
+```http
+HTTP/1.1 200 OK
+Transfer-Encoding: chunked
+ abc
+
+5
+World
+0
+
+
+```
+
+```log
+off=0 message begin
+off=5 len=3 span[version]="1.1"
+off=8 version complete
+off=13 len=2 span[status]="OK"
+off=17 status complete
+off=17 len=17 span[header_field]="Transfer-Encoding"
+off=35 header_field complete
+off=36 len=7 span[header_value]="chunked"
+off=45 len=5 span[header_value]=" abc"
+off=52 header_value complete
+off=54 headers complete status=200 v=1/1 flags=200 content_length=0
+off=54 len=1 span[body]="5"
+off=55 len=1 span[body]=cr
+off=56 len=1 span[body]=lf
+off=57 len=5 span[body]="World"
+off=62 len=1 span[body]=cr
+off=63 len=1 span[body]=lf
+off=64 len=1 span[body]="0"
+off=65 len=1 span[body]=cr
+off=66 len=1 span[body]=lf
+off=67 len=1 span[body]=cr
+off=68 len=1 span[body]=lf
+```
+
diff --git a/third_party/python/aiohttp/vendor/llhttp/test/url.md b/third_party/python/aiohttp/vendor/llhttp/test/url.md
new file mode 100644
index 0000000000..6f0a7ed4ef
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/test/url.md
@@ -0,0 +1,283 @@
+# URL tests
+
+## Absolute URL
+
+```url
+http://example.com/path?query=value#schema
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=11 span[url.host]="example.com"
+off=18 len=5 span[url.path]="/path"
+off=24 len=11 span[url.query]="query=value"
+off=36 len=6 span[url.fragment]="schema"
+```
+
+## Relative URL
+
+```url
+/path?query=value#schema
+```
+
+```log
+off=0 len=5 span[url.path]="/path"
+off=6 len=11 span[url.query]="query=value"
+off=18 len=6 span[url.fragment]="schema"
+```
+
+## Failing on broken schema
+
+<!-- meta={"noScan": true} -->
+```url
+schema:/path?query=value#schema
+```
+
+```log
+off=0 len=6 span[url.schema]="schema"
+off=8 error code=7 reason="Unexpected char in url schema"
+```
+
+## Proxy request
+
+```url
+http://hostname/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=8 span[url.host]="hostname"
+off=15 len=1 span[url.path]="/"
+```
+
+## Proxy request with port
+
+```url
+http://hostname:444/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=12 span[url.host]="hostname:444"
+off=19 len=1 span[url.path]="/"
+```
+
+## Proxy IPv6 request
+
+```url
+http://[1:2::3:4]/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=10 span[url.host]="[1:2::3:4]"
+off=17 len=1 span[url.path]="/"
+```
+
+## Proxy IPv6 request with port
+
+```url
+http://[1:2::3:4]:67/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=13 span[url.host]="[1:2::3:4]:67"
+off=20 len=1 span[url.path]="/"
+```
+
+## IPv4 in IPv6 address
+
+```url
+http://[2001:0000:0000:0000:0000:0000:1.9.1.1]/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=39 span[url.host]="[2001:0000:0000:0000:0000:0000:1.9.1.1]"
+off=46 len=1 span[url.path]="/"
+```
+
+## Extra `?` in query string
+
+```url
+http://a.tbcdn.cn/p/fp/2010c/??fp-header-min.css,fp-base-min.css,\
+fp-channel-min.css,fp-product-min.css,fp-mall-min.css,fp-category-min.css,\
+fp-sub-min.css,fp-gdp4p-min.css,fp-css3-min.css,fp-misc-min.css?t=20101022.css
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=10 span[url.host]="a.tbcdn.cn"
+off=17 len=12 span[url.path]="/p/fp/2010c/"
+off=30 len=187 span[url.query]="?fp-header-min.css,fp-base-min.css,fp-channel-min.css,fp-product-min.css,fp-mall-min.css,fp-category-min.css,fp-sub-min.css,fp-gdp4p-min.css,fp-css3-min.css,fp-misc-min.css?t=20101022.css"
+```
+
+## URL encoded space
+
+```url
+/toto.html?toto=a%20b
+```
+
+```log
+off=0 len=10 span[url.path]="/toto.html"
+off=11 len=10 span[url.query]="toto=a%20b"
+```
+
+## URL fragment
+
+```url
+/toto.html#titi
+```
+
+```log
+off=0 len=10 span[url.path]="/toto.html"
+off=11 len=4 span[url.fragment]="titi"
+```
+
+## Complex URL fragment
+
+```url
+http://www.webmasterworld.com/r.cgi?f=21&d=8405&url=\
+http://www.example.com/index.html?foo=bar&hello=world#midpage
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=22 span[url.host]="www.webmasterworld.com"
+off=29 len=6 span[url.path]="/r.cgi"
+off=36 len=69 span[url.query]="f=21&d=8405&url=http://www.example.com/index.html?foo=bar&hello=world"
+off=106 len=7 span[url.fragment]="midpage"
+```
+
+## Complex URL from node.js url parser doc
+
+```url
+http://host.com:8080/p/a/t/h?query=string#hash
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=13 span[url.host]="host.com:8080"
+off=20 len=8 span[url.path]="/p/a/t/h"
+off=29 len=12 span[url.query]="query=string"
+off=42 len=4 span[url.fragment]="hash"
+```
+
+## Complex URL with basic auth from node.js url parser doc
+
+```url
+http://a:b@host.com:8080/p/a/t/h?query=string#hash
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=17 span[url.host]="a:b@host.com:8080"
+off=24 len=8 span[url.path]="/p/a/t/h"
+off=33 len=12 span[url.query]="query=string"
+off=46 len=4 span[url.fragment]="hash"
+```
+
+## Double `@`
+
+<!-- meta={"noScan": true} -->
+```url
+http://a:b@@hostname:443/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=12 error code=7 reason="Double @ in url"
+```
+
+## Proxy basic auth with url encoded space
+
+```url
+http://a%20:b@host.com/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=15 span[url.host]="a%20:b@host.com"
+off=22 len=1 span[url.path]="/"
+```
+
+## Proxy basic auth with unreserved chars
+
+```url
+http://a!;-_!=+$@host.com/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=18 span[url.host]="a!;-_!=+$@host.com"
+off=25 len=1 span[url.path]="/"
+```
+
+## IPv6 address with Zone ID
+
+```url
+http://[fe80::a%25eth0]/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=16 span[url.host]="[fe80::a%25eth0]"
+off=23 len=1 span[url.path]="/"
+```
+
+## IPv6 address with Zone ID, but `%` is not percent-encoded
+
+```url
+http://[fe80::a%eth0]/
+```
+
+```log
+off=0 len=4 span[url.schema]="http"
+off=7 len=14 span[url.host]="[fe80::a%eth0]"
+off=21 len=1 span[url.path]="/"
+```
+
+## Disallow tab in URL in strict mode
+
+<!-- meta={"mode": "strict", "noScan": true} -->
+```url
+/foo\tbar/
+```
+
+```log
+off=5 error code=7 reason="Invalid characters in url (strict mode)"
+```
+
+## Tab in URL in loose mode
+
+<!-- meta={"mode": "loose"} -->
+```url
+/foo\tbar/
+```
+
+```log
+off=0 len=9 span[url.path]="/foo\tbar/"
+```
+
+## Disallow form-feed in URL in strict mode
+
+<!-- meta={"mode": "strict", "noScan": true} -->
+```url
+/foo\fbar/
+```
+
+```log
+off=5 error code=7 reason="Invalid characters in url (strict mode)"
+```
+
+## Form-feed in URL in loose mode
+
+<!-- meta={"mode": "loose"} -->
+```url
+/foo\fbar/
+```
+
+```log
+off=0 len=9 span[url.path]="/foo\fbar/"
+```
diff --git a/third_party/python/aiohttp/vendor/llhttp/tsconfig.json b/third_party/python/aiohttp/vendor/llhttp/tsconfig.json
new file mode 100644
index 0000000000..01ec7c264a
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/tsconfig.json
@@ -0,0 +1,15 @@
+{
+ "compilerOptions": {
+ "strict": true,
+ "target": "es2017",
+ "module": "commonjs",
+ "moduleResolution": "node",
+ "outDir": "./lib",
+ "declaration": true,
+ "pretty": true,
+ "sourceMap": true
+ },
+ "include": [
+ "src/**/*.ts"
+ ]
+}
diff --git a/third_party/python/aiohttp/vendor/llhttp/tslint.json b/third_party/python/aiohttp/vendor/llhttp/tslint.json
new file mode 100644
index 0000000000..b0aaf97bc0
--- /dev/null
+++ b/third_party/python/aiohttp/vendor/llhttp/tslint.json
@@ -0,0 +1,14 @@
+{
+ "defaultSeverity": "error",
+ "extends": [
+ "tslint:recommended"
+ ],
+ "jsRules": {},
+ "rules": {
+ "no-bitwise": null,
+ "quotemark": [
+ true, "single", "avoid-escape", "avoid-template"
+ ]
+ },
+ "rulesDirectory": []
+}