]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-remote: use MHD_OPTION_STRICT_FOR_CLIENT if MHD_USE_PEDANTIC_CHECKS is deprecated 6472/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Jul 2017 07:22:14 +0000 (16:22 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 28 Jul 2017 07:22:14 +0000 (16:22 +0900)
The option MHD_OPTION_STRICT_FOR_CLIENT is provided since libmicrohttpd-0.9.54, and
MHD_USE_PEDANTIC_CHECKS will be deprecated in future.
This makes support both option.

src/journal-remote/journal-remote.c

index a658301252b89824da5e7d84378871f3b8a896dd..0e051c8ff93a20ac408de2a9925bb8c57da95826 100644 (file)
@@ -644,6 +644,7 @@ static int setup_microhttpd_server(RemoteServer *s,
                 { MHD_OPTION_END},
                 { MHD_OPTION_END},
                 { MHD_OPTION_END},
+                { MHD_OPTION_END},
                 { MHD_OPTION_END}};
         int opts_pos = 4;
         int flags =
@@ -663,6 +664,15 @@ static int setup_microhttpd_server(RemoteServer *s,
         if (r < 0)
                 return log_error_errno(r, "Failed to make fd:%d nonblocking: %m", fd);
 
+/* MHD_OPTION_STRICT_FOR_CLIENT is introduced in microhttpd 0.9.54,
+ *  and MHD_USE_PEDANTIC_CHECKS will be deprecated in future. */
+#ifdef MHD_USE_PEDANTIC_CHECKS
+        opts[opts_pos++] = (struct MHD_OptionItem)
+                {MHD_OPTION_STRICT_FOR_CLIENT, 1};
+#else
+        flags |= MHD_USE_PEDANTIC_CHECKS;
+#endif
+
         if (key) {
                 assert(cert);