gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated (efa08edf -> 8d9065a0


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated (efa08edf -> 8d9065a0)
Date: Sat, 25 Mar 2017 19:01:25 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from efa08edf Do not fail on full read buffer if connection was resumed too 
quick after suspend
     new 65e7a45f Ignore "1" and "0" as thread pool sizes, do not create thread 
pools and warn user.
     new 0571f7bf Check for invalid combinations of MHD_OPTION_THREAD_POOL_SIZE 
and daemon flags.
     new 8d9065a0 MHD_start_daemon(): check for invalid combination of 
MHD_USE_NO_LISTEN_SOCKET and MHD_OPTION_LISTEN_SOCKET

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ChangeLog               |  4 ++++
 src/microhttpd/daemon.c | 51 ++++++++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 52 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c8fcffb9..08dd8499 100644
--- 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
index 277ed60a..69180865 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4822,9 +4822,44 @@ 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 (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,
@@ -4970,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

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



reply via email to

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