gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 02/03: do not fail if MHD_OPTION_THREAD_POO


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 02/03: do not fail if MHD_OPTION_THREAD_POOL_SIZE is specified as 0 or 1 in combination with internal polling, that's OK (as a pool size of 0/1 means no pool)
Date: Sat, 25 Mar 2017 21:00:57 +0100

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

grothoff pushed a commit to branch master
in repository libmicrohttpd.

commit b8e9408180f5adf70fb759350c073954084186b7
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Mar 25 20:44:27 2017 +0100

    do not fail if MHD_OPTION_THREAD_POOL_SIZE is specified as 0 or 1 in 
combination with internal polling, that's OK (as a pool size of 0/1 means no 
pool)
---
 src/microhttpd/daemon.c       | 39 +++++++++++++++++++++------------------
 src/microhttpd/test_upgrade.c | 16 ++++++++--------
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 69180865..f2427902 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4822,24 +4822,6 @@ 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)
@@ -4868,6 +4850,27 @@ parse_options_va (struct MHD_Daemon *daemon,
 #endif
              return MHD_NO;
            }
+         else
+           {
+             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;
+               }
+           }
           break;
 #ifdef HTTPS_SUPPORT
         case MHD_OPTION_HTTPS_MEM_KEY:
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index fe72a70f..e96009c3 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -990,14 +990,14 @@ test_upgrade (int flags,
 
   if (!test_tls)
     d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE,
-                        1080,
-                        NULL, NULL,
-                        &ahc_upgrade, NULL,
-                        MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
-                        MHD_OPTION_NOTIFY_COMPLETED, &notify_completed_cb, 
NULL,
-                        MHD_OPTION_NOTIFY_CONNECTION, &notify_connection_cb, 
NULL,
-                        MHD_OPTION_THREAD_POOL_SIZE, pool,
-                        MHD_OPTION_END);
+                         1080,
+                         NULL, NULL,
+                         &ahc_upgrade, NULL,
+                         MHD_OPTION_URI_LOG_CALLBACK, &log_cb, NULL,
+                         MHD_OPTION_NOTIFY_COMPLETED, &notify_completed_cb, 
NULL,
+                         MHD_OPTION_NOTIFY_CONNECTION, &notify_connection_cb, 
NULL,
+                         MHD_OPTION_THREAD_POOL_SIZE, pool,
+                         MHD_OPTION_END);
 #ifdef HTTPS_SUPPORT
   else
     d = MHD_start_daemon (flags | MHD_USE_ERROR_LOG | MHD_ALLOW_UPGRADE | 
MHD_USE_TLS,

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



reply via email to

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