[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 16/31: daemon: small refactoring for more compact code w
From: |
gnunet |
Subject: |
[libmicrohttpd] 16/31: daemon: small refactoring for more compact code when poll() is not supported |
Date: |
Mon, 10 Oct 2022 13:01:01 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 3921f777c11a5d8d4d275519cca87319218b77d2
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu Oct 6 13:51:11 2022 +0300
daemon: small refactoring for more compact code when poll() is not supported
---
src/microhttpd/daemon.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index eb210a36..6c8f3db6 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -4930,6 +4930,7 @@ MHD_poll_listen_socket (struct MHD_Daemon *daemon,
#endif
+#ifdef HAVE_POLL
/**
* Do poll()-based processing.
@@ -4942,7 +4943,6 @@ static enum MHD_Result
MHD_poll (struct MHD_Daemon *daemon,
int may_block)
{
-#ifdef HAVE_POLL
if (daemon->shutdown)
return MHD_NO;
if (0 == (daemon->options & MHD_USE_THREAD_PER_CONNECTION))
@@ -4950,14 +4950,12 @@ MHD_poll (struct MHD_Daemon *daemon,
may_block ? -1 : 0);
return MHD_poll_listen_socket (daemon,
may_block);
-#else
- (void) daemon;
- (void) may_block;
- return MHD_NO;
-#endif
}
+#endif /* HAVE_POLL */
+
+
#ifdef EPOLL_SUPPORT
/**
@@ -5642,14 +5640,17 @@ MHD_polling_thread (void *cls)
#endif /* HAVE_PTHREAD_SIGMASK */
while (! daemon->shutdown)
{
+#ifdef HAVE_POLL
if (0 != (daemon->options & MHD_USE_POLL))
MHD_poll (daemon, MHD_YES);
+ else
+#endif /* HAVE_POLL */
#ifdef EPOLL_SUPPORT
- else if (0 != (daemon->options & MHD_USE_EPOLL))
+ if (0 != (daemon->options & MHD_USE_EPOLL))
MHD_epoll (daemon, -1);
-#endif
else
- MHD_select (daemon, -1);
+#endif
+ MHD_select (daemon, -1);
MHD_cleanup_connections (daemon);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 12/31: test_https_time_out: second attempt to really check something with this test, (continued)
- [libmicrohttpd] 12/31: test_https_time_out: second attempt to really check something with this test, gnunet, 2022/10/10
- [libmicrohttpd] 02/31: testcurl/https: fixed functions declarations, gnunet, 2022/10/10
- [libmicrohttpd] 03/31: testcurl/https: fixed compiler warnings, wrong types, gnunet, 2022/10/10
- [libmicrohttpd] 06/31: testcurl/https: do not enforce TLSv1, gnunet, 2022/10/10
- [libmicrohttpd] 08/31: testcurl/https: removed usage of deprecated libcurl parameter, gnunet, 2022/10/10
- [libmicrohttpd] 10/31: test_https_get_parallel{,_threads}: removed artificial delay, gnunet, 2022/10/10
- [libmicrohttpd] 13/31: MHD_start_daemon(): minor readability improvement, gnunet, 2022/10/10
- [libmicrohttpd] 14/31: microhttpd.h: improved doxy for MHD_USE_THREAD_PER_CONNECTION, gnunet, 2022/10/10
- [libmicrohttpd] 15/31: MHD_run_wait(): improved readability, gnunet, 2022/10/10
- [libmicrohttpd] 11/31: daemon: fixed delayed notification callback in thread-per-connection mode, gnunet, 2022/10/10
- [libmicrohttpd] 16/31: daemon: small refactoring for more compact code when poll() is not supported,
gnunet <=
- [libmicrohttpd] 17/31: MHD_poll(): removed unneeded check, gnunet, 2022/10/10
- [libmicrohttpd] 18/31: testcurl/https: significantly simplified test URI, gnunet, 2022/10/10
- [libmicrohttpd] 25/31: test_https_get_parallel_threads: removed libcurl-GnuTLS requirement, gnunet, 2022/10/10
- [libmicrohttpd] 09/31: testcurl/https: enable verbose libcurl on debug builds, gnunet, 2022/10/10
- [libmicrohttpd] 21/31: test_tls_extensions: removed unused test, gnunet, 2022/10/10
- [libmicrohttpd] 29/31: https tests: updated self-signed certificate, gnunet, 2022/10/10
- [libmicrohttpd] 20/31: testcurl/https: some simplifications and clean-ups, gnunet, 2022/10/10
- [libmicrohttpd] 23/31: microhttpd.h: minor doxy fix, gnunet, 2022/10/10
- [libmicrohttpd] 24/31: digestauth.h: removed leftover in doxy, gnunet, 2022/10/10
- [libmicrohttpd] 30/31: test_tls_authentication: fixed to really test TLS authentication, gnunet, 2022/10/10