diff --git a/thirdparty/README.md b/thirdparty/README.md index 154845a1f3..275e032626 100644 --- a/thirdparty/README.md +++ b/thirdparty/README.md @@ -103,7 +103,7 @@ ## llhttp - [![Upstream](https://img.shields.io/github/v/release/nodejs/llhttp?label=Upstream)](https://github.com/nodejs/llhttp) -- Version: 6.0.9 +- Version: 6.0.10 - License: MIT ## lua diff --git a/thirdparty/llhttp/include/api.h b/thirdparty/llhttp/include/api.h deleted file mode 100644 index 0e71d1a653..0000000000 --- a/thirdparty/llhttp/include/api.h +++ /dev/null @@ -1,265 +0,0 @@ -#ifndef INCLUDE_LLHTTP_API_H_ -#define INCLUDE_LLHTTP_API_H_ -#ifdef __cplusplus -extern "C" { -#endif -#include - -#if defined(__wasm__) -#define LLHTTP_EXPORT __attribute__((visibility("default"))) -#else -#define LLHTTP_EXPORT -#endif - -typedef llhttp__internal_t llhttp_t; -typedef struct llhttp_settings_s llhttp_settings_t; - -typedef int (*llhttp_data_cb)(llhttp_t*, const char *at, size_t length); -typedef int (*llhttp_cb)(llhttp_t*); - -struct llhttp_settings_s { - /* Possible return values 0, -1, `HPE_PAUSED` */ - llhttp_cb on_message_begin; - - /* Possible return values 0, -1, HPE_USER */ - llhttp_data_cb on_url; - llhttp_data_cb on_status; - llhttp_data_cb on_header_field; - llhttp_data_cb on_header_value; - - /* Possible return values: - * 0 - Proceed normally - * 1 - Assume that request/response has no body, and proceed to parsing the - * next message - * 2 - Assume absence of body (as above) and make `llhttp_execute()` return - * `HPE_PAUSED_UPGRADE` - * -1 - Error - * `HPE_PAUSED` - */ - llhttp_cb on_headers_complete; - - /* Possible return values 0, -1, HPE_USER */ - llhttp_data_cb on_body; - - /* Possible return values 0, -1, `HPE_PAUSED` */ - llhttp_cb on_message_complete; - - /* When on_chunk_header is called, the current chunk length is stored - * in parser->content_length. - * Possible return values 0, -1, `HPE_PAUSED` - */ - llhttp_cb on_chunk_header; - llhttp_cb on_chunk_complete; - - /* Information-only callbacks, return value is ignored */ - llhttp_cb on_url_complete; - llhttp_cb on_status_complete; - llhttp_cb on_header_field_complete; - llhttp_cb on_header_value_complete; -}; - -/* Initialize the parser with specific type and user settings. - * - * NOTE: lifetime of `settings` has to be at least the same as the lifetime of - * the `parser` here. In practice, `settings` has to be either a static - * variable or be allocated with `malloc`, `new`, etc. - */ -LLHTTP_EXPORT -void llhttp_init(llhttp_t* parser, llhttp_type_t type, - const llhttp_settings_t* settings); - -LLHTTP_EXPORT -llhttp_t* llhttp_alloc(llhttp_type_t type); - -LLHTTP_EXPORT -void llhttp_free(llhttp_t* parser); - -LLHTTP_EXPORT -uint8_t llhttp_get_type(llhttp_t* parser); - -LLHTTP_EXPORT -uint8_t llhttp_get_http_major(llhttp_t* parser); - -LLHTTP_EXPORT -uint8_t llhttp_get_http_minor(llhttp_t* parser); - -LLHTTP_EXPORT -uint8_t llhttp_get_method(llhttp_t* parser); - -LLHTTP_EXPORT -int llhttp_get_status_code(llhttp_t* parser); - -LLHTTP_EXPORT -uint8_t llhttp_get_upgrade(llhttp_t* parser); - -/* Reset an already initialized parser back to the start state, preserving the - * existing parser type, callback settings, user data, and lenient flags. - */ -LLHTTP_EXPORT -void llhttp_reset(llhttp_t* parser); - -/* Initialize the settings object */ -LLHTTP_EXPORT -void llhttp_settings_init(llhttp_settings_t* settings); - -/* Parse full or partial request/response, invoking user callbacks along the - * way. - * - * If any of `llhttp_data_cb` returns errno not equal to `HPE_OK` - the parsing - * interrupts, and such errno is returned from `llhttp_execute()`. If - * `HPE_PAUSED` was used as a errno, the execution can be resumed with - * `llhttp_resume()` call. - * - * In a special case of CONNECT/Upgrade request/response `HPE_PAUSED_UPGRADE` - * is returned after fully parsing the request/response. If the user wishes to - * continue parsing, they need to invoke `llhttp_resume_after_upgrade()`. - * - * NOTE: if this function ever returns a non-pause type error, it will continue - * to return the same error upon each successive call up until `llhttp_init()` - * is called. - */ -LLHTTP_EXPORT -llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len); - -/* This method should be called when the other side has no further bytes to - * send (e.g. shutdown of readable side of the TCP connection.) - * - * Requests without `Content-Length` and other messages might require treating - * all incoming bytes as the part of the body, up to the last byte of the - * connection. This method will invoke `on_message_complete()` callback if the - * request was terminated safely. Otherwise a error code would be returned. - */ -LLHTTP_EXPORT -llhttp_errno_t llhttp_finish(llhttp_t* parser); - -/* Returns `1` if the incoming message is parsed until the last byte, and has - * to be completed by calling `llhttp_finish()` on EOF - */ -LLHTTP_EXPORT -int llhttp_message_needs_eof(const llhttp_t* parser); - -/* Returns `1` if there might be any other messages following the last that was - * successfully parsed. - */ -LLHTTP_EXPORT -int llhttp_should_keep_alive(const llhttp_t* parser); - -/* Make further calls of `llhttp_execute()` return `HPE_PAUSED` and set - * appropriate error reason. - * - * Important: do not call this from user callbacks! User callbacks must return - * `HPE_PAUSED` if pausing is required. - */ -LLHTTP_EXPORT -void llhttp_pause(llhttp_t* parser); - -/* Might be called to resume the execution after the pause in user's callback. - * See `llhttp_execute()` above for details. - * - * Call this only if `llhttp_execute()` returns `HPE_PAUSED`. - */ -LLHTTP_EXPORT -void llhttp_resume(llhttp_t* parser); - -/* Might be called to resume the execution after the pause in user's callback. - * See `llhttp_execute()` above for details. - * - * Call this only if `llhttp_execute()` returns `HPE_PAUSED_UPGRADE` - */ -LLHTTP_EXPORT -void llhttp_resume_after_upgrade(llhttp_t* parser); - -/* Returns the latest return error */ -LLHTTP_EXPORT -llhttp_errno_t llhttp_get_errno(const llhttp_t* parser); - -/* Returns the verbal explanation of the latest returned error. - * - * Note: User callback should set error reason when returning the error. See - * `llhttp_set_error_reason()` for details. - */ -LLHTTP_EXPORT -const char* llhttp_get_error_reason(const llhttp_t* parser); - -/* Assign verbal description to the returned error. Must be called in user - * callbacks right before returning the errno. - * - * Note: `HPE_USER` error code might be useful in user callbacks. - */ -LLHTTP_EXPORT -void llhttp_set_error_reason(llhttp_t* parser, const char* reason); - -/* Returns the pointer to the last parsed byte before the returned error. The - * pointer is relative to the `data` argument of `llhttp_execute()`. - * - * Note: this method might be useful for counting the number of parsed bytes. - */ -LLHTTP_EXPORT -const char* llhttp_get_error_pos(const llhttp_t* parser); - -/* Returns textual name of error code */ -LLHTTP_EXPORT -const char* llhttp_errno_name(llhttp_errno_t err); - -/* Returns textual name of HTTP method */ -LLHTTP_EXPORT -const char* llhttp_method_name(llhttp_method_t method); - - -/* Enables/disables lenient header value parsing (disabled by default). - * - * Lenient parsing disables header value token checks, extending llhttp's - * protocol support to highly non-compliant clients/server. No - * `HPE_INVALID_HEADER_TOKEN` will be raised for incorrect header values when - * lenient parsing is "on". - * - * **(USE AT YOUR OWN RISK)** - */ -LLHTTP_EXPORT -void llhttp_set_lenient_headers(llhttp_t* parser, int enabled); - - -/* Enables/disables lenient handling of conflicting `Transfer-Encoding` and - * `Content-Length` headers (disabled by default). - * - * Normally `llhttp` would error when `Transfer-Encoding` is present in - * conjunction with `Content-Length`. This error is important to prevent HTTP - * request smuggling, but may be less desirable for small number of cases - * involving legacy servers. - * - * **(USE AT YOUR OWN RISK)** - */ -LLHTTP_EXPORT -void llhttp_set_lenient_chunked_length(llhttp_t* parser, int enabled); - - -/* Enables/disables lenient handling of `Connection: close` and HTTP/1.0 - * requests responses. - * - * Normally `llhttp` would error on (in strict mode) or discard (in loose mode) - * the HTTP request/response after the request/response with `Connection: close` - * and `Content-Length`. This is important to prevent cache poisoning attacks, - * but might interact badly with outdated and insecure clients. With this flag - * the extra request/response will be parsed normally. - * - * **(USE AT YOUR OWN RISK)** - */ -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 -#endif /* INCLUDE_LLHTTP_API_H_ */ diff --git a/thirdparty/llhttp/include/llhttp.h b/thirdparty/llhttp/include/llhttp.h index 4d5312e7aa..6e1e71ecbc 100644 --- a/thirdparty/llhttp/include/llhttp.h +++ b/thirdparty/llhttp/include/llhttp.h @@ -3,7 +3,7 @@ #define LLHTTP_VERSION_MAJOR 6 #define LLHTTP_VERSION_MINOR 0 -#define LLHTTP_VERSION_PATCH 9 +#define LLHTTP_VERSION_PATCH 10 #ifndef LLHTTP_STRICT_MODE # define LLHTTP_STRICT_MODE 0 diff --git a/thirdparty/llhttp/src/llhttp.c b/thirdparty/llhttp/src/llhttp.c index 9a0a35bd33..8e63e79cff 100644 --- a/thirdparty/llhttp/src/llhttp.c +++ b/thirdparty/llhttp/src/llhttp.c @@ -359,8 +359,7 @@ 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_error_24, 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, @@ -814,7 +813,7 @@ int llhttp__internal__c_or_flags_6( return 0; } -int llhttp__internal__c_update_header_state_2( +int llhttp__internal__c_update_header_state_3( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -822,7 +821,7 @@ int llhttp__internal__c_update_header_state_2( return 0; } -int llhttp__internal__c_update_header_state_4( +int llhttp__internal__c_update_header_state_1( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -830,7 +829,7 @@ int llhttp__internal__c_update_header_state_4( return 0; } -int llhttp__internal__c_update_header_state_5( +int llhttp__internal__c_update_header_state_6( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -838,7 +837,7 @@ int llhttp__internal__c_update_header_state_5( return 0; } -int llhttp__internal__c_update_header_state_6( +int llhttp__internal__c_update_header_state_7( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -894,7 +893,7 @@ int llhttp__internal__c_test_flags_3( return (state->flags & 8) == 8; } -int llhttp__internal__c_test_lenient_flags_4( +int llhttp__internal__c_test_lenient_flags_5( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -917,7 +916,7 @@ int llhttp__internal__c_and_flags( return 0; } -int llhttp__internal__c_update_header_state_7( +int llhttp__internal__c_update_header_state_8( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -958,7 +957,7 @@ int llhttp__internal__c_store_http_minor( return 0; } -int llhttp__internal__c_test_lenient_flags_6( +int llhttp__internal__c_test_lenient_flags_7( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -1682,7 +1681,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_value_discard_lws; } default: { - goto s_n_llhttp__internal__n_error_21; + goto s_n_llhttp__internal__n_error_22; } } /* UNREACHABLE */; @@ -1695,13 +1694,13 @@ static llparse_state_t llhttp__internal__run( } switch (*p) { case 9: { - goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1; + goto s_n_llhttp__internal__n_invoke_load_header_state_3; } case ' ': { - goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1; + goto s_n_llhttp__internal__n_invoke_load_header_state_3; } default: { - goto s_n_llhttp__internal__n_invoke_load_header_state_3; + goto s_n_llhttp__internal__n_invoke_load_header_state_4; } } /* UNREACHABLE */; @@ -1718,7 +1717,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_value_lws; } default: { - goto s_n_llhttp__internal__n_error_22; + goto s_n_llhttp__internal__n_error_23; } } /* UNREACHABLE */; @@ -1744,32 +1743,16 @@ 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"; + case s_n_llhttp__internal__n_error_24: + s_n_llhttp__internal__n_error_24: { + state->error = 0xa; + state->reason = "Invalid header value char"; state->error_pos = (const char*) p; state->_current = (void*) (intptr_t) s_error; return s_error; /* UNREACHABLE */; abort(); } - case s_n_llhttp__internal__n_header_value_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) { @@ -1780,7 +1763,7 @@ static llparse_state_t llhttp__internal__run( 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; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_4; } } /* UNREACHABLE */; @@ -1843,10 +1826,10 @@ static llparse_state_t llhttp__internal__run( } case ',': { p++; - goto s_n_llhttp__internal__n_invoke_load_header_state_4; + goto s_n_llhttp__internal__n_invoke_load_header_state_5; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_4; + goto s_n_llhttp__internal__n_invoke_update_header_state_5; } } /* UNREACHABLE */; @@ -1864,7 +1847,7 @@ static llparse_state_t llhttp__internal__run( switch (match_seq.status) { case kMatchComplete: { p++; - goto s_n_llhttp__internal__n_invoke_update_header_state_2; + goto s_n_llhttp__internal__n_invoke_update_header_state_3; } case kMatchPause: { return s_n_llhttp__internal__n_header_value_connection_1; @@ -1888,7 +1871,7 @@ static llparse_state_t llhttp__internal__run( switch (match_seq.status) { case kMatchComplete: { p++; - goto s_n_llhttp__internal__n_invoke_update_header_state_5; + goto s_n_llhttp__internal__n_invoke_update_header_state_6; } case kMatchPause: { return s_n_llhttp__internal__n_header_value_connection_2; @@ -1912,7 +1895,7 @@ static llparse_state_t llhttp__internal__run( switch (match_seq.status) { case kMatchComplete: { p++; - goto s_n_llhttp__internal__n_invoke_update_header_state_6; + goto s_n_llhttp__internal__n_invoke_update_header_state_7; } case kMatchPause: { return s_n_llhttp__internal__n_header_value_connection_3; @@ -2196,7 +2179,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_value_te_token_ows; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_8; + goto s_n_llhttp__internal__n_invoke_update_header_state_9; } } /* UNREACHABLE */; @@ -2209,10 +2192,10 @@ static llparse_state_t llhttp__internal__run( } switch (*p) { case 10: { - goto s_n_llhttp__internal__n_invoke_update_header_state_7; + goto s_n_llhttp__internal__n_invoke_update_header_state_8; } case 13: { - goto s_n_llhttp__internal__n_invoke_update_header_state_7; + goto s_n_llhttp__internal__n_invoke_update_header_state_8; } case ' ': { p++; @@ -2275,7 +2258,7 @@ static llparse_state_t llhttp__internal__run( } case 10: { p++; - goto s_n_llhttp__internal__n_header_value_discard_lws; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_3; } case 13: { p++; @@ -2401,7 +2384,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_1; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_9; + goto s_n_llhttp__internal__n_invoke_update_header_state_10; } } /* UNREACHABLE */; @@ -2426,7 +2409,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -2451,7 +2434,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_4; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -2472,7 +2455,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_field_4; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -2496,7 +2479,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_1; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -2521,7 +2504,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_5; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -2546,7 +2529,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_6; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -2571,7 +2554,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_7; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -2600,7 +2583,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_field_7; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -6325,7 +6308,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_20: { + s_n_llhttp__internal__n_error_21: { state->error = 0xb; state->reason = "Empty Content-Length"; state->error_pos = (const char*) p; @@ -6410,14 +6393,33 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_load_header_state: { switch (llhttp__internal__c_load_header_state(state, p, endp)) { case 2: - goto s_n_llhttp__internal__n_error_20; + goto s_n_llhttp__internal__n_error_21; default: goto s_n_llhttp__internal__n_invoke_load_header_state_1; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_21: { + s_n_llhttp__internal__n_error_20: { + state->error = 0xa; + state->reason = "Invalid header value char"; + state->error_pos = (const char*) p; + state->_current = (void*) (intptr_t) s_error; + return s_error; + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_test_lenient_flags_3: { + switch (llhttp__internal__c_test_lenient_flags_2(state, p, endp)) { + case 1: + goto s_n_llhttp__internal__n_header_value_discard_lws; + default: + goto s_n_llhttp__internal__n_error_20; + } + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_error_22: { state->error = 0x2; state->reason = "Expected LF after CR"; state->error_pos = (const char*) p; @@ -6427,6 +6429,24 @@ static llparse_state_t llhttp__internal__run( abort(); } s_n_llhttp__internal__n_invoke_update_header_state_1: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { + default: + goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1; + } + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_load_header_state_3: { + switch (llhttp__internal__c_load_header_state(state, p, endp)) { + case 8: + goto s_n_llhttp__internal__n_invoke_update_header_state_1; + default: + goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1; + } + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_update_header_state_2: { switch (llhttp__internal__c_update_header_state(state, p, endp)) { default: goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete; @@ -6437,7 +6457,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_7: { switch (llhttp__internal__c_or_flags_3(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_1; + goto s_n_llhttp__internal__n_invoke_update_header_state_2; } /* UNREACHABLE */; abort(); @@ -6445,7 +6465,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_8: { switch (llhttp__internal__c_or_flags_4(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_1; + goto s_n_llhttp__internal__n_invoke_update_header_state_2; } /* UNREACHABLE */; abort(); @@ -6453,7 +6473,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_9: { switch (llhttp__internal__c_or_flags_5(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_1; + goto s_n_llhttp__internal__n_invoke_update_header_state_2; } /* UNREACHABLE */; abort(); @@ -6466,7 +6486,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_load_header_state_3: { + s_n_llhttp__internal__n_invoke_load_header_state_4: { switch (llhttp__internal__c_load_header_state(state, p, endp)) { case 5: goto s_n_llhttp__internal__n_invoke_or_flags_7; @@ -6482,7 +6502,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_22: { + s_n_llhttp__internal__n_error_23: { state->error = 0x3; state->reason = "Missing expected LF after header value"; state->error_pos = (const char*) p; @@ -6553,35 +6573,25 @@ 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->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_23; + state->error_pos = (const char*) p; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_24; return s_error; } - p++; - goto s_n_llhttp__internal__n_error_23; + goto s_n_llhttp__internal__n_error_24; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_24: { - state->error = 0xa; - state->reason = "Invalid header value char"; - state->error_pos = (const char*) p; - state->_current = (void*) (intptr_t) s_error; - return s_error; - /* UNREACHABLE */; - abort(); - } - s_n_llhttp__internal__n_invoke_test_lenient_flags_3: { + s_n_llhttp__internal__n_invoke_test_lenient_flags_4: { switch (llhttp__internal__c_test_lenient_flags_2(state, p, endp)) { case 1: goto s_n_llhttp__internal__n_header_value_lenient; default: - goto s_n_llhttp__internal__n_header_value_lenient_failed; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_3: { + s_n_llhttp__internal__n_invoke_update_header_state_4: { switch (llhttp__internal__c_update_header_state(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value_connection; @@ -6592,7 +6602,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_11: { switch (llhttp__internal__c_or_flags_3(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_3; + goto s_n_llhttp__internal__n_invoke_update_header_state_4; } /* UNREACHABLE */; abort(); @@ -6600,7 +6610,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_12: { switch (llhttp__internal__c_or_flags_4(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_3; + goto s_n_llhttp__internal__n_invoke_update_header_state_4; } /* UNREACHABLE */; abort(); @@ -6608,7 +6618,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_13: { switch (llhttp__internal__c_or_flags_5(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_3; + goto s_n_llhttp__internal__n_invoke_update_header_state_4; } /* UNREACHABLE */; abort(); @@ -6621,7 +6631,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_load_header_state_4: { + s_n_llhttp__internal__n_invoke_load_header_state_5: { switch (llhttp__internal__c_load_header_state(state, p, endp)) { case 5: goto s_n_llhttp__internal__n_invoke_or_flags_11; @@ -6637,24 +6647,16 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_4: { - switch (llhttp__internal__c_update_header_state_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_5: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value_connection_token; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_2: { - switch (llhttp__internal__c_update_header_state_2(state, p, endp)) { - default: - goto s_n_llhttp__internal__n_header_value_connection_ws; - } - /* UNREACHABLE */; - abort(); - } - s_n_llhttp__internal__n_invoke_update_header_state_5: { - switch (llhttp__internal__c_update_header_state_5(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_3: { + switch (llhttp__internal__c_update_header_state_3(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value_connection_ws; } @@ -6669,6 +6671,14 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } + s_n_llhttp__internal__n_invoke_update_header_state_7: { + switch (llhttp__internal__c_update_header_state_7(state, p, endp)) { + default: + goto s_n_llhttp__internal__n_header_value_connection_ws; + } + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: { const unsigned char* start; int err; @@ -6758,8 +6768,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_7: { - switch (llhttp__internal__c_update_header_state_7(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_8: { + switch (llhttp__internal__c_update_header_state_8(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value_otherwise; } @@ -6784,8 +6794,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_test_lenient_flags_4: { - switch (llhttp__internal__c_test_lenient_flags_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_test_lenient_flags_5: { + switch (llhttp__internal__c_test_lenient_flags_5(state, p, endp)) { case 0: goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_7; default: @@ -6797,15 +6807,15 @@ static llparse_state_t llhttp__internal__run( 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; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_5; 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)) { + s_n_llhttp__internal__n_invoke_update_header_state_9: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value; } @@ -6828,8 +6838,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_test_lenient_flags_5: { - switch (llhttp__internal__c_test_lenient_flags_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_test_lenient_flags_6: { + switch (llhttp__internal__c_test_lenient_flags_5(state, p, endp)) { case 0: goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_8; default: @@ -6841,7 +6851,7 @@ static llparse_state_t llhttp__internal__run( 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; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_6; default: goto s_n_llhttp__internal__n_invoke_or_flags_17; } @@ -6869,7 +6879,7 @@ static llparse_state_t llhttp__internal__run( 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; + goto s_n_llhttp__internal__n_invoke_update_header_state_9; } /* UNREACHABLE */; abort(); @@ -6935,8 +6945,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_9: { - switch (llhttp__internal__c_update_header_state_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_10: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_field_general; } @@ -6951,8 +6961,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_10: { - switch (llhttp__internal__c_update_header_state_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_11: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_field_general; } @@ -7145,8 +7155,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_test_lenient_flags_6: { - switch (llhttp__internal__c_test_lenient_flags_6(state, p, endp)) { + s_n_llhttp__internal__n_invoke_test_lenient_flags_7: { + switch (llhttp__internal__c_test_lenient_flags_7(state, p, endp)) { case 1: goto s_n_llhttp__internal__n_invoke_load_method_1; default: @@ -7158,7 +7168,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_store_http_minor: { switch (llhttp__internal__c_store_http_minor(state, p, endp, match)) { default: - goto s_n_llhttp__internal__n_invoke_test_lenient_flags_6; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_7; } /* UNREACHABLE */; abort(); @@ -7876,8 +7886,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_test_lenient_flags_7: { - switch (llhttp__internal__c_test_lenient_flags_6(state, p, endp)) { + s_n_llhttp__internal__n_invoke_test_lenient_flags_8: { + switch (llhttp__internal__c_test_lenient_flags_7(state, p, endp)) { case 1: goto s_n_llhttp__internal__n_res_http_end; default: @@ -7889,7 +7899,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_store_http_minor_1: { switch (llhttp__internal__c_store_http_minor(state, p, endp, match)) { default: - goto s_n_llhttp__internal__n_invoke_test_lenient_flags_7; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_8; } /* UNREACHABLE */; abort(); @@ -8421,8 +8431,7 @@ 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_error_18, 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, @@ -8871,7 +8880,7 @@ int llhttp__internal__c_or_flags_6( return 0; } -int llhttp__internal__c_update_header_state_2( +int llhttp__internal__c_update_header_state_3( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -8879,7 +8888,7 @@ int llhttp__internal__c_update_header_state_2( return 0; } -int llhttp__internal__c_update_header_state_4( +int llhttp__internal__c_update_header_state_1( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -8887,7 +8896,7 @@ int llhttp__internal__c_update_header_state_4( return 0; } -int llhttp__internal__c_update_header_state_5( +int llhttp__internal__c_update_header_state_6( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -8895,7 +8904,7 @@ int llhttp__internal__c_update_header_state_5( return 0; } -int llhttp__internal__c_update_header_state_6( +int llhttp__internal__c_update_header_state_7( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -8951,7 +8960,7 @@ int llhttp__internal__c_test_flags_3( return (state->flags & 8) == 8; } -int llhttp__internal__c_test_lenient_flags_4( +int llhttp__internal__c_test_lenient_flags_5( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -8974,7 +8983,7 @@ int llhttp__internal__c_and_flags( return 0; } -int llhttp__internal__c_update_header_state_7( +int llhttp__internal__c_update_header_state_8( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -9015,7 +9024,7 @@ int llhttp__internal__c_store_http_minor( return 0; } -int llhttp__internal__c_test_lenient_flags_6( +int llhttp__internal__c_test_lenient_flags_7( llhttp__internal_t* state, const unsigned char* p, const unsigned char* endp) { @@ -9715,13 +9724,13 @@ static llparse_state_t llhttp__internal__run( } switch (*p) { case 9: { - goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1; + goto s_n_llhttp__internal__n_invoke_load_header_state_3; } case ' ': { - goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1; + goto s_n_llhttp__internal__n_invoke_load_header_state_3; } default: { - goto s_n_llhttp__internal__n_invoke_load_header_state_3; + goto s_n_llhttp__internal__n_invoke_load_header_state_4; } } /* UNREACHABLE */; @@ -9738,7 +9747,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_value_lws; } default: { - goto s_n_llhttp__internal__n_error_16; + goto s_n_llhttp__internal__n_error_17; } } /* UNREACHABLE */; @@ -9764,32 +9773,16 @@ 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"; + case s_n_llhttp__internal__n_error_18: + s_n_llhttp__internal__n_error_18: { + state->error = 0xa; + state->reason = "Invalid header value char"; state->error_pos = (const char*) p; state->_current = (void*) (intptr_t) s_error; return s_error; /* UNREACHABLE */; abort(); } - case s_n_llhttp__internal__n_header_value_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) { @@ -9800,7 +9793,7 @@ static llparse_state_t llhttp__internal__run( 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; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_4; } } /* UNREACHABLE */; @@ -9863,10 +9856,10 @@ static llparse_state_t llhttp__internal__run( } case ',': { p++; - goto s_n_llhttp__internal__n_invoke_load_header_state_4; + goto s_n_llhttp__internal__n_invoke_load_header_state_5; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_4; + goto s_n_llhttp__internal__n_invoke_update_header_state_5; } } /* UNREACHABLE */; @@ -9884,7 +9877,7 @@ static llparse_state_t llhttp__internal__run( switch (match_seq.status) { case kMatchComplete: { p++; - goto s_n_llhttp__internal__n_invoke_update_header_state_2; + goto s_n_llhttp__internal__n_invoke_update_header_state_3; } case kMatchPause: { return s_n_llhttp__internal__n_header_value_connection_1; @@ -9908,7 +9901,7 @@ static llparse_state_t llhttp__internal__run( switch (match_seq.status) { case kMatchComplete: { p++; - goto s_n_llhttp__internal__n_invoke_update_header_state_5; + goto s_n_llhttp__internal__n_invoke_update_header_state_6; } case kMatchPause: { return s_n_llhttp__internal__n_header_value_connection_2; @@ -9932,7 +9925,7 @@ static llparse_state_t llhttp__internal__run( switch (match_seq.status) { case kMatchComplete: { p++; - goto s_n_llhttp__internal__n_invoke_update_header_state_6; + goto s_n_llhttp__internal__n_invoke_update_header_state_7; } case kMatchPause: { return s_n_llhttp__internal__n_header_value_connection_3; @@ -10216,7 +10209,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_value_te_token_ows; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_8; + goto s_n_llhttp__internal__n_invoke_update_header_state_9; } } /* UNREACHABLE */; @@ -10229,10 +10222,10 @@ static llparse_state_t llhttp__internal__run( } switch (*p) { case 10: { - goto s_n_llhttp__internal__n_invoke_update_header_state_7; + goto s_n_llhttp__internal__n_invoke_update_header_state_8; } case 13: { - goto s_n_llhttp__internal__n_invoke_update_header_state_7; + goto s_n_llhttp__internal__n_invoke_update_header_state_8; } case ' ': { p++; @@ -10295,7 +10288,7 @@ static llparse_state_t llhttp__internal__run( } case 10: { p++; - goto s_n_llhttp__internal__n_header_value_discard_lws; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_3; } case 13: { p++; @@ -10421,7 +10414,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_1; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_9; + goto s_n_llhttp__internal__n_invoke_update_header_state_10; } } /* UNREACHABLE */; @@ -10446,7 +10439,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -10471,7 +10464,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_4; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -10492,7 +10485,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_field_4; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -10516,7 +10509,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_1; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -10541,7 +10534,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_5; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -10566,7 +10559,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_6; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -10591,7 +10584,7 @@ static llparse_state_t llhttp__internal__run( return s_n_llhttp__internal__n_header_field_7; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -10620,7 +10613,7 @@ static llparse_state_t llhttp__internal__run( goto s_n_llhttp__internal__n_header_field_7; } default: { - goto s_n_llhttp__internal__n_invoke_update_header_state_10; + goto s_n_llhttp__internal__n_invoke_update_header_state_11; } } /* UNREACHABLE */; @@ -14147,7 +14140,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_15: { + s_n_llhttp__internal__n_error_16: { state->error = 0xb; state->reason = "Empty Content-Length"; state->error_pos = (const char*) p; @@ -14232,14 +14225,51 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_load_header_state: { switch (llhttp__internal__c_load_header_state(state, p, endp)) { case 2: - goto s_n_llhttp__internal__n_error_15; + goto s_n_llhttp__internal__n_error_16; default: goto s_n_llhttp__internal__n_invoke_load_header_state_1; } /* UNREACHABLE */; abort(); } + s_n_llhttp__internal__n_error_15: { + state->error = 0xa; + state->reason = "Invalid header value char"; + state->error_pos = (const char*) p; + state->_current = (void*) (intptr_t) s_error; + return s_error; + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_test_lenient_flags_3: { + switch (llhttp__internal__c_test_lenient_flags_2(state, p, endp)) { + case 1: + goto s_n_llhttp__internal__n_header_value_discard_lws; + default: + goto s_n_llhttp__internal__n_error_15; + } + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_invoke_update_header_state_1: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { + default: + goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1; + } + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_load_header_state_3: { + switch (llhttp__internal__c_load_header_state(state, p, endp)) { + case 8: + goto s_n_llhttp__internal__n_invoke_update_header_state_1; + default: + goto s_n_llhttp__internal__n_span_start_llhttp__on_header_value_1; + } + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_update_header_state_2: { switch (llhttp__internal__c_update_header_state(state, p, endp)) { default: goto s_n_llhttp__internal__n_invoke_llhttp__on_header_value_complete; @@ -14250,7 +14280,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_7: { switch (llhttp__internal__c_or_flags_3(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_1; + goto s_n_llhttp__internal__n_invoke_update_header_state_2; } /* UNREACHABLE */; abort(); @@ -14258,7 +14288,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_8: { switch (llhttp__internal__c_or_flags_4(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_1; + goto s_n_llhttp__internal__n_invoke_update_header_state_2; } /* UNREACHABLE */; abort(); @@ -14266,7 +14296,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_9: { switch (llhttp__internal__c_or_flags_5(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_1; + goto s_n_llhttp__internal__n_invoke_update_header_state_2; } /* UNREACHABLE */; abort(); @@ -14279,7 +14309,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_load_header_state_3: { + s_n_llhttp__internal__n_invoke_load_header_state_4: { switch (llhttp__internal__c_load_header_state(state, p, endp)) { case 5: goto s_n_llhttp__internal__n_invoke_or_flags_7; @@ -14295,7 +14325,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_16: { + s_n_llhttp__internal__n_error_17: { state->error = 0x3; state->reason = "Missing expected LF after header value"; state->error_pos = (const char*) p; @@ -14366,35 +14396,25 @@ 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->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_17; + state->error_pos = (const char*) p; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_18; return s_error; } - p++; - goto s_n_llhttp__internal__n_error_17; + goto s_n_llhttp__internal__n_error_18; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_18: { - state->error = 0xa; - state->reason = "Invalid header value char"; - state->error_pos = (const char*) p; - state->_current = (void*) (intptr_t) s_error; - return s_error; - /* UNREACHABLE */; - abort(); - } - s_n_llhttp__internal__n_invoke_test_lenient_flags_3: { + s_n_llhttp__internal__n_invoke_test_lenient_flags_4: { switch (llhttp__internal__c_test_lenient_flags_2(state, p, endp)) { case 1: goto s_n_llhttp__internal__n_header_value_lenient; default: - goto s_n_llhttp__internal__n_header_value_lenient_failed; + goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_3: { + s_n_llhttp__internal__n_invoke_update_header_state_4: { switch (llhttp__internal__c_update_header_state(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value_connection; @@ -14405,7 +14425,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_11: { switch (llhttp__internal__c_or_flags_3(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_3; + goto s_n_llhttp__internal__n_invoke_update_header_state_4; } /* UNREACHABLE */; abort(); @@ -14413,7 +14433,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_12: { switch (llhttp__internal__c_or_flags_4(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_3; + goto s_n_llhttp__internal__n_invoke_update_header_state_4; } /* UNREACHABLE */; abort(); @@ -14421,7 +14441,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_or_flags_13: { switch (llhttp__internal__c_or_flags_5(state, p, endp)) { default: - goto s_n_llhttp__internal__n_invoke_update_header_state_3; + goto s_n_llhttp__internal__n_invoke_update_header_state_4; } /* UNREACHABLE */; abort(); @@ -14434,7 +14454,7 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_load_header_state_4: { + s_n_llhttp__internal__n_invoke_load_header_state_5: { switch (llhttp__internal__c_load_header_state(state, p, endp)) { case 5: goto s_n_llhttp__internal__n_invoke_or_flags_11; @@ -14450,24 +14470,16 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_4: { - switch (llhttp__internal__c_update_header_state_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_5: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value_connection_token; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_2: { - switch (llhttp__internal__c_update_header_state_2(state, p, endp)) { - default: - goto s_n_llhttp__internal__n_header_value_connection_ws; - } - /* UNREACHABLE */; - abort(); - } - s_n_llhttp__internal__n_invoke_update_header_state_5: { - switch (llhttp__internal__c_update_header_state_5(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_3: { + switch (llhttp__internal__c_update_header_state_3(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value_connection_ws; } @@ -14482,6 +14494,14 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } + s_n_llhttp__internal__n_invoke_update_header_state_7: { + switch (llhttp__internal__c_update_header_state_7(state, p, endp)) { + default: + goto s_n_llhttp__internal__n_header_value_connection_ws; + } + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: { const unsigned char* start; int err; @@ -14571,8 +14591,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_7: { - switch (llhttp__internal__c_update_header_state_7(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_8: { + switch (llhttp__internal__c_update_header_state_8(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value_otherwise; } @@ -14597,8 +14617,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_test_lenient_flags_4: { - switch (llhttp__internal__c_test_lenient_flags_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_test_lenient_flags_5: { + switch (llhttp__internal__c_test_lenient_flags_5(state, p, endp)) { case 0: goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_7; default: @@ -14610,15 +14630,15 @@ static llparse_state_t llhttp__internal__run( 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; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_5; 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)) { + s_n_llhttp__internal__n_invoke_update_header_state_9: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_value; } @@ -14641,8 +14661,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_test_lenient_flags_5: { - switch (llhttp__internal__c_test_lenient_flags_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_test_lenient_flags_6: { + switch (llhttp__internal__c_test_lenient_flags_5(state, p, endp)) { case 0: goto s_n_llhttp__internal__n_span_end_llhttp__on_header_value_8; default: @@ -14654,7 +14674,7 @@ static llparse_state_t llhttp__internal__run( 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; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_6; default: goto s_n_llhttp__internal__n_invoke_or_flags_17; } @@ -14682,7 +14702,7 @@ static llparse_state_t llhttp__internal__run( 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; + goto s_n_llhttp__internal__n_invoke_update_header_state_9; } /* UNREACHABLE */; abort(); @@ -14748,8 +14768,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_9: { - switch (llhttp__internal__c_update_header_state_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_10: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_field_general; } @@ -14764,8 +14784,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_update_header_state_10: { - switch (llhttp__internal__c_update_header_state_4(state, p, endp)) { + s_n_llhttp__internal__n_invoke_update_header_state_11: { + switch (llhttp__internal__c_update_header_state_1(state, p, endp)) { default: goto s_n_llhttp__internal__n_header_field_general; } @@ -14958,8 +14978,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_test_lenient_flags_6: { - switch (llhttp__internal__c_test_lenient_flags_6(state, p, endp)) { + s_n_llhttp__internal__n_invoke_test_lenient_flags_7: { + switch (llhttp__internal__c_test_lenient_flags_7(state, p, endp)) { case 1: goto s_n_llhttp__internal__n_invoke_load_method_1; default: @@ -14971,7 +14991,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_store_http_minor: { switch (llhttp__internal__c_store_http_minor(state, p, endp, match)) { default: - goto s_n_llhttp__internal__n_invoke_test_lenient_flags_6; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_7; } /* UNREACHABLE */; abort(); @@ -15680,8 +15700,8 @@ static llparse_state_t llhttp__internal__run( /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_invoke_test_lenient_flags_7: { - switch (llhttp__internal__c_test_lenient_flags_6(state, p, endp)) { + s_n_llhttp__internal__n_invoke_test_lenient_flags_8: { + switch (llhttp__internal__c_test_lenient_flags_7(state, p, endp)) { case 1: goto s_n_llhttp__internal__n_res_http_end; default: @@ -15693,7 +15713,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_invoke_store_http_minor_1: { switch (llhttp__internal__c_store_http_minor(state, p, endp, match)) { default: - goto s_n_llhttp__internal__n_invoke_test_lenient_flags_7; + goto s_n_llhttp__internal__n_invoke_test_lenient_flags_8; } /* UNREACHABLE */; abort();