mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
Moved user options counter to shorter its lifetime
This commit is contained in:
+12
-3
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user