CLEANUP: config: make the cfg_keyword parsers take a const for the defproxy
The default proxy was passed as a variable to all parsers instead of a
const, which is not without risk, especially when some timeout parsers used
to make some int pointers point to the default values for comparisons. We
want to be certain that none of these parsers will modify the defaults
sections by accident, so it's important to mark this proxy as const.
This patch touches all occurrences found (89).
diff --git a/include/haproxy/cfgparse.h b/include/haproxy/cfgparse.h
index 186ecf7..62973d8 100644
--- a/include/haproxy/cfgparse.h
+++ b/include/haproxy/cfgparse.h
@@ -47,7 +47,7 @@
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 aa6486e..f558a1f 100644
--- a/include/haproxy/stream.h
+++ b/include/haproxy/stream.h
@@ -72,10 +72,6 @@
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 6cd1d28..2c52c59 100644
--- a/src/51d.c
+++ b/src/51d.c
@@ -57,7 +57,7 @@
};
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_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_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_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 0d945ac..764613f 100644
--- a/src/activity.c
+++ b/src/activity.c
@@ -42,7 +42,7 @@
/* 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 6af1328..9ac3702 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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_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 @@
/* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
* 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 @@
/* 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 @@
/* 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 @@
/* 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 @@
* 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 @@
/* 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 f48795a..72919ce 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -257,7 +257,7 @@
* 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 b1d643b..ac098d3 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -1298,7 +1298,7 @@
/* 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 c11e076..4189092 100644
--- a/src/da.c
+++ b/src/da.c
@@ -35,7 +35,7 @@
};
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_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_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_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 6eaeac1..79a63b2 100644
--- a/src/extcheck.c
+++ b/src/extcheck.c
@@ -602,7 +602,7 @@
/* 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 71f6dd4..4a7e0b3 100644
--- a/src/fcgi-app.c
+++ b/src/fcgi-app.c
@@ -581,7 +581,7 @@
/* 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 5102c94..292a9e0 100644
--- a/src/fd.c
+++ b/src/fd.c
@@ -809,7 +809,7 @@
/* 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 69ebf52..a5fc367 100644
--- a/src/filters.c
+++ b/src/filters.c
@@ -174,7 +174,7 @@
*/
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 b0a2f0b..c9ac021 100644
--- a/src/flt_http_comp.c
+++ b/src/flt_http_comp.c
@@ -619,7 +619,7 @@
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 12a4872..42d5be2 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -8132,7 +8132,7 @@
}
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_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_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_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_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_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(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_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_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 cf536a3..1444cf6 100644
--- a/src/http_htx.c
+++ b/src/http_htx.c
@@ -1721,7 +1721,7 @@
/* 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 @@
/* 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 @@
/* 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 @@
/* 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 8a8ad73..4dfaa7f 100644
--- a/src/listener.c
+++ b/src/listener.c
@@ -1507,7 +1507,7 @@
/* 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 b44de54..53cbb44 100644
--- a/src/mux_h1.c
+++ b/src/mux_h1.c
@@ -3779,7 +3779,7 @@
/* 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 @@
/* 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 20d343a..e064042 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -6588,7 +6588,7 @@
/* 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 @@
/* 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 @@
/* 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 @@
/* 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 27a1b9f..afcada6 100644
--- a/src/mworker.c
+++ b/src/mworker.c
@@ -558,7 +558,7 @@
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 6d783fd..a9a4943 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -198,14 +198,14 @@
* "{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 @@
* parsed, and <defpx> 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 @@
* the proxy being parsed, and <defpx> 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 @@
* 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 @@
/* 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 @@
#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 @@
#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 @@
#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 @@
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 04d2347..8eb659d 100644
--- a/src/server.c
+++ b/src/server.c
@@ -4732,7 +4732,7 @@
/* 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 @@
/* 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 602c6ce..8069dda 100644
--- a/src/task.c
+++ b/src/task.c
@@ -909,7 +909,7 @@
/* 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 c89c2fb..da4ce30 100644
--- a/src/tcp_rules.c
+++ b/src/tcp_rules.c
@@ -568,7 +568,7 @@
/* 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 @@
/* 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 @@
* 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 @@
* 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 0fe3d10..37d3b38 100644
--- a/src/tcpcheck.c
+++ b/src/tcpcheck.c
@@ -3680,7 +3680,7 @@
/* 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 @@
/* 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 c101c72..65930c9 100644
--- a/src/vars.c
+++ b/src/vars.c
@@ -798,7 +798,7 @@
}
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_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 6030c4c..8ec1783 100644
--- a/src/wurfl.c
+++ b/src/wurfl.c
@@ -129,7 +129,7 @@
* 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_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_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_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(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_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_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