deps: update llhttp to 6.0.4

Refs: https://hackerone.com/reports/1238099
Refs: https://hackerone.com/reports/1238709
Refs: https://github.com/nodejs-private/llhttp-private/pull/6
Refs: https://github.com/nodejs-private/llhttp-private/pull/5
CVE-ID: CVE-2021-22959
CVE-ID: CVE-2021-22960

PR-URL: https://github.com/nodejs-private/node-private/pull/284
Reviewed-By: Akshay K <iit.akshay@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Robert Nagy <ronagy@icloud.com>
This commit is contained in:
Matteo Collina authored and Beth Griggs committed 2021-10-11 16:37:04 +01:00
1 parent dfd5892921
commit af488f8dc8
5 files changed
+691 -446

No files matched your search

+53
View File
@@ -0,0 +1,53 @@
cmake_minimum_required(VERSION 3.5.1)
cmake_policy(SET CMP0069 NEW)
project(llhttp C)
set(CMAKE_C_STANDARD 99)
#
# Options
#
# Generic option
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF)
# Source code
set(LLHTTP_SOURCES
src/llhttp.c
src/http.c
src/api.c
)
set(LLHTTP_HEADERS
include/llhttp.h
)
add_library(llhttp)
add_library(llhttp::llhttp ALIAS llhttp)
target_sources(llhttp PRIVATE ${LLHTTP_SOURCES} ${LLHTTP_HEADERS})
# On windows with Visual Studio, add a debug postfix so that release
# and debug libraries can coexist.
if(MSVC)
set(CMAKE_DEBUG_POSTFIX "d")
endif()
target_include_directories(llhttp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
set_target_properties(llhttp PROPERTIES PUBLIC_HEADER ${LLHTTP_HEADERS})
install(TARGETS llhttp
EXPORT llhttp
ARCHIVE DESTINATION lib
PUBLIC_HEADER DESTINATION include/
)
# This is required to work with FetchContent
install(EXPORT llhttp
FILE llhttp-config.cmake
NAMESPACE llhttp::
DESTINATION lib/cmake/llhttp)
+14
View File
@@ -99,6 +99,20 @@ For more information on API usage, please refer to [src/native/api.h](https://gi
* Python: [pallas/pyllhttp][8]
* Ruby: [metabahn/llhttp][9]
### Using with CMake
If you want to use this library in a CMake project you can use the snippet below.
```
FetchContent_Declare(llhttp
URL "https://github.com/nodejs/llhttp/releases/download/v6.0.4/llhttp-release-v6.0.4.tar.gz") # Using version 6.0.4
FetchContent_MakeAvailable(llhttp)
target_link_libraries(${EXAMPLE_PROJECT_NAME} ${PROJECT_LIBRARIES} llhttp ${PROJECT_NAME})
```
#### LICENSE
This software is licensed under the MIT License.
+1 -1
View File
@@ -3,7 +3,7 @@
#define LLHTTP_VERSION_MAJOR 6
#define LLHTTP_VERSION_MINOR 0
#define LLHTTP_VERSION_PATCH 2
#define LLHTTP_VERSION_PATCH 4
#ifndef LLHTTP_STRICT_MODE
# define LLHTTP_STRICT_MODE 0
+8 -2
View File
@@ -46,17 +46,23 @@ extern int wasm_on_url(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_status(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_header_field(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_header_value(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_headers_complete(llhttp_t * p);
extern int wasm_on_headers_complete(llhttp_t * p, int status_code,
uint8_t upgrade, int should_keep_alive);
extern int wasm_on_body(llhttp_t* p, const char* at, size_t length);
extern int wasm_on_message_complete(llhttp_t * p);
static int wasm_on_headers_complete_wrap(llhttp_t* p) {
return wasm_on_headers_complete(p, p->status_code, p->upgrade,
llhttp_should_keep_alive(p));
}
const llhttp_settings_t wasm_settings = {
wasm_on_message_begin,
wasm_on_url,
wasm_on_status,
wasm_on_header_field,
wasm_on_header_value,
wasm_on_headers_complete,
wasm_on_headers_complete_wrap,
wasm_on_body,
wasm_on_message_complete,
NULL,
+615 -443
View File
File diff suppressed because it is too large. Load diff