MINOR: log: migrate log-forward options from proxy->options2 to options3
Migrate recently added log-forward section options, currently stored under proxy->options2 to proxy->options3 since proxy->options2 is running out of space and we plan on adding more log-forward options.
This commit is contained in:
parent
cc5a66212d
commit
bc76f6dde9
@ -156,11 +156,7 @@ enum PR_SRV_STATE_FILE {
|
|||||||
#define PR_O2_RSTRICT_REQ_HDR_NAMES_NOOP 0x01000000 /* preserve request header names containing chars outside of [0-9a-zA-Z-] charset */
|
#define PR_O2_RSTRICT_REQ_HDR_NAMES_NOOP 0x01000000 /* preserve request header names containing chars outside of [0-9a-zA-Z-] charset */
|
||||||
#define PR_O2_RSTRICT_REQ_HDR_NAMES_MASK 0x01c00000 /* mask for restrict-http-header-names option */
|
#define PR_O2_RSTRICT_REQ_HDR_NAMES_MASK 0x01c00000 /* mask for restrict-http-header-names option */
|
||||||
|
|
||||||
/* bits for log-forward proxies */
|
/* unused : 0x02000000 ... 0x08000000 */
|
||||||
#define PR_O2_DONTPARSELOG 0x02000000 /* don't parse log messages */
|
|
||||||
#define PR_O2_ASSUME_RFC6587_NTF 0x04000000 /* assume that we are going to receive just non-transparent framing messages */
|
|
||||||
|
|
||||||
/* unused : 0x08000000 */
|
|
||||||
|
|
||||||
/* server health checks */
|
/* server health checks */
|
||||||
#define PR_O2_CHK_NONE 0x00000000 /* no L7 health checks configured (TCP by default) */
|
#define PR_O2_CHK_NONE 0x00000000 /* no L7 health checks configured (TCP by default) */
|
||||||
@ -171,7 +167,12 @@ enum PR_SRV_STATE_FILE {
|
|||||||
/* end of proxy->options2 */
|
/* end of proxy->options2 */
|
||||||
|
|
||||||
/* bits for proxy->options3 */
|
/* bits for proxy->options3 */
|
||||||
/* unused: 0x00000000 to 0x80000000 */
|
|
||||||
|
/* bits for log-forward proxies */
|
||||||
|
#define PR_O3_DONTPARSELOG 0x00000001 /* don't parse log messages */
|
||||||
|
#define PR_O3_ASSUME_RFC6587_NTF 0x00000002 /* assume that we are going to receive just non-transparent framing messages */
|
||||||
|
|
||||||
|
/* unused: 0x00000004 to 0x80000000 */
|
||||||
/* end of proxy->options3 */
|
/* end of proxy->options3 */
|
||||||
|
|
||||||
/* Cookie settings for pr->ck_opts */
|
/* Cookie settings for pr->ck_opts */
|
||||||
|
@ -5729,7 +5729,7 @@ static void syslog_process_message(struct proxy *frontend, struct listener *l,
|
|||||||
|
|
||||||
prepare_log_message(buf->area, buf->data, &level, &facility, metadata, &message, &size);
|
prepare_log_message(buf->area, buf->data, &level, &facility, metadata, &message, &size);
|
||||||
|
|
||||||
if (!(frontend->options2 & PR_O2_DONTPARSELOG))
|
if (!(frontend->options3 & PR_O3_DONTPARSELOG))
|
||||||
parse_log_message(buf->area, buf->data, &level, &facility, metadata, &message, &size);
|
parse_log_message(buf->area, buf->data, &level, &facility, metadata, &message, &size);
|
||||||
|
|
||||||
process_send_log(NULL, &frontend->loggers, level, facility, metadata, message, size);
|
process_send_log(NULL, &frontend->loggers, level, facility, metadata, message, size);
|
||||||
@ -5813,7 +5813,7 @@ static void syslog_io_handler(struct appctx *appctx)
|
|||||||
else if (to_skip < 0)
|
else if (to_skip < 0)
|
||||||
goto cli_abort;
|
goto cli_abort;
|
||||||
|
|
||||||
if (c == '<' || (frontend->options2 & PR_O2_ASSUME_RFC6587_NTF)) {
|
if (c == '<' || (frontend->options3 & PR_O3_ASSUME_RFC6587_NTF)) {
|
||||||
/* rfc-6587, Non-Transparent-Framing: messages separated by
|
/* rfc-6587, Non-Transparent-Framing: messages separated by
|
||||||
* a trailing LF or CR LF
|
* a trailing LF or CR LF
|
||||||
*/
|
*/
|
||||||
@ -6211,9 +6211,9 @@ int cfg_parse_log_forward(const char *file, int linenum, char **args, int kwm)
|
|||||||
/* only consider options that are frontend oriented and log oriented, such options may be set
|
/* only consider options that are frontend oriented and log oriented, such options may be set
|
||||||
* in px->options2 because px->options is already full of tcp/http oriented options
|
* in px->options2 because px->options is already full of tcp/http oriented options
|
||||||
*/
|
*/
|
||||||
if (cfg_parse_listen_match_option(file, linenum, kwm, cfg_opts2, &err_code, args,
|
if (cfg_parse_listen_match_option(file, linenum, kwm, cfg_opts3, &err_code, args,
|
||||||
PR_MODE_SYSLOG, PR_CAP_FE,
|
PR_MODE_SYSLOG, PR_CAP_FE,
|
||||||
&cfg_log_forward->options2, &cfg_log_forward->no_options2))
|
&cfg_log_forward->options3, &cfg_log_forward->no_options3))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (err_code & ERR_CODE)
|
if (err_code & ERR_CODE)
|
||||||
|
@ -131,14 +131,14 @@ const struct cfg_opt cfg_opts2[] =
|
|||||||
{"h1-case-adjust-bogus-client", PR_O2_H1_ADJ_BUGCLI, PR_CAP_FE, 0, 0 },
|
{"h1-case-adjust-bogus-client", PR_O2_H1_ADJ_BUGCLI, PR_CAP_FE, 0, 0 },
|
||||||
{"h1-case-adjust-bogus-server", PR_O2_H1_ADJ_BUGSRV, PR_CAP_BE, 0, 0 },
|
{"h1-case-adjust-bogus-server", PR_O2_H1_ADJ_BUGSRV, PR_CAP_BE, 0, 0 },
|
||||||
{"disable-h2-upgrade", PR_O2_NO_H2_UPGRADE, PR_CAP_FE, 0, PR_MODE_HTTP },
|
{"disable-h2-upgrade", PR_O2_NO_H2_UPGRADE, PR_CAP_FE, 0, PR_MODE_HTTP },
|
||||||
{"assume-rfc6587-ntf", PR_O2_ASSUME_RFC6587_NTF, PR_CAP_FE, 0, PR_MODE_SYSLOG },
|
|
||||||
{"dont-parse-log", PR_O2_DONTPARSELOG, PR_CAP_FE, 0, PR_MODE_SYSLOG },
|
|
||||||
{ NULL, 0, 0, 0 }
|
{ NULL, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* proxy->options3 */
|
/* proxy->options3 */
|
||||||
const struct cfg_opt cfg_opts3[] =
|
const struct cfg_opt cfg_opts3[] =
|
||||||
{
|
{
|
||||||
|
{"assume-rfc6587-ntf", PR_O3_ASSUME_RFC6587_NTF, PR_CAP_FE, 0, PR_MODE_SYSLOG },
|
||||||
|
{"dont-parse-log", PR_O3_DONTPARSELOG, PR_CAP_FE, 0, PR_MODE_SYSLOG },
|
||||||
{ NULL, 0, 0, 0 }
|
{ NULL, 0, 0, 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user