Officially support zero for MHD_OPTION_THREAD_POOL_SIZE

This commit is contained in:
Evgeny Grin (Karlson2k)
2023-11-23 13:47:00 +03:00
parent 67b1cdc29d
commit a19df909da
2 changed files with 6 additions and 11 deletions
+3 -4
View File
@@ -1817,10 +1817,9 @@ enum MHD_OPTION
/**
* Number (`unsigned int`) of threads in thread pool. Enable
* thread pooling by setting this value to to something
* greater than 1. Currently, thread mode must be
* #MHD_USE_INTERNAL_POLLING_THREAD if thread pooling is enabled
* (#MHD_start_daemon returns NULL for an unsupported thread
* mode).
* greater than 1.
* Can be used only for daemons started with #MHD_USE_INTERNAL_POLLING_THREAD.
* Ignored if followed by zero value.
*/
MHD_OPTION_THREAD_POOL_SIZE = 14,
+3 -7
View File
@@ -6735,18 +6735,14 @@ parse_options_va (struct MHD_Daemon *daemon,
unsigned int);
if (0 == daemon->worker_pool_size)
{
#ifdef HAVE_MESSAGES
MHD_DLOG (daemon,
_ ("Warning: Zero size, specified for thread pool size," \
" is ignored. Thread pool is not used.\n"));
#endif
(void) 0; /* MHD_OPTION_THREAD_POOL_SIZE ignored, do nothing */
}
else if (1 == daemon->worker_pool_size)
{
#ifdef HAVE_MESSAGES
MHD_DLOG (daemon,
_ ("Warning: \"1\", specified for thread pool size, " \
"is ignored. Thread pool is not used.\n"));
_ ("Warning: value \"1\", specified as the thread pool " \
"size, is ignored. Thread pool is not used.\n"));
#endif
daemon->worker_pool_size = 0;
}