diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-07-28 16:22:14 +0900 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2017-07-28 16:22:14 +0900 |
commit | 010585873454d07625ee962ffa2ef2823624bfbe (patch) | |
tree | 851e920f92bfe745007d5121eecfc142fdb7907e | |
parent | 315629a83f6c46695ce7ff87c77ad493f1283172 (diff) | |
download | systemd-010585873454d07625ee962ffa2ef2823624bfbe.tar.gz |
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.
-rw-r--r-- | src/journal-remote/journal-remote.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c index a658301252..0e051c8ff9 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); |