commit ad0e5f4059bb076818c107abdd649781ff2beadf
parent 7471f02d5d4fc7920a770644f9ce5cd6f31c5632
Author: Christian Grothoff <christian@grothoff.org>
Date: Sun, 31 May 2026 00:17:22 +0200
fix comparison: allow UNLESS very strict; also use named constants
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/mhd2/stream_process_request.c b/src/mhd2/stream_process_request.c
@@ -2349,15 +2349,15 @@ parse_cookies_string (const size_t str_len,
size_t i;
bool non_strict;
/* Skip extra whitespaces and empty cookies */
- const bool allow_wsp_empty = (0 >= strictness);
+ const bool allow_wsp_empty = (MHD_PSL_DEFAULT >= strictness);
/* Allow whitespaces around '=' character */
- const bool wsp_around_eq = (-3 >= strictness);
+ const bool wsp_around_eq = (MHD_PSL_EXTRA_PERMISSIVE >= strictness);
/* Allow whitespaces in quoted cookie value */
- const bool wsp_in_quoted = (-2 >= strictness);
+ const bool wsp_in_quoted = (MHD_PSL_VERY_PERMISSIVE >= strictness);
/* Allow tab as space after semicolon between cookies */
- const bool tab_as_sp = (0 >= strictness);
+ const bool tab_as_sp = (MHD_PSL_DEFAULT >= strictness);
/* Allow no space after semicolon between cookies */
- const bool allow_no_space = (0 >= strictness);
+ const bool allow_no_space = (MHD_PSL_DEFAULT >= strictness);
non_strict = false;
i = 0;
@@ -3260,7 +3260,7 @@ process_request_chunked_body (struct MHD_Connection *restrict c)
const bool bare_lf_as_crlf = mhd_ALLOW_BARE_LF_AS_CRLF (discp_lvl);
/* Allow "Bad WhiteSpace" in chunk extension.
RFC 9112, Section 7.1.1, Paragraph 2 */
- const bool allow_bws = (2 < discp_lvl);
+ const bool allow_bws = (MHD_PSL_VERY_STRICT > discp_lvl);
bool state_updated;
mhd_assert (NULL == c->rp.response);