gnunet-svn
[Top][All Lists]
Advanced

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

[libmicrohttpd] 09/13: Micro-optimisations for non-overridable FD_SETSIZ


From: gnunet
Subject: [libmicrohttpd] 09/13: Micro-optimisations for non-overridable FD_SETSIZE
Date: Thu, 23 Nov 2023 11:49:12 +0100

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

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit af6dd184d69b0d87751b6210c36c3f24370c389f
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Nov 21 15:58:31 2023 +0300

    Micro-optimisations for non-overridable FD_SETSIZE
---
 src/microhttpd/daemon.c      | 11 +++++++++++
 src/microhttpd/mhd_sockets.c |  6 ++++++
 2 files changed, 17 insertions(+)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 56abbdf3..96f0411f 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -732,6 +732,11 @@ urh_to_fdset (struct MHD_UpgradeResponseHandle *urh,
   const MHD_socket mhd_sckt = urh->mhd.socket;
   bool res = true;
 
+#ifndef HAS_FD_SETSIZE_OVERRIDABLE
+  (void) fd_setsize;  /* Mute compiler warning */
+  fd_setsize = (int) FD_SETSIZE; /* Help compiler to optimise */
+#endif /* ! HAS_FD_SETSIZE_OVERRIDABLE */
+
   /* Do not add to 'es' only if socket is closed
    * or not used anymore. */
   if (MHD_INVALID_SOCKET != conn_sckt)
@@ -991,6 +996,11 @@ internal_get_fdset2 (struct MHD_Daemon *daemon,
   enum MHD_Result result = MHD_YES;
   MHD_socket ls;
 
+#ifndef HAS_FD_SETSIZE_OVERRIDABLE
+  (void) fd_setsize;  /* Mute compiler warning */
+  fd_setsize = (int) FD_SETSIZE; /* Help compiler to optimise */
+#endif /* ! HAS_FD_SETSIZE_OVERRIDABLE */
+
   if (daemon->shutdown)
     return MHD_YES;
 
@@ -1198,6 +1208,7 @@ MHD_get_fdset2 (struct MHD_Daemon *daemon,
 #endif /* HAVE_MESSAGES */
     return MHD_NO;
   }
+  fd_setsize = (int) FD_SETSIZE; /* Help compiler to optimise */
 #endif /* ! HAS_FD_SETSIZE_OVERRIDABLE */
 
 #ifdef EPOLL_SUPPORT
diff --git a/src/microhttpd/mhd_sockets.c b/src/microhttpd/mhd_sockets.c
index bd7f30d3..0b348d83 100644
--- a/src/microhttpd/mhd_sockets.c
+++ b/src/microhttpd/mhd_sockets.c
@@ -386,6 +386,12 @@ MHD_add_to_fd_set_ (MHD_socket fd,
   if ( (NULL == set) ||
        (MHD_INVALID_SOCKET == fd) )
     return 0;
+
+#ifndef HAS_FD_SETSIZE_OVERRIDABLE
+  (void) fd_setsize;  /* Mute compiler warning */
+  fd_setsize = (int) FD_SETSIZE; /* Help compiler to optimise */
+#endif /* ! HAS_FD_SETSIZE_OVERRIDABLE */
+
   if (! MHD_SCKT_FD_FITS_FDSET_SETSIZE_ (fd,
                                          set,
                                          fd_setsize))

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