commit 234f74cabeca7130af481e43a6b3348f9c716a50
parent 7896fb23f4d5a1ae178b208be6b6565e899eee12
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 19 Feb 2024 21:30:17 +0500
Fixed code logic for builds without messages
Diffstat:
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
@@ -4189,24 +4189,28 @@ parse_cookie_header (struct MHD_Connection *connection)
#endif /* HAVE_MESSAGES */
break;
case MHD_PARSE_COOKIE_MALFORMED:
-#ifdef HAVE_MESSAGES
if (saved_tail != connection->rq.headers_received_tail)
{
- if (allow_partially_correct_cookie)
- MHD_DLOG (connection->daemon,
- _ ("The Cookie header has been only partially parsed as it "
- "contains malformed data.\n"));
- else
+ if (! allow_partially_correct_cookie)
{
/* Remove extracted values from partially broken cookie */
/* Memory remains allocated until the end of the request processing */
connection->rq.headers_received_tail = saved_tail;
saved_tail->next = NULL;
+#ifdef HAVE_MESSAGES
MHD_DLOG (connection->daemon,
_ ("The Cookie header has been ignored as it contains "
"malformed data.\n"));
+#endif /* HAVE_MESSAGES */
}
+#ifdef HAVE_MESSAGES
+ else
+ MHD_DLOG (connection->daemon,
+ _ ("The Cookie header has been only partially parsed as it "
+ "contains malformed data.\n"));
+#endif /* HAVE_MESSAGES */
}
+#ifdef HAVE_MESSAGES
else
MHD_DLOG (connection->daemon,
_ ("The Cookie header has malformed data.\n"));