Jelajahi Sumber

Fixed code logic for builds without messages

Evgeny Grin (Karlson2k) 2 tahun lalu
induk
melakukan
47fce1c2f2
1 mengubah file dengan 10 tambahan dan 6 penghapusan
  1. 10 6
      src/microhttpd/connection.c

+ 10 - 6
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"));