From a694dd25d1ba9862d50a3d19103d36083422c1ae Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Wed, 30 Sep 2020 16:43:10 -0700 Subject: [PATCH] deps: update llhttp to 2.1.3 PR-URL: https://github.com/nodejs/node/pull/35435 Refs: https://github.com/nodejs/llhttp/pull/65 Reviewed-By: Colin Ihrig Reviewed-By: Rich Trott Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Jiawen Geng --- deps/llhttp/README.md | 4 +- deps/llhttp/include/llhttp.h | 2 +- deps/llhttp/src/llhttp.c | 216 +++++++++++++++++------------------ 3 files changed, 111 insertions(+), 111 deletions(-) diff --git a/deps/llhttp/README.md b/deps/llhttp/README.md index f1998e923af4f9..c95e8d045843e0 100644 --- a/deps/llhttp/README.md +++ b/deps/llhttp/README.md @@ -22,7 +22,7 @@ were tried. However, all of them failed due to resulting significant performance degradation. This project is a port of [http_parser][0] to TypeScript. [llparse][1] is used -to generate the output C and/or bitcode artifacts, which could be compiled and +to generate the output C source file, which could be compiled and linked with the embedder's program (like [Node.js][7]). ## Performance @@ -31,7 +31,7 @@ So far llhttp outperforms http_parser: | | input size | bandwidth | reqs/sec | time | |:----------------|-----------:|-------------:|-----------:|--------:| -| **llhttp** _(C)_ | 8192.00 mb | 1777.24 mb/s | 3583799.39 ops/sec | 4.61 s | +| **llhttp** | 8192.00 mb | 1777.24 mb/s | 3583799.39 ops/sec | 4.61 s | | **http_parser** | 8192.00 mb | 694.66 mb/s | 1406180.33 req/sec | 11.79 s | llhttp is faster by approximately **156%**. diff --git a/deps/llhttp/include/llhttp.h b/deps/llhttp/include/llhttp.h index bfa290880580c1..4bf4d8b0cef85f 100644 --- a/deps/llhttp/include/llhttp.h +++ b/deps/llhttp/include/llhttp.h @@ -3,7 +3,7 @@ #define LLHTTP_VERSION_MAJOR 2 #define LLHTTP_VERSION_MINOR 1 -#define LLHTTP_VERSION_PATCH 2 +#define LLHTTP_VERSION_PATCH 3 #ifndef LLHTTP_STRICT_MODE # define LLHTTP_STRICT_MODE 0 diff --git a/deps/llhttp/src/llhttp.c b/deps/llhttp/src/llhttp.c index 56cd1f58486b38..acc35479f88ca6 100644 --- a/deps/llhttp/src/llhttp.c +++ b/deps/llhttp/src/llhttp.c @@ -49,7 +49,7 @@ static const unsigned char llparse_blob7[] = { }; #ifdef __SSE4_2__ static const unsigned char ALIGN(16) llparse_blob8[] = { - 0x9, 0x9, ' ', '~', 0x80, 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x9, 0x9, ' ', '~', 0x80, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; #endif /* __SSE4_2__ */ @@ -616,9 +616,9 @@ int llhttp__internal__c_mul_add_content_length( if (state->content_length > 0xffffffffffffffffULL / 16) { return 1; } - + state->content_length *= 16; - + /* Addition overflow */ if (match >= 0) { if (state->content_length > 0xffffffffffffffffULL - match) { @@ -780,9 +780,9 @@ int llhttp__internal__c_mul_add_content_length_1( if (state->content_length > 0xffffffffffffffffULL / 10) { return 1; } - + state->content_length *= 10; - + /* Addition overflow */ if (match >= 0) { if (state->content_length > 0xffffffffffffffffULL - match) { @@ -871,9 +871,9 @@ int llhttp__internal__c_mul_add_status_code( if (state->status_code > 0xffff / 10) { return 1; } - + state->status_code *= 10; - + /* Addition overflow */ if (match >= 0) { if (state->status_code > 0xffff - match) { @@ -885,7 +885,7 @@ int llhttp__internal__c_mul_add_status_code( } } state->status_code += match; - + /* Enforce maximum */ if (state->status_code > 999) { return 1; @@ -991,7 +991,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_chunk_data_almost_done: s_n_llhttp__internal__n_chunk_data_almost_done: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_chunk_data_almost_done; } @@ -1016,7 +1016,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_consume_content_length: { size_t avail; size_t need; - + avail = endp - p; need = state->content_length; if (avail >= need) { @@ -1024,7 +1024,7 @@ static llparse_state_t llhttp__internal__run( state->content_length = 0; goto s_n_llhttp__internal__n_span_end_llhttp__on_body; } - + state->content_length -= avail; return s_n_llhttp__internal__n_consume_content_length; /* UNREACHABLE */; @@ -1371,7 +1371,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_consume_content_length_1: { size_t avail; size_t need; - + avail = endp - p; need = state->content_length; if (avail >= need) { @@ -1379,7 +1379,7 @@ static llparse_state_t llhttp__internal__run( state->content_length = 0; goto s_n_llhttp__internal__n_span_end_llhttp__on_body_1; } - + state->content_length -= avail; return s_n_llhttp__internal__n_consume_content_length_1; /* UNREACHABLE */; @@ -1595,7 +1595,7 @@ static llparse_state_t llhttp__internal__run( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; if (p == endp) { return s_n_llhttp__internal__n_header_value_connection_token; @@ -1646,7 +1646,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_value_connection_1: s_n_llhttp__internal__n_header_value_connection_1: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_value_connection_1; } @@ -1670,7 +1670,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_value_connection_2: s_n_llhttp__internal__n_header_value_connection_2: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_value_connection_2; } @@ -1694,7 +1694,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_value_connection_3: s_n_llhttp__internal__n_header_value_connection_3: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_value_connection_3; } @@ -1916,7 +1916,7 @@ static llparse_state_t llhttp__internal__run( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; if (p == endp) { return s_n_llhttp__internal__n_header_value; @@ -1927,17 +1927,17 @@ static llparse_state_t llhttp__internal__run( __m128i input; int avail; int match_len; - + /* Load input */ input = _mm_loadu_si128((__m128i const*) p); ranges = _mm_loadu_si128((__m128i const*) llparse_blob8); - + /* Find first character that does not match `ranges` */ match_len = _mm_cmpestri(ranges, 6, input, 16, _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES | _SIDD_NEGATIVE_POLARITY); - + if (match_len != 0) { p += match_len; goto s_n_llhttp__internal__n_header_value; @@ -1975,7 +1975,7 @@ static llparse_state_t llhttp__internal__run( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; if (p == endp) { return s_n_llhttp__internal__n_header_value_te_token; @@ -1999,7 +1999,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_value_te_chunked: s_n_llhttp__internal__n_header_value_te_chunked: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_value_te_chunked; } @@ -2105,29 +2105,29 @@ static llparse_state_t llhttp__internal__run( __m128i input; int avail; int match_len; - + /* Load input */ input = _mm_loadu_si128((__m128i const*) p); ranges = _mm_loadu_si128((__m128i const*) llparse_blob9); - + /* Find first character that does not match `ranges` */ match_len = _mm_cmpestri(ranges, 16, input, 16, _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES | _SIDD_NEGATIVE_POLARITY); - + if (match_len != 0) { p += match_len; goto s_n_llhttp__internal__n_header_field_general; } ranges = _mm_loadu_si128((__m128i const*) llparse_blob10); - + /* Find first character that does not match `ranges` */ match_len = _mm_cmpestri(ranges, 2, input, 16, _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES | _SIDD_NEGATIVE_POLARITY); - + if (match_len != 0) { p += match_len; goto s_n_llhttp__internal__n_header_field_general; @@ -2170,7 +2170,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_field_3: s_n_llhttp__internal__n_header_field_3: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_field_3; } @@ -2195,7 +2195,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_field_4: s_n_llhttp__internal__n_header_field_4: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_field_4; } @@ -2241,7 +2241,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_field_1: s_n_llhttp__internal__n_header_field_1: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_field_1; } @@ -2265,7 +2265,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_field_5: s_n_llhttp__internal__n_header_field_5: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_field_5; } @@ -2290,7 +2290,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_field_6: s_n_llhttp__internal__n_header_field_6: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_field_6; } @@ -2315,7 +2315,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_field_7: s_n_llhttp__internal__n_header_field_7: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_field_7; } @@ -2666,7 +2666,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_req_http_start_1: s_n_llhttp__internal__n_req_http_start_1: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_req_http_start_1; } @@ -2690,7 +2690,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_req_http_start_2: s_n_llhttp__internal__n_req_http_start_2: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_req_http_start_2; } @@ -3369,7 +3369,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_1: s_n_llhttp__internal__n_start_req_1: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_1; } @@ -3394,7 +3394,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_2: s_n_llhttp__internal__n_start_req_2: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_2; } @@ -3419,7 +3419,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_4: s_n_llhttp__internal__n_start_req_4: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_4; } @@ -3444,7 +3444,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_6: s_n_llhttp__internal__n_start_req_6: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_6; } @@ -3529,7 +3529,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_8: s_n_llhttp__internal__n_start_req_8: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_8; } @@ -3554,7 +3554,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_9: s_n_llhttp__internal__n_start_req_9: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_9; } @@ -3579,7 +3579,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_10: s_n_llhttp__internal__n_start_req_10: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_10; } @@ -3604,7 +3604,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_12: s_n_llhttp__internal__n_start_req_12: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_12; } @@ -3629,7 +3629,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_13: s_n_llhttp__internal__n_start_req_13: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_13; } @@ -3675,7 +3675,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_15: s_n_llhttp__internal__n_start_req_15: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_15; } @@ -3700,7 +3700,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_16: s_n_llhttp__internal__n_start_req_16: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_16; } @@ -3725,7 +3725,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_18: s_n_llhttp__internal__n_start_req_18: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_18; } @@ -3750,7 +3750,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_20: s_n_llhttp__internal__n_start_req_20: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_20; } @@ -3835,7 +3835,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_22: s_n_llhttp__internal__n_start_req_22: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_22; } @@ -3889,7 +3889,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_23: s_n_llhttp__internal__n_start_req_23: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_23; } @@ -3914,7 +3914,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_24: s_n_llhttp__internal__n_start_req_24: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_24; } @@ -3939,7 +3939,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_26: s_n_llhttp__internal__n_start_req_26: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_26; } @@ -3964,7 +3964,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_27: s_n_llhttp__internal__n_start_req_27: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_27; } @@ -3989,7 +3989,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_31: s_n_llhttp__internal__n_start_req_31: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_31; } @@ -4014,7 +4014,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_32: s_n_llhttp__internal__n_start_req_32: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_32; } @@ -4099,7 +4099,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_34: s_n_llhttp__internal__n_start_req_34: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_34; } @@ -4175,7 +4175,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_37: s_n_llhttp__internal__n_start_req_37: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_37; } @@ -4200,7 +4200,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_38: s_n_llhttp__internal__n_start_req_38: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_38; } @@ -4263,7 +4263,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_40: s_n_llhttp__internal__n_start_req_40: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_40; } @@ -4288,7 +4288,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_41: s_n_llhttp__internal__n_start_req_41: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_41; } @@ -4313,7 +4313,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_42: s_n_llhttp__internal__n_start_req_42: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_42; } @@ -4363,7 +4363,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_43: s_n_llhttp__internal__n_start_req_43: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_43; } @@ -4388,7 +4388,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_46: s_n_llhttp__internal__n_start_req_46: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_46; } @@ -4413,7 +4413,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_48: s_n_llhttp__internal__n_start_req_48: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_48; } @@ -4438,7 +4438,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_49: s_n_llhttp__internal__n_start_req_49: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_49; } @@ -4484,7 +4484,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_req_50: s_n_llhttp__internal__n_start_req_50: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_req_50; } @@ -4939,7 +4939,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_start_res: s_n_llhttp__internal__n_start_res: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_start_res; } @@ -4963,7 +4963,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_req_or_res_method_2: s_n_llhttp__internal__n_req_or_res_method_2: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_req_or_res_method_2; } @@ -4988,7 +4988,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_req_or_res_method_3: s_n_llhttp__internal__n_req_or_res_method_3: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_req_or_res_method_3; } @@ -5291,7 +5291,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_body: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_body(state, start, p); @@ -5383,7 +5383,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_body_1: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_body(state, start, p); @@ -5573,7 +5573,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_header_value: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_header_value(state, start, p); @@ -5730,7 +5730,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_header_value_1: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_header_value(state, start, p); @@ -5747,7 +5747,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_header_value_2: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_header_value(state, start, p); @@ -5765,7 +5765,7 @@ static llparse_state_t llhttp__internal__run( 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); @@ -5890,7 +5890,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_header_value_4: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_header_value(state, start, p); @@ -5925,7 +5925,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_header_value_5: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_header_value(state, start, p); @@ -6009,7 +6009,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_header_field: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_header_field(state, start, p); @@ -6027,7 +6027,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_header_field_1: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_header_field(state, start, p); @@ -6094,7 +6094,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_3: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6120,7 +6120,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_4: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6217,7 +6217,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_5: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6234,7 +6234,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_6: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6251,7 +6251,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_7: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6268,7 +6268,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_8: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6294,7 +6294,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_9: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6311,7 +6311,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_10: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6328,7 +6328,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_11: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6363,7 +6363,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6380,7 +6380,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_1: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6397,7 +6397,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_2: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6414,7 +6414,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_12: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6431,7 +6431,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_13: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6448,7 +6448,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_url_14: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_url(state, start, p); @@ -6583,7 +6583,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_status: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_status(state, start, p); @@ -6601,7 +6601,7 @@ static llparse_state_t llhttp__internal__run( s_n_llhttp__internal__n_span_end_llhttp__on_status_1: { const unsigned char* start; int err; - + start = state->_span_pos0; state->_span_pos0 = NULL; err = llhttp__on_status(state, start, p); @@ -6787,7 +6787,7 @@ int llhttp__internal_execute(llhttp__internal_t* state, const char* p, const cha if (state->_span_pos0 != NULL) { state->_span_pos0 = (void*) p; } - + next = llhttp__internal__run(state, (const unsigned char*) p, (const unsigned char*) endp); if (next == s_error) { return state->error; @@ -6797,7 +6797,7 @@ int llhttp__internal_execute(llhttp__internal_t* state, const char* p, const cha /* execute spans */ if (state->_span_pos0 != NULL) { int error; - + error = ((llhttp__internal__span_cb) state->_span_cb0)(state, state->_span_pos0, (const char*) endp); if (error != 0) { state->error = error; @@ -6805,7 +6805,7 @@ int llhttp__internal_execute(llhttp__internal_t* state, const char* p, const cha return error; } } - + return 0; } @@ -6863,7 +6863,7 @@ static const unsigned char llparse_blob7[] = { }; #ifdef __SSE4_2__ static const unsigned char ALIGN(16) llparse_blob8[] = { - 0x9, 0x9, ' ', '~', 0x80, 0xfe, 0x0, 0x0, 0x0, 0x0, 0x0, + 0x9, 0x9, ' ', '~', 0x80, 0xff, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 }; #endif /* __SSE4_2__ */ @@ -8358,7 +8358,7 @@ static llparse_state_t llhttp__internal__run( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; if (p == endp) { return s_n_llhttp__internal__n_header_value_connection_token; @@ -8679,7 +8679,7 @@ static llparse_state_t llhttp__internal__run( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; if (p == endp) { return s_n_llhttp__internal__n_header_value; @@ -8690,17 +8690,17 @@ static llparse_state_t llhttp__internal__run( __m128i input; int avail; int match_len; - + /* Load input */ input = _mm_loadu_si128((__m128i const*) p); ranges = _mm_loadu_si128((__m128i const*) llparse_blob8); - + /* Find first character that does not match `ranges` */ match_len = _mm_cmpestri(ranges, 6, input, 16, _SIDD_UBYTE_OPS | _SIDD_CMP_RANGES | _SIDD_NEGATIVE_POLARITY); - + if (match_len != 0) { p += match_len; goto s_n_llhttp__internal__n_header_value; @@ -8738,7 +8738,7 @@ static llparse_state_t llhttp__internal__run( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; if (p == endp) { return s_n_llhttp__internal__n_header_value_te_token; @@ -8762,7 +8762,7 @@ static llparse_state_t llhttp__internal__run( case s_n_llhttp__internal__n_header_value_te_chunked: s_n_llhttp__internal__n_header_value_te_chunked: { llparse_match_t match_seq; - + if (p == endp) { return s_n_llhttp__internal__n_header_value_te_chunked; }