MHD_start_daemon(): check for invalid combination of MHD_USE_NO_LISTEN_SOCKET and

MHD_OPTION_LISTEN_SOCKET
This commit is contained in:
Evgeny Grin (Karlson2k)
2017-03-25 21:01:13 +03:00
parent 0571f7bf52
commit 8d9065a077
2 changed files with 16 additions and 2 deletions
+4
View File
@@ -1,3 +1,7 @@
Tue Mar 25 20:59:18 MSK 2017
Check for invalid combinations of flags and options in
MHD_start_daemon(). -EG
Tue Mar 21 13:51:04 CET 2017
Use "-lrt" to link libmicrohttpd if we are using
clock_gettime() as needed by glibc < 2.17. -CG
+12 -2
View File
@@ -5005,8 +5005,18 @@ parse_options_va (struct MHD_Daemon *daemon,
break;
#endif
case MHD_OPTION_LISTEN_SOCKET:
daemon->listen_fd = va_arg (ap,
MHD_socket);
if (0 != (daemon->options & MHD_USE_NO_LISTEN_SOCKET))
{
#ifdef HAVE_MESSAGES
MHD_DLOG (daemon,
_("MHD_OPTION_LISTEN_SOCKET specified for daemon "
"with MHD_USE_NO_LISTEN_SOCKET flag set.\n"));
#endif
return MHD_NO;
}
else
daemon->listen_fd = va_arg (ap,
MHD_socket);
break;
case MHD_OPTION_EXTERNAL_LOGGER:
#ifdef HAVE_MESSAGES