[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 03/04: MHD_get_master(): moved to the header, simplified
From: |
gnunet |
Subject: |
[libmicrohttpd] 03/04: MHD_get_master(): moved to the header, simplified |
Date: |
Fri, 06 May 2022 21:22:13 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit c658010707f6fc8a97b095584b55d842bc9faba9
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri May 6 15:19:18 2022 +0300
MHD_get_master(): moved to the header, simplified
There is no need to support more than one level of 'master' daemon.
---
src/microhttpd/daemon.c | 16 ----------------
src/microhttpd/internal.h | 22 ++++++++++++++++++++++
2 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 78a112aa..f0708737 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -218,22 +218,6 @@ MHD_free (void *ptr)
}
-/**
- * Trace up to and return master daemon. If the supplied daemon
- * is a master, then return the daemon itself.
- *
- * @param daemon handle to a daemon
- * @return master daemon handle
- */
-static struct MHD_Daemon *
-MHD_get_master (struct MHD_Daemon *daemon)
-{
- while (NULL != daemon->master)
- daemon = daemon->master;
- return daemon;
-}
-
-
/**
* Maintain connection count for single address.
*/
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index ce852fd9..829f225d 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -2441,3 +2441,25 @@ void
internal_suspend_connection_ (struct MHD_Connection *connection);
#endif
+
+
+/**
+ * Trace up to and return master daemon. If the supplied daemon
+ * is a master, then return the daemon itself.
+ *
+ * @param daemon handle to a daemon
+ * @return master daemon handle
+ */
+_MHD_static_inline struct MHD_Daemon *
+MHD_get_master (struct MHD_Daemon *const daemon)
+{
+ struct MHD_Daemon *ret;
+
+ if (NULL != daemon->master)
+ ret = daemon->master;
+ else
+ ret = daemon;
+ mhd_assert (NULL == ret->master);
+
+ return ret;
+}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.