aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2024-02-19 21:30:17 +0500
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2024-02-19 21:30:17 +0500
commit234f74cabeca7130af481e43a6b3348f9c716a50 (patch)
treee20c41633df93701ef8ac541e3bba19481594d53
parent7896fb23f4d5a1ae178b208be6b6565e899eee12 (diff)
downloadlibmicrohttpd-234f74cabeca7130af481e43a6b3348f9c716a50.tar.gz
libmicrohttpd-234f74cabeca7130af481e43a6b3348f9c716a50.zip
Fixed code logic for builds without messages
-rw-r--r--src/microhttpd/connection.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 44f075a3..9039cecd 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -4189,24 +4189,28 @@ parse_cookie_header (struct MHD_Connection *connection)
4189#endif /* HAVE_MESSAGES */ 4189#endif /* HAVE_MESSAGES */
4190 break; 4190 break;
4191 case MHD_PARSE_COOKIE_MALFORMED: 4191 case MHD_PARSE_COOKIE_MALFORMED:
4192#ifdef HAVE_MESSAGES
4193 if (saved_tail != connection->rq.headers_received_tail) 4192 if (saved_tail != connection->rq.headers_received_tail)
4194 { 4193 {
4195 if (allow_partially_correct_cookie) 4194 if (! allow_partially_correct_cookie)
4196 MHD_DLOG (connection->daemon,
4197 _ ("The Cookie header has been only partially parsed as it "
4198 "contains malformed data.\n"));
4199 else
4200 { 4195 {
4201 /* Remove extracted values from partially broken cookie */ 4196 /* Remove extracted values from partially broken cookie */
4202 /* Memory remains allocated until the end of the request processing */ 4197 /* Memory remains allocated until the end of the request processing */
4203 connection->rq.headers_received_tail = saved_tail; 4198 connection->rq.headers_received_tail = saved_tail;
4204 saved_tail->next = NULL; 4199 saved_tail->next = NULL;
4200#ifdef HAVE_MESSAGES
4205 MHD_DLOG (connection->daemon, 4201 MHD_DLOG (connection->daemon,
4206 _ ("The Cookie header has been ignored as it contains " 4202 _ ("The Cookie header has been ignored as it contains "
4207 "malformed data.\n")); 4203 "malformed data.\n"));
4204#endif /* HAVE_MESSAGES */
4208 } 4205 }
4206#ifdef HAVE_MESSAGES
4207 else
4208 MHD_DLOG (connection->daemon,
4209 _ ("The Cookie header has been only partially parsed as it "
4210 "contains malformed data.\n"));
4211#endif /* HAVE_MESSAGES */
4209 } 4212 }
4213#ifdef HAVE_MESSAGES
4210 else 4214 else
4211 MHD_DLOG (connection->daemon, 4215 MHD_DLOG (connection->daemon,
4212 _ ("The Cookie header has malformed data.\n")); 4216 _ ("The Cookie header has malformed data.\n"));