gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] branch master updated (c267a114 -> 4e9c6646)


From: gnunet
Subject: [libmicrohttpd] branch master updated (c267a114 -> 4e9c6646)
Date: Sun, 05 Dec 2021 10:05:14 +0100

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

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from c267a114 configure: fixed missing quoting
     new 46a07b64 mhd_threads.c: cosmetics
     new 4e9c6646 Added special log message to report exceeded system limit on 
number of threads

The 2 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:
 src/microhttpd/daemon.c      | 28 ++++++++++++++++++++++++++--
 src/microhttpd/mhd_threads.c | 12 ++++++------
 2 files changed, 32 insertions(+), 8 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 4b7df545..b320177a 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -2803,10 +2803,18 @@ new_connection_process_ (struct MHD_Daemon *daemon,
     {
       eno = errno;
 #ifdef HAVE_MESSAGES
+#ifdef EAGAIN
+      if (EAGAIN == eno)
+        MHD_DLOG (daemon,
+                  _ ("Failed to create a new thread because it would have " \
+                     "exceeded the system limit on the number of threads or " \
+                     "no system resources available.\n"));
+      else
+#endif /* EAGAIN */
       MHD_DLOG (daemon,
                 _ ("Failed to create a thread: %s\n"),
                 MHD_strerror_ (eno));
-#endif
+#endif /* HAVE_MESSAGES */
       goto cleanup;
     }
   }
@@ -7158,10 +7166,18 @@ MHD_start_daemon_va (unsigned int flags,
                                       daemon) )
       {
 #ifdef HAVE_MESSAGES
+#ifdef EAGAIN
+        if (EAGAIN == errno)
+          MHD_DLOG (daemon,
+                    _ ("Failed to create a new thread because it would have " \
+                       "exceeded the system limit on the number of threads or 
" \
+                       "no system resources available.\n"));
+        else
+#endif /* EAGAIN */
         MHD_DLOG (daemon,
                   _ ("Failed to create listen thread: %s\n"),
                   MHD_strerror_ (errno));
-#endif
+#endif /* HAVE_MESSAGES */
         MHD_mutex_destroy_chk_ (&daemon->new_connections_mutex);
         MHD_mutex_destroy_chk_ (&daemon->cleanup_connection_mutex);
         MHD_mutex_destroy_chk_ (&daemon->per_ip_connection_mutex);
@@ -7284,6 +7300,14 @@ MHD_start_daemon_va (unsigned int flags,
                                         d))
         {
 #ifdef HAVE_MESSAGES
+#ifdef EAGAIN
+          if (EAGAIN == errno)
+            MHD_DLOG (daemon,
+                      _ ("Failed to create a new pool thread because it would 
" \
+                         "have exceeded the system limit on the number of " \
+                         "threads or no system resources available.\n"));
+          else
+#endif /* EAGAIN */
           MHD_DLOG (daemon,
                     _ ("Failed to create pool thread: %s\n"),
                     MHD_strerror_ (errno));
diff --git a/src/microhttpd/mhd_threads.c b/src/microhttpd/mhd_threads.c
index f40480c6..7291bfef 100644
--- a/src/microhttpd/mhd_threads.c
+++ b/src/microhttpd/mhd_threads.c
@@ -51,8 +51,8 @@
 #if defined(HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD) || \
   defined(HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI)
 #  define MHD_USE_THREAD_ATTR_SETNAME 1
-#endif \
-  /* HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD || HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI 
*/
+#endif /* HAVE_PTHREAD_ATTR_SETNAME_NP_NETBSD || \
+          HAVE_PTHREAD_ATTR_SETNAME_NP_IBMI */
 
 #if defined(HAVE_PTHREAD_SETNAME_NP_GNU) || \
   defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD) \
@@ -75,12 +75,12 @@ MHD_set_thread_name_ (const MHD_thread_ID_ thread_id,
 #if defined(HAVE_PTHREAD_SETNAME_NP_GNU)
   return ! pthread_setname_np (thread_id, thread_name);
 #elif defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD)
-  /* FreeBSD and OpenBSD use different name and void return type */
+  /* FreeBSD and OpenBSD use different function name and void return type */
   pthread_set_name_np (thread_id, thread_name);
   return ! 0;
 #elif defined(HAVE_PTHREAD_SETNAME_NP_NETBSD)
   /* NetBSD use 3 arguments: second argument is string in printf-like format,
-   *                         third argument is single argument for printf;
+   *                         third argument is a single argument for printf();
    * OSF1 use 3 arguments too, but last one always must be zero (NULL).
    * MHD doesn't use '%' in thread names, so both form are used in same way.
    */
@@ -297,7 +297,7 @@ named_thread_starter (void *data)
  */
 int
 MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread,
-                          const char*thread_name,
+                          const char *thread_name,
                           size_t stack_size,
                           MHD_THREAD_START_ROUTINE_ start_routine,
                           void *arg)
@@ -361,7 +361,7 @@ MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread,
   if (! MHD_create_thread_ (thread,
                             stack_size,
                             &named_thread_starter,
-                            (void*) param))
+                            (void *) param))
   {
     free (param);
     return 0;

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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