[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.
- [libmicrohttpd] branch master updated (cd4d2f65 -> a19df909), gnunet, 2023/11/23
- [libmicrohttpd] 03/13: MHD_start_daemon(): moved daemon flags internal initialisation, gnunet, 2023/11/23
- [libmicrohttpd] 01/13: Added detection of more conditions to process the data without waiting, gnunet, 2023/11/23
- [libmicrohttpd] 04/13: MHD_start_daemon(): reject INTERNAL_POLLING_THREAD if threads are disabled, gnunet, 2023/11/23
- [libmicrohttpd] 02/13: MHD_quiesce_daemon(): fixed return value if already quiesced, gnunet, 2023/11/23
- [libmicrohttpd] 05/13: Moved user options counter to shorter its lifetime, gnunet, 2023/11/23
- [libmicrohttpd] 06/13: test_daemon: fixed to not skip if failed, gnunet, 2023/11/23
- [libmicrohttpd] 08/13: Improved daemon shutdown handling in external polling mode, gnunet, 2023/11/23
- [libmicrohttpd] 07/13: test_digestauth2: fixed order of the initial checks, gnunet, 2023/11/23
- [libmicrohttpd] 09/13: Micro-optimisations for non-overridable FD_SETSIZE,
gnunet <=
- [libmicrohttpd] 13/13: Officially support zero for MHD_OPTION_THREAD_POOL_SIZE, gnunet, 2023/11/23
- [libmicrohttpd] 10/13: Unified and simplified fd_set filling, gnunet, 2023/11/23
- [libmicrohttpd] 11/13: Added new daemon flag MHD_USE_NO_THREAD_SAFETY, gnunet, 2023/11/23
- [libmicrohttpd] 12/13: Tests: added use of MHD_USE_NO_THREAD_SAFETY flag, gnunet, 2023/11/23