[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 07/07: MHD_start_daemon(): added check for epoll FD to f
From: |
gnunet |
Subject: |
[libmicrohttpd] 07/07: MHD_start_daemon(): added check for epoll FD to fit fd_set for external polling mode |
Date: |
Fri, 10 Nov 2023 15:40:16 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit a56499312204a8da5a555f5512b1c898183a8ae2
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Nov 10 17:20:05 2023 +0300
MHD_start_daemon(): added check for epoll FD to fit fd_set for external
polling mode
---
src/microhttpd/daemon.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index f0b620d1..283e0839 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -7267,6 +7267,25 @@ setup_epoll_to_listen (struct MHD_Daemon *daemon)
(MHD_INVALID_SOCKET != (ls = daemon->listen_fd)) || \
MHD_ITC_IS_VALID_ (daemon->itc) );
daemon->epoll_fd = setup_epoll_fd (daemon);
+ if (! MHD_D_IS_USING_THREADS_ (daemon)
+ && (0 != (daemon->options & MHD_USE_AUTO)))
+ {
+ /* Application requested "MHD_USE_AUTO", probably MHD_get_fdset() will be
+ used.
+ Make sure that epoll FD is suitable for fd_set.
+ Actually, MHD_get_fdset() is allowed for MHD_USE_EPOLL direct,
+ but most probably direct requirement for MHD_USE_EPOLL means that
+ epoll FD will be used directly. This logic is fuzzy, but better
+ than nothing with current MHD API. */
+ if (! MHD_D_DOES_SCKT_FIT_FDSET_ (daemon->epoll_fd, daemon))
+ {
+#ifdef HAVE_MESSAGES
+ MHD_DLOG (daemon,
+ _ ("The epoll FD is too large to be used with fd_set.\n"));
+#endif /* HAVE_MESSAGES */
+ return MHD_NO;
+ }
+ }
if (-1 == daemon->epoll_fd)
return MHD_NO;
#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (e62cd69d -> a5649931), gnunet, 2023/11/10
- [libmicrohttpd] 02/07: daemon.c: moved processing and checking of app-provided listen socket, gnunet, 2023/11/10
- [libmicrohttpd] 04/07: MHD_start_daemon(): added some asserts, gnunet, 2023/11/10
- [libmicrohttpd] 03/07: MHD_start_daemon(): mark listen as UNIX based on available information, gnunet, 2023/11/10
- [libmicrohttpd] 01/07: .gitlab-ci.yml: removed "keep-going" make flag, gnunet, 2023/11/10
- [libmicrohttpd] 06/07: MHD_start_daemon(): added stricter checks for bind() and listen() return values, gnunet, 2023/11/10
- [libmicrohttpd] 05/07: MHD_D_DOES_SCKT_FIT_FDSET_(): simplified macro, gnunet, 2023/11/10
- [libmicrohttpd] 07/07: MHD_start_daemon(): added check for epoll FD to fit fd_set for external polling mode,
gnunet <=