commit 0571f7bf52614ac091b9ae37a739539f4dbc0a5a parent 65e7a45faac536f7ca00ecca59e6689cb2dff858 Author: Evgeny Grin (Karlson2k) <k2k@narod.ru> Date: Fri, 24 Mar 2017 15:44:27 +0300 Check for invalid combinations of MHD_OPTION_THREAD_POOL_SIZE and daemon flags. Diffstat:
| M | src/microhttpd/daemon.c | | | 18 | ++++++++++++++++++ |
1 file changed, 18 insertions(+), 0 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -4822,6 +4822,24 @@ parse_options_va (struct MHD_Daemon *daemon, void *); break; case MHD_OPTION_THREAD_POOL_SIZE: + if (0 == (daemon->options & MHD_USE_INTERNAL_POLLING_THREAD)) + { +#ifdef HAVE_MESSAGES + MHD_DLOG (daemon, + _("MHD_OPTION_THREAD_POOL_SIZE option is specified but " + "MHD_USE_INTERNAL_POLLING_THREAD flag is not specified.\n")); +#endif + return MHD_NO; + } + if (0 != (daemon->options & MHD_USE_THREAD_PER_CONNECTION)) + { +#ifdef HAVE_MESSAGES + MHD_DLOG (daemon, + _("Both MHD_OPTION_THREAD_POOL_SIZE option and " + "MHD_USE_THREAD_PER_CONNECTION flag are specified.\n")); +#endif + return MHD_NO; + } daemon->worker_pool_size = va_arg (ap, unsigned int); if (0 == daemon->worker_pool_size)