1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-19 22:50:17 +03:00

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.
This commit is contained in:
Yu Watanabe 2017-07-28 16:22:14 +09:00
parent 315629a83f
commit 0105858734

View 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);