commit 8d9065a0774f4e07afdc21fd83d74e221a104c3d
parent 0571f7bf52614ac091b9ae37a739539f4dbc0a5a
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sat, 25 Mar 2017 20:58:24 +0300
MHD_start_daemon(): check for invalid combination of MHD_USE_NO_LISTEN_SOCKET and
MHD_OPTION_LISTEN_SOCKET
Diffstat:
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -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
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -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