Skip to content

Commit 3f8c22b

Browse files
indutnytargos
authored andcommitted
deps: update llhttp to 1.1.1
PR-URL: #25753 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent eb4b5ea commit 3f8c22b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

deps/llhttp/include/llhttp.h

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define INCLUDE_LLHTTP_H_
33

44
#define LLHTTP_VERSION_MAJOR 1
5-
#define LLHTTP_VERSION_MINOR 0
5+
#define LLHTTP_VERSION_MINOR 1
66
#define LLHTTP_VERSION_PATCH 1
77

88
#ifndef INCLUDE_LLHTTP_ITSELF_H_
@@ -215,6 +215,7 @@ typedef enum llhttp_method llhttp_method_t;
215215
#ifdef __cplusplus
216216
extern "C" {
217217
#endif
218+
#include <stddef.h>
218219

219220
typedef llhttp__internal_t llhttp_t;
220221
typedef struct llhttp_settings_s llhttp_settings_t;
@@ -273,6 +274,10 @@ void llhttp_settings_init(llhttp_settings_t* settings);
273274
* In a special case of CONNECT/Upgrade request/response `HPE_PAUSED_UPGRADE`
274275
* is returned after fully parsing the request/response. If the user wishes to
275276
* continue parsing, they need to invoke `llhttp_resume_after_upgrade()`.
277+
*
278+
* NOTE: if this function ever returns a non-pause type error, it will continue
279+
* to return the same error upon each successive call up until `llhttp_init()`
280+
* call.
276281
*/
277282
llhttp_errno_t llhttp_execute(llhttp_t* parser, const char* data, size_t len);
278283

@@ -345,6 +350,9 @@ const char* llhttp_get_error_pos(const llhttp_t* parser);
345350
/* Returns textual name of error code */
346351
const char* llhttp_errno_name(llhttp_errno_t err);
347352

353+
/* Returns textual name of HTTP method */
354+
const char* llhttp_method_name(llhttp_method_t method);
355+
348356
#ifdef __cplusplus
349357
} /* extern "C" */
350358
#endif

deps/llhttp/src/api.c

+10
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,16 @@ const char* llhttp_errno_name(llhttp_errno_t err) {
117117
}
118118

119119

120+
const char* llhttp_method_name(llhttp_method_t method) {
121+
#define HTTP_METHOD_GEN(NUM, NAME, STRING) case HTTP_##NAME: return #STRING;
122+
switch (method) {
123+
HTTP_METHOD_MAP(HTTP_METHOD_GEN)
124+
default: abort();
125+
}
126+
#undef HTTP_METHOD_GEN
127+
}
128+
129+
120130
/* Callbacks */
121131

122132

0 commit comments

Comments
 (0)