[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 05/13: Moved user options counter to shorter its lifetim
From: |
gnunet |
Subject: |
[libmicrohttpd] 05/13: Moved user options counter to shorter its lifetime |
Date: |
Thu, 23 Nov 2023 11:49:08 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 53a691039c1f350229e555070be751d2e4540beb
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Tue Nov 21 11:08:02 2023 +0300
Moved user options counter to shorter its lifetime
---
src/microhttpd/daemon.c | 15 ++++++++++++---
src/microhttpd/internal.h | 9 ---------
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 78153056..44be347a 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -6200,6 +6200,14 @@ MHD_quiesce_daemon (struct MHD_Daemon *daemon)
*/
struct MHD_InterimParams_
{
+ /**
+ * The total number of all user options used.
+ *
+ * Contains number only of meaningful options, i.e. #MHD_OPTION_END and
+ * #MHD_OPTION_ARRAY themselves are not counted, while options inside
+ * #MHD_OPTION_ARRAY are counted.
+ */
+ size_t num_opts;
/**
* Set to 'true' if @a fdset_size is set by application.
*/
@@ -6582,7 +6590,7 @@ parse_options_va (struct MHD_Daemon *daemon,
{
/* Increase counter at start, so resulting value is number of
* processed options, including any failed ones. */
- daemon->num_opts++;
+ params->num_opts++;
switch (opt)
{
case MHD_OPTION_CONNECTION_MEMORY_LIMIT:
@@ -6978,7 +6986,7 @@ parse_options_va (struct MHD_Daemon *daemon,
VfprintfFunctionPointerType);
daemon->custom_error_log_cls = va_arg (ap,
void *);
- if (1 != daemon->num_opts)
+ if (1 != params->num_opts)
MHD_DLOG (daemon,
_ ("MHD_OPTION_EXTERNAL_LOGGER is not the first option "
"specified for the daemon. Some messages may be "
@@ -7049,7 +7057,7 @@ parse_options_va (struct MHD_Daemon *daemon,
#endif /* HAVE_MESSAGES */
break;
case MHD_OPTION_ARRAY:
- daemon->num_opts--; /* Do not count MHD_OPTION_ARRAY */
+ params->num_opts--; /* Do not count MHD_OPTION_ARRAY */
oa = va_arg (ap, struct MHD_OptionItem *);
i = 0;
while (MHD_OPTION_END != (opt = oa[i].option))
@@ -7754,6 +7762,7 @@ MHD_start_daemon_va (unsigned int flags,
}
#endif /* HTTPS_SUPPORT */
+ interim_params->num_opts = 0;
interim_params->fdset_size_set = false;
interim_params->fdset_size = 0;
interim_params->listen_fd_set = false;
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 3d7d774a..4113e66d 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -2443,15 +2443,6 @@ struct MHD_Daemon
*/
unsigned int listen_backlog_size;
- /**
- * The number of user options used.
- *
- * Contains number of only meaningful options, i.e. #MHD_OPTION_END
- * and #MHD_OPTION_ARRAY are not counted, while options inside
- * #MHD_OPTION_ARRAY are counted.
- */
- size_t num_opts;
-
/* TODO: replace with a single member */
/**
* The value to be returned by #MHD_get_daemon_info()
--
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 <=
- [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, 2023/11/23
- [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