From 010585873454d07625ee962ffa2ef2823624bfbe Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 28 Jul 2017 16:22:14 +0900 Subject: [PATCH] journal-remote: use MHD_OPTION_STRICT_FOR_CLIENT if MHD_USE_PEDANTIC_CHECKS is deprecated 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index a658301..0e051c8 100644 --- a/src/journal-remote/journal-remote.c +++ b/src/journal-remote/journal-remote.c @@ -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); -- 2.7.4