gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]