From 6a7eecec57783a042d12f895d5ae148c44f4d074 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 10:52:22 +0200 Subject: Merging upstream version 1.60.0. Signed-off-by: Daniel Baumann --- third-party/llhttp/src/api.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'third-party/llhttp/src/api.c') diff --git a/third-party/llhttp/src/api.c b/third-party/llhttp/src/api.c index e0d0385..8c2ce3d 100644 --- a/third-party/llhttp/src/api.c +++ b/third-party/llhttp/src/api.c @@ -126,7 +126,7 @@ void llhttp_reset(llhttp_t* parser) { llhttp_type_t type = parser->type; const llhttp_settings_t* settings = parser->settings; void* data = parser->data; - uint8_t lenient_flags = parser->lenient_flags; + uint16_t lenient_flags = parser->lenient_flags; llhttp__internal_init(parser); @@ -315,6 +315,22 @@ void llhttp_set_lenient_optional_crlf_after_chunk(llhttp_t* parser, int enabled) } } +void llhttp_set_lenient_optional_cr_before_lf(llhttp_t* parser, int enabled) { + if (enabled) { + parser->lenient_flags |= LENIENT_OPTIONAL_CR_BEFORE_LF; + } else { + parser->lenient_flags &= ~LENIENT_OPTIONAL_CR_BEFORE_LF; + } +} + +void llhttp_set_lenient_spaces_after_chunk_size(llhttp_t* parser, int enabled) { + if (enabled) { + parser->lenient_flags |= LENIENT_SPACES_AFTER_CHUNK_SIZE; + } else { + parser->lenient_flags &= ~LENIENT_SPACES_AFTER_CHUNK_SIZE; + } +} + /* Callbacks */ -- cgit v1.2.3