]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: config: make the cfg_keyword parsers take a const for the defproxy
authorWilly Tarreau <w@1wt.eu>
Tue, 9 Mar 2021 08:53:46 +0000 (09:53 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Mar 2021 09:09:43 +0000 (10:09 +0100)
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).

26 files changed:
include/haproxy/cfgparse.h
include/haproxy/stream.h
src/51d.c
src/activity.c
src/cfgparse-ssl.c
src/cli.c
src/connection.c
src/da.c
src/extcheck.c
src/fcgi-app.c
src/fd.c
src/filters.c
src/flt_http_comp.c
src/hlua.c
src/http_htx.c
src/listener.c
src/mux_h1.c
src/mux_h2.c
src/mworker.c
src/proxy.c
src/server.c
src/task.c
src/tcp_rules.c
src/tcpcheck.c
src/vars.c
src/wurfl.c

index 186ecf75b74ec210aee2921852ed1f1534621a92..62973d81807d4821c39fe60193ba99a717bd8027 100644 (file)
@@ -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 */
index aa6486e25a6965245f98e7ba0c5aedb8e74bf4e9..f558a1fa4df63f2d5ef94ff65ade332b5582a298 100644 (file)
@@ -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);
index 6cd1d28aaf3d5254ab67837c4d0f4b3179b9457d..2c52c597c07a4bc0a41f5aa700a23a43cdca8458 100644 (file)
--- 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) {
index 0d945ac96446e4c66d67b6107fa7e3e1c5cc3eaa..764613ffc1709be0c0234e6a5aae005a86df8710 100644 (file)
@@ -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))
index 6af1328f60f7e8f52de75e129d79bf9cd2d71dfd..9ac3702e4920e51a6d72c7e53afabf954a7e8f6e 100644 (file)
@@ -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
index f48795a42b39c72e8e55d65da66079935e43b791..72919ce320da6a1d5c618ab3a591f9ff9d9ead7d 100644 (file)
--- 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;
index b1d643b9dccde25dd36dc4aa56007467571e5c22..ac098d3718de7f813f7e4bdd301b8e3f533b660c 100644 (file)
@@ -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))
index c11e0766eefa6b611e3b5b4740d0a7c199ad640e..4189092264ebfc3e21bf8b403a9674d6d09378c6 100644 (file)
--- 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) {
index 6eaeac1e14387523932cf6f1d4c9f2dc66992134..79a63b2a6da42f67aef71cc0410d786935917017 100644 (file)
@@ -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;
index 71f6dd48b5b66bfd12baf91a815d4e1e9a8d5deb..4a7e0b358fda9b93cf702f3b59fb4de8e690b319 100644 (file)
@@ -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;
index 5102c9444e1c4f7a4f69b3a0f8a6bf2769589432..292a9e0ea9e25b2eaa5bf52ef0029a784524030d 100644 (file)
--- 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))
index 69ebf525f6aa02e0a4918aefbe3f1a0aea25bd5f..a5fc36760bed9b68c34f0af0395be73ba358fafc 100644 (file)
@@ -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;
 
index b0a2f0bc986c4155513a826e25679f0a55a02f83..c9ac021125556afc52a80ba025b25d11a2bca8f0 100644 (file)
@@ -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;
index 12a487267b967e89f2771c2bf50f74b8aba4575f..42d5be2a5ade92e2ecfd79360949034222b0d786 100644 (file)
@@ -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;
index cf536a3fe67fbd383bc9ced21a974929712bb1a2..1444cf67d08694fc73d9985f900d724e97f2caca 100644 (file)
@@ -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;
index 8a8ad73a99f2da212e0a67459b82d401ad28b3b9..4dfaa7f23e525b396310ad6e2c070cf6d7b9174f 100644 (file)
@@ -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))
index b44de543939e3bc85a6012afd6be6d4a71cea62b..53cbb44febd33fe575e69c3c23ccb44e246d7cf5 100644 (file)
@@ -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))
index 20d343a979d97a32f37efb894d0a45fae63f1e51..e06404273b6b5aed815e5532228ae7bc05c9fee9 100644 (file)
@@ -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))
index 27a1b9f48ffe79574c9f0e9cdfc5c6a6e16c0885..afcada6f99f6de3415c18f8df5aff5d0c84cb546 100644 (file)
@@ -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;
index 6d783fd97f73ccef3d417512b3fbbafc790f9385..a9a49439d6beec9dc3f6e2c9a77e1ac5472d9214 100644 (file)
@@ -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 <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 @@ static int proxy_parse_rate_limit(char **args, int section, struct proxy *proxy,
  * 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 @@ 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;
index 04d2347798f4990ffda279cdb2803ec4c902965b..8eb659d335be84afb650362b3d18734278b5b797 100644 (file)
@@ -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;
index 602c6cef52f9c1d1e6207a764b6a4d59973210b4..8069dda1816ed8ad458603c49dc48c1f7df00bb0 100644 (file)
@@ -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))
index c89c2fbcb2f9efdf133903608e3a26bec7f33639..da4ce302a0978424036040a6720ecf388891c0c9 100644 (file)
@@ -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;
index 0fe3d10cd34078268277e658df2315878da70189..37d3b38ca13e94524feaeb652818060d0e21b346 100644 (file)
@@ -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;
index c101c7288fc8e88e9f94ceabc98ef00fbe941705..65930c984e8945aff5d08d556a63201fe055aec0 100644 (file)
@@ -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);
index 6030c4c90222c1de5f5fc95fd4cc14a513b76e88..8ec17836d15fdc019fc960212786407b9e1746c6 100644 (file)
@@ -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