Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
nodejs12.26737
CVE-2022-32213.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File CVE-2022-32213.patch of Package nodejs12.26737
commit da0fda0fe81d372e24c0cb11aec37534985708dd Author: Paolo Insogna <paolo@cowtech.it> Date: Wed Jul 6 23:24:45 2022 +0200 http: stricter Transfer-Encoding and header separator parsing Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com> PR-URL: #315 Backport-PR-URL: #327 CVE-ID: CVE-2022-32215,CVE-2022-32214,CVE-2022-32213 Index: node-v12.22.12/deps/llhttp/include/llhttp.h =================================================================== --- node-v12.22.12.orig/deps/llhttp/include/llhttp.h +++ node-v12.22.12/deps/llhttp/include/llhttp.h @@ -3,7 +3,7 @@ #define LLHTTP_VERSION_MAJOR 2 #define LLHTTP_VERSION_MINOR 1 -#define LLHTTP_VERSION_PATCH 4 +#define LLHTTP_VERSION_PATCH 5 #ifndef LLHTTP_STRICT_MODE # define LLHTTP_STRICT_MODE 0 @@ -58,6 +58,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, @@ -78,7 +79,7 @@ enum llhttp_errno { HPE_CB_CHUNK_COMPLETE = 20, HPE_PAUSED = 21, HPE_PAUSED_UPGRADE = 22, - HPE_USER = 23 + HPE_USER = 24 }; typedef enum llhttp_errno llhttp_errno_t; @@ -153,6 +154,7 @@ typedef enum llhttp_method llhttp_method 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) \ @@ -173,7 +175,7 @@ typedef enum llhttp_method llhttp_method XX(20, CB_CHUNK_COMPLETE, CB_CHUNK_COMPLETE) \ XX(21, PAUSED, PAUSED) \ XX(22, PAUSED_UPGRADE, PAUSED_UPGRADE) \ - XX(23, USER, USER) \ + XX(24, USER, USER) \ #define HTTP_METHOD_MAP(XX) \ Index: node-v12.22.12/deps/llhttp/src/llhttp.c =================================================================== --- node-v12.22.12.orig/deps/llhttp/src/llhttp.c +++ node-v12.22.12/deps/llhttp/src/llhttp.c @@ -325,6 +325,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_24, + 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, @@ -332,14 +334,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_26, s_n_llhttp__internal__n_error_27, + s_n_llhttp__internal__n_error_28, 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_30, + s_n_llhttp__internal__n_error_29, 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, @@ -807,6 +811,13 @@ int llhttp__internal__c_or_flags_15( return 0; } +int llhttp__internal__c_test_flags_7( + llhttp__internal_t* state, + const unsigned char* p, + const unsigned char* endp) { + return (state->flags & 8) == 8; +} + int llhttp__internal__c_or_flags_16( llhttp__internal_t* state, const unsigned char* p, @@ -831,7 +842,7 @@ int llhttp__internal__c_update_header_st 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) { @@ -1603,10 +1614,10 @@ static llparse_state_t llhttp__internal_ } 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++; @@ -1616,17 +1627,40 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } + case s_n_llhttp__internal__n_error_24: + s_n_llhttp__internal__n_error_24: { + 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_25; + } + } + /* 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_flags_5; @@ -1806,8 +1840,8 @@ static llparse_state_t llhttp__internal_ /* 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 = "Content-Length overflow"; state->error_pos = (const char*) p; @@ -1816,8 +1850,8 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - case s_n_llhttp__internal__n_error_27: - s_n_llhttp__internal__n_error_27: { + case s_n_llhttp__internal__n_error_28: + s_n_llhttp__internal__n_error_28: { state->error = 0xb; state->reason = "Invalid character in Content-Length"; state->error_pos = (const char*) p; @@ -1843,7 +1877,7 @@ static llparse_state_t llhttp__internal_ 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 */; @@ -1912,26 +1946,23 @@ static llparse_state_t llhttp__internal_ /* 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_30: + s_n_llhttp__internal__n_error_30: { + 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_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(); } @@ -2054,6 +2085,32 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -2128,7 +2185,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2; } default: { - goto s_n_llhttp__internal__n_error_28; + goto s_n_llhttp__internal__n_error_31; } } /* UNREACHABLE */; @@ -2508,7 +2565,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_to_http_09; } default: { - goto s_n_llhttp__internal__n_error_29; + goto s_n_llhttp__internal__n_error_32; } } /* UNREACHABLE */; @@ -2533,7 +2590,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_skip_lf_to_http09_1; } default: { - goto s_n_llhttp__internal__n_error_29; + goto s_n_llhttp__internal__n_error_32; } } /* UNREACHABLE */; @@ -2550,7 +2607,7 @@ static llparse_state_t llhttp__internal_ 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 */; @@ -2571,7 +2628,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_http_end_1; } default: { - goto s_n_llhttp__internal__n_error_30; + goto s_n_llhttp__internal__n_error_33; } } /* UNREACHABLE */; @@ -2634,7 +2691,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_http_minor; } default: { - goto s_n_llhttp__internal__n_error_31; + goto s_n_llhttp__internal__n_error_34; } } /* UNREACHABLE */; @@ -2651,7 +2708,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_http_minor; } default: { - goto s_n_llhttp__internal__n_error_32; + goto s_n_llhttp__internal__n_error_35; } } /* UNREACHABLE */; @@ -2714,7 +2771,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_http_major; } default: { - goto s_n_llhttp__internal__n_error_33; + goto s_n_llhttp__internal__n_error_36; } } /* UNREACHABLE */; @@ -2738,7 +2795,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_req_http_start_1; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_35; + goto s_n_llhttp__internal__n_error_38; } } /* UNREACHABLE */; @@ -2762,7 +2819,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_req_http_start_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_35; + goto s_n_llhttp__internal__n_error_38; } } /* UNREACHABLE */; @@ -2787,7 +2844,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_http_start_2; } default: { - goto s_n_llhttp__internal__n_error_35; + goto s_n_llhttp__internal__n_error_38; } } /* UNREACHABLE */; @@ -2878,7 +2935,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_fragment; } default: { - goto s_n_llhttp__internal__n_error_36; + goto s_n_llhttp__internal__n_error_39; } } /* UNREACHABLE */; @@ -2939,7 +2996,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_span_end_stub_query_3; } default: { - goto s_n_llhttp__internal__n_error_37; + goto s_n_llhttp__internal__n_error_40; } } /* UNREACHABLE */; @@ -2977,7 +3034,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_query; } default: { - goto s_n_llhttp__internal__n_error_38; + goto s_n_llhttp__internal__n_error_41; } } /* UNREACHABLE */; @@ -3102,10 +3159,10 @@ static llparse_state_t llhttp__internal_ } case 8: { p++; - goto s_n_llhttp__internal__n_error_39; + goto s_n_llhttp__internal__n_error_42; } default: { - goto s_n_llhttp__internal__n_error_40; + goto s_n_llhttp__internal__n_error_43; } } /* UNREACHABLE */; @@ -3164,7 +3221,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_server_with_at; } default: { - goto s_n_llhttp__internal__n_error_41; + goto s_n_llhttp__internal__n_error_44; } } /* UNREACHABLE */; @@ -3181,7 +3238,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_server; } default: { - goto s_n_llhttp__internal__n_error_43; + goto s_n_llhttp__internal__n_error_46; } } /* UNREACHABLE */; @@ -3199,7 +3256,7 @@ static llparse_state_t llhttp__internal_ } case 10: { p++; - goto s_n_llhttp__internal__n_error_42; + goto s_n_llhttp__internal__n_error_45; } case 12: { p++; @@ -3207,18 +3264,18 @@ static llparse_state_t llhttp__internal_ } case 13: { p++; - goto s_n_llhttp__internal__n_error_42; + goto s_n_llhttp__internal__n_error_45; } case ' ': { p++; - goto s_n_llhttp__internal__n_error_42; + goto s_n_llhttp__internal__n_error_45; } case '/': { p++; goto s_n_llhttp__internal__n_url_schema_delim_1; } default: { - goto s_n_llhttp__internal__n_error_43; + goto s_n_llhttp__internal__n_error_46; } } /* UNREACHABLE */; @@ -3264,7 +3321,7 @@ static llparse_state_t llhttp__internal_ } case 2: { p++; - goto s_n_llhttp__internal__n_error_42; + goto s_n_llhttp__internal__n_error_45; } case 3: { goto s_n_llhttp__internal__n_span_end_stub_schema; @@ -3274,7 +3331,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_schema; } default: { - goto s_n_llhttp__internal__n_error_44; + goto s_n_llhttp__internal__n_error_47; } } /* UNREACHABLE */; @@ -3310,7 +3367,7 @@ static llparse_state_t llhttp__internal_ } case 2: { p++; - goto s_n_llhttp__internal__n_error_42; + goto s_n_llhttp__internal__n_error_45; } case 3: { goto s_n_llhttp__internal__n_span_start_stub_path_2; @@ -3319,7 +3376,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_schema; } default: { - goto s_n_llhttp__internal__n_error_45; + goto s_n_llhttp__internal__n_error_48; } } /* UNREACHABLE */; @@ -3417,7 +3474,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_spaces_before_url; } default: { - goto s_n_llhttp__internal__n_error_46; + goto s_n_llhttp__internal__n_error_49; } } /* UNREACHABLE */; @@ -3442,7 +3499,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_1; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3467,7 +3524,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3492,7 +3549,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_4; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3517,7 +3574,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_6; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3535,7 +3592,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3556,7 +3613,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_7; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3577,7 +3634,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_5; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3602,7 +3659,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_8; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3627,7 +3684,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_9; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3652,7 +3709,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_10; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3677,7 +3734,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_12; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3702,7 +3759,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_13; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3723,7 +3780,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_13; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3748,7 +3805,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_15; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3773,7 +3830,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_16; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3798,7 +3855,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_18; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3823,7 +3880,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_20; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3841,7 +3898,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3862,7 +3919,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_21; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3883,7 +3940,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_19; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3908,7 +3965,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_22; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3937,7 +3994,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_22; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3962,7 +4019,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_23; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -3987,7 +4044,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_24; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4012,7 +4069,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_26; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4037,7 +4094,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_27; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4062,7 +4119,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_31; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4087,7 +4144,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_32; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4108,7 +4165,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_32; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4125,7 +4182,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_30; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4147,7 +4204,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_29; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4172,7 +4229,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_34; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4194,7 +4251,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4223,7 +4280,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_33; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4248,7 +4305,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_37; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4273,7 +4330,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_38; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4294,7 +4351,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_38; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4311,7 +4368,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_36; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4336,7 +4393,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_40; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4361,7 +4418,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_41; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4386,7 +4443,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_42; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4411,7 +4468,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_42; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4436,7 +4493,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_43; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4461,7 +4518,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_46; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4486,7 +4543,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_48; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4511,7 +4568,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_49; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4532,7 +4589,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_49; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4557,7 +4614,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_50; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4582,7 +4639,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_50; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4599,7 +4656,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_45; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4672,7 +4729,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_44; } default: { - goto s_n_llhttp__internal__n_error_55; + goto s_n_llhttp__internal__n_error_58; } } /* UNREACHABLE */; @@ -4689,7 +4746,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_header_field_start; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -4764,7 +4821,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_res_status_start; } default: { - goto s_n_llhttp__internal__n_error_49; + goto s_n_llhttp__internal__n_error_52; } } /* UNREACHABLE */; @@ -4844,7 +4901,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_update_status_code; } default: { - goto s_n_llhttp__internal__n_error_50; + goto s_n_llhttp__internal__n_error_53; } } /* UNREACHABLE */; @@ -4907,7 +4964,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_http_minor_1; } default: { - goto s_n_llhttp__internal__n_error_51; + goto s_n_llhttp__internal__n_error_54; } } /* UNREACHABLE */; @@ -4924,7 +4981,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_res_http_minor; } default: { - goto s_n_llhttp__internal__n_error_52; + goto s_n_llhttp__internal__n_error_55; } } /* UNREACHABLE */; @@ -4987,7 +5044,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_http_major_1; } default: { - goto s_n_llhttp__internal__n_error_53; + goto s_n_llhttp__internal__n_error_56; } } /* UNREACHABLE */; @@ -5011,7 +5068,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_res; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_56; + goto s_n_llhttp__internal__n_error_59; } } /* UNREACHABLE */; @@ -5036,7 +5093,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_req_or_res_method_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_54; + goto s_n_llhttp__internal__n_error_57; } } /* UNREACHABLE */; @@ -5060,7 +5117,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_req_or_res_method_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_54; + goto s_n_llhttp__internal__n_error_57; } } /* UNREACHABLE */; @@ -5081,7 +5138,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_or_res_method_3; } default: { - goto s_n_llhttp__internal__n_error_54; + goto s_n_llhttp__internal__n_error_57; } } /* UNREACHABLE */; @@ -5098,7 +5155,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_or_res_method_1; } default: { - goto s_n_llhttp__internal__n_error_54; + goto s_n_llhttp__internal__n_error_57; } } /* UNREACHABLE */; @@ -5167,7 +5224,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_42: { + s_n_llhttp__internal__n_error_45: { state->error = 0x7; state->reason = "Invalid characters in url"; state->error_pos = (const char*) p; @@ -5830,6 +5887,24 @@ static llparse_state_t llhttp__internal_ err = llhttp__on_header_value(state, start, p); if (err != 0) { state->error = err; + state->error_pos = (const char*) (p + 1); + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done; + return s_error; + } + p++; + goto s_n_llhttp__internal__n_header_value_almost_done; + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_3: { + const unsigned char* start; + int err; + + start = state->_span_pos0; + state->_span_pos0 = NULL; + err = llhttp__on_header_value(state, start, p); + if (err != 0) { + state->error = err; state->error_pos = (const char*) p; state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done; return s_error; @@ -5838,7 +5913,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -5856,7 +5931,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -5866,15 +5941,15 @@ static llparse_state_t llhttp__internal_ 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_24; return s_error; } p++; - goto s_n_llhttp__internal__n_header_value_almost_done; + goto s_n_llhttp__internal__n_error_24; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_24: { + s_n_llhttp__internal__n_error_25: { state->error = 0xa; state->reason = "Invalid header value char"; state->error_pos = (const char*) p; @@ -5888,7 +5963,7 @@ static llparse_state_t llhttp__internal_ case 1: goto s_n_llhttp__internal__n_header_value_lenient; default: - goto s_n_llhttp__internal__n_error_24; + goto s_n_llhttp__internal__n_header_value_lenient_failed; } /* UNREACHABLE */; abort(); @@ -5981,7 +6056,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -5991,17 +6066,17 @@ static llparse_state_t llhttp__internal_ 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_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; } @@ -6016,7 +6091,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -6026,14 +6101,14 @@ static llparse_state_t llhttp__internal_ if (err != 0) { state->error = err; state->error_pos = (const char*) p; - state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_27; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_28; return s_error; } - goto s_n_llhttp__internal__n_error_27; + goto s_n_llhttp__internal__n_error_28; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_25: { + s_n_llhttp__internal__n_error_26: { state->error = 0x4; state->reason = "Duplicate Content-Length"; state->error_pos = (const char*) p; @@ -6047,8 +6122,26 @@ static llparse_state_t llhttp__internal_ case 0: goto s_n_llhttp__internal__n_header_value_content_length; default: - goto s_n_llhttp__internal__n_error_25; + goto s_n_llhttp__internal__n_error_26; + } + /* 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_30; + return s_error; } + p++; + goto s_n_llhttp__internal__n_error_30; /* UNREACHABLE */; abort(); } @@ -6060,6 +6153,44 @@ static llparse_state_t llhttp__internal_ /* 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_29; + return s_error; + } + p++; + goto s_n_llhttp__internal__n_error_29; + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_test_flags_8: { + switch (llhttp__internal__c_test_flags_2(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_flags_8; + 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: @@ -6076,6 +6207,34 @@ static llparse_state_t llhttp__internal_ /* 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_flags_9: { + switch (llhttp__internal__c_test_flags_2(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_flags_9; + default: + goto s_n_llhttp__internal__n_invoke_or_flags_17; + } + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_invoke_or_flags_16: { switch (llhttp__internal__c_or_flags_16(state, p, endp)) { default: @@ -6084,8 +6243,18 @@ static llparse_state_t llhttp__internal_ /* 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_7: { + switch (llhttp__internal__c_test_flags_7(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; } @@ -6099,9 +6268,9 @@ static llparse_state_t llhttp__internal_ case 2: goto s_n_llhttp__internal__n_invoke_test_flags_6; case 3: - goto s_n_llhttp__internal__n_invoke_or_flags_16; + goto s_n_llhttp__internal__n_invoke_test_flags_7; 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; } @@ -6144,7 +6313,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_28: { + s_n_llhttp__internal__n_error_31: { state->error = 0xa; state->reason = "Invalid header token"; state->error_pos = (const char*) p; @@ -6210,7 +6379,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_29: { + s_n_llhttp__internal__n_error_32: { state->error = 0x7; state->reason = "Expected CRLF"; state->error_pos = (const char*) p; @@ -6236,7 +6405,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -6253,7 +6422,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_31: { + s_n_llhttp__internal__n_error_34: { state->error = 0x9; state->reason = "Invalid minor version"; state->error_pos = (const char*) p; @@ -6262,7 +6431,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_32: { + s_n_llhttp__internal__n_error_35: { state->error = 0x9; state->reason = "Expected dot"; state->error_pos = (const char*) p; @@ -6279,7 +6448,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_33: { + s_n_llhttp__internal__n_error_36: { state->error = 0x9; state->reason = "Invalid major version"; state->error_pos = (const char*) p; @@ -6288,7 +6457,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_35: { + s_n_llhttp__internal__n_error_38: { state->error = 0x8; state->reason = "Expected HTTP/"; state->error_pos = (const char*) p; @@ -6297,7 +6466,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_34: { + s_n_llhttp__internal__n_error_37: { state->error = 0x8; state->reason = "Expected SOURCE method for ICE/x.x request"; state->error_pos = (const char*) p; @@ -6309,7 +6478,7 @@ static llparse_state_t llhttp__internal_ s_n_llhttp__internal__n_invoke_is_equal_method_1: { switch (llhttp__internal__c_is_equal_method_1(state, p, endp)) { case 0: - goto s_n_llhttp__internal__n_error_34; + goto s_n_llhttp__internal__n_error_37; default: goto s_n_llhttp__internal__n_req_http_major; } @@ -6384,7 +6553,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_36: { + s_n_llhttp__internal__n_error_39: { state->error = 0x7; state->reason = "Invalid char in url fragment start"; state->error_pos = (const char*) p; @@ -6444,7 +6613,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_37: { + s_n_llhttp__internal__n_error_40: { state->error = 0x7; state->reason = "Invalid char in url query"; state->error_pos = (const char*) p; @@ -6453,7 +6622,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_38: { + s_n_llhttp__internal__n_error_41: { state->error = 0x7; state->reason = "Invalid char in url path"; state->error_pos = (const char*) p; @@ -6564,7 +6733,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_39: { + s_n_llhttp__internal__n_error_42: { state->error = 0x7; state->reason = "Double @ in url"; state->error_pos = (const char*) p; @@ -6573,7 +6742,7 @@ static llparse_state_t llhttp__internal_ /* 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 server"; state->error_pos = (const char*) p; @@ -6582,7 +6751,7 @@ static llparse_state_t llhttp__internal_ /* 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 server"; state->error_pos = (const char*) p; @@ -6591,7 +6760,7 @@ static llparse_state_t llhttp__internal_ /* 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 schema"; state->error_pos = (const char*) p; @@ -6600,7 +6769,7 @@ static llparse_state_t llhttp__internal_ /* 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 schema"; state->error_pos = (const char*) p; @@ -6609,7 +6778,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_45: { + s_n_llhttp__internal__n_error_48: { state->error = 0x7; state->reason = "Unexpected start char in url"; state->error_pos = (const char*) p; @@ -6628,7 +6797,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_46: { + s_n_llhttp__internal__n_error_49: { state->error = 0x6; state->reason = "Expected space after method"; state->error_pos = (const char*) p; @@ -6645,7 +6814,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_55: { + s_n_llhttp__internal__n_error_58: { state->error = 0x6; state->reason = "Invalid method encountered"; state->error_pos = (const char*) p; @@ -6654,7 +6823,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_47: { + s_n_llhttp__internal__n_error_50: { state->error = 0xd; state->reason = "Response overflow"; state->error_pos = (const char*) p; @@ -6666,14 +6835,14 @@ static llparse_state_t llhttp__internal_ 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_47; + goto s_n_llhttp__internal__n_error_50; default: goto s_n_llhttp__internal__n_res_status_code; } /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_48: { + s_n_llhttp__internal__n_error_51: { state->error = 0x2; state->reason = "Expected LF after CR"; state->error_pos = (const char*) p; @@ -6718,7 +6887,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_49: { + s_n_llhttp__internal__n_error_52: { state->error = 0xd; state->reason = "Invalid response status"; state->error_pos = (const char*) p; @@ -6735,7 +6904,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_50: { + s_n_llhttp__internal__n_error_53: { state->error = 0x9; state->reason = "Expected space after version"; state->error_pos = (const char*) p; @@ -6752,7 +6921,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_51: { + s_n_llhttp__internal__n_error_54: { state->error = 0x9; state->reason = "Invalid minor version"; state->error_pos = (const char*) p; @@ -6761,7 +6930,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_52: { + s_n_llhttp__internal__n_error_55: { state->error = 0x9; state->reason = "Expected dot"; state->error_pos = (const char*) p; @@ -6778,7 +6947,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_53: { + s_n_llhttp__internal__n_error_56: { state->error = 0x9; state->reason = "Invalid major version"; state->error_pos = (const char*) p; @@ -6787,7 +6956,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_56: { + s_n_llhttp__internal__n_error_59: { state->error = 0x8; state->reason = "Expected HTTP/"; state->error_pos = (const char*) p; @@ -6812,7 +6981,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_54: { + s_n_llhttp__internal__n_error_57: { state->error = 0x8; state->reason = "Invalid word encountered"; state->error_pos = (const char*) p; @@ -7244,6 +7413,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_18, + 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, @@ -7251,14 +7422,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_20, s_n_llhttp__internal__n_error_21, + s_n_llhttp__internal__n_error_22, 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_24, + s_n_llhttp__internal__n_error_23, 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, @@ -7721,6 +7894,13 @@ int llhttp__internal__c_or_flags_15( return 0; } +int llhttp__internal__c_test_flags_7( + llhttp__internal_t* state, + const unsigned char* p, + const unsigned char* endp) { + return (state->flags & 8) == 8; +} + int llhttp__internal__c_or_flags_16( llhttp__internal_t* state, const unsigned char* p, @@ -7745,7 +7925,7 @@ int llhttp__internal__c_update_header_st 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) { @@ -8468,10 +8648,10 @@ static llparse_state_t llhttp__internal_ } 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++; @@ -8481,17 +8661,40 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } + case s_n_llhttp__internal__n_error_18: + s_n_llhttp__internal__n_error_18: { + 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_19; + } + } + /* 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_flags_5; @@ -8671,8 +8874,8 @@ static llparse_state_t llhttp__internal_ /* 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 = "Content-Length overflow"; state->error_pos = (const char*) p; @@ -8681,8 +8884,8 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - case s_n_llhttp__internal__n_error_21: - s_n_llhttp__internal__n_error_21: { + case s_n_llhttp__internal__n_error_22: + s_n_llhttp__internal__n_error_22: { state->error = 0xb; state->reason = "Invalid character in Content-Length"; state->error_pos = (const char*) p; @@ -8708,7 +8911,7 @@ static llparse_state_t llhttp__internal_ 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 */; @@ -8777,26 +8980,23 @@ static llparse_state_t llhttp__internal_ /* 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_24: + s_n_llhttp__internal__n_error_24: { + 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_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(); } @@ -8919,6 +9119,32 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -8993,7 +9219,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_span_end_llhttp__on_header_field_2; } default: { - goto s_n_llhttp__internal__n_error_22; + goto s_n_llhttp__internal__n_error_25; } } /* UNREACHABLE */; @@ -9347,7 +9573,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_url_skip_lf_to_http09; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_23; + goto s_n_llhttp__internal__n_error_26; } } /* UNREACHABLE */; @@ -9364,7 +9590,7 @@ static llparse_state_t llhttp__internal_ 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 */; @@ -9385,7 +9611,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_http_end_1; } default: { - goto s_n_llhttp__internal__n_error_24; + goto s_n_llhttp__internal__n_error_27; } } /* UNREACHABLE */; @@ -9448,7 +9674,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_http_minor; } default: { - goto s_n_llhttp__internal__n_error_25; + goto s_n_llhttp__internal__n_error_28; } } /* UNREACHABLE */; @@ -9465,7 +9691,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_http_minor; } default: { - goto s_n_llhttp__internal__n_error_26; + goto s_n_llhttp__internal__n_error_29; } } /* UNREACHABLE */; @@ -9528,7 +9754,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_http_major; } default: { - goto s_n_llhttp__internal__n_error_27; + goto s_n_llhttp__internal__n_error_30; } } /* UNREACHABLE */; @@ -9552,7 +9778,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_req_http_start_1; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_29; + goto s_n_llhttp__internal__n_error_32; } } /* UNREACHABLE */; @@ -9576,7 +9802,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_req_http_start_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_29; + goto s_n_llhttp__internal__n_error_32; } } /* UNREACHABLE */; @@ -9601,7 +9827,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_http_start_2; } default: { - goto s_n_llhttp__internal__n_error_29; + goto s_n_llhttp__internal__n_error_32; } } /* UNREACHABLE */; @@ -9655,7 +9881,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_span_end_llhttp__on_url_8; } default: { - goto s_n_llhttp__internal__n_error_30; + goto s_n_llhttp__internal__n_error_33; } } /* UNREACHABLE */; @@ -9712,7 +9938,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_span_end_stub_query_3; } default: { - goto s_n_llhttp__internal__n_error_31; + goto s_n_llhttp__internal__n_error_34; } } /* UNREACHABLE */; @@ -9742,7 +9968,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_query; } default: { - goto s_n_llhttp__internal__n_error_32; + goto s_n_llhttp__internal__n_error_35; } } /* UNREACHABLE */; @@ -9883,10 +10109,10 @@ static llparse_state_t llhttp__internal_ } case 7: { p++; - goto s_n_llhttp__internal__n_error_33; + goto s_n_llhttp__internal__n_error_36; } default: { - goto s_n_llhttp__internal__n_error_34; + goto s_n_llhttp__internal__n_error_37; } } /* UNREACHABLE */; @@ -9941,7 +10167,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_server_with_at; } default: { - goto s_n_llhttp__internal__n_error_35; + goto s_n_llhttp__internal__n_error_38; } } /* UNREACHABLE */; @@ -9958,7 +10184,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_server; } default: { - goto s_n_llhttp__internal__n_error_37; + goto s_n_llhttp__internal__n_error_40; } } /* UNREACHABLE */; @@ -9972,22 +10198,22 @@ static llparse_state_t llhttp__internal_ switch (*p) { case 10: { p++; - goto s_n_llhttp__internal__n_error_36; + goto s_n_llhttp__internal__n_error_39; } case 13: { p++; - goto s_n_llhttp__internal__n_error_36; + goto s_n_llhttp__internal__n_error_39; } case ' ': { p++; - goto s_n_llhttp__internal__n_error_36; + goto s_n_llhttp__internal__n_error_39; } case '/': { p++; goto s_n_llhttp__internal__n_url_schema_delim_1; } default: { - goto s_n_llhttp__internal__n_error_37; + goto s_n_llhttp__internal__n_error_40; } } /* UNREACHABLE */; @@ -10029,7 +10255,7 @@ static llparse_state_t llhttp__internal_ switch (lookup_table[(uint8_t) *p]) { case 1: { p++; - goto s_n_llhttp__internal__n_error_36; + goto s_n_llhttp__internal__n_error_39; } case 2: { goto s_n_llhttp__internal__n_span_end_stub_schema; @@ -10039,7 +10265,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_schema; } default: { - goto s_n_llhttp__internal__n_error_38; + goto s_n_llhttp__internal__n_error_41; } } /* UNREACHABLE */; @@ -10071,7 +10297,7 @@ static llparse_state_t llhttp__internal_ switch (lookup_table[(uint8_t) *p]) { case 1: { p++; - goto s_n_llhttp__internal__n_error_36; + goto s_n_llhttp__internal__n_error_39; } case 2: { goto s_n_llhttp__internal__n_span_start_stub_path_2; @@ -10080,7 +10306,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_url_schema; } default: { - goto s_n_llhttp__internal__n_error_39; + goto s_n_llhttp__internal__n_error_42; } } /* UNREACHABLE */; @@ -10136,7 +10362,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_spaces_before_url; } default: { - goto s_n_llhttp__internal__n_error_40; + goto s_n_llhttp__internal__n_error_43; } } /* UNREACHABLE */; @@ -10161,7 +10387,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_1; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10186,7 +10412,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10211,7 +10437,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_4; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10236,7 +10462,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_6; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10254,7 +10480,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10275,7 +10501,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_7; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10296,7 +10522,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_5; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10321,7 +10547,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_8; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10346,7 +10572,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_9; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10371,7 +10597,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_10; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10396,7 +10622,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_12; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10421,7 +10647,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_13; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10442,7 +10668,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_13; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10467,7 +10693,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_15; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10492,7 +10718,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_16; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10517,7 +10743,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_18; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10542,7 +10768,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_20; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10560,7 +10786,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10581,7 +10807,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_21; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10602,7 +10828,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_19; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10627,7 +10853,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_22; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10656,7 +10882,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_22; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10681,7 +10907,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_23; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10706,7 +10932,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_24; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10731,7 +10957,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_26; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10756,7 +10982,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_27; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10781,7 +11007,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_31; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10806,7 +11032,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_32; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10827,7 +11053,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_32; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10844,7 +11070,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_30; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10866,7 +11092,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_29; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10891,7 +11117,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_34; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10913,7 +11139,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_method_1; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10942,7 +11168,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_33; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10967,7 +11193,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_37; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -10992,7 +11218,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_38; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11013,7 +11239,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_38; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11030,7 +11256,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_36; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11055,7 +11281,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_40; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11080,7 +11306,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_41; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11105,7 +11331,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_42; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11130,7 +11356,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_42; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11155,7 +11381,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_43; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11180,7 +11406,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_46; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11205,7 +11431,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_48; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11230,7 +11456,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_49; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11251,7 +11477,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_49; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11276,7 +11502,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_req_50; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11301,7 +11527,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_50; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11318,7 +11544,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_45; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11391,7 +11617,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_start_req_44; } default: { - goto s_n_llhttp__internal__n_error_48; + goto s_n_llhttp__internal__n_error_51; } } /* UNREACHABLE */; @@ -11476,7 +11702,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_res_status_start; } default: { - goto s_n_llhttp__internal__n_error_42; + goto s_n_llhttp__internal__n_error_45; } } /* UNREACHABLE */; @@ -11556,7 +11782,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_update_status_code; } default: { - goto s_n_llhttp__internal__n_error_43; + goto s_n_llhttp__internal__n_error_46; } } /* UNREACHABLE */; @@ -11619,7 +11845,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_http_minor_1; } default: { - goto s_n_llhttp__internal__n_error_44; + goto s_n_llhttp__internal__n_error_47; } } /* UNREACHABLE */; @@ -11636,7 +11862,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_res_http_minor; } default: { - goto s_n_llhttp__internal__n_error_45; + goto s_n_llhttp__internal__n_error_48; } } /* UNREACHABLE */; @@ -11699,7 +11925,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_invoke_store_http_major_1; } default: { - goto s_n_llhttp__internal__n_error_46; + goto s_n_llhttp__internal__n_error_49; } } /* UNREACHABLE */; @@ -11723,7 +11949,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_start_res; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_49; + goto s_n_llhttp__internal__n_error_52; } } /* UNREACHABLE */; @@ -11748,7 +11974,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_req_or_res_method_2; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_47; + goto s_n_llhttp__internal__n_error_50; } } /* UNREACHABLE */; @@ -11772,7 +11998,7 @@ static llparse_state_t llhttp__internal_ return s_n_llhttp__internal__n_req_or_res_method_3; } case kMatchMismatch: { - goto s_n_llhttp__internal__n_error_47; + goto s_n_llhttp__internal__n_error_50; } } /* UNREACHABLE */; @@ -11793,7 +12019,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_or_res_method_3; } default: { - goto s_n_llhttp__internal__n_error_47; + goto s_n_llhttp__internal__n_error_50; } } /* UNREACHABLE */; @@ -11810,7 +12036,7 @@ static llparse_state_t llhttp__internal_ goto s_n_llhttp__internal__n_req_or_res_method_1; } default: { - goto s_n_llhttp__internal__n_error_47; + goto s_n_llhttp__internal__n_error_50; } } /* UNREACHABLE */; @@ -11870,7 +12096,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */ abort(); } - s_n_llhttp__internal__n_error_36: { + s_n_llhttp__internal__n_error_39: { state->error = 0x7; state->reason = "Invalid characters in url"; state->error_pos = (const char*) p; @@ -12480,6 +12706,24 @@ static llparse_state_t llhttp__internal_ err = llhttp__on_header_value(state, start, p); if (err != 0) { state->error = err; + state->error_pos = (const char*) (p + 1); + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done; + return s_error; + } + p++; + goto s_n_llhttp__internal__n_header_value_almost_done; + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_span_end_llhttp__on_header_value_3: { + const unsigned char* start; + int err; + + start = state->_span_pos0; + state->_span_pos0 = NULL; + err = llhttp__on_header_value(state, start, p); + if (err != 0) { + state->error = err; state->error_pos = (const char*) p; state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_header_value_almost_done; return s_error; @@ -12488,7 +12732,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -12506,7 +12750,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -12516,15 +12760,15 @@ static llparse_state_t llhttp__internal_ 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_18; return s_error; } p++; - goto s_n_llhttp__internal__n_header_value_almost_done; + goto s_n_llhttp__internal__n_error_18; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_18: { + s_n_llhttp__internal__n_error_19: { state->error = 0xa; state->reason = "Invalid header value char"; state->error_pos = (const char*) p; @@ -12538,7 +12782,7 @@ static llparse_state_t llhttp__internal_ case 1: goto s_n_llhttp__internal__n_header_value_lenient; default: - goto s_n_llhttp__internal__n_error_18; + goto s_n_llhttp__internal__n_header_value_lenient_failed; } /* UNREACHABLE */; abort(); @@ -12631,7 +12875,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -12641,17 +12885,17 @@ static llparse_state_t llhttp__internal_ 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_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; } @@ -12666,7 +12910,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -12676,14 +12920,14 @@ static llparse_state_t llhttp__internal_ if (err != 0) { state->error = err; state->error_pos = (const char*) p; - state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_21; + state->_current = (void*) (intptr_t) s_n_llhttp__internal__n_error_22; return s_error; } - goto s_n_llhttp__internal__n_error_21; + goto s_n_llhttp__internal__n_error_22; /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_19: { + s_n_llhttp__internal__n_error_20: { state->error = 0x4; state->reason = "Duplicate Content-Length"; state->error_pos = (const char*) p; @@ -12697,11 +12941,29 @@ static llparse_state_t llhttp__internal_ case 0: goto s_n_llhttp__internal__n_header_value_content_length; default: - goto s_n_llhttp__internal__n_error_19; + goto s_n_llhttp__internal__n_error_20; } /* 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_24; + return s_error; + } + p++; + goto s_n_llhttp__internal__n_error_24; + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_invoke_update_header_state_7: { switch (llhttp__internal__c_update_header_state_7(state, p, endp)) { default: @@ -12710,6 +12972,44 @@ static llparse_state_t llhttp__internal_ /* 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_23; + return s_error; + } + p++; + goto s_n_llhttp__internal__n_error_23; + /* UNREACHABLE */; + abort(); + } + s_n_llhttp__internal__n_invoke_test_flags_8: { + switch (llhttp__internal__c_test_flags_2(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_flags_8; + 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: @@ -12726,6 +13026,34 @@ static llparse_state_t llhttp__internal_ /* 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_flags_9: { + switch (llhttp__internal__c_test_flags_2(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_flags_9; + default: + goto s_n_llhttp__internal__n_invoke_or_flags_17; + } + /* UNREACHABLE */; + abort(); + } s_n_llhttp__internal__n_invoke_or_flags_16: { switch (llhttp__internal__c_or_flags_16(state, p, endp)) { default: @@ -12734,8 +13062,18 @@ static llparse_state_t llhttp__internal_ /* 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_7: { + switch (llhttp__internal__c_test_flags_7(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; } @@ -12749,9 +13087,9 @@ static llparse_state_t llhttp__internal_ case 2: goto s_n_llhttp__internal__n_invoke_test_flags_6; case 3: - goto s_n_llhttp__internal__n_invoke_or_flags_16; + goto s_n_llhttp__internal__n_invoke_test_flags_7; 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; } @@ -12794,7 +13132,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_22: { + s_n_llhttp__internal__n_error_25: { state->error = 0xa; state->reason = "Invalid header token"; state->error_pos = (const char*) p; @@ -12860,7 +13198,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_23: { + s_n_llhttp__internal__n_error_26: { state->error = 0x7; state->reason = "Expected CRLF"; state->error_pos = (const char*) p; @@ -12886,7 +13224,7 @@ static llparse_state_t llhttp__internal_ /* 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; @@ -12903,7 +13241,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_25: { + s_n_llhttp__internal__n_error_28: { state->error = 0x9; state->reason = "Invalid minor version"; state->error_pos = (const char*) p; @@ -12912,7 +13250,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_26: { + s_n_llhttp__internal__n_error_29: { state->error = 0x9; state->reason = "Expected dot"; state->error_pos = (const char*) p; @@ -12929,7 +13267,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_27: { + s_n_llhttp__internal__n_error_30: { state->error = 0x9; state->reason = "Invalid major version"; state->error_pos = (const char*) p; @@ -12938,7 +13276,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_29: { + s_n_llhttp__internal__n_error_32: { state->error = 0x8; state->reason = "Expected HTTP/"; state->error_pos = (const char*) p; @@ -12947,7 +13285,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_28: { + s_n_llhttp__internal__n_error_31: { state->error = 0x8; state->reason = "Expected SOURCE method for ICE/x.x request"; state->error_pos = (const char*) p; @@ -12959,7 +13297,7 @@ static llparse_state_t llhttp__internal_ s_n_llhttp__internal__n_invoke_is_equal_method_1: { switch (llhttp__internal__c_is_equal_method_1(state, p, endp)) { case 0: - goto s_n_llhttp__internal__n_error_28; + goto s_n_llhttp__internal__n_error_31; default: goto s_n_llhttp__internal__n_req_http_major; } @@ -13034,7 +13372,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_30: { + s_n_llhttp__internal__n_error_33: { state->error = 0x7; state->reason = "Invalid char in url fragment start"; state->error_pos = (const char*) p; @@ -13094,7 +13432,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_31: { + s_n_llhttp__internal__n_error_34: { state->error = 0x7; state->reason = "Invalid char in url query"; state->error_pos = (const char*) p; @@ -13103,7 +13441,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_32: { + s_n_llhttp__internal__n_error_35: { state->error = 0x7; state->reason = "Invalid char in url path"; state->error_pos = (const char*) p; @@ -13214,7 +13552,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_33: { + s_n_llhttp__internal__n_error_36: { state->error = 0x7; state->reason = "Double @ in url"; state->error_pos = (const char*) p; @@ -13223,7 +13561,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_34: { + s_n_llhttp__internal__n_error_37: { state->error = 0x7; state->reason = "Unexpected char in url server"; state->error_pos = (const char*) p; @@ -13232,7 +13570,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_35: { + s_n_llhttp__internal__n_error_38: { state->error = 0x7; state->reason = "Unexpected char in url server"; state->error_pos = (const char*) p; @@ -13241,7 +13579,7 @@ static llparse_state_t llhttp__internal_ /* 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 schema"; state->error_pos = (const char*) p; @@ -13250,7 +13588,7 @@ static llparse_state_t llhttp__internal_ /* 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 schema"; state->error_pos = (const char*) p; @@ -13259,7 +13597,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_39: { + s_n_llhttp__internal__n_error_42: { state->error = 0x7; state->reason = "Unexpected start char in url"; state->error_pos = (const char*) p; @@ -13278,7 +13616,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_40: { + s_n_llhttp__internal__n_error_43: { state->error = 0x6; state->reason = "Expected space after method"; state->error_pos = (const char*) p; @@ -13295,7 +13633,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_48: { + s_n_llhttp__internal__n_error_51: { state->error = 0x6; state->reason = "Invalid method encountered"; state->error_pos = (const char*) p; @@ -13304,7 +13642,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_41: { + s_n_llhttp__internal__n_error_44: { state->error = 0xd; state->reason = "Response overflow"; state->error_pos = (const char*) p; @@ -13316,7 +13654,7 @@ static llparse_state_t llhttp__internal_ 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_41; + goto s_n_llhttp__internal__n_error_44; default: goto s_n_llhttp__internal__n_res_status_code; } @@ -13359,7 +13697,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_42: { + s_n_llhttp__internal__n_error_45: { state->error = 0xd; state->reason = "Invalid response status"; state->error_pos = (const char*) p; @@ -13376,7 +13714,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_43: { + s_n_llhttp__internal__n_error_46: { state->error = 0x9; state->reason = "Expected space after version"; state->error_pos = (const char*) p; @@ -13393,7 +13731,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_44: { + s_n_llhttp__internal__n_error_47: { state->error = 0x9; state->reason = "Invalid minor version"; state->error_pos = (const char*) p; @@ -13402,7 +13740,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_45: { + s_n_llhttp__internal__n_error_48: { state->error = 0x9; state->reason = "Expected dot"; state->error_pos = (const char*) p; @@ -13419,7 +13757,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_46: { + s_n_llhttp__internal__n_error_49: { state->error = 0x9; state->reason = "Invalid major version"; state->error_pos = (const char*) p; @@ -13428,7 +13766,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_49: { + s_n_llhttp__internal__n_error_52: { state->error = 0x8; state->reason = "Expected HTTP/"; state->error_pos = (const char*) p; @@ -13453,7 +13791,7 @@ static llparse_state_t llhttp__internal_ /* UNREACHABLE */; abort(); } - s_n_llhttp__internal__n_error_47: { + s_n_llhttp__internal__n_error_50: { state->error = 0x8; state->reason = "Invalid word encountered"; state->error_pos = (const char*) p; Index: node-v12.22.12/test/parallel/test-http-invalid-te.js =================================================================== --- node-v12.22.12.orig/test/parallel/test-http-invalid-te.js +++ node-v12.22.12/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 Index: node-v12.22.12/test/parallel/test-http-missing-header-separator-cr.js =================================================================== --- /dev/null +++ node-v12.22.12/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(); +})); Index: node-v12.22.12/test/parallel/test-http-transfer-encoding-repeated-chunked.js =================================================================== --- /dev/null +++ node-v12.22.12/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(); +})); Index: node-v12.22.12/test/parallel/test-http-transfer-encoding-smuggling.js =================================================================== --- node-v12.22.12.orig/test/parallel/test-http-transfer-encoding-smuggling.js +++ node-v12.22.12/test/parallel/test-http-transfer-encoding-smuggling.js @@ -1,8 +1,8 @@ 'use strict'; const common = require('../common'); - const assert = require('assert'); + const http = require('http'); const net = require('net'); @@ -23,24 +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.mustCall((err) => { - assert.ifError(err); - 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(); })); Index: node-v12.22.12/test/common/index.js =================================================================== --- node-v12.22.12.orig/test/common/index.js +++ node-v12.22.12/test/common/index.js @@ -332,6 +332,14 @@ function mustCall(fn, exact) { return _mustCallInner(fn, exact, 'exact'); } +function mustSucceed(fn, exact) { + return mustCall(function(err, ...args) { + assert.ifError(err); + if (typeof fn === 'function') + return fn.apply(this, args); + }, exact); +} + function mustCallAtLeast(fn, minimum) { return _mustCallInner(fn, minimum, 'minimum'); } @@ -735,6 +743,7 @@ const common = { isWindows, localIPv6Hosts, mustCall, + mustSucceed, mustCallAtLeast, mustNotCall, nodeProcessAborted,
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor