libmicrohttpd2

HTTP server C library (MHD 2.x, alpha)
Log | Files | Refs | README | LICENSE

commit 6ee6d3b87e47d8572b2699a04a344efb9ab06192
parent eb879339e8c0daa5a8f179e17e7deae2882ad511
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date:   Mon,  6 Jul 2026 16:11:13 +0200

Fixed formatting in generated headers

Diffstat:
Msrc/include/d_options.rec | 3+--
Msrc/include/microhttpd2_generated_daemon_options.h | 30+++++++++++++++---------------
Msrc/include/microhttpd2_generated_response_options.h | 2+-
Msrc/include/options-generator.c | 166++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
Msrc/include/r_options.rec | 4++--
Msrc/mhd2/daemon_options.h | 1-
Msrc/mhd2/daemon_set_options.c | 37++++++++++++++++++++++---------------
Msrc/mhd2/response_options.h | 1-
Msrc/mhd2/response_set_options.c | 25++++++++++++++-----------
9 files changed, 157 insertions(+), 112 deletions(-)

diff --git a/src/include/d_options.rec b/src/include/d_options.rec @@ -502,8 +502,7 @@ Comment: Disable cookies parsing. + Cookies are automatically parsed by default. CustomSetter: /* custom setter */ + /* The is not an easy for automatic generations */ -+ // TODO: remove options generator, put preprocessor directives to -+ // the first column ++ // TODO: remove options generator + #ifdef MHD_SUPPORT_COOKIES + settings->disable_cookies = option->val.disable_cookies; + #else diff --git a/src/include/microhttpd2_generated_daemon_options.h b/src/include/microhttpd2_generated_daemon_options.h @@ -1026,7 +1026,7 @@ If this options is enabled, then #MHD_SocketRegistrationUpdateCallback is * @param log_cb_cls the closure for the logging callback * @return structure with the requested setting */ -# define MHD_D_OPTION_LOG_CALLBACK(log_cb,log_cb_cls) \ +# define MHD_D_OPTION_LOG_CALLBACK(log_cb, log_cb_cls) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1047,7 +1047,7 @@ If no listen socket optins (#MHD_D_OPTION_BIND_PORT(), #MHD_D_OPTION_BIND_SA(), * ignored if @a af is #MHD_AF_NONE * @return structure with the requested setting */ -# define MHD_D_OPTION_BIND_PORT(af,port) \ +# define MHD_D_OPTION_BIND_PORT(af, port) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1067,7 +1067,7 @@ If no listen socket optins (#MHD_D_OPTION_BIND_PORT(), #MHD_D_OPTION_BIND_SA(), * @param dual When a previous version of the protocol exist (like IPv4 when @a v_sa is IPv6) bind to both protocols (IPv6 and IPv4). * @return structure with the requested setting */ -# define MHD_D_OPTION_BIND_SA(sa_len,sa,dual) \ +# define MHD_D_OPTION_BIND_SA(sa_len, sa, dual) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1124,7 +1124,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used. * silently ignored on platforms without support for custom queue size * @return structure with the requested setting */ -# define MHD_D_OPTION_TCP_FASTOPEN(option,queue_length) \ +# define MHD_D_OPTION_TCP_FASTOPEN(option, queue_length) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1188,7 +1188,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used. * could be NULL if private key does not need a password * @return structure with the requested setting */ -# define MHD_D_OPTION_TLS_CERT_KEY(mem_cert,mem_key,mem_pass) \ +# define MHD_D_OPTION_TLS_CERT_KEY(mem_cert, mem_key, mem_pass) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1218,7 +1218,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used. * @param psk_cb_cls the closure for @a psk_cb * @return structure with the requested setting */ -# define MHD_D_OPTION_TLS_PSK_CALLBACK(psk_cb,psk_cb_cls) \ +# define MHD_D_OPTION_TLS_PSK_CALLBACK(psk_cb, psk_cb_cls) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1258,7 +1258,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used. * errors * @return structure with the requested setting */ -# define MHD_D_OPTION_TLS_APP_NAME(app_name,disable_fallback) \ +# define MHD_D_OPTION_TLS_APP_NAME(app_name, disable_fallback) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1280,7 +1280,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used. * configuration file * @return structure with the requested setting */ -# define MHD_D_OPTION_TLS_OPENSSL_DEF_FILE(pathname,disable_fallback) \ +# define MHD_D_OPTION_TLS_OPENSSL_DEF_FILE(pathname, disable_fallback) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1353,7 +1353,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used. * @param apc_cls the closure for the callback * @return structure with the requested setting */ -# define MHD_D_OPTION_ACCEPT_POLICY(apc,apc_cls) \ +# define MHD_D_OPTION_ACCEPT_POLICY(apc, apc_cls) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1381,7 +1381,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used. * @param how the way how to use the requested level * @return structure with the requested setting */ -# define MHD_D_OPTION_PROTOCOL_STRICT_LEVEL(sl,how) \ +# define MHD_D_OPTION_PROTOCOL_STRICT_LEVEL(sl, how) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1398,7 +1398,7 @@ Works only when #MHD_D_OPTION_BIND_PORT() or #MHD_D_OPTION_BIND_SA() are used. * @param cls the closure for the callback * @return structure with the requested setting */ -# define MHD_D_OPTION_EARLY_URI_LOGGER(cb,cls) \ +# define MHD_D_OPTION_EARLY_URI_LOGGER(cb, cls) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1595,7 +1595,7 @@ The specified callback will be called one time, after network initialisation, TL * @param cb_cls the closure for the callback * @return structure with the requested setting */ -# define MHD_D_OPTION_DAEMON_READY_CALLBACK(cb,cb_cls) \ +# define MHD_D_OPTION_DAEMON_READY_CALLBACK(cb, cb_cls) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1610,7 +1610,7 @@ The specified callback will be called one time, after network initialisation, TL * @param cls the closure for the callback * @return structure with the requested setting */ -# define MHD_D_OPTION_NOTIFY_CONNECTION(ncc,cls) \ +# define MHD_D_OPTION_NOTIFY_CONNECTION(ncc, cls) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1626,7 +1626,7 @@ The specified callback will be called one time, after network initialisation, TL * @param cls the closure for the callback * @return structure with the requested setting */ -# define MHD_D_OPTION_NOTIFY_STREAM(nsc,cls) \ +# define MHD_D_OPTION_NOTIFY_STREAM(nsc, cls) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ @@ -1645,7 +1645,7 @@ The specified callback will be called one time, after network initialisation, TL * @param buf the buffer with strong random data, the content will be copied by MHD * @return structure with the requested setting */ -# define MHD_D_OPTION_RANDOM_ENTROPY(buf_size,buf) \ +# define MHD_D_OPTION_RANDOM_ENTROPY(buf_size, buf) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_DaemonOptionAndValue) \ { \ diff --git a/src/include/microhttpd2_generated_response_options.h b/src/include/microhttpd2_generated_response_options.h @@ -296,7 +296,7 @@ With this option HTTP/1.0 server is emulated (with support for 'keep-alive' conn * @param ended_cb_cls the closure for the callback * @return structure with the requested setting */ -# define MHD_R_OPTION_TERMINATION_CALLBACK(ended_cb,ended_cb_cls) \ +# define MHD_R_OPTION_TERMINATION_CALLBACK(ended_cb, ended_cb_cls) \ MHD_NOWARN_COMPOUND_LITERALS_ MHD_NOWARN_AGGR_DYN_INIT_ \ (const struct MHD_ResponseOptionAndValue) \ { \ diff --git a/src/include/options-generator.c b/src/include/options-generator.c @@ -73,16 +73,16 @@ static FILE *f; static char *category; typedef void -(*Callback) (const char *name, - unsigned int value, - const char *comment, - const char *type, - const char *conditional, - const char *custom_setter, - unsigned int argc, - char **arguments, - unsigned int desc, - char **descriptions); +(*Callback)(const char *name, + unsigned int value, + const char *comment, + const char *type, + const char *conditional, + const char *custom_setter, + unsigned int argc, + char **arguments, + unsigned int desc, + char **descriptions); static int @@ -153,16 +153,16 @@ check (const char *name, name); exit (2); } - if ( (NULL == type) && - ( (0 == argc) || - (1 != argc) ) ) + if ((NULL == type) + && ((0 == argc) + || (1 != argc))) { fprintf (stderr, "Type and argument missing for `%s' and not exactly 1 argument\n", name); exit (2); } - for (unsigned int i = 0; i<argc; i++) + for (unsigned int i = 0; i < argc; i++) { const char *arg = arguments[i]; @@ -194,8 +194,8 @@ indent (const char *pfx, char *off; size_t pos = 0; - while ( (strlen (xfx) > 0) && - (isspace (xfx[strlen (xfx) - 1])) ) + while ((strlen (xfx) > 0) + && (isspace (xfx[strlen (xfx) - 1]))) xfx[strlen (xfx) - 1] = '\0'; while (NULL != (off = strchr (ret + pos, '\n'))) { @@ -302,7 +302,7 @@ dump_union_members (const char *name, (char) toupper (*category), uppercase (name), type); - for (unsigned int i = 0; i<argc; i++) + for (unsigned int i = 0; i < argc; i++) { const char *arg = arguments[i]; const char *desc = descriptions[i]; @@ -417,7 +417,7 @@ dump_option_macros (const char *name, printf ( "/**\n * %s\n", indent (" * ", comment)); - for (unsigned int off = 0; off<desct; off++) + for (unsigned int off = 0; off < desct; off++) { const char *arg = arguments[off]; const char *desc = descriptions[off]; @@ -437,10 +437,10 @@ dump_option_macros (const char *name, if (0 == argc) printf ("value"); else - for (unsigned int i = 0; i<argc; i++) + for (unsigned int i = 0; i < argc; i++) { if (0 != i) - printf (","); + printf (", "); printf ("%s", var_name (arguments[i])); } @@ -457,7 +457,7 @@ dump_option_macros (const char *name, printf (" .val.%s = (value) \\\n", lowercase (name)); else - for (unsigned int i = 0; i<argc; i++) + for (unsigned int i = 0; i < argc; i++) { const char *vn = var_name (arguments[i]); @@ -525,7 +525,7 @@ dump_option_static_functions (const char *name, ? type : arguments[0]); else - for (unsigned int i = 0; i<argc; i++) + for (unsigned int i = 0; i < argc; i++) { const char *arg = arguments[i]; const char *vn @@ -551,7 +551,7 @@ dump_option_static_functions (const char *name, printf (" opt_val.val.%s = (value); \\\n", lowercase (name)); else - for (unsigned int i = 0; i<argc; i++) + for (unsigned int i = 0; i < argc; i++) { const char *vn = var_name (arguments[i]); @@ -585,7 +585,7 @@ dump_option_documentation_functions (const char *name, fprintf (f, "/**\n * %s\n", indent (" * ", comment)); - for (unsigned int off = 0; off<desct; off++) + for (unsigned int off = 0; off < desct; off++) { const char *arg = arguments[off]; const char *desc = descriptions[off]; @@ -599,7 +599,7 @@ dump_option_documentation_functions (const char *name, if (0 == desct) fprintf (f, " * @param value the value of the parameter"); fprintf (f, " * @return structure with the requested setting\n */\n"); - fprintf (f,"struct MHD_%sOptionAndValue\n" + fprintf (f, "struct MHD_%sOptionAndValue\n" "MHD_%c_OPTION_%s (\n", capitalize (category), (char) toupper (*category), @@ -611,7 +611,7 @@ dump_option_documentation_functions (const char *name, ? type : arguments[0]); else - for (unsigned int i = 0; i<argc; i++) + for (unsigned int i = 0; i < argc; i++) { const char *arg = arguments[i]; const char *vn = var_name (arg); @@ -629,6 +629,26 @@ dump_option_documentation_functions (const char *name, } +/* Emit " DST = SRC;", wrapped after the '=' when the whole line would + * exceed the 80-column target. */ +static void +dump_setter_assignment (const char *dst, + const char *src) +{ + if (80 >= 6 + strlen (dst) + 3 + strlen (src) + 1) + fprintf (f, + " %s = %s;\n", + dst, + src); + else + fprintf (f, + " %s =\n" + " %s;\n", + dst, + src); +} + + static void dump_option_set_switch (const char *name, unsigned int value, @@ -651,38 +671,58 @@ dump_option_set_switch (const char *name, uppercase (name)); if (NULL != custom_setter) { - fprintf (f, - " %s\n", - indent (" ", - custom_setter)); + /* Emit line by line: preprocessor directives must stay at the first + * column, ordinary code lines get the 'case' body indentation. */ + const char *line = custom_setter; + + while (NULL != line) + { + const char *nl = strchr (line, '\n'); + size_t len = (NULL == nl) ? strlen (line) : (size_t) (nl - line); + + if (0 == len) + fprintf (f, "\n"); + else if ('#' == line[0]) + fprintf (f, "%.*s\n", (int) len, line); + else + fprintf (f, " %.*s\n", (int) len, line); + line = (NULL == nl) ? NULL : nl + 1; + } } else { if (0 == argc) { - fprintf (f, - " settings->%s = option->val.%s;\n", - lowercase (name), - lowercase (name)); + char *dst; + char *src; + + my_asprintf (&dst, "settings->%s", lowercase (name)); + my_asprintf (&src, "option->val.%s", lowercase (name)); + dump_setter_assignment (dst, src); + free (dst); + free (src); } else { - for (unsigned int i = 0; i<argc; i++) + for (unsigned int i = 0; i < argc; i++) { const char *vn = var_name (arguments[i]); + char *dst; + char *src; if (1 < argc) - fprintf (f, - " settings->%s.v_%s = option->val.%s.v_%s;\n", - lowercase (name), - vn, - lowercase (name), - vn); + { + my_asprintf (&dst, "settings->%s.v_%s", lowercase (name), vn); + my_asprintf (&src, "option->val.%s.v_%s", lowercase (name), vn); + } else - fprintf (f, - " settings->%s = option->val.%s;\n", - lowercase (name), - lowercase (name)); + { + my_asprintf (&dst, "settings->%s", lowercase (name)); + my_asprintf (&src, "option->val.%s", lowercase (name)); + } + dump_setter_assignment (dst, src); + free (dst); + free (src); } } } @@ -756,21 +796,21 @@ TOP: break; r = strlen (line); off++; - while ( (r > 0) && - ( (isspace (line[r - 1])) || - (line[r - 1] == '\n') ) ) + while ((r > 0) + && ((isspace (line[r - 1])) + || (line[r - 1] == '\n'))) line[--r] = '\0'; /* remove new line */ if (0 == r) { larg = NULL; continue; } - if ( (NULL != larg) && - ( (0 == strncmp ("+ ", - line, - 2) ) || - (0 == strcmp ("+", - line) ) ) ) + if ((NULL != larg) + && ((0 == strncmp ("+ ", + line, + 2)) + || (0 == strcmp ("+", + line)))) { if (larg == &dummy) { @@ -785,13 +825,13 @@ TOP: strcat (*larg, "\n"); if (0 != strcmp ("+", - line) ) + line)) strcat (*larg, line + 2); continue; } - if ( ('%' == line[0]) || - ('#' == line[0]) ) + if (('%' == line[0]) + || ('#' == line[0])) continue; if (NULL == larg) { @@ -843,7 +883,7 @@ TOP: off); return 2; } - for (unsigned int i = 0; i<MAX_ARGS; i++) + for (unsigned int i = 0; i < MAX_ARGS; i++) { char name[32]; @@ -1039,7 +1079,6 @@ TOP: fprintf (f, "/* This is generated code, it is still under LGPLv2.1+.\n" " Do not edit directly! */\n" - "/* *INDENT-OFF* */\n" "/**\n" " * @file %s_set_options.c\n" " * @author options-generator.c\n" @@ -1111,12 +1150,12 @@ TOP: " if (response->reuse.reusable)\n" " {\n" " need_unlock = true;\n" - " if (! mhd_mutex_lock(&response->reuse.settings_lock))\n" + " if (! mhd_mutex_lock (&response->reuse.settings_lock))\n" " return MHD_SC_RESP_MUTEX_LOCK_FAILED;\n" - " mhd_assert (1 == mhd_atomic_counter_get(&response->reuse.counter));\n" + " mhd_assert (1 == mhd_atomic_counter_get (&response->reuse.counter));\n" " if (response->frozen) /* Firm re-check under the lock */\n" " {\n" - " mhd_mutex_unlock_chk(&response->reuse.settings_lock);\n" + " mhd_mutex_unlock_chk (&response->reuse.settings_lock);\n" " return MHD_SC_TOO_LATE;\n" " }\n" " }\n" @@ -1160,7 +1199,7 @@ TOP: fprintf (f, "\n" " if (need_unlock)\n" - " mhd_mutex_unlock_chk(&response->reuse.settings_lock);\n" + " mhd_mutex_unlock_chk (&response->reuse.settings_lock);\n" "\n"); } fprintf (f, @@ -1190,7 +1229,6 @@ TOP: fprintf (f, "/* This is generated code, it is still under LGPLv2.1+.\n" " Do not edit directly! */\n" - "/* *INDENT-OFF* */\n" "/**\n" " * @file %s_options.h\n" " * @author %s-options-generator.c\n" diff --git a/src/include/r_options.rec b/src/include/r_options.rec @@ -33,8 +33,8 @@ CustomSetter: /* custom setter */ + break; + } + } -+ else if ((MHD_NO != option->val.reusable) && -+ (! response_make_reusable(response))) ++ else if ((MHD_NO != option->val.reusable) ++ && (! response_make_reusable (response))) + { + res = MHD_SC_RESP_MUTEX_INIT_FAILED; + i = options_max_num - 1; diff --git a/src/mhd2/daemon_options.h b/src/mhd2/daemon_options.h @@ -1,6 +1,5 @@ /* This is generated code, it is still under LGPLv2.1+. Do not edit directly! */ -/* *INDENT-OFF* */ /** * @file daemon_options.h * @author daemon-options-generator.c diff --git a/src/mhd2/daemon_set_options.c b/src/mhd2/daemon_set_options.c @@ -1,6 +1,5 @@ /* This is generated code, it is still under LGPLv2.1+. Do not edit directly! */ -/* *INDENT-OFF* */ /** * @file daemon_set_options.c * @author options-generator.c @@ -79,7 +78,8 @@ MHD_daemon_set_options ( continue; case MHD_D_O_TCP_FASTOPEN: settings->tcp_fastopen.v_option = option->val.tcp_fastopen.v_option; - settings->tcp_fastopen.v_queue_length = option->val.tcp_fastopen.v_queue_length; + settings->tcp_fastopen.v_queue_length = + option->val.tcp_fastopen.v_queue_length; continue; case MHD_D_O_LISTEN_BACKLOG: settings->listen_backlog = option->val.listen_backlog; @@ -144,8 +144,10 @@ MHD_daemon_set_options ( settings->tls_client_ca = option->val.tls_client_ca; continue; case MHD_D_O_TLS_PSK_CALLBACK: - settings->tls_psk_callback.v_psk_cb = option->val.tls_psk_callback.v_psk_cb; - settings->tls_psk_callback.v_psk_cb_cls = option->val.tls_psk_callback.v_psk_cb_cls; + settings->tls_psk_callback.v_psk_cb = + option->val.tls_psk_callback.v_psk_cb; + settings->tls_psk_callback.v_psk_cb_cls = + option->val.tls_psk_callback.v_psk_cb_cls; continue; case MHD_D_O_NO_ALPN: settings->no_alpn = option->val.no_alpn; @@ -205,15 +207,18 @@ MHD_daemon_set_options ( settings->conn_buff_zeroing = option->val.conn_buff_zeroing; continue; case MHD_D_O_PROTOCOL_STRICT_LEVEL: - settings->protocol_strict_level.v_sl = option->val.protocol_strict_level.v_sl; - settings->protocol_strict_level.v_how = option->val.protocol_strict_level.v_how; + settings->protocol_strict_level.v_sl = + option->val.protocol_strict_level.v_sl; + settings->protocol_strict_level.v_how = + option->val.protocol_strict_level.v_how; continue; case MHD_D_O_EARLY_URI_LOGGER: settings->early_uri_logger.v_cb = option->val.early_uri_logger.v_cb; settings->early_uri_logger.v_cls = option->val.early_uri_logger.v_cls; continue; case MHD_D_O_DISABLE_URI_QUERY_PLUS_AS_SPACE: - settings->disable_uri_query_plus_as_space = option->val.disable_uri_query_plus_as_space; + settings->disable_uri_query_plus_as_space = + option->val.disable_uri_query_plus_as_space; continue; case MHD_D_O_SUPPRESS_DATE_HEADER: settings->suppress_date_header = option->val.suppress_date_header; @@ -248,18 +253,19 @@ MHD_daemon_set_options ( case MHD_D_O_DISABLE_COOKIES: /* custom setter */ /* The is not an easy for automatic generations */ - // TODO: remove options generator, put preprocessor directives to - // the first column - #ifdef MHD_SUPPORT_COOKIES + // TODO: remove options generator +#ifdef MHD_SUPPORT_COOKIES settings->disable_cookies = option->val.disable_cookies; - #else +#else if (MHD_NO != option->val.disable_cookies) return MHD_SC_FEATURE_DISABLED; - #endif +#endif continue; case MHD_D_O_DAEMON_READY_CALLBACK: - settings->daemon_ready_callback.v_cb = option->val.daemon_ready_callback.v_cb; - settings->daemon_ready_callback.v_cb_cls = option->val.daemon_ready_callback.v_cb_cls; + settings->daemon_ready_callback.v_cb = + option->val.daemon_ready_callback.v_cb; + settings->daemon_ready_callback.v_cb_cls = + option->val.daemon_ready_callback.v_cb_cls; continue; case MHD_D_O_NOTIFY_CONNECTION: settings->notify_connection.v_ncc = option->val.notify_connection.v_ncc; @@ -291,7 +297,8 @@ MHD_daemon_set_options ( settings->auth_digest_map_size = option->val.auth_digest_map_size; continue; case MHD_D_O_AUTH_DIGEST_NONCE_TIMEOUT: - settings->auth_digest_nonce_timeout = option->val.auth_digest_nonce_timeout; + settings->auth_digest_nonce_timeout = + option->val.auth_digest_nonce_timeout; continue; case MHD_D_O_AUTH_DIGEST_DEF_MAX_NC: settings->auth_digest_def_max_nc = option->val.auth_digest_def_max_nc; diff --git a/src/mhd2/response_options.h b/src/mhd2/response_options.h @@ -1,6 +1,5 @@ /* This is generated code, it is still under LGPLv2.1+. Do not edit directly! */ -/* *INDENT-OFF* */ /** * @file response_options.h * @author response-options-generator.c diff --git a/src/mhd2/response_set_options.c b/src/mhd2/response_set_options.c @@ -1,6 +1,5 @@ /* This is generated code, it is still under LGPLv2.1+. Do not edit directly! */ -/* *INDENT-OFF* */ /** * @file response_set_options.c * @author options-generator.c @@ -35,12 +34,12 @@ MHD_response_set_options ( if (response->reuse.reusable) { need_unlock = true; - if (! mhd_mutex_lock(&response->reuse.settings_lock)) + if (! mhd_mutex_lock (&response->reuse.settings_lock)) return MHD_SC_RESP_MUTEX_LOCK_FAILED; - mhd_assert (1 == mhd_atomic_counter_get(&response->reuse.counter)); + mhd_assert (1 == mhd_atomic_counter_get (&response->reuse.counter)); if (response->frozen) /* Firm re-check under the lock */ { - mhd_mutex_unlock_chk(&response->reuse.settings_lock); + mhd_mutex_unlock_chk (&response->reuse.settings_lock); return MHD_SC_TOO_LATE; } } @@ -65,8 +64,8 @@ MHD_response_set_options ( break; } } - else if ((MHD_NO != option->val.reusable) && - (! response_make_reusable(response))) + else if ((MHD_NO != option->val.reusable) + && (! response_make_reusable (response))) { res = MHD_SC_RESP_MUTEX_INIT_FAILED; i = options_max_num - 1; @@ -83,17 +82,21 @@ MHD_response_set_options ( settings->conn_close = option->val.conn_close; continue; case MHD_R_O_HTTP_1_0_COMPATIBLE_STRICT: - settings->http_1_0_compatible_strict = option->val.http_1_0_compatible_strict; + settings->http_1_0_compatible_strict = + option->val.http_1_0_compatible_strict; continue; case MHD_R_O_HTTP_1_0_SERVER: settings->http_1_0_server = option->val.http_1_0_server; continue; case MHD_R_O_INSANITY_HEADER_CONTENT_LENGTH: - settings->insanity_header_content_length = option->val.insanity_header_content_length; + settings->insanity_header_content_length = + option->val.insanity_header_content_length; continue; case MHD_R_O_TERMINATION_CALLBACK: - settings->termination_callback.v_ended_cb = option->val.termination_callback.v_ended_cb; - settings->termination_callback.v_ended_cb_cls = option->val.termination_callback.v_ended_cb_cls; + settings->termination_callback.v_ended_cb = + option->val.termination_callback.v_ended_cb; + settings->termination_callback.v_ended_cb_cls = + option->val.termination_callback.v_ended_cb_cls; continue; case MHD_R_O_SENTINEL: default: /* for -Wswitch-default -Wswitch-enum */ @@ -104,7 +107,7 @@ MHD_response_set_options ( } if (need_unlock) - mhd_mutex_unlock_chk(&response->reuse.settings_lock); + mhd_mutex_unlock_chk (&response->reuse.settings_lock); return res; }