Skip to content

Commit

Permalink
deps: update llhttp to 6.0.0
Browse files Browse the repository at this point in the history
See: #37678 (comment)

PR-URL: #38277
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Beth Griggs <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Jiawen Geng <[email protected]>
  • Loading branch information
indutny authored and gengjiawen committed Apr 19, 2021
1 parent 767643f commit bfee9da
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 14 deletions.
1 change: 1 addition & 0 deletions deps/llhttp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ if (err == HPE_OK) {
parser.reason);
}
```
For more information on API usage, please refer to [src/native/api.h](https://github.com/nodejs/llhttp/blob/master/src/native/api.h).
---
Expand Down
58 changes: 56 additions & 2 deletions deps/llhttp/include/llhttp.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef INCLUDE_LLHTTP_H_
#define INCLUDE_LLHTTP_H_

#define LLHTTP_VERSION_MAJOR 5
#define LLHTTP_VERSION_MINOR 1
#define LLHTTP_VERSION_MAJOR 6
#define LLHTTP_VERSION_MINOR 0
#define LLHTTP_VERSION_PATCH 0

#ifndef LLHTTP_STRICT_MODE
Expand Down Expand Up @@ -232,6 +232,12 @@ typedef enum llhttp_method llhttp_method_t;
XX(32, UNLINK, UNLINK) \
XX(33, SOURCE, SOURCE) \
XX(34, PRI, PRI) \


#define RTSP_METHOD_MAP(XX) \
XX(1, GET, GET) \
XX(3, POST, POST) \
XX(6, OPTIONS, OPTIONS) \
XX(35, DESCRIBE, DESCRIBE) \
XX(36, ANNOUNCE, ANNOUNCE) \
XX(37, SETUP, SETUP) \
Expand All @@ -245,6 +251,54 @@ typedef enum llhttp_method llhttp_method_t;
XX(45, FLUSH, FLUSH) \


#define HTTP_ALL_METHOD_MAP(XX) \
XX(0, DELETE, DELETE) \
XX(1, GET, GET) \
XX(2, HEAD, HEAD) \
XX(3, POST, POST) \
XX(4, PUT, PUT) \
XX(5, CONNECT, CONNECT) \
XX(6, OPTIONS, OPTIONS) \
XX(7, TRACE, TRACE) \
XX(8, COPY, COPY) \
XX(9, LOCK, LOCK) \
XX(10, MKCOL, MKCOL) \
XX(11, MOVE, MOVE) \
XX(12, PROPFIND, PROPFIND) \
XX(13, PROPPATCH, PROPPATCH) \
XX(14, SEARCH, SEARCH) \
XX(15, UNLOCK, UNLOCK) \
XX(16, BIND, BIND) \
XX(17, REBIND, REBIND) \
XX(18, UNBIND, UNBIND) \
XX(19, ACL, ACL) \
XX(20, REPORT, REPORT) \
XX(21, MKACTIVITY, MKACTIVITY) \
XX(22, CHECKOUT, CHECKOUT) \
XX(23, MERGE, MERGE) \
XX(24, MSEARCH, M-SEARCH) \
XX(25, NOTIFY, NOTIFY) \
XX(26, SUBSCRIBE, SUBSCRIBE) \
XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \
XX(28, PATCH, PATCH) \
XX(29, PURGE, PURGE) \
XX(30, MKCALENDAR, MKCALENDAR) \
XX(31, LINK, LINK) \
XX(32, UNLINK, UNLINK) \
XX(33, SOURCE, SOURCE) \
XX(34, PRI, PRI) \
XX(35, DESCRIBE, DESCRIBE) \
XX(36, ANNOUNCE, ANNOUNCE) \
XX(37, SETUP, SETUP) \
XX(38, PLAY, PLAY) \
XX(39, PAUSE, PAUSE) \
XX(40, TEARDOWN, TEARDOWN) \
XX(41, GET_PARAMETER, GET_PARAMETER) \
XX(42, SET_PARAMETER, SET_PARAMETER) \
XX(43, REDIRECT, REDIRECT) \
XX(44, RECORD, RECORD) \
XX(45, FLUSH, FLUSH) \


#ifdef __cplusplus
} /* extern "C" */
Expand Down
2 changes: 1 addition & 1 deletion deps/llhttp/src/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const char* llhttp_errno_name(llhttp_errno_t err) {
const char* llhttp_method_name(llhttp_method_t method) {
#define HTTP_METHOD_GEN(NUM, NAME, STRING) case HTTP_##NAME: return #STRING;
switch (method) {
HTTP_METHOD_MAP(HTTP_METHOD_GEN)
HTTP_ALL_METHOD_MAP(HTTP_METHOD_GEN)
default: abort();
}
#undef HTTP_METHOD_GEN
Expand Down
11 changes: 0 additions & 11 deletions test/parallel/test-http-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@ const http = require('http');

const methods = [
'ACL',
'ANNOUNCE',
'BIND',
'CHECKOUT',
'CONNECT',
'COPY',
'DELETE',
'DESCRIBE',
'FLUSH',
'GET',
'GET_PARAMETER',
'HEAD',
'LINK',
'LOCK',
Expand All @@ -51,24 +47,17 @@ const methods = [
'NOTIFY',
'OPTIONS',
'PATCH',
'PAUSE',
'PLAY',
'POST',
'PRI',
'PROPFIND',
'PROPPATCH',
'PURGE',
'PUT',
'REBIND',
'RECORD',
'REDIRECT',
'REPORT',
'SEARCH',
'SETUP',
'SET_PARAMETER',
'SOURCE',
'SUBSCRIBE',
'TEARDOWN',
'TRACE',
'UNBIND',
'UNLINK',
Expand Down

0 comments on commit bfee9da

Please sign in to comment.