summaryrefslogtreecommitdiffstats
path: root/third-party/llhttp/include/llhttp.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:52:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:52:01 +0000
commit42f47327da6a208ac3cd1f9bca07fc506ed51a63 (patch)
treee06c5e993e0d0b618f616280b372506b1f0f8419 /third-party/llhttp/include/llhttp.h
parentAdding debian version 1.59.0-1. (diff)
downloadnghttp2-42f47327da6a208ac3cd1f9bca07fc506ed51a63.tar.xz
nghttp2-42f47327da6a208ac3cd1f9bca07fc506ed51a63.zip
Merging upstream version 1.60.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--third-party/llhttp/include/llhttp.h44
1 files changed, 38 insertions, 6 deletions
diff --git a/third-party/llhttp/include/llhttp.h b/third-party/llhttp/include/llhttp.h
index 6588ae5..6919693 100644
--- a/third-party/llhttp/include/llhttp.h
+++ b/third-party/llhttp/include/llhttp.h
@@ -3,8 +3,8 @@
#define INCLUDE_LLHTTP_H_
#define LLHTTP_VERSION_MAJOR 9
-#define LLHTTP_VERSION_MINOR 0
-#define LLHTTP_VERSION_PATCH 1
+#define LLHTTP_VERSION_MINOR 2
+#define LLHTTP_VERSION_PATCH 0
#ifndef INCLUDE_LLHTTP_ITSELF_H_
#define INCLUDE_LLHTTP_ITSELF_H_
@@ -30,7 +30,7 @@ struct llhttp__internal_s {
uint8_t http_major;
uint8_t http_minor;
uint8_t header_state;
- uint8_t lenient_flags;
+ uint16_t lenient_flags;
uint8_t upgrade;
uint8_t finish;
uint16_t flags;
@@ -115,7 +115,9 @@ enum llhttp_lenient_flags {
LENIENT_VERSION = 0x10,
LENIENT_DATA_AFTER_CLOSE = 0x20,
LENIENT_OPTIONAL_LF_AFTER_CR = 0x40,
- LENIENT_OPTIONAL_CRLF_AFTER_CHUNK = 0x80
+ LENIENT_OPTIONAL_CRLF_AFTER_CHUNK = 0x80,
+ LENIENT_OPTIONAL_CR_BEFORE_LF = 0x100,
+ LENIENT_SPACES_AFTER_CHUNK_SIZE = 0x200
};
typedef enum llhttp_lenient_flags llhttp_lenient_flags_t;
@@ -179,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;
@@ -360,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) \
@@ -426,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) \
@@ -545,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
@@ -807,7 +814,7 @@ void llhttp_set_lenient_keep_alive(llhttp_t* parser, int enabled);
* avoid request smuggling.
* With this flag the extra value will be parsed normally.
*
- * **Enabling this flag can pose a security issue since you will be exposed to
+ * **Enabling this flag can pose a security issue since you will be exposed to
* request smuggling attacks. USE WITH CAUTION!**
*/
LLHTTP_EXPORT
@@ -850,6 +857,19 @@ void llhttp_set_lenient_data_after_close(llhttp_t* parser, int enabled);
LLHTTP_EXPORT
void llhttp_set_lenient_optional_lf_after_cr(llhttp_t* parser, int enabled);
+/*
+ * Enables/disables lenient handling of line separators.
+ *
+ * Normally `llhttp` would error when a LF is not preceded by CR when terminating the
+ * request line, the status line, the headers, a chunk header or a chunk data.
+ * With this flag only a LF is required to terminate such sections.
+ *
+ * **Enabling this flag can pose a security issue since you will be exposed to
+ * request smuggling attacks. USE WITH CAUTION!**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_optional_cr_before_lf(llhttp_t* parser, int enabled);
+
/* Enables/disables lenient handling of chunks not separated via CRLF.
*
* Normally `llhttp` would error when after a chunk data a CRLF is missing before
@@ -862,6 +882,18 @@ void llhttp_set_lenient_optional_lf_after_cr(llhttp_t* parser, int enabled);
LLHTTP_EXPORT
void llhttp_set_lenient_optional_crlf_after_chunk(llhttp_t* parser, int enabled);
+/* Enables/disables lenient handling of spaces after chunk size.
+ *
+ * Normally `llhttp` would error when after a chunk size is followed by one or more
+ * spaces are present instead of a CRLF or `;`.
+ * With this flag this check is disabled.
+ *
+ * **Enabling this flag can pose a security issue since you will be exposed to
+ * request smuggling attacks. USE WITH CAUTION!**
+ */
+LLHTTP_EXPORT
+void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled);
+
#ifdef __cplusplus
} /* extern "C" */
#endif