diff --git a/include/haproxy/cfgparse.h b/include/haproxy/cfgparse.h index 186ecf75b..62973d818 100644 --- a/include/haproxy/cfgparse.h +++ b/include/haproxy/cfgparse.h @@ -47,7 +47,7 @@ struct cfg_keyword { char **args, /* command line and arguments */ int section_type, /* current section CFG_{GLOBAL|LISTEN} */ struct proxy *curpx, /* current proxy (NULL in GLOBAL) */ - struct proxy *defpx, /* default proxy (NULL in GLOBAL) */ + const struct proxy *defpx, /* default proxy (NULL in GLOBAL) */ const char *file, /* config file name */ int line, /* config file line number */ char **err); /* error or warning message output pointer */ diff --git a/include/haproxy/stream.h b/include/haproxy/stream.h index aa6486e25..f558a1fa4 100644 --- a/include/haproxy/stream.h +++ b/include/haproxy/stream.h @@ -72,10 +72,6 @@ void stream_process_counters(struct stream *s); void sess_change_server(struct stream *sess, struct server *newsrv); struct task *process_stream(struct task *t, void *context, unsigned int state); void default_srv_error(struct stream *s, struct stream_interface *si); -int parse_track_counters(char **args, int *arg, - int section_type, struct proxy *curpx, - struct track_ctr_prm *prm, - struct proxy *defpx, char **err); /* Update the stream's backend and server time stats */ void stream_update_time_stats(struct stream *s); diff --git a/src/51d.c b/src/51d.c index 6cd1d28aa..2c52c597c 100644 --- a/src/51d.c +++ b/src/51d.c @@ -57,7 +57,7 @@ static struct { }; static int _51d_data_file(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { @@ -75,7 +75,7 @@ static int _51d_data_file(char **args, int section_type, struct proxy *curpx, } static int _51d_property_name_list(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int cur_arg = 1; @@ -99,7 +99,7 @@ static int _51d_property_name_list(char **args, int section_type, struct proxy * } static int _51d_property_separator(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { @@ -121,7 +121,7 @@ static int _51d_property_separator(char **args, int section_type, struct proxy * } static int _51d_cache_size(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { diff --git a/src/activity.c b/src/activity.c index 0d945ac96..764613ffc 100644 --- a/src/activity.c +++ b/src/activity.c @@ -42,7 +42,7 @@ void report_stolen_time(uint64_t stolen) /* config parser for global "profiling.tasks", accepts "on" or "off" */ static int cfg_parse_prof_tasks(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) diff --git a/src/cfgparse-ssl.c b/src/cfgparse-ssl.c index 6af1328f6..9ac3702e4 100644 --- a/src/cfgparse-ssl.c +++ b/src/cfgparse-ssl.c @@ -42,7 +42,7 @@ /****************** Global Section Parsing ********************************************/ static int ssl_load_global_issuers_from_path(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char *path; @@ -121,7 +121,7 @@ static int ssl_load_global_issuers_from_path(char **args, int section_type, stru * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_ssl_async(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { #ifdef SSL_MODE_ASYNC @@ -139,7 +139,7 @@ static int ssl_parse_global_ssl_async(char **args, int section_type, struct prox * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_ssl_engine(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char *algo; @@ -182,7 +182,7 @@ add_engine: * in global section. Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_ciphers(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char **target; @@ -207,7 +207,7 @@ static int ssl_parse_global_ciphers(char **args, int section_type, struct proxy * in global section. Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_ciphersuites(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char **target; @@ -234,7 +234,7 @@ static int ssl_parse_global_ciphersuites(char **args, int section_type, struct p * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_curves(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char **target; @@ -257,7 +257,7 @@ static int ssl_parse_global_curves(char **args, int section_type, struct proxy * * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_int(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int *target; @@ -294,7 +294,7 @@ static int ssl_parse_global_int(char **args, int section_type, struct proxy *cur } static int ssl_parse_global_capture_cipherlist(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int ret; @@ -319,7 +319,7 @@ static int ssl_parse_global_capture_cipherlist(char **args, int section_type, st /* init the SSLKEYLOGFILE pool */ #ifdef HAVE_OPENSSL_KEYLOG static int ssl_parse_global_keylog(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { @@ -358,7 +358,7 @@ static int ssl_parse_global_keylog(char **args, int section_type, struct proxy * * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_private_cache(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(0, args, err, NULL)) @@ -372,7 +372,7 @@ static int ssl_parse_global_private_cache(char **args, int section_type, struct * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_lifetime(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { const char *res; @@ -408,7 +408,7 @@ static int ssl_parse_global_lifetime(char **args, int section_type, struct proxy * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_dh_param_file(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) @@ -430,7 +430,7 @@ static int ssl_parse_global_dh_param_file(char **args, int section_type, struct * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_default_dh(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) @@ -456,7 +456,7 @@ static int ssl_parse_global_default_dh(char **args, int section_type, struct pro * multiple arguments are allowed: "bundle", "sctl", "ocsp", "issuer", "all", "none" */ static int ssl_parse_global_extra_files(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int i; @@ -519,7 +519,7 @@ err_arg: /* parse 'ssl-load-extra-del-ext */ static int ssl_parse_global_extra_noext(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { global_ssl.extra_files_noext = 1; @@ -1619,7 +1619,7 @@ static int srv_parse_verifyhost(char **args, int *cur_arg, struct proxy *px, str /* parse the "ssl-default-bind-options" keyword in global section */ static int ssl_parse_default_bind_options(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int i = 1; @@ -1651,7 +1651,7 @@ static int ssl_parse_default_bind_options(char **args, int section_type, struct /* parse the "ssl-default-server-options" keyword in global section */ static int ssl_parse_default_server_options(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int i = 1; @@ -1683,7 +1683,7 @@ static int ssl_parse_default_server_options(char **args, int section_type, struc * Returns <0 on alert, >0 on warning, 0 on success. */ static int ssl_parse_global_ca_crt_base(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char **target; @@ -1708,7 +1708,7 @@ static int ssl_parse_global_ca_crt_base(char **args, int section_type, struct pr /* parse the "ssl-skip-self-issued-ca" keyword in global section. */ static int ssl_parse_skip_self_issued_ca(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { #ifdef SSL_CTX_build_cert_chain diff --git a/src/cli.c b/src/cli.c index f48795a42..72919ce32 100644 --- a/src/cli.c +++ b/src/cli.c @@ -257,7 +257,7 @@ static struct proxy *alloc_stats_fe(const char *name, const char *file, int line * the first word after "stats". */ static int stats_parse_global(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { struct bind_conf *bind_conf; diff --git a/src/connection.c b/src/connection.c index b1d643b9d..ac098d371 100644 --- a/src/connection.c +++ b/src/connection.c @@ -1298,7 +1298,7 @@ int make_proxy_line_v2(char *buf, int buf_len, struct server *srv, struct connec /* returns 0 on success */ static int cfg_parse_pp2_never_send_local(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(0, args, err, NULL)) diff --git a/src/da.c b/src/da.c index c11e0766e..418909226 100644 --- a/src/da.c +++ b/src/da.c @@ -35,7 +35,7 @@ static struct { }; static int da_json_file(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { @@ -47,7 +47,7 @@ static int da_json_file(char **args, int section_type, struct proxy *curpx, } static int da_log_level(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int loglevel; @@ -67,7 +67,7 @@ static int da_log_level(char **args, int section_type, struct proxy *curpx, } static int da_property_separator(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { @@ -79,7 +79,7 @@ static int da_property_separator(char **args, int section_type, struct proxy *cu } static int da_properties_cookie(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { diff --git a/src/extcheck.c b/src/extcheck.c index 6eaeac1e1..79a63b2a6 100644 --- a/src/extcheck.c +++ b/src/extcheck.c @@ -602,7 +602,7 @@ struct task *process_chk_proc(struct task *t, void *context, unsigned int state) /* Parses the "external-check" proxy keyword */ int proxy_parse_extcheck(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **errmsg) { int cur_arg, ret = 0; diff --git a/src/fcgi-app.c b/src/fcgi-app.c index 71f6dd48b..4a7e0b358 100644 --- a/src/fcgi-app.c +++ b/src/fcgi-app.c @@ -581,7 +581,7 @@ parse_fcgi_flt(char **args, int *cur_arg, struct proxy *px, /* Parses the "use-fcgi-app" proxy keyword */ static int proxy_parse_use_fcgi_app(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { struct flt_conf *fconf = NULL; diff --git a/src/fd.c b/src/fd.c index 5102c9444..292a9e0ea 100644 --- a/src/fd.c +++ b/src/fd.c @@ -809,7 +809,7 @@ int fork_poller() /* config parser for global "tune.fd.edge-triggered", accepts "on" or "off" */ static int cfg_parse_tune_fd_edge_triggered(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) diff --git a/src/filters.c b/src/filters.c index 69ebf525f..a5fc36760 100644 --- a/src/filters.c +++ b/src/filters.c @@ -174,7 +174,7 @@ list_filters(FILE *out) */ static int parse_filter(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, char **err) + const struct proxy *defpx, const char *file, int line, char **err) { struct flt_conf *fconf = NULL; diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index b0a2f0bc9..c9ac02112 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -619,7 +619,7 @@ struct flt_ops comp_ops = { static int parse_compression_options(char **args, int section, struct proxy *proxy, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { struct comp *comp; diff --git a/src/hlua.c b/src/hlua.c index 12a487267..42d5be2a5 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -8132,7 +8132,7 @@ __LJMP static int hlua_register_cli(lua_State *L) } static int hlua_read_timeout(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err, unsigned int *timeout) { const char *error; @@ -8156,7 +8156,7 @@ static int hlua_read_timeout(char **args, int section_type, struct proxy *curpx, } static int hlua_session_timeout(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return hlua_read_timeout(args, section_type, curpx, defpx, @@ -8164,7 +8164,7 @@ static int hlua_session_timeout(char **args, int section_type, struct proxy *cur } static int hlua_task_timeout(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return hlua_read_timeout(args, section_type, curpx, defpx, @@ -8172,7 +8172,7 @@ static int hlua_task_timeout(char **args, int section_type, struct proxy *curpx, } static int hlua_applet_timeout(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return hlua_read_timeout(args, section_type, curpx, defpx, @@ -8180,7 +8180,7 @@ static int hlua_applet_timeout(char **args, int section_type, struct proxy *curp } static int hlua_forced_yield(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char *error; @@ -8194,7 +8194,7 @@ static int hlua_forced_yield(char **args, int section_type, struct proxy *curpx, } static int hlua_parse_maxmem(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char *error; @@ -8270,7 +8270,7 @@ static int hlua_load_state(char *filename, lua_State *L, char **err) } static int hlua_load(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { @@ -8285,7 +8285,7 @@ static int hlua_load(char **args, int section_type, struct proxy *curpx, } static int hlua_load_per_thread(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int len; @@ -8345,7 +8345,7 @@ static int hlua_prepend_path(lua_State *L, char *type, char *path) } static int hlua_config_prepend_path(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { char *path; diff --git a/src/http_htx.c b/src/http_htx.c index cf536a3fe..1444cf67d 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -1721,7 +1721,7 @@ struct http_reply *http_parse_http_reply(const char **args, int *orig_arg, struc /* Parses the "errorloc[302|303]" proxy keyword */ static int proxy_parse_errorloc(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **errmsg) { struct conf_errors *conf_err; @@ -1788,7 +1788,7 @@ static int proxy_parse_errorloc(char **args, int section, struct proxy *curpx, /* Parses the "errorfile" proxy keyword */ static int proxy_parse_errorfile(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **errmsg) { struct conf_errors *conf_err; @@ -1853,7 +1853,7 @@ static int proxy_parse_errorfile(char **args, int section, struct proxy *curpx, /* Parses the "errorfiles" proxy keyword */ static int proxy_parse_errorfiles(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { struct conf_errors *conf_err = NULL; @@ -1916,7 +1916,7 @@ static int proxy_parse_errorfiles(char **args, int section, struct proxy *curpx, /* Parses the "http-error" proxy keyword */ static int proxy_parse_http_error(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **errmsg) { struct conf_errors *conf_err; diff --git a/src/listener.c b/src/listener.c index 8a8ad73a9..4dfaa7f23 100644 --- a/src/listener.c +++ b/src/listener.c @@ -1507,7 +1507,7 @@ static int bind_parse_proto(char **args, int cur_arg, struct proxy *px, struct b /* config parser for global "tune.listener.multi-queue", accepts "on" or "off" */ static int cfg_parse_tune_listener_mq(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) diff --git a/src/mux_h1.c b/src/mux_h1.c index b44de5439..53cbb44fe 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -3779,7 +3779,7 @@ static int cfg_h1_headers_case_adjust_postparser() /* config parser for global "h1-outgoing-header-case-adjust" */ static int cfg_parse_h1_header_case_adjust(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(2, args, err, NULL)) @@ -3793,7 +3793,7 @@ static int cfg_parse_h1_header_case_adjust(char **args, int section_type, struct /* config parser for global "h1-outgoing-headers-case-adjust-file" */ static int cfg_parse_h1_headers_case_adjust_file(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) diff --git a/src/mux_h2.c b/src/mux_h2.c index 20d343a97..e06404273 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -6588,7 +6588,7 @@ static int h2_takeover(struct connection *conn, int orig_tid) /* config parser for global "tune.h2.header-table-size" */ static int h2_parse_header_table_size(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) @@ -6604,7 +6604,7 @@ static int h2_parse_header_table_size(char **args, int section_type, struct prox /* config parser for global "tune.h2.initial-window-size" */ static int h2_parse_initial_window_size(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) @@ -6620,7 +6620,7 @@ static int h2_parse_initial_window_size(char **args, int section_type, struct pr /* config parser for global "tune.h2.max-concurrent-streams" */ static int h2_parse_max_concurrent_streams(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) @@ -6636,7 +6636,7 @@ static int h2_parse_max_concurrent_streams(char **args, int section_type, struct /* config parser for global "tune.h2.max-frame-size" */ static int h2_parse_max_frame_size(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) diff --git a/src/mworker.c b/src/mworker.c index 27a1b9f48..afcada6f9 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -558,7 +558,7 @@ static int cli_parse_reload(char **args, char *payload, struct appctx *appctx, v static int mworker_parse_global_max_reloads(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int linenum, char **err) + const struct proxy *defpx, const char *file, int linenum, char **err) { int err_code = 0; diff --git a/src/proxy.c b/src/proxy.c index 6d783fd97..a9a49439d 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -198,14 +198,14 @@ int get_backend_server(const char *bk_name, const char *sv_name, * "{cli|srv|con}timeout" in args[0]. */ static int proxy_parse_timeout(char **args, int section, struct proxy *proxy, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { unsigned timeout; int retval, cap; const char *res, *name; int *tv = NULL; - int *td = NULL; + const int *td = NULL; retval = 0; @@ -328,13 +328,13 @@ static int proxy_parse_timeout(char **args, int section, struct proxy *proxy, * parsed, and to the default proxy or NULL. */ static int proxy_parse_rate_limit(char **args, int section, struct proxy *proxy, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int retval; char *res; unsigned int *tv = NULL; - unsigned int *td = NULL; + const unsigned int *td = NULL; unsigned int val; retval = 0; @@ -381,7 +381,7 @@ static int proxy_parse_rate_limit(char **args, int section, struct proxy *proxy, * the proxy being parsed, and to the default proxy or NULL. */ static int proxy_parse_max_ka_queue(char **args, int section, struct proxy *proxy, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int retval; @@ -420,7 +420,7 @@ static int proxy_parse_max_ka_queue(char **args, int section, struct proxy *prox * default proxy or NULL. */ static int proxy_parse_declare(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { /* Capture keyword wannot be declared in a default proxy. */ @@ -515,7 +515,7 @@ static int proxy_parse_declare(char **args, int section, struct proxy *curpx, /* This function parses a "retry-on" statement */ static int proxy_parse_retry_on(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int i; @@ -584,7 +584,7 @@ proxy_parse_retry_on(char **args, int section, struct proxy *curpx, #ifdef TCP_KEEPCNT /* This function parses "{cli|srv}tcpka-cnt" statements */ static int proxy_parse_tcpka_cnt(char **args, int section, struct proxy *proxy, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int retval; @@ -631,7 +631,7 @@ static int proxy_parse_tcpka_cnt(char **args, int section, struct proxy *proxy, #ifdef TCP_KEEPIDLE /* This function parses "{cli|srv}tcpka-idle" statements */ static int proxy_parse_tcpka_idle(char **args, int section, struct proxy *proxy, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int retval; @@ -687,7 +687,7 @@ static int proxy_parse_tcpka_idle(char **args, int section, struct proxy *proxy, #ifdef TCP_KEEPINTVL /* This function parses "{cli|srv}tcpka-intvl" statements */ static int proxy_parse_tcpka_intvl(char **args, int section, struct proxy *proxy, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int retval; @@ -1577,7 +1577,7 @@ struct task *manage_proxy(struct task *t, void *context, unsigned int state) static int proxy_parse_hard_stop_after(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { const char *res; diff --git a/src/server.c b/src/server.c index 04d234779..8eb659d33 100644 --- a/src/server.c +++ b/src/server.c @@ -4732,7 +4732,7 @@ remove: /* config parser for global "tune.idle-pool.shared", accepts "on" or "off" */ static int cfg_parse_idle_pool_shared(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) @@ -4751,7 +4751,7 @@ static int cfg_parse_idle_pool_shared(char **args, int section_type, struct prox /* config parser for global "tune.pool-{low,high}-fd-ratio" */ static int cfg_parse_pool_fd_ratio(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int arg = -1; diff --git a/src/task.c b/src/task.c index 602c6cef5..8069dda18 100644 --- a/src/task.c +++ b/src/task.c @@ -909,7 +909,7 @@ static void init_task() /* config parser for global "tune.sched.low-latency", accepts "on" or "off" */ static int cfg_parse_tune_sched_low_latency(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (too_many_args(1, args, err, NULL)) diff --git a/src/tcp_rules.c b/src/tcp_rules.c index c89c2fbcb..da4ce302a 100644 --- a/src/tcp_rules.c +++ b/src/tcp_rules.c @@ -568,7 +568,7 @@ int tcp_exec_l5_rules(struct session *sess) /* Parse a tcp-response rule. Return a negative value in case of failure */ static int tcp_parse_response_rule(char **args, int arg, int section_type, - struct proxy *curpx, struct proxy *defpx, + struct proxy *curpx, const struct proxy *defpx, struct act_rule *rule, char **err, unsigned int where, const char *file, int line) @@ -731,7 +731,7 @@ static void release_tcp_track_sc(struct act_rule * rule) /* Parse a tcp-request rule. Return a negative value in case of failure */ static int tcp_parse_request_rule(char **args, int arg, int section_type, - struct proxy *curpx, struct proxy *defpx, + struct proxy *curpx, const struct proxy *defpx, struct act_rule *rule, char **err, unsigned int where, const char *file, int line) { @@ -986,7 +986,7 @@ static int tcp_parse_request_rule(char **args, int arg, int section_type, * keyword. */ static int tcp_parse_tcp_rep(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { const char *ptr = NULL; @@ -1097,7 +1097,7 @@ static int tcp_parse_tcp_rep(char **args, int section_type, struct proxy *curpx, * keyword. */ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { const char *ptr = NULL; diff --git a/src/tcpcheck.c b/src/tcpcheck.c index 0fe3d10cd..37d3b38ca 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -3680,7 +3680,7 @@ int add_tcpcheck_send_strs(struct tcpcheck_rules *rules, const char * const *str /* Parses the "tcp-check" proxy keyword */ static int proxy_parse_tcpcheck(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **errmsg) { struct tcpcheck_ruleset *rs = NULL; @@ -3764,7 +3764,7 @@ static int proxy_parse_tcpcheck(char **args, int section, struct proxy *curpx, /* Parses the "http-check" proxy keyword */ static int proxy_parse_httpcheck(char **args, int section, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **errmsg) { struct tcpcheck_ruleset *rs = NULL; diff --git a/src/vars.c b/src/vars.c index c101c7288..65930c984 100644 --- a/src/vars.c +++ b/src/vars.c @@ -798,7 +798,7 @@ static enum act_parse_ret parse_store(const char **args, int *arg, struct proxy } static int vars_max_size(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err, unsigned int *limit) { char *error; @@ -812,42 +812,42 @@ static int vars_max_size(char **args, int section_type, struct proxy *curpx, } static int vars_max_size_global(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return vars_max_size(args, section_type, curpx, defpx, file, line, err, &var_global_limit); } static int vars_max_size_proc(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return vars_max_size(args, section_type, curpx, defpx, file, line, err, &var_proc_limit); } static int vars_max_size_sess(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return vars_max_size(args, section_type, curpx, defpx, file, line, err, &var_sess_limit); } static int vars_max_size_txn(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return vars_max_size(args, section_type, curpx, defpx, file, line, err, &var_txn_limit); } static int vars_max_size_reqres(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return vars_max_size(args, section_type, curpx, defpx, file, line, err, &var_reqres_limit); } static int vars_max_size_check(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { return vars_max_size(args, section_type, curpx, defpx, file, line, err, &var_check_limit); diff --git a/src/wurfl.c b/src/wurfl.c index 6030c4c90..8ec17836d 100644 --- a/src/wurfl.c +++ b/src/wurfl.c @@ -129,7 +129,7 @@ typedef struct { * configuration parameters parsing functions */ static int ha_wurfl_cfg_data_file(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { @@ -143,7 +143,7 @@ static int ha_wurfl_cfg_data_file(char **args, int section_type, struct proxy *c } static int ha_wurfl_cfg_cache(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { @@ -156,7 +156,7 @@ static int ha_wurfl_cfg_cache(char **args, int section_type, struct proxy *curpx } static int ha_wurfl_cfg_engine_mode(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { // kept for backward conf file compat @@ -164,7 +164,7 @@ static int ha_wurfl_cfg_engine_mode(char **args, int section_type, struct proxy } static int ha_wurfl_cfg_information_list_separator(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { if (*(args[1]) == 0) { @@ -182,7 +182,7 @@ static int ha_wurfl_cfg_information_list_separator(char **args, int section_type } static int ha_wurfl_cfg_information_list(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int argIdx = 1; @@ -212,7 +212,7 @@ static int ha_wurfl_cfg_information_list(char **args, int section_type, struct p } static int ha_wurfl_cfg_patch_file_list(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { int argIdx = 1; @@ -240,7 +240,7 @@ static int ha_wurfl_cfg_patch_file_list(char **args, int section_type, struct pr } static int ha_wurfl_cfg_useragent_priority(char **args, int section_type, struct proxy *curpx, - struct proxy *defpx, const char *file, int line, + const struct proxy *defpx, const char *file, int line, char **err) { // this feature is deprecated, keeping only not to break compatibility