From: Aurelien DARRAGON Date: Fri, 7 Mar 2025 09:55:31 +0000 (+0100) Subject: MINOR: proxy: add proxy->options3 X-Git-Tag: v3.2-dev8~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc5a66212d8d56d97a7bc0be6969e893b61d3adb;p=thirdparty%2Fhaproxy.git MINOR: proxy: add proxy->options3 proxy->options2 is almost full, yet we will add new log-forward options in upcoming patches so we anticipate that by adding a new {no_}options3 and cfg_opts3[] to further extend proxy options --- diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index 79b6499dc..3da19da69 100644 --- a/include/haproxy/proxy-t.h +++ b/include/haproxy/proxy-t.h @@ -170,6 +170,10 @@ enum PR_SRV_STATE_FILE { #define PR_O2_CHK_ANY 0xF0000000 /* Mask to cover any check */ /* end of proxy->options2 */ +/* bits for proxy->options3 */ +/* unused: 0x00000000 to 0x80000000 */ +/* end of proxy->options3 */ + /* Cookie settings for pr->ck_opts */ #define PR_CK_RW 0x00000001 /* rewrite all direct cookies with the right serverid */ #define PR_CK_IND 0x00000002 /* keep only indirect cookies */ @@ -294,6 +298,7 @@ struct proxy { int options; /* PR_O_REDISP, PR_O_TRANSP, ... */ int options2; /* PR_O2_* */ + int options3; /* PR_O3_* */ unsigned int ck_opts; /* PR_CK_* (cookie options) */ unsigned int fe_req_ana, be_req_ana; /* bitmap of common request protocol analysers for the frontend and backend */ unsigned int fe_rsp_ana, be_rsp_ana; /* bitmap of common response protocol analysers for the frontend and backend */ @@ -429,6 +434,7 @@ struct proxy { /* used only during configuration parsing */ int no_options; /* PR_O_REDISP, PR_O_TRANSP, ... */ int no_options2; /* PR_O2_* */ + int no_options3; /* PR_O3_* */ struct { const char *file; /* file where the section appears */ diff --git a/include/haproxy/proxy.h b/include/haproxy/proxy.h index 3de1aa9ee..5abbeb5f3 100644 --- a/include/haproxy/proxy.h +++ b/include/haproxy/proxy.h @@ -39,6 +39,7 @@ extern struct eb_root proxy_by_name; /* tree of proxies sorted by name */ extern const struct cfg_opt cfg_opts[]; extern const struct cfg_opt cfg_opts2[]; +extern const struct cfg_opt cfg_opts3[]; struct task *manage_proxy(struct task *t, void *context, unsigned int state); void proxy_cond_pause(struct proxy *p); diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index de89740dd..2dd2a4897 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -2066,6 +2066,14 @@ stats_error_parsing: if (err_code & ERR_CODE) goto out; + /* try to match option within cfg_opts3 */ + if (cfg_parse_listen_match_option(file, linenum, kwm, cfg_opts3, &err_code, args, + PR_MODES, PR_CAP_NONE, + &curproxy->options3, &curproxy->no_options3)) + goto out; + if (err_code & ERR_CODE) + goto out; + /* HTTP options override each other. They can be cancelled using * "no option xxx" which only switches to default mode if the mode * was this one (useful for cancelling options set in defaults diff --git a/src/proxy.c b/src/proxy.c index c3b3467be..fa270ab9d 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -136,6 +136,12 @@ const struct cfg_opt cfg_opts2[] = { NULL, 0, 0, 0 } }; +/* proxy->options3 */ +const struct cfg_opt cfg_opts3[] = +{ + { NULL, 0, 0, 0 } +}; + /* Helper function to resolve a single sticking rule after config parsing. * Returns 1 for success and 0 for failure */