Skip to content

Commit 7e14e66

Browse files
nodejs-github-botH4ad
authored andcommitted
deps: update llhttp to 9.1.3
PR-URL: nodejs#50080 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent 16d8cd5 commit 7e14e66

File tree

6 files changed

+1002
-334
lines changed

6 files changed

+1002
-334
lines changed

deps/llhttp/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.5.1)
22
cmake_policy(SET CMP0069 NEW)
33

4-
project(llhttp VERSION 8.1.1)
4+
project(llhttp VERSION 9.1.3)
55
include(GNUInstallDirs)
66

77
set(CMAKE_C_STANDARD 99)

deps/llhttp/include/llhttp.h

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
#define LLHTTP_VERSION_MAJOR 8
55
#define LLHTTP_VERSION_MINOR 1
6-
#define LLHTTP_VERSION_PATCH 1
7-
8-
#ifndef LLHTTP_STRICT_MODE
9-
# define LLHTTP_STRICT_MODE 0
10-
#endif
6+
#define LLHTTP_VERSION_PATCH 3
117

128
#ifndef INCLUDE_LLHTTP_ITSELF_H_
139
#define INCLUDE_LLHTTP_ITSELF_H_

deps/llhttp/src/api.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void llhttp_reset(llhttp_t* parser) {
126126
llhttp_type_t type = parser->type;
127127
const llhttp_settings_t* settings = parser->settings;
128128
void* data = parser->data;
129-
uint8_t lenient_flags = parser->lenient_flags;
129+
uint16_t lenient_flags = parser->lenient_flags;
130130

131131
llhttp__internal_init(parser);
132132

deps/llhttp/src/http.c

+23-3
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,33 @@ int llhttp__after_headers_complete(llhttp_t* parser, const char* p,
3939
int hasBody;
4040

4141
hasBody = parser->flags & F_CHUNKED || parser->content_length > 0;
42-
if (parser->upgrade && (parser->method == HTTP_CONNECT ||
43-
(parser->flags & F_SKIPBODY) || !hasBody)) {
42+
if (
43+
(parser->upgrade && (parser->method == HTTP_CONNECT ||
44+
(parser->flags & F_SKIPBODY) || !hasBody)) ||
45+
/* See RFC 2616 section 4.4 - 1xx e.g. Continue */
46+
(parser->type == HTTP_RESPONSE && parser->status_code == 101)
47+
) {
4448
/* Exit, the rest of the message is in a different protocol. */
4549
return 1;
4650
}
4751

48-
if (parser->flags & F_SKIPBODY) {
52+
if (parser->type == HTTP_RESPONSE && parser->status_code == 100) {
53+
/* No body, restart as the message is complete */
54+
return 0;
55+
}
56+
57+
/* See RFC 2616 section 4.4 */
58+
if (
59+
parser->flags & F_SKIPBODY || /* response to a HEAD request */
60+
(
61+
parser->type == HTTP_RESPONSE && (
62+
parser->status_code == 102 || /* Processing */
63+
parser->status_code == 103 || /* Early Hints */
64+
parser->status_code == 204 || /* No Content */
65+
parser->status_code == 304 /* Not Modified */
66+
)
67+
)
68+
) {
4969
return 0;
5070
} else if (parser->flags & F_CHUNKED) {
5171
/* chunked encoding - ignore Content-Length header, prepare for a chunk */

0 commit comments

Comments
 (0)