From cebdc0a7d6dbcd4a9b1de4ded1d4344ff6d32cb7 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Mon, 13 Jan 2025 13:36:32 +0100 Subject: [PATCH] daemon_start: added setting simple configuration values --- src/mhd2/daemon_start.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/mhd2/daemon_start.c b/src/mhd2/daemon_start.c index 766e4286..38e63065 100644 --- a/src/mhd2/daemon_start.c +++ b/src/mhd2/daemon_start.c @@ -114,6 +114,27 @@ dsettings_release (struct DaemonOptions *s) } +/** + * Set basic daemon parameters that not require additional initialisation. + * Mostly copy such parameters from the settings object to the daemon object. + * @param d the daemon object + * @param s the user settings + * @return MHD_SC_OK on success, + * the error code otherwise + */ +static MHD_FN_PAR_NONNULL_ (1) MHD_FN_PAR_NONNULL_ (2) +MHD_FN_MUST_CHECK_RESULT_ enum MHD_StatusCode +daemon_set_basic_settings (struct MHD_Daemon *restrict d, + struct DaemonOptions *restrict s) +{ + d->req_cfg.strictness = s->protocol_strict_level.v_sl; + + d->req_cfg.suppress_date = (MHD_NO != s->suppress_date_header); + + return MHD_SC_OK; +} + + /** * Set the daemon work mode and perform some related checks. * @param d the daemon object @@ -3052,6 +3073,10 @@ daemon_start_internal (struct MHD_Daemon *restrict d, { enum MHD_StatusCode res; + res = daemon_set_basic_settings (d, s); + if (MHD_SC_OK != res) + return res; + res = daemon_set_work_mode (d, s); if (MHD_SC_OK != res) return res;