gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [libmicrohttpd] 01/03: Ignore "1" and "0" as thread pool si


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 01/03: Ignore "1" and "0" as thread pool sizes, do not create thread pools and warn user.
Date: Sat, 25 Mar 2017 19:01:26 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 65e7a45faac536f7ca00ecca59e6689cb2dff858
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Fri Mar 24 15:33:58 2017 +0300

    Ignore "1" and "0" as thread pool sizes, do not create thread pools and 
warn user.
---
 src/microhttpd/daemon.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 277ed60a..cbf57773 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4824,7 +4824,24 @@ parse_options_va (struct MHD_Daemon *daemon,
         case MHD_OPTION_THREAD_POOL_SIZE:
           daemon->worker_pool_size = va_arg (ap,
                                              unsigned int);
-         if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct 
MHD_Daemon)))
+          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
+            }
+          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"));
+#endif
+              daemon->worker_pool_size = 0;
+            }
+          else if (daemon->worker_pool_size >= (SIZE_MAX / sizeof (struct 
MHD_Daemon)))
            {
 #ifdef HAVE_MESSAGES
              MHD_DLOG (daemon,

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]