gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 02/05: Moved check for listen socket to fit fd_set


From: gnunet
Subject: [libmicrohttpd] 02/05: Moved check for listen socket to fit fd_set
Date: Thu, 16 Nov 2023 07:13:14 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 6ee00803efd6c1ac363eeeb30302784b1212a424
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Wed Nov 15 15:26:39 2023 +0300

    Moved check for listen socket to fit fd_set
---
 src/microhttpd/daemon.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 8d39c7ac..0b7902e7 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -7877,6 +7877,19 @@ MHD_start_daemon_va (unsigned int flags,
 #endif
       goto free_and_fail;
     }
+    if (MHD_D_IS_USING_SELECT_ (daemon) &&
+        (! MHD_D_DOES_SCKT_FIT_FDSET_ (listen_fd, daemon)) )
+    {
+#ifdef HAVE_MESSAGES
+      MHD_DLOG (daemon,
+                _ ("Listen socket descriptor (%d) is not " \
+                   "less than daemon FD_SETSIZE value (%d).\n"),
+                (int) listen_fd,
+                (int) MHD_D_GET_FD_SETSIZE_ (daemon));
+#endif
+      MHD_socket_close_chk_ (listen_fd);
+      goto free_and_fail;
+    }
     daemon->listen_is_unix = _MHD_NO;
 
     /* Apply the socket options according to listening_address_reuse. */
@@ -8254,19 +8267,6 @@ MHD_start_daemon_va (unsigned int flags,
     }
     else
       daemon->listen_nonblk = true;
-    if (MHD_D_IS_USING_SELECT_ (daemon) &&
-        (! MHD_D_DOES_SCKT_FIT_FDSET_ (listen_fd, daemon)) )
-    {
-#ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-                _ ("Listen socket descriptor (%d) is not " \
-                   "less than daemon FD_SETSIZE value (%d).\n"),
-                (int) listen_fd,
-                (int) MHD_D_GET_FD_SETSIZE_ (daemon));
-#endif
-      MHD_socket_close_chk_ (listen_fd);
-      goto free_and_fail;
-    }
   }
   else
   {

-- 
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]