diff --git a/deps/llhttp/CMakeLists.txt b/deps/llhttp/CMakeLists.txt index 41d2000e993d70..c2342223de7b89 100644 --- a/deps/llhttp/CMakeLists.txt +++ b/deps/llhttp/CMakeLists.txt @@ -1,53 +1,115 @@ cmake_minimum_required(VERSION 3.5.1) cmake_policy(SET CMP0069 NEW) -project(llhttp C) +project(llhttp VERSION 6.0.5) +include(GNUInstallDirs) set(CMAKE_C_STANDARD 99) +# By default build in relwithdebinfo type, supports both lowercase and uppercase +if(NOT CMAKE_CONFIGURATION_TYPES) + set(allowableBuileTypes DEBUG RELEASE RELWITHDEBINFO MINSIZEREL) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "${allowableBuileTypes}") + 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 allowableBuileTypes) + message(FATEL_ERROR "Invalid build type: ${CMAKE_BUILD_TYPE}") + endif() + endif() +endif() + # # Options # # Generic option -option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF) +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 - src/llhttp.c - src/http.c - src/api.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/llhttp.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/http.c + ${CMAKE_CURRENT_SOURCE_DIR}/src/api.c ) set(LLHTTP_HEADERS - include/llhttp.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/llhttp.h ) -add_library(llhttp) -add_library(llhttp::llhttp ALIAS llhttp) +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc.in + ${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc + @ONLY +) -target_sources(llhttp PRIVATE ${LLHTTP_SOURCES} ${LLHTTP_HEADERS}) +function(config_library target) + target_sources(${target} PRIVATE ${LLHTTP_SOURCES} ${LLHTTP_HEADERS}) -# 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() + target_include_directories(${target} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/include + ) -target_include_directories(llhttp PUBLIC - $ - $ -) + set_target_properties(${target} PROPERTIES + OUTPUT_NAME llhttp + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + PUBLIC_HEADER ${LLHTTP_HEADERS} + ) -set_target_properties(llhttp PROPERTIES 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(TARGETS llhttp - EXPORT llhttp - ARCHIVE DESTINATION lib - PUBLIC_HEADER DESTINATION include/ -) + install(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) -# This is required to work with FetchContent -install(EXPORT llhttp + # This is required to work with FetchContent + install(EXPORT llhttp FILE llhttp-config.cmake NAMESPACE llhttp:: - DESTINATION lib/cmake/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/deps/llhttp/README.md b/deps/llhttp/README.md index 1c37cf662b9c05..fb31ce2cfc610e 100644 --- a/deps/llhttp/README.md +++ b/deps/llhttp/README.md @@ -90,7 +90,16 @@ if (err == HPE_OK) { parser.reason); } ``` -For more information on API usage, please refer to [src/native/api.h](https://github.com/nodejs/llhttp/blob/master/src/native/api.h). +For more information on API usage, please refer to [src/native/api.h](https://github.com/nodejs/llhttp/blob/main/src/native/api.h). + +## Build Instructions + +Make sure you have [Node.js](https://nodejs.org/), npm and npx installed. Then under project directory run: + +```sh +npm install +make +``` --- @@ -99,20 +108,41 @@ For more information on API usage, please refer to [src/native/api.h](https://gi * Python: [pallas/pyllhttp][8] * Ruby: [metabahn/llhttp][9] - ### Using with CMake If you want to use this library in a CMake project you can use the snippet below. ``` FetchContent_Declare(llhttp - URL "https://github.com/nodejs/llhttp/releases/download/v6.0.4/llhttp-release-v6.0.4.tar.gz") # Using version 6.0.4 + URL "https://github.com/nodejs/llhttp/releases/download/v6.0.5/llhttp-release-v6.0.5.tar.gz") # Using version 6.0.5 FetchContent_MakeAvailable(llhttp) target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp ${PROJECT_NAME}) ``` +## 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. diff --git a/deps/llhttp/include/llhttp.h b/deps/llhttp/include/llhttp.h index 94b14988164531..c9f1251ca4da0e 100644 --- a/deps/llhttp/include/llhttp.h +++ b/deps/llhttp/include/llhttp.h @@ -3,7 +3,7 @@ #define LLHTTP_VERSION_MAJOR 6 #define LLHTTP_VERSION_MINOR 0 -#define LLHTTP_VERSION_PATCH 6 +#define LLHTTP_VERSION_PATCH 7 #ifndef LLHTTP_STRICT_MODE # define LLHTTP_STRICT_MODE 0 @@ -59,6 +59,7 @@ 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_CLOSED_CONNECTION = 5, @@ -100,7 +101,8 @@ typedef enum llhttp_flags llhttp_flags_t; enum llhttp_lenient_flags { LENIENT_HEADERS = 0x1, LENIENT_CHUNKED_LENGTH = 0x2, - LENIENT_KEEP_ALIVE = 0x4 + LENIENT_KEEP_ALIVE = 0x4, + LENIENT_TRANSFER_ENCODING = 0x8 }; typedef enum llhttp_lenient_flags llhttp_lenient_flags_t; @@ -172,6 +174,7 @@ typedef enum llhttp_method llhttp_method_t; 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(5, CLOSED_CONNECTION, CLOSED_CONNECTION) \ @@ -374,8 +377,6 @@ LLHTTP_EXPORT void llhttp_init(llhttp_t* parser, llhttp_type_t type, const llhttp_settings_t* settings); -#if defined(__wasm__) - LLHTTP_EXPORT llhttp_t* llhttp_alloc(llhttp_type_t type); @@ -400,8 +401,6 @@ int llhttp_get_status_code(llhttp_t* parser); LLHTTP_EXPORT uint8_t llhttp_get_upgrade(llhttp_t* parser); -#endif // defined(__wasm__) - /* Reset an already initialized parser back to the start state, preserving the * existing parser type, callback settings, user data, and lenient flags. */ @@ -556,6 +555,19 @@ void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled); */ 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)** + */ +void llhttp_set_lenient_transfer_encoding(llhttp_t* parser, int enabled); + #ifdef __cplusplus } /* extern "C" */ #endif diff --git a/deps/llhttp/libllhttp.pc.in b/deps/llhttp/libllhttp.pc.in new file mode 100644 index 00000000000000..67d280a830dcc9 --- /dev/null +++ b/deps/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/deps/llhttp/src/api.c b/deps/llhttp/src/api.c index 1a3bf7b5f3527c..c4ce197c585f64 100644 --- a/deps/llhttp/src/api.c +++ b/deps/llhttp/src/api.c @@ -253,6 +253,14 @@ void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled) { } } +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 */ diff --git a/deps/llhttp/src/http.c b/deps/llhttp/src/http.c index e6279f3bc2cab9..3a66044f5fb716 100644 --- a/deps/llhttp/src/http.c +++ b/deps/llhttp/src/http.c @@ -52,7 +52,8 @@ int llhttp__after_headers_complete(llhttp_t* parser, const char* p, 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_CHUNKED_LENGTH) == 0 && + (parser->lenient_flags & LENIENT_TRANSFER_ENCODING) == 0) { /* RFC 7230 3.3.3 */ /* If a Transfer-Encoding header field diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c index eb49b0c47cc0ce..296a1a75ac1112 100644 --- a/deps/llhttp/src/llhttp.c +++ b/deps/llhttp/src/llhttp.c @@ -359,6 +359,8 @@ enum llparse_state_e { 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_23, + s_n_llhttp__internal__n_header_value_lenient_failed, 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, @@ -366,14 +368,16 @@ enum llparse_state_e { 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_25, s_n_llhttp__internal__n_error_26, + s_n_llhttp__internal__n_error_27, s_n_llhttp__internal__n_header_value_content_length_ws, s_n_llhttp__internal__n_header_value_content_length, - s_n_llhttp__internal__n_header_value_te_chunked_last, + s_n_llhttp__internal__n_error_29, + s_n_llhttp__internal__n_error_28, 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, @@ -883,6 +887,20 @@ int llhttp__internal__c_or_flags_15( 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_4( + 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, @@ -907,7 +925,7 @@ int llhttp__internal__c_update_header_state_7( return 0; } -int llhttp__internal__c_or_flags_17( +int llhttp__internal__c_or_flags_18( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -1692,10 +1710,10 @@ static llparse_state_t llhttp__internal__run( } switch (*p) { case 10: { - goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1; + 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_3; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4; } default: { p++; @@ -1705,17 +1723,40 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } + case s_n_llhttp__internal__n_error_23: + s_n_llhttp__internal__n_error_23: { + state->error = 0x19; + state->reason = "Missing expected CR after 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_lenient_failed: + s_n_llhttp__internal__n_header_value_lenient_failed: { + if (p == endp) { + return s_n_llhttp__internal__n_header_value_lenient_failed; + } + switch (*p) { + case 10: { + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2; + } + default: { + goto s_n_llhttp__internal__n_error_24; + } + } + /* 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 10: { - goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1; - } case 13: { - goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1; } default: { goto s_n_llhttp__internal__n_invoke_test_lenient_flags_3; @@ -1895,8 +1936,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - case s_n_llhttp__internal__n_error_25: - s_n_llhttp__internal__n_error_25: { + case s_n_llhttp__internal__n_error_26: + s_n_llhttp__internal__n_error_26: { state->error = 0xb; state->reason = "Content-Length overflow"; state->error_pos = (const char*) p; @@ -1905,8 +1946,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - case s_n_llhttp__internal__n_error_26: - s_n_llhttp__internal__n_error_26: { + case s_n_llhttp__internal__n_error_27: + s_n_llhttp__internal__n_error_27: { state->error = 0xb; state->reason = "Invalid character in Content-Length"; state->error_pos = (const char*) p; @@ -1932,7 +1973,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_value_content_length_ws; } default: { - goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_6; } } /* UNREACHABLE */; @@ -2001,26 +2042,23 @@ static llparse_state_t llhttp__internal__run( /* 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_7; - } - case 13: { - goto s_n_llhttp__internal__n_invoke_update_header_state_7; - } - case ' ': { - p++; - goto s_n_llhttp__internal__n_header_value_te_chunked_last; - } - default: { - goto s_n_llhttp__internal__n_header_value_te_chunked; - } - } + case s_n_llhttp__internal__n_error_29: + s_n_llhttp__internal__n_error_29: { + 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_28: + s_n_llhttp__internal__n_error_28: { + 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(); } @@ -2143,6 +2181,32 @@ static llparse_state_t llhttp__internal__run( /* 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_7; + } + case 13: { + goto s_n_llhttp__internal__n_invoke_update_header_state_7; + } + 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; @@ -2226,7 +2290,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2; } default: { - goto s_n_llhttp__internal__n_error_27; + goto s_n_llhttp__internal__n_error_30; } } /* UNREACHABLE */; @@ -2606,7 +2670,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_to_http_09; } default: { - goto s_n_llhttp__internal__n_error_28; + goto s_n_llhttp__internal__n_error_31; } } /* UNREACHABLE */; @@ -2631,7 +2695,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_skip_lf_to_http09_1; } default: { - goto s_n_llhttp__internal__n_error_28; + goto s_n_llhttp__internal__n_error_31; } } /* UNREACHABLE */; @@ -2649,13 +2713,13 @@ static llparse_state_t llhttp__internal__run( switch (match_seq.status) { case kMatchComplete: { p++; - goto s_n_llhttp__internal__n_error_31; + goto s_n_llhttp__internal__n_error_34; } case kMatchPause: { return s_n_llhttp__internal__n_req_pri_upgrade; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_32; + goto s_n_llhttp__internal__n_error_35; } } /* UNREACHABLE */; @@ -2672,7 +2736,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_field_start; } default: { - goto s_n_llhttp__internal__n_error_30; + goto s_n_llhttp__internal__n_error_33; } } /* UNREACHABLE */; @@ -2693,7 +2757,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_http_complete_1; } default: { - goto s_n_llhttp__internal__n_error_30; + goto s_n_llhttp__internal__n_error_33; } } /* UNREACHABLE */; @@ -2756,7 +2820,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_http_minor; } default: { - goto s_n_llhttp__internal__n_error_33; + goto s_n_llhttp__internal__n_error_36; } } /* UNREACHABLE */; @@ -2773,7 +2837,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_http_minor; } default: { - goto s_n_llhttp__internal__n_error_34; + goto s_n_llhttp__internal__n_error_37; } } /* UNREACHABLE */; @@ -2836,7 +2900,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_http_major; } default: { - goto s_n_llhttp__internal__n_error_35; + goto s_n_llhttp__internal__n_error_38; } } /* UNREACHABLE */; @@ -2860,7 +2924,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_http_start_1; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_38; + goto s_n_llhttp__internal__n_error_41; } } /* UNREACHABLE */; @@ -2884,7 +2948,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_http_start_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_38; + goto s_n_llhttp__internal__n_error_41; } } /* UNREACHABLE */; @@ -2908,7 +2972,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_http_start_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_38; + goto s_n_llhttp__internal__n_error_41; } } /* UNREACHABLE */; @@ -2937,7 +3001,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_http_start_3; } default: { - goto s_n_llhttp__internal__n_error_38; + goto s_n_llhttp__internal__n_error_41; } } /* UNREACHABLE */; @@ -3028,7 +3092,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_fragment; } default: { - goto s_n_llhttp__internal__n_error_39; + goto s_n_llhttp__internal__n_error_42; } } /* UNREACHABLE */; @@ -3089,7 +3153,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_span_end_stub_query_3; } default: { - goto s_n_llhttp__internal__n_error_40; + goto s_n_llhttp__internal__n_error_43; } } /* UNREACHABLE */; @@ -3127,7 +3191,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_query; } default: { - goto s_n_llhttp__internal__n_error_41; + goto s_n_llhttp__internal__n_error_44; } } /* UNREACHABLE */; @@ -3252,10 +3316,10 @@ static llparse_state_t llhttp__internal__run( } case 8: { p++; - goto s_n_llhttp__internal__n_error_42; + goto s_n_llhttp__internal__n_error_45; } default: { - goto s_n_llhttp__internal__n_error_43; + goto s_n_llhttp__internal__n_error_46; } } /* UNREACHABLE */; @@ -3314,7 +3378,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_server_with_at; } default: { - goto s_n_llhttp__internal__n_error_44; + goto s_n_llhttp__internal__n_error_47; } } /* UNREACHABLE */; @@ -3331,7 +3395,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_server; } default: { - goto s_n_llhttp__internal__n_error_46; + goto s_n_llhttp__internal__n_error_49; } } /* UNREACHABLE */; @@ -3349,7 +3413,7 @@ static llparse_state_t llhttp__internal__run( } case 10: { p++; - goto s_n_llhttp__internal__n_error_45; + goto s_n_llhttp__internal__n_error_48; } case 12: { p++; @@ -3357,18 +3421,18 @@ static llparse_state_t llhttp__internal__run( } case 13: { p++; - goto s_n_llhttp__internal__n_error_45; + goto s_n_llhttp__internal__n_error_48; } case ' ': { p++; - goto s_n_llhttp__internal__n_error_45; + goto s_n_llhttp__internal__n_error_48; } case '/': { p++; goto s_n_llhttp__internal__n_url_schema_delim_1; } default: { - goto s_n_llhttp__internal__n_error_46; + goto s_n_llhttp__internal__n_error_49; } } /* UNREACHABLE */; @@ -3414,7 +3478,7 @@ static llparse_state_t llhttp__internal__run( } case 2: { p++; - goto s_n_llhttp__internal__n_error_45; + goto s_n_llhttp__internal__n_error_48; } case 3: { goto s_n_llhttp__internal__n_span_end_stub_schema; @@ -3424,7 +3488,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_schema; } default: { - goto s_n_llhttp__internal__n_error_47; + goto s_n_llhttp__internal__n_error_50; } } /* UNREACHABLE */; @@ -3460,7 +3524,7 @@ static llparse_state_t llhttp__internal__run( } case 2: { p++; - goto s_n_llhttp__internal__n_error_45; + goto s_n_llhttp__internal__n_error_48; } case 3: { goto s_n_llhttp__internal__n_span_start_stub_path_2; @@ -3469,7 +3533,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_schema; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -3567,7 +3631,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_spaces_before_url; } default: { - goto s_n_llhttp__internal__n_error_49; + goto s_n_llhttp__internal__n_error_52; } } /* UNREACHABLE */; @@ -3585,7 +3649,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3610,7 +3674,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3631,7 +3695,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_3; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3656,7 +3720,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_4; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3681,7 +3745,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_6; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3706,7 +3770,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_8; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3724,7 +3788,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3745,7 +3809,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_9; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3766,7 +3830,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_7; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3791,7 +3855,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_12; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3816,7 +3880,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_13; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3837,7 +3901,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_13; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3854,7 +3918,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_11; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3879,7 +3943,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_14; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3904,7 +3968,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_17; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3946,7 +4010,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_15; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3971,7 +4035,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_18; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -3996,7 +4060,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_20; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4021,7 +4085,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_21; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4042,7 +4106,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_21; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4067,7 +4131,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_23; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4092,7 +4156,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_24; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4117,7 +4181,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_26; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4142,7 +4206,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_28; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4160,7 +4224,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4181,7 +4245,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_29; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4202,7 +4266,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_27; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4227,7 +4291,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_30; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4256,7 +4320,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_30; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4281,7 +4345,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_31; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4306,7 +4370,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_32; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4331,7 +4395,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_35; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4356,7 +4420,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_36; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4377,7 +4441,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_36; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4402,7 +4466,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_37; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4427,7 +4491,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_38; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4452,7 +4516,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_42; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4477,7 +4541,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_43; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4498,7 +4562,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_43; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4515,7 +4579,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_41; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4537,7 +4601,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_40; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4562,7 +4626,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_45; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4584,7 +4648,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4617,7 +4681,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_44; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4642,7 +4706,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_48; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4667,7 +4731,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_49; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4692,7 +4756,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_50; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4717,7 +4781,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_51; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4746,7 +4810,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_51; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4763,7 +4827,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_47; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4788,7 +4852,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_54; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4806,7 +4870,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4831,7 +4895,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_57; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4852,7 +4916,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_57; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4873,7 +4937,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_55; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4898,7 +4962,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_58; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4923,7 +4987,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_59; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4948,7 +5012,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_59; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4973,7 +5037,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_61; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -4998,7 +5062,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_62; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5019,7 +5083,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_62; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5044,7 +5108,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_65; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5069,7 +5133,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_67; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5094,7 +5158,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_68; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5115,7 +5179,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_68; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5140,7 +5204,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_69; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5165,7 +5229,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_69; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5182,7 +5246,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_64; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5259,7 +5323,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_63; } default: { - goto s_n_llhttp__internal__n_error_58; + goto s_n_llhttp__internal__n_error_61; } } /* UNREACHABLE */; @@ -5285,7 +5349,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_llhttp__on_status_complete; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -5360,7 +5424,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_res_status_start; } default: { - goto s_n_llhttp__internal__n_error_52; + goto s_n_llhttp__internal__n_error_55; } } /* UNREACHABLE */; @@ -5440,7 +5504,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_update_status_code; } default: { - goto s_n_llhttp__internal__n_error_53; + goto s_n_llhttp__internal__n_error_56; } } /* UNREACHABLE */; @@ -5503,7 +5567,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_http_minor_1; } default: { - goto s_n_llhttp__internal__n_error_54; + goto s_n_llhttp__internal__n_error_57; } } /* UNREACHABLE */; @@ -5520,7 +5584,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_res_http_minor; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -5583,7 +5647,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_http_major_1; } default: { - goto s_n_llhttp__internal__n_error_56; + goto s_n_llhttp__internal__n_error_59; } } /* UNREACHABLE */; @@ -5607,7 +5671,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_res; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_59; + goto s_n_llhttp__internal__n_error_62; } } /* UNREACHABLE */; @@ -5632,7 +5696,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_or_res_method_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_57; + goto s_n_llhttp__internal__n_error_60; } } /* UNREACHABLE */; @@ -5656,7 +5720,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_or_res_method_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_57; + goto s_n_llhttp__internal__n_error_60; } } /* UNREACHABLE */; @@ -5677,7 +5741,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_or_res_method_3; } default: { - goto s_n_llhttp__internal__n_error_57; + goto s_n_llhttp__internal__n_error_60; } } /* UNREACHABLE */; @@ -5694,7 +5758,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_or_res_method_1; } default: { - goto s_n_llhttp__internal__n_error_57; + goto s_n_llhttp__internal__n_error_60; } } /* UNREACHABLE */; @@ -5763,7 +5827,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_45: { + s_n_llhttp__internal__n_error_48: { state->error = 0x7; state->reason = "Invalid characters in url"; state->error_pos = (const char*) p; @@ -6215,7 +6279,7 @@ static llparse_state_t llhttp__internal__run( 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); @@ -6415,15 +6479,16 @@ static llparse_state_t llhttp__internal__run( err = llhttp__on_header_value(state, start, p); if (err != 0) { state->error = err; - state->error_pos = (const char*) p; + 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: { + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_3: { const unsigned char* start; int err; @@ -6432,16 +6497,15 @@ static llparse_state_t llhttp__internal__run( err = llhttp__on_header_value(state, start, p); if (err != 0) { state->error = err; - state->error_pos = (const char*) (p + 1); + state->error_pos = (const char*) p; 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: { + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4: { const unsigned char* start; int err; @@ -6459,7 +6523,25 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_23: { + 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 + 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_error_24: { state->error = 0xa; state->reason = "Invalid header value char"; state->error_pos = (const char*) p; @@ -6473,7 +6555,7 @@ static llparse_state_t llhttp__internal__run( case 1: goto s_n_llhttp__internal__n_header_value_lenient; default: - goto s_n_llhttp__internal__n_error_23; + goto s_n_llhttp__internal__n_header_value_lenient_failed; } /* UNREACHABLE */; abort(); @@ -6566,7 +6648,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4: { + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: { const unsigned char* start; int err; @@ -6576,17 +6658,17 @@ static llparse_state_t llhttp__internal__run( if (err != 0) { state->error = err; state->error_pos = (const char*) p; - state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_25; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_26; return s_error; } - goto s_n_llhttp__internal__n_error_25; + goto s_n_llhttp__internal__n_error_26; /* 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_4; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5; default: goto s_n_llhttp__internal__n_header_value_content_length; } @@ -6601,7 +6683,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: { + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_6: { const unsigned char* start; int err; @@ -6611,14 +6693,14 @@ static llparse_state_t llhttp__internal__run( if (err != 0) { state->error = err; state->error_pos = (const char*) p; - state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_26; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_27; return s_error; } - goto s_n_llhttp__internal__n_error_26; + goto s_n_llhttp__internal__n_error_27; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_24: { + s_n_llhttp__internal__n_error_25: { state->error = 0x4; state->reason = "Duplicate Content-Length"; state->error_pos = (const char*) p; @@ -6632,8 +6714,26 @@ static llparse_state_t llhttp__internal__run( case 0: goto s_n_llhttp__internal__n_header_value_content_length; default: - goto s_n_llhttp__internal__n_error_24; + goto s_n_llhttp__internal__n_error_25; + } + /* 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_29; + return s_error; } + p++; + goto s_n_llhttp__internal__n_error_29; /* UNREACHABLE */; abort(); } @@ -6645,6 +6745,44 @@ static llparse_state_t llhttp__internal__run( /* 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_28; + return s_error; + } + p++; + goto s_n_llhttp__internal__n_error_28; + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_test_lenient_flags_4: { + switch (llhttp__internal__c_test_lenient_flags_4(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_4; + default: + goto s_n_llhttp__internal__n_header_value_te_chunked; + } + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_invoke_update_header_state_8: { switch (llhttp__internal__c_update_header_state_4(state, p, endp)) { default: @@ -6661,6 +6799,34 @@ static llparse_state_t llhttp__internal__run( /* 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_5: { + switch (llhttp__internal__c_test_lenient_flags_4(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_5; + 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: @@ -6669,8 +6835,18 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_or_flags_17: { - switch (llhttp__internal__c_or_flags_17(state, p, endp)) { + 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_8; } @@ -6684,9 +6860,9 @@ static llparse_state_t llhttp__internal__run( case 2: goto s_n_llhttp__internal__n_invoke_test_flags_2; case 3: - goto s_n_llhttp__internal__n_invoke_or_flags_16; + goto s_n_llhttp__internal__n_invoke_test_flags_3; case 4: - goto s_n_llhttp__internal__n_invoke_or_flags_17; + goto s_n_llhttp__internal__n_invoke_or_flags_18; default: goto s_n_llhttp__internal__n_header_value; } @@ -6729,7 +6905,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_27: { + s_n_llhttp__internal__n_error_30: { state->error = 0xa; state->reason = "Invalid header token"; state->error_pos = (const char*) p; @@ -6803,7 +6979,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_28: { + s_n_llhttp__internal__n_error_31: { state->error = 0x7; state->reason = "Expected CRLF"; state->error_pos = (const char*) p; @@ -6829,7 +7005,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_31: { + s_n_llhttp__internal__n_error_34: { state->error = 0x17; state->reason = "Pause on PRI/Upgrade"; state->error_pos = (const char*) p; @@ -6838,7 +7014,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_32: { + s_n_llhttp__internal__n_error_35: { state->error = 0x9; state->reason = "Expected HTTP/2 Connection Preface"; state->error_pos = (const char*) p; @@ -6847,7 +7023,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_30: { + s_n_llhttp__internal__n_error_33: { state->error = 0x9; state->reason = "Expected CRLF after version"; state->error_pos = (const char*) p; @@ -6874,7 +7050,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_33: { + s_n_llhttp__internal__n_error_36: { state->error = 0x9; state->reason = "Invalid minor version"; state->error_pos = (const char*) p; @@ -6883,7 +7059,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_34: { + s_n_llhttp__internal__n_error_37: { state->error = 0x9; state->reason = "Expected dot"; state->error_pos = (const char*) p; @@ -6900,7 +7076,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_35: { + s_n_llhttp__internal__n_error_38: { state->error = 0x9; state->reason = "Invalid major version"; state->error_pos = (const char*) p; @@ -6909,7 +7085,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_29: { + s_n_llhttp__internal__n_error_32: { state->error = 0x8; state->reason = "Invalid method for HTTP/x.x request"; state->error_pos = (const char*) p; @@ -6991,12 +7167,12 @@ static llparse_state_t llhttp__internal__run( case 34: goto s_n_llhttp__internal__n_req_http_major; default: - goto s_n_llhttp__internal__n_error_29; + goto s_n_llhttp__internal__n_error_32; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_38: { + s_n_llhttp__internal__n_error_41: { state->error = 0x8; state->reason = "Expected HTTP/"; state->error_pos = (const char*) p; @@ -7005,7 +7181,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_36: { + s_n_llhttp__internal__n_error_39: { state->error = 0x8; state->reason = "Expected SOURCE method for ICE/x.x request"; state->error_pos = (const char*) p; @@ -7019,12 +7195,12 @@ static llparse_state_t llhttp__internal__run( case 33: goto s_n_llhttp__internal__n_req_http_major; default: - goto s_n_llhttp__internal__n_error_36; + goto s_n_llhttp__internal__n_error_39; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_37: { + s_n_llhttp__internal__n_error_40: { state->error = 0x8; state->reason = "Invalid method for RTSP/x.x request"; state->error_pos = (const char*) p; @@ -7064,7 +7240,7 @@ static llparse_state_t llhttp__internal__run( case 45: goto s_n_llhttp__internal__n_req_http_major; default: - goto s_n_llhttp__internal__n_error_37; + goto s_n_llhttp__internal__n_error_40; } /* UNREACHABLE */; abort(); @@ -7145,7 +7321,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_39: { + s_n_llhttp__internal__n_error_42: { state->error = 0x7; state->reason = "Invalid char in url fragment start"; state->error_pos = (const char*) p; @@ -7205,7 +7381,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_40: { + s_n_llhttp__internal__n_error_43: { state->error = 0x7; state->reason = "Invalid char in url query"; state->error_pos = (const char*) p; @@ -7214,7 +7390,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_41: { + s_n_llhttp__internal__n_error_44: { state->error = 0x7; state->reason = "Invalid char in url path"; state->error_pos = (const char*) p; @@ -7325,7 +7501,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_42: { + s_n_llhttp__internal__n_error_45: { state->error = 0x7; state->reason = "Double @ in url"; state->error_pos = (const char*) p; @@ -7334,7 +7510,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_43: { + s_n_llhttp__internal__n_error_46: { state->error = 0x7; state->reason = "Unexpected char in url server"; state->error_pos = (const char*) p; @@ -7343,7 +7519,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_44: { + s_n_llhttp__internal__n_error_47: { state->error = 0x7; state->reason = "Unexpected char in url server"; state->error_pos = (const char*) p; @@ -7352,7 +7528,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_46: { + s_n_llhttp__internal__n_error_49: { state->error = 0x7; state->reason = "Unexpected char in url schema"; state->error_pos = (const char*) p; @@ -7361,7 +7537,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_47: { + s_n_llhttp__internal__n_error_50: { state->error = 0x7; state->reason = "Unexpected char in url schema"; state->error_pos = (const char*) p; @@ -7370,7 +7546,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_48: { + s_n_llhttp__internal__n_error_51: { state->error = 0x7; state->reason = "Unexpected start char in url"; state->error_pos = (const char*) p; @@ -7389,7 +7565,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_49: { + s_n_llhttp__internal__n_error_52: { state->error = 0x6; state->reason = "Expected space after method"; state->error_pos = (const char*) p; @@ -7406,7 +7582,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_58: { + s_n_llhttp__internal__n_error_61: { state->error = 0x6; state->reason = "Invalid method encountered"; state->error_pos = (const char*) p; @@ -7415,7 +7591,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_50: { + s_n_llhttp__internal__n_error_53: { state->error = 0xd; state->reason = "Response overflow"; state->error_pos = (const char*) p; @@ -7427,14 +7603,14 @@ static llparse_state_t llhttp__internal__run( 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_50; + goto s_n_llhttp__internal__n_error_53; default: goto s_n_llhttp__internal__n_res_status_code; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_51: { + s_n_llhttp__internal__n_error_54: { state->error = 0x2; state->reason = "Expected LF after CR"; state->error_pos = (const char*) p; @@ -7479,7 +7655,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_52: { + s_n_llhttp__internal__n_error_55: { state->error = 0xd; state->reason = "Invalid response status"; state->error_pos = (const char*) p; @@ -7496,7 +7672,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_53: { + s_n_llhttp__internal__n_error_56: { state->error = 0x9; state->reason = "Expected space after version"; state->error_pos = (const char*) p; @@ -7513,7 +7689,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_54: { + s_n_llhttp__internal__n_error_57: { state->error = 0x9; state->reason = "Invalid minor version"; state->error_pos = (const char*) p; @@ -7522,7 +7698,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_55: { + s_n_llhttp__internal__n_error_58: { state->error = 0x9; state->reason = "Expected dot"; state->error_pos = (const char*) p; @@ -7539,7 +7715,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_56: { + s_n_llhttp__internal__n_error_59: { state->error = 0x9; state->reason = "Invalid major version"; state->error_pos = (const char*) p; @@ -7548,7 +7724,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_59: { + s_n_llhttp__internal__n_error_62: { state->error = 0x8; state->reason = "Expected HTTP/"; state->error_pos = (const char*) p; @@ -7573,7 +7749,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_57: { + s_n_llhttp__internal__n_error_60: { state->error = 0x8; state->reason = "Invalid word encountered"; state->error_pos = (const char*) p; @@ -8040,6 +8216,8 @@ enum llparse_state_e { 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_17, + s_n_llhttp__internal__n_header_value_lenient_failed, 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, @@ -8047,14 +8225,16 @@ enum llparse_state_e { 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_19, s_n_llhttp__internal__n_error_20, + s_n_llhttp__internal__n_error_21, s_n_llhttp__internal__n_header_value_content_length_ws, s_n_llhttp__internal__n_header_value_content_length, - s_n_llhttp__internal__n_header_value_te_chunked_last, + s_n_llhttp__internal__n_error_23, + s_n_llhttp__internal__n_error_22, 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, @@ -8559,6 +8739,20 @@ int llhttp__internal__c_or_flags_15( 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_4( + 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, @@ -8583,7 +8777,7 @@ int llhttp__internal__c_update_header_state_7( return 0; } -int llhttp__internal__c_or_flags_17( +int llhttp__internal__c_or_flags_18( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -9331,10 +9525,10 @@ static llparse_state_t llhttp__internal__run( } switch (*p) { case 10: { - goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1; + 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_3; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4; } default: { p++; @@ -9344,17 +9538,40 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } + case s_n_llhttp__internal__n_error_17: + s_n_llhttp__internal__n_error_17: { + state->error = 0x19; + state->reason = "Missing expected CR after 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_lenient_failed: + s_n_llhttp__internal__n_header_value_lenient_failed: { + if (p == endp) { + return s_n_llhttp__internal__n_header_value_lenient_failed; + } + switch (*p) { + case 10: { + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2; + } + default: { + goto s_n_llhttp__internal__n_error_18; + } + } + /* 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 10: { - goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1; - } case 13: { - goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1; } default: { goto s_n_llhttp__internal__n_invoke_test_lenient_flags_3; @@ -9534,8 +9751,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - case s_n_llhttp__internal__n_error_19: - s_n_llhttp__internal__n_error_19: { + case s_n_llhttp__internal__n_error_20: + s_n_llhttp__internal__n_error_20: { state->error = 0xb; state->reason = "Content-Length overflow"; state->error_pos = (const char*) p; @@ -9544,8 +9761,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - case s_n_llhttp__internal__n_error_20: - s_n_llhttp__internal__n_error_20: { + case s_n_llhttp__internal__n_error_21: + s_n_llhttp__internal__n_error_21: { state->error = 0xb; state->reason = "Invalid character in Content-Length"; state->error_pos = (const char*) p; @@ -9571,7 +9788,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_value_content_length_ws; } default: { - goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_6; } } /* UNREACHABLE */; @@ -9640,26 +9857,23 @@ static llparse_state_t llhttp__internal__run( /* 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_7; - } - case 13: { - goto s_n_llhttp__internal__n_invoke_update_header_state_7; - } - case ' ': { - p++; - goto s_n_llhttp__internal__n_header_value_te_chunked_last; - } - default: { - goto s_n_llhttp__internal__n_header_value_te_chunked; - } - } + case s_n_llhttp__internal__n_error_23: + s_n_llhttp__internal__n_error_23: { + 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_22: + s_n_llhttp__internal__n_error_22: { + 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(); } @@ -9782,19 +9996,45 @@ static llparse_state_t llhttp__internal__run( /* 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; - + 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; + return s_n_llhttp__internal__n_header_value_te_chunked_last; } - 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; + switch (*p) { + case 10: { + goto s_n_llhttp__internal__n_invoke_update_header_state_7; + } + case 13: { + goto s_n_llhttp__internal__n_invoke_update_header_state_7; + } + 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; @@ -9865,7 +10105,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2; } default: { - goto s_n_llhttp__internal__n_error_21; + goto s_n_llhttp__internal__n_error_24; } } /* UNREACHABLE */; @@ -10219,7 +10459,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_url_skip_lf_to_http09; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_22; + goto s_n_llhttp__internal__n_error_25; } } /* UNREACHABLE */; @@ -10237,13 +10477,13 @@ static llparse_state_t llhttp__internal__run( switch (match_seq.status) { case kMatchComplete: { p++; - goto s_n_llhttp__internal__n_error_25; + goto s_n_llhttp__internal__n_error_28; } case kMatchPause: { return s_n_llhttp__internal__n_req_pri_upgrade; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_26; + goto s_n_llhttp__internal__n_error_29; } } /* UNREACHABLE */; @@ -10260,7 +10500,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_field_start; } default: { - goto s_n_llhttp__internal__n_error_24; + goto s_n_llhttp__internal__n_error_27; } } /* UNREACHABLE */; @@ -10281,7 +10521,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_http_complete_1; } default: { - goto s_n_llhttp__internal__n_error_24; + goto s_n_llhttp__internal__n_error_27; } } /* UNREACHABLE */; @@ -10344,7 +10584,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_http_minor; } default: { - goto s_n_llhttp__internal__n_error_27; + goto s_n_llhttp__internal__n_error_30; } } /* UNREACHABLE */; @@ -10361,7 +10601,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_http_minor; } default: { - goto s_n_llhttp__internal__n_error_28; + goto s_n_llhttp__internal__n_error_31; } } /* UNREACHABLE */; @@ -10424,7 +10664,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_http_major; } default: { - goto s_n_llhttp__internal__n_error_29; + goto s_n_llhttp__internal__n_error_32; } } /* UNREACHABLE */; @@ -10448,7 +10688,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_http_start_1; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_32; + goto s_n_llhttp__internal__n_error_35; } } /* UNREACHABLE */; @@ -10472,7 +10712,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_http_start_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_32; + goto s_n_llhttp__internal__n_error_35; } } /* UNREACHABLE */; @@ -10496,7 +10736,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_http_start_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_32; + goto s_n_llhttp__internal__n_error_35; } } /* UNREACHABLE */; @@ -10525,7 +10765,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_http_start_3; } default: { - goto s_n_llhttp__internal__n_error_32; + goto s_n_llhttp__internal__n_error_35; } } /* UNREACHABLE */; @@ -10579,7 +10819,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_span_end_llhttp__on_url_8; } default: { - goto s_n_llhttp__internal__n_error_33; + goto s_n_llhttp__internal__n_error_36; } } /* UNREACHABLE */; @@ -10636,7 +10876,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_span_end_stub_query_3; } default: { - goto s_n_llhttp__internal__n_error_34; + goto s_n_llhttp__internal__n_error_37; } } /* UNREACHABLE */; @@ -10666,7 +10906,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_query; } default: { - goto s_n_llhttp__internal__n_error_35; + goto s_n_llhttp__internal__n_error_38; } } /* UNREACHABLE */; @@ -10807,10 +11047,10 @@ static llparse_state_t llhttp__internal__run( } case 7: { p++; - goto s_n_llhttp__internal__n_error_36; + goto s_n_llhttp__internal__n_error_39; } default: { - goto s_n_llhttp__internal__n_error_37; + goto s_n_llhttp__internal__n_error_40; } } /* UNREACHABLE */; @@ -10865,7 +11105,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_server_with_at; } default: { - goto s_n_llhttp__internal__n_error_38; + goto s_n_llhttp__internal__n_error_41; } } /* UNREACHABLE */; @@ -10882,7 +11122,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_server; } default: { - goto s_n_llhttp__internal__n_error_40; + goto s_n_llhttp__internal__n_error_43; } } /* UNREACHABLE */; @@ -10896,22 +11136,22 @@ static llparse_state_t llhttp__internal__run( switch (*p) { case 10: { p++; - goto s_n_llhttp__internal__n_error_39; + goto s_n_llhttp__internal__n_error_42; } case 13: { p++; - goto s_n_llhttp__internal__n_error_39; + goto s_n_llhttp__internal__n_error_42; } case ' ': { p++; - goto s_n_llhttp__internal__n_error_39; + goto s_n_llhttp__internal__n_error_42; } case '/': { p++; goto s_n_llhttp__internal__n_url_schema_delim_1; } default: { - goto s_n_llhttp__internal__n_error_40; + goto s_n_llhttp__internal__n_error_43; } } /* UNREACHABLE */; @@ -10953,7 +11193,7 @@ static llparse_state_t llhttp__internal__run( switch (lookup_table[(uint8_t) *p]) { case 1: { p++; - goto s_n_llhttp__internal__n_error_39; + goto s_n_llhttp__internal__n_error_42; } case 2: { goto s_n_llhttp__internal__n_span_end_stub_schema; @@ -10963,7 +11203,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_schema; } default: { - goto s_n_llhttp__internal__n_error_41; + goto s_n_llhttp__internal__n_error_44; } } /* UNREACHABLE */; @@ -10995,7 +11235,7 @@ static llparse_state_t llhttp__internal__run( switch (lookup_table[(uint8_t) *p]) { case 1: { p++; - goto s_n_llhttp__internal__n_error_39; + goto s_n_llhttp__internal__n_error_42; } case 2: { goto s_n_llhttp__internal__n_span_start_stub_path_2; @@ -11004,7 +11244,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_url_schema; } default: { - goto s_n_llhttp__internal__n_error_42; + goto s_n_llhttp__internal__n_error_45; } } /* UNREACHABLE */; @@ -11060,7 +11300,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_spaces_before_url; } default: { - goto s_n_llhttp__internal__n_error_43; + goto s_n_llhttp__internal__n_error_46; } } /* UNREACHABLE */; @@ -11078,7 +11318,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11103,7 +11343,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11124,7 +11364,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_3; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11149,7 +11389,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_4; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11174,7 +11414,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_6; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11199,7 +11439,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_8; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11217,7 +11457,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11238,7 +11478,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_9; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11259,7 +11499,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_7; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11284,7 +11524,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_12; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11309,7 +11549,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_13; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11330,7 +11570,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_13; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11347,7 +11587,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_11; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11372,7 +11612,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_14; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11397,7 +11637,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_17; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11439,7 +11679,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_15; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11464,7 +11704,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_18; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11489,7 +11729,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_20; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11514,7 +11754,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_21; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11535,7 +11775,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_21; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11560,7 +11800,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_23; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11585,7 +11825,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_24; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11610,7 +11850,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_26; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11635,7 +11875,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_28; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11653,7 +11893,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11674,7 +11914,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_29; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11695,7 +11935,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_27; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11720,7 +11960,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_30; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11749,7 +11989,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_30; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11774,7 +12014,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_31; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11799,7 +12039,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_32; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11824,7 +12064,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_35; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11849,7 +12089,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_36; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11870,7 +12110,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_36; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11895,7 +12135,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_37; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11920,7 +12160,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_38; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11945,7 +12185,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_42; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11970,7 +12210,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_43; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -11991,7 +12231,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_43; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12008,7 +12248,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_41; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12030,7 +12270,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_40; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12055,7 +12295,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_45; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12077,7 +12317,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12110,7 +12350,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_44; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12135,7 +12375,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_48; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12160,7 +12400,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_49; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12185,7 +12425,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_50; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12210,7 +12450,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_51; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12239,7 +12479,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_51; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12256,7 +12496,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_47; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12281,7 +12521,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_54; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12299,7 +12539,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12324,7 +12564,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_57; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12345,7 +12585,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_57; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12366,7 +12606,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_55; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12391,7 +12631,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_58; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12416,7 +12656,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_59; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12441,7 +12681,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_59; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12466,7 +12706,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_61; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12491,7 +12731,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_62; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12512,7 +12752,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_62; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12537,7 +12777,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_65; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12562,7 +12802,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_67; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12587,7 +12827,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_68; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12608,7 +12848,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_68; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12633,7 +12873,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_req_69; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12658,7 +12898,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_69; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12675,7 +12915,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_64; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12752,7 +12992,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_start_req_63; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -12846,7 +13086,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_res_status_start; } default: { - goto s_n_llhttp__internal__n_error_45; + goto s_n_llhttp__internal__n_error_48; } } /* UNREACHABLE */; @@ -12926,7 +13166,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_update_status_code; } default: { - goto s_n_llhttp__internal__n_error_46; + goto s_n_llhttp__internal__n_error_49; } } /* UNREACHABLE */; @@ -12989,7 +13229,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_http_minor_1; } default: { - goto s_n_llhttp__internal__n_error_47; + goto s_n_llhttp__internal__n_error_50; } } /* UNREACHABLE */; @@ -13006,7 +13246,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_res_http_minor; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -13069,7 +13309,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_invoke_store_http_major_1; } default: { - goto s_n_llhttp__internal__n_error_49; + goto s_n_llhttp__internal__n_error_52; } } /* UNREACHABLE */; @@ -13093,7 +13333,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_start_res; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_52; + goto s_n_llhttp__internal__n_error_55; } } /* UNREACHABLE */; @@ -13118,7 +13358,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_or_res_method_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_50; + goto s_n_llhttp__internal__n_error_53; } } /* UNREACHABLE */; @@ -13142,7 +13382,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_req_or_res_method_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_50; + goto s_n_llhttp__internal__n_error_53; } } /* UNREACHABLE */; @@ -13163,7 +13403,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_or_res_method_3; } default: { - goto s_n_llhttp__internal__n_error_50; + goto s_n_llhttp__internal__n_error_53; } } /* UNREACHABLE */; @@ -13180,7 +13420,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_req_or_res_method_1; } default: { - goto s_n_llhttp__internal__n_error_50; + goto s_n_llhttp__internal__n_error_53; } } /* UNREACHABLE */; @@ -13240,7 +13480,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */ abort(); } - s_n_llhttp__internal__n_error_39: { + s_n_llhttp__internal__n_error_42: { state->error = 0x7; state->reason = "Invalid characters in url"; state->error_pos = (const char*) p; @@ -13656,7 +13896,7 @@ static llparse_state_t llhttp__internal__run( 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); @@ -13842,6 +14082,24 @@ static llparse_state_t llhttp__internal__run( 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); @@ -13855,7 +14113,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2: { + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4: { const unsigned char* start; int err; @@ -13873,7 +14131,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_span_end_llhttp__on_header_value_3: { + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2: { const unsigned char* start; int err; @@ -13883,15 +14141,15 @@ static llparse_state_t llhttp__internal__run( 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; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_17; return s_error; } p++; - goto s_n_llhttp__internal__n_header_value_almost_done; + goto s_n_llhttp__internal__n_error_17; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_17: { + s_n_llhttp__internal__n_error_18: { state->error = 0xa; state->reason = "Invalid header value char"; state->error_pos = (const char*) p; @@ -13905,7 +14163,7 @@ static llparse_state_t llhttp__internal__run( case 1: goto s_n_llhttp__internal__n_header_value_lenient; default: - goto s_n_llhttp__internal__n_error_17; + goto s_n_llhttp__internal__n_header_value_lenient_failed; } /* UNREACHABLE */; abort(); @@ -13998,7 +14256,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4: { + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: { const unsigned char* start; int err; @@ -14008,17 +14266,17 @@ static llparse_state_t llhttp__internal__run( if (err != 0) { state->error = err; state->error_pos = (const char*) p; - state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_19; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_20; return s_error; } - goto s_n_llhttp__internal__n_error_19; + goto s_n_llhttp__internal__n_error_20; /* 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_4; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5; default: goto s_n_llhttp__internal__n_header_value_content_length; } @@ -14033,7 +14291,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: { + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_6: { const unsigned char* start; int err; @@ -14043,14 +14301,14 @@ static llparse_state_t llhttp__internal__run( if (err != 0) { state->error = err; state->error_pos = (const char*) p; - state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_20; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_21; return s_error; } - goto s_n_llhttp__internal__n_error_20; + goto s_n_llhttp__internal__n_error_21; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_18: { + s_n_llhttp__internal__n_error_19: { state->error = 0x4; state->reason = "Duplicate Content-Length"; state->error_pos = (const char*) p; @@ -14064,11 +14322,29 @@ static llparse_state_t llhttp__internal__run( case 0: goto s_n_llhttp__internal__n_header_value_content_length; default: - goto s_n_llhttp__internal__n_error_18; + goto s_n_llhttp__internal__n_error_19; } /* 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_23; + return s_error; + } + p++; + goto s_n_llhttp__internal__n_error_23; + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_invoke_update_header_state_7: { switch (llhttp__internal__c_update_header_state_7(state, p, endp)) { default: @@ -14077,6 +14353,44 @@ static llparse_state_t llhttp__internal__run( /* 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_22; + return s_error; + } + p++; + goto s_n_llhttp__internal__n_error_22; + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_test_lenient_flags_4: { + switch (llhttp__internal__c_test_lenient_flags_4(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_4; + default: + goto s_n_llhttp__internal__n_header_value_te_chunked; + } + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_invoke_update_header_state_8: { switch (llhttp__internal__c_update_header_state_4(state, p, endp)) { default: @@ -14093,6 +14407,34 @@ static llparse_state_t llhttp__internal__run( /* 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_5: { + switch (llhttp__internal__c_test_lenient_flags_4(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_5; + 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: @@ -14101,8 +14443,18 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_or_flags_17: { - switch (llhttp__internal__c_or_flags_17(state, p, endp)) { + 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_8; } @@ -14116,9 +14468,9 @@ static llparse_state_t llhttp__internal__run( case 2: goto s_n_llhttp__internal__n_invoke_test_flags_2; case 3: - goto s_n_llhttp__internal__n_invoke_or_flags_16; + goto s_n_llhttp__internal__n_invoke_test_flags_3; case 4: - goto s_n_llhttp__internal__n_invoke_or_flags_17; + goto s_n_llhttp__internal__n_invoke_or_flags_18; default: goto s_n_llhttp__internal__n_header_value; } @@ -14161,7 +14513,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_21: { + s_n_llhttp__internal__n_error_24: { state->error = 0xa; state->reason = "Invalid header token"; state->error_pos = (const char*) p; @@ -14235,7 +14587,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_22: { + s_n_llhttp__internal__n_error_25: { state->error = 0x7; state->reason = "Expected CRLF"; state->error_pos = (const char*) p; @@ -14261,7 +14613,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_25: { + s_n_llhttp__internal__n_error_28: { state->error = 0x17; state->reason = "Pause on PRI/Upgrade"; state->error_pos = (const char*) p; @@ -14270,7 +14622,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_26: { + s_n_llhttp__internal__n_error_29: { state->error = 0x9; state->reason = "Expected HTTP/2 Connection Preface"; state->error_pos = (const char*) p; @@ -14279,7 +14631,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_24: { + s_n_llhttp__internal__n_error_27: { state->error = 0x9; state->reason = "Expected CRLF after version"; state->error_pos = (const char*) p; @@ -14306,7 +14658,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_27: { + s_n_llhttp__internal__n_error_30: { state->error = 0x9; state->reason = "Invalid minor version"; state->error_pos = (const char*) p; @@ -14315,7 +14667,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_28: { + s_n_llhttp__internal__n_error_31: { state->error = 0x9; state->reason = "Expected dot"; state->error_pos = (const char*) p; @@ -14332,7 +14684,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_29: { + s_n_llhttp__internal__n_error_32: { state->error = 0x9; state->reason = "Invalid major version"; state->error_pos = (const char*) p; @@ -14341,7 +14693,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_23: { + s_n_llhttp__internal__n_error_26: { state->error = 0x8; state->reason = "Invalid method for HTTP/x.x request"; state->error_pos = (const char*) p; @@ -14423,12 +14775,12 @@ static llparse_state_t llhttp__internal__run( case 34: goto s_n_llhttp__internal__n_req_http_major; default: - goto s_n_llhttp__internal__n_error_23; + goto s_n_llhttp__internal__n_error_26; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_32: { + s_n_llhttp__internal__n_error_35: { state->error = 0x8; state->reason = "Expected HTTP/"; state->error_pos = (const char*) p; @@ -14437,7 +14789,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_30: { + s_n_llhttp__internal__n_error_33: { state->error = 0x8; state->reason = "Expected SOURCE method for ICE/x.x request"; state->error_pos = (const char*) p; @@ -14451,12 +14803,12 @@ static llparse_state_t llhttp__internal__run( case 33: goto s_n_llhttp__internal__n_req_http_major; default: - goto s_n_llhttp__internal__n_error_30; + goto s_n_llhttp__internal__n_error_33; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_31: { + s_n_llhttp__internal__n_error_34: { state->error = 0x8; state->reason = "Invalid method for RTSP/x.x request"; state->error_pos = (const char*) p; @@ -14496,7 +14848,7 @@ static llparse_state_t llhttp__internal__run( case 45: goto s_n_llhttp__internal__n_req_http_major; default: - goto s_n_llhttp__internal__n_error_31; + goto s_n_llhttp__internal__n_error_34; } /* UNREACHABLE */; abort(); @@ -14577,7 +14929,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_33: { + s_n_llhttp__internal__n_error_36: { state->error = 0x7; state->reason = "Invalid char in url fragment start"; state->error_pos = (const char*) p; @@ -14637,7 +14989,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_34: { + s_n_llhttp__internal__n_error_37: { state->error = 0x7; state->reason = "Invalid char in url query"; state->error_pos = (const char*) p; @@ -14646,7 +14998,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_35: { + s_n_llhttp__internal__n_error_38: { state->error = 0x7; state->reason = "Invalid char in url path"; state->error_pos = (const char*) p; @@ -14757,7 +15109,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_36: { + s_n_llhttp__internal__n_error_39: { state->error = 0x7; state->reason = "Double @ in url"; state->error_pos = (const char*) p; @@ -14766,7 +15118,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_37: { + s_n_llhttp__internal__n_error_40: { state->error = 0x7; state->reason = "Unexpected char in url server"; state->error_pos = (const char*) p; @@ -14775,7 +15127,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_38: { + s_n_llhttp__internal__n_error_41: { state->error = 0x7; state->reason = "Unexpected char in url server"; state->error_pos = (const char*) p; @@ -14784,7 +15136,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_40: { + s_n_llhttp__internal__n_error_43: { state->error = 0x7; state->reason = "Unexpected char in url schema"; state->error_pos = (const char*) p; @@ -14793,7 +15145,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_41: { + s_n_llhttp__internal__n_error_44: { state->error = 0x7; state->reason = "Unexpected char in url schema"; state->error_pos = (const char*) p; @@ -14802,7 +15154,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_42: { + s_n_llhttp__internal__n_error_45: { state->error = 0x7; state->reason = "Unexpected start char in url"; state->error_pos = (const char*) p; @@ -14821,7 +15173,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_43: { + s_n_llhttp__internal__n_error_46: { state->error = 0x6; state->reason = "Expected space after method"; state->error_pos = (const char*) p; @@ -14838,7 +15190,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_51: { + s_n_llhttp__internal__n_error_54: { state->error = 0x6; state->reason = "Invalid method encountered"; state->error_pos = (const char*) p; @@ -14847,7 +15199,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_44: { + s_n_llhttp__internal__n_error_47: { state->error = 0xd; state->reason = "Response overflow"; state->error_pos = (const char*) p; @@ -14859,7 +15211,7 @@ static llparse_state_t llhttp__internal__run( 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_44; + goto s_n_llhttp__internal__n_error_47; default: goto s_n_llhttp__internal__n_res_status_code; } @@ -14902,7 +15254,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_45: { + s_n_llhttp__internal__n_error_48: { state->error = 0xd; state->reason = "Invalid response status"; state->error_pos = (const char*) p; @@ -14919,7 +15271,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_46: { + s_n_llhttp__internal__n_error_49: { state->error = 0x9; state->reason = "Expected space after version"; state->error_pos = (const char*) p; @@ -14936,7 +15288,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_47: { + s_n_llhttp__internal__n_error_50: { state->error = 0x9; state->reason = "Invalid minor version"; state->error_pos = (const char*) p; @@ -14945,7 +15297,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_48: { + s_n_llhttp__internal__n_error_51: { state->error = 0x9; state->reason = "Expected dot"; state->error_pos = (const char*) p; @@ -14962,7 +15314,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_49: { + s_n_llhttp__internal__n_error_52: { state->error = 0x9; state->reason = "Invalid major version"; state->error_pos = (const char*) p; @@ -14971,7 +15323,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_52: { + s_n_llhttp__internal__n_error_55: { state->error = 0x8; state->reason = "Expected HTTP/"; state->error_pos = (const char*) p; @@ -14996,7 +15348,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_50: { + s_n_llhttp__internal__n_error_53: { state->error = 0x8; state->reason = "Invalid word encountered"; state->error_pos = (const char*) p; diff --git a/test/parallel/test-http-invalid-te.js b/test/parallel/test-http-invalid-te.js index 0f633a74551c02..9ae8a87d8e128a 100644 --- a/test/parallel/test-http-invalid-te.js +++ b/test/parallel/test-http-invalid-te.js @@ -13,7 +13,7 @@ Content-Type: text/plain; charset=utf-8 Host: hacker.exploit.com Connection: keep-alive Content-Length: 10 -Transfer-Encoding: chunked, eee +Transfer-Encoding: eee, chunked HELLOWORLDPOST / HTTP/1.1 Content-Type: text/plain; charset=utf-8 diff --git a/test/parallel/test-http-missing-header-separator-cr.js b/test/parallel/test-http-missing-header-separator-cr.js new file mode 100644 index 00000000000000..15ef8195d19372 --- /dev/null +++ b/test/parallel/test-http-missing-header-separator-cr.js @@ -0,0 +1,43 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +const http = require('http'); +const net = require('net'); + +const msg = [ + 'GET / HTTP/1.1', + 'Host: localhost', + 'Dummy: x\nContent-Length: 23', + '', + 'GET / HTTP/1.1', + 'Dummy: GET /admin HTTP/1.1', + 'Host: localhost', + '', + '', +].join('\r\n'); + +const server = http.createServer(common.mustNotCall()); + +server.listen(0, common.mustSucceed(() => { + const client = net.connect(server.address().port, 'localhost'); + + let response = ''; + + client.on('data', common.mustCall((chunk) => { + response += chunk.toString('utf-8'); + })); + + client.setEncoding('utf8'); + client.on('error', common.mustNotCall()); + client.on('end', common.mustCall(() => { + assert.strictEqual( + response, + 'HTTP/1.1 400 Bad Request\r\nConnection: close\r\n\r\n' + ); + server.close(); + })); + client.write(msg); + client.resume(); +})); diff --git a/test/parallel/test-http-transfer-encoding-repeated-chunked.js b/test/parallel/test-http-transfer-encoding-repeated-chunked.js new file mode 100644 index 00000000000000..f38c625646c078 --- /dev/null +++ b/test/parallel/test-http-transfer-encoding-repeated-chunked.js @@ -0,0 +1,51 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); + +const http = require('http'); +const net = require('net'); + +const msg = [ + 'POST / HTTP/1.1', + 'Host: 127.0.0.1', + 'Transfer-Encoding: chunkedchunked', + '', + '1', + 'A', + '0', + '', +].join('\r\n'); + +const server = http.createServer(common.mustCall((req, res) => { + // Verify that no data is received + + req.on('data', common.mustNotCall()); + + req.on('end', common.mustNotCall(() => { + res.writeHead(200, { 'Content-Type': 'text/plain' }); + res.end(); + })); +}, 1)); + +server.listen(0, common.mustSucceed(() => { + const client = net.connect(server.address().port, 'localhost'); + + let response = ''; + + client.on('data', common.mustCall((chunk) => { + response += chunk.toString('utf-8'); + })); + + client.setEncoding('utf8'); + client.on('error', common.mustNotCall()); + client.on('end', common.mustCall(() => { + assert.strictEqual( + response, + 'HTTP/1.1 400 Bad Request\r\nConnection: close\r\n\r\n' + ); + server.close(); + })); + client.write(msg); + client.resume(); +})); diff --git a/test/parallel/test-http-transfer-encoding-smuggling.js b/test/parallel/test-http-transfer-encoding-smuggling.js index 77e719d37e143e..9cd611464fec08 100644 --- a/test/parallel/test-http-transfer-encoding-smuggling.js +++ b/test/parallel/test-http-transfer-encoding-smuggling.js @@ -1,6 +1,7 @@ 'use strict'; const common = require('../common'); +const assert = require('assert'); const http = require('http'); const net = require('net'); @@ -22,23 +23,30 @@ const msg = [ '', ].join('\r\n'); -// Verify that the server is called only once even with a smuggled request. - -const server = http.createServer(common.mustCall((req, res) => { +const server = http.createServer(common.mustNotCall((req, res) => { res.end(); }, 1)); -function send(next) { +server.listen(0, common.mustSucceed(() => { const client = net.connect(server.address().port, 'localhost'); + + let response = ''; + + // Verify that the server listener is never called + + client.on('data', common.mustCall((chunk) => { + response += chunk.toString('utf-8'); + })); + client.setEncoding('utf8'); client.on('error', common.mustNotCall()); - client.on('end', next); - client.write(msg); - client.resume(); -} - -server.listen(0, common.mustSucceed(() => { - send(common.mustCall(() => { + client.on('end', common.mustCall(() => { + assert.strictEqual( + response, + 'HTTP/1.1 400 Bad Request\r\nConnection: close\r\n\r\n' + ); server.close(); })); + client.write(msg); + client.resume(); }));