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
This commit is contained in:
Aurelien DARRAGON 2025-03-07 10:55:31 +01:00
parent d47e7103b8
commit cc5a66212d
4 changed files with 21 additions and 0 deletions

View File

@ -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 */

View File

@ -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);

View File

@ -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

View File

@ -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
*/