mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
deps: update llhttp to 9.2.0
PR-URL: https://github.com/nodejs/node/pull/51719 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev>
This commit is contained in:
1 parent
84de97a61e
commit
25a6fb6a07
6 files changed
+607
-546
No files matched your search
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.5.1)
|
||||
cmake_policy(SET CMP0069 NEW)
|
||||
|
||||
project(llhttp VERSION 9.1.3)
|
||||
project(llhttp VERSION 9.2.0)
|
||||
include(GNUInstallDirs)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
Vendored
+8
-3
@@ -3,8 +3,8 @@
|
||||
#define INCLUDE_LLHTTP_H_
|
||||
|
||||
#define LLHTTP_VERSION_MAJOR 9
|
||||
#define LLHTTP_VERSION_MINOR 1
|
||||
#define LLHTTP_VERSION_PATCH 3
|
||||
#define LLHTTP_VERSION_MINOR 2
|
||||
#define LLHTTP_VERSION_PATCH 0
|
||||
|
||||
#ifndef INCLUDE_LLHTTP_ITSELF_H_
|
||||
#define INCLUDE_LLHTTP_ITSELF_H_
|
||||
@@ -181,7 +181,8 @@ enum llhttp_method {
|
||||
HTTP_SET_PARAMETER = 42,
|
||||
HTTP_REDIRECT = 43,
|
||||
HTTP_RECORD = 44,
|
||||
HTTP_FLUSH = 45
|
||||
HTTP_FLUSH = 45,
|
||||
HTTP_QUERY = 46
|
||||
};
|
||||
typedef enum llhttp_method llhttp_method_t;
|
||||
|
||||
@@ -362,6 +363,7 @@ typedef enum llhttp_status llhttp_status_t;
|
||||
XX(31, LINK, LINK) \
|
||||
XX(32, UNLINK, UNLINK) \
|
||||
XX(33, SOURCE, SOURCE) \
|
||||
XX(46, QUERY, QUERY) \
|
||||
|
||||
|
||||
#define RTSP_METHOD_MAP(XX) \
|
||||
@@ -428,6 +430,7 @@ typedef enum llhttp_status llhttp_status_t;
|
||||
XX(43, REDIRECT, REDIRECT) \
|
||||
XX(44, RECORD, RECORD) \
|
||||
XX(45, FLUSH, FLUSH) \
|
||||
XX(46, QUERY, QUERY) \
|
||||
|
||||
|
||||
#define HTTP_STATUS_MAP(XX) \
|
||||
@@ -547,6 +550,8 @@ extern "C" {
|
||||
|
||||
#if defined(__wasm__)
|
||||
#define LLHTTP_EXPORT __attribute__((visibility("default")))
|
||||
#elif defined(_WIN32)
|
||||
#define LLHTTP_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define LLHTTP_EXPORT
|
||||
#endif
|
||||
|
||||
Vendored
+583
-536
File diff suppressed because it is too large.
Load diff
@@ -1304,9 +1304,13 @@ void InitializeHttpParser(Local<Object> target,
|
||||
Integer::NewFromUnsigned(env->isolate(), kLenientAll));
|
||||
|
||||
Local<Array> methods = Array::New(env->isolate());
|
||||
#define V(num, name, string) \
|
||||
methods->Set(env->context(), \
|
||||
num, FIXED_ONE_BYTE_STRING(env->isolate(), #string)).Check();
|
||||
size_t method_index = -1;
|
||||
#define V(num, name, string) \
|
||||
methods \
|
||||
->Set(env->context(), \
|
||||
++method_index, \
|
||||
FIXED_ONE_BYTE_STRING(env->isolate(), #string)) \
|
||||
.Check();
|
||||
HTTP_METHOD_MAP(V)
|
||||
#undef V
|
||||
target->Set(env->context(),
|
||||
|
||||
@@ -52,6 +52,7 @@ const methods = [
|
||||
'PROPPATCH',
|
||||
'PURGE',
|
||||
'PUT',
|
||||
'QUERY',
|
||||
'REBIND',
|
||||
'REPORT',
|
||||
'SEARCH',
|
||||
|
||||
@@ -28,14 +28,14 @@ const httpServer = http.createServer(common.mustNotCall());
|
||||
|
||||
httpServer.once('clientError', common.mustCall((err, socket) => {
|
||||
assert.strictEqual(err.code, 'HPE_INVALID_METHOD');
|
||||
assert.strictEqual(err.rawPacket.toString(), 'Q');
|
||||
assert.strictEqual(err.rawPacket.toString(), '1');
|
||||
socket.destroy();
|
||||
|
||||
httpServer.once('clientError', common.mustCall((err) => {
|
||||
assert.strictEqual(err.code, 'HPE_INVALID_METHOD');
|
||||
assert.strictEqual(
|
||||
err.rawPacket.toString(),
|
||||
'WE http://example.com HTTP/1.1\r\n\r\n'
|
||||
'23 http://example.com HTTP/1.1\r\n\r\n'
|
||||
);
|
||||
}));
|
||||
}));
|
||||
@@ -44,7 +44,11 @@ netServer.listen(0, common.mustCall(() => {
|
||||
const socket = net.createConnection(netServer.address().port);
|
||||
|
||||
socket.on('connect', common.mustCall(() => {
|
||||
socket.end('QWE http://example.com HTTP/1.1\r\n\r\n');
|
||||
// Note: do not use letters here for the method.
|
||||
// There is a very small chance that a method with that initial
|
||||
// might be added in the future and thus this test might fail.
|
||||
// Numbers will likely never have this issue.
|
||||
socket.end('123 http://example.com HTTP/1.1\r\n\r\n');
|
||||
}));
|
||||
|
||||
socket.on('close', () => {
|
||||
|
||||
Reference in new issue
Block a user