int cfg_parse_log_forward(const char *file, int linenum, char **args, int kwm)
{
int err_code = ERR_NONE;
- struct proxy *px;
char *errmsg = NULL;
const char *err = NULL;
goto out;
}
- px = log_forward_by_name(args[1]);
- if (px) {
+ curproxy = log_forward_by_name(args[1]);
+ if (curproxy) {
ha_alert("Parsing [%s:%d]: log-forward section '%s' has the same name as another log-forward section declared at %s:%d.\n",
- file, linenum, args[1], px->conf.file, px->conf.line);
+ file, linenum, args[1], curproxy->conf.file, curproxy->conf.line);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- px = proxy_find_by_name(args[1], 0, 0);
- if (px) {
+ curproxy = proxy_find_by_name(args[1], 0, 0);
+ if (curproxy) {
ha_alert("Parsing [%s:%d]: log forward section '%s' has the same name as %s '%s' declared at %s:%d.\n",
- file, linenum, args[1], proxy_type_str(px),
- px->id, px->conf.file, px->conf.line);
+ file, linenum, args[1], proxy_type_str(curproxy),
+ curproxy->id, curproxy->conf.file, curproxy->conf.line);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- px = proxy_find_by_name(args[1], PR_CAP_DEF, 0);
- if (px) {
+ curproxy = proxy_find_by_name(args[1], PR_CAP_DEF, 0);
+ if (curproxy) {
/* collision with a "defaults" section */
ha_warning("Parsing [%s:%d]: log-forward section '%s' has the same name as %s '%s' declared at %s:%d."
" This is dangerous and will not be supported anymore in version 3.3.\n",
- file, linenum, args[1], proxy_type_str(px),
- px->id, px->conf.file, px->conf.line);
+ file, linenum, args[1], proxy_type_str(curproxy),
+ curproxy->id, curproxy->conf.file, curproxy->conf.line);
err_code |= ERR_WARN;
}
- px = alloc_new_proxy(args[1], PR_CAP_FE, &errmsg);
- if (!px) {
+ curproxy = alloc_new_proxy(args[1], PR_CAP_FE, &errmsg);
+ if (!curproxy) {
ha_alert("Parsing [%s:%d]: %s\n", file, linenum, errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- px->next = cfg_log_forward;
- cfg_log_forward = px;
- px->conf.file = copy_file_name(file);
- px->conf.line = linenum;
- px->mode = PR_MODE_SYSLOG;
- px->maxconn = 10;
- px->timeout.client = TICK_ETERNITY;
- px->accept = frontend_accept;
- px->default_target = &syslog_applet.obj_type;
- px->options3 |= PR_O3_LOGF_HOST_FILL;
+ curproxy->next = cfg_log_forward;
+ cfg_log_forward = curproxy;
+ curproxy->conf.file = copy_file_name(file);
+ curproxy->conf.line = linenum;
+ curproxy->mode = PR_MODE_SYSLOG;
+ curproxy->maxconn = 10;
+ curproxy->timeout.client = TICK_ETERNITY;
+ curproxy->accept = frontend_accept;
+ curproxy->default_target = &syslog_applet.obj_type;
+ curproxy->options3 |= PR_O3_LOGF_HOST_FILL;
}
else if (strcmp(args[0], "maxconn") == 0) { /* maxconn */
- if (warnifnotcap(cfg_log_forward, PR_CAP_FE, file, linenum, args[0], " Maybe you want 'fullconn' instead ?"))
+ if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], " Maybe you want 'fullconn' instead ?"))
err_code |= ERR_WARN;
if (*(args[1]) == 0) {
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- cfg_log_forward->maxconn = atol(args[1]);
+ curproxy->maxconn = atol(args[1]);
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
}
else if (strcmp(args[0], "backlog") == 0) { /* backlog */
- if (warnifnotcap(cfg_log_forward, PR_CAP_FE, file, linenum, args[0], NULL))
+ if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
err_code |= ERR_WARN;
if (*(args[1]) == 0) {
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- cfg_log_forward->backlog = atol(args[1]);
+ curproxy->backlog = atol(args[1]);
if (alertif_too_many_args(1, file, linenum, args, &err_code))
goto out;
}
cur_arg = 1;
- bind_conf = bind_conf_alloc(cfg_log_forward, file, linenum,
- NULL, xprt_get(XPRT_RAW));
+ bind_conf = bind_conf_alloc(curproxy, file, linenum,
+ NULL, xprt_get(XPRT_RAW));
if (!bind_conf) {
ha_alert("parsing [%s:%d] : out of memory error.", file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
bind_conf->maxaccept = global.tune.maxaccept ? global.tune.maxaccept : MAX_ACCEPT;
bind_conf->accept = session_accept_fd;
- if (!str2listener(args[1], cfg_log_forward, bind_conf, file, linenum, &errmsg)) {
+ if (!str2listener(args[1], curproxy, bind_conf, file, linenum, &errmsg)) {
if (errmsg) {
indent_msg(&errmsg, 2);
ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg);
cur_arg = 1;
- bind_conf = bind_conf_alloc(cfg_log_forward, file, linenum,
+ bind_conf = bind_conf_alloc(curproxy, file, linenum,
NULL, xprt_get(XPRT_RAW));
if (!bind_conf) {
ha_alert("parsing [%s:%d] : out of memory error.", file, linenum);
bind_conf->maxaccept = global.tune.maxaccept ? global.tune.maxaccept : MAX_ACCEPT;
- if (!str2receiver(args[1], cfg_log_forward, bind_conf, file, linenum, &errmsg)) {
+ if (!str2receiver(args[1], curproxy, bind_conf, file, linenum, &errmsg)) {
if (errmsg) {
indent_msg(&errmsg, 2);
ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg);
while (*args[cur_arg] && (kw = bind_find_kw(args[cur_arg]))) {
int ret;
- ret = kw->parse(args, cur_arg, cfg_log_forward, bind_conf, &errmsg);
+ ret = kw->parse(args, cur_arg, curproxy, bind_conf, &errmsg);
err_code |= ret;
if (ret) {
if (errmsg) {
}
}
else if (strcmp(args[0], "log") == 0) {
- if (!parse_logger(args, &cfg_log_forward->loggers, (kwm == KWM_NO), file, linenum, &errmsg)) {
+ if (!parse_logger(args, &curproxy->loggers, (kwm == KWM_NO), file, linenum, &errmsg)) {
ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
- cfg_log_forward->timeout.client = MS_TO_TICKS(timeout);
+ curproxy->timeout.client = MS_TO_TICKS(timeout);
}
else if (strcmp(args[0], "option") == 0) {
if (*(args[1]) == '\0') {
curproxy = cfg_log_forward;
if (cfg_parse_listen_match_option(file, linenum, kwm, cfg_opts3, &err_code, args,
PR_MODE_SYSLOG, PR_CAP_FE,
- &cfg_log_forward->options3, &cfg_log_forward->no_options3))
+ &curproxy->options3, &curproxy->no_options3))
goto out;
if (err_code & ERR_CODE)
goto out;
}
- cfg_log_forward->options3 &= ~PR_O3_LOGF_HOST;
- cfg_log_forward->no_options3 &= ~PR_O3_LOGF_HOST;
+ curproxy->options3 &= ~PR_O3_LOGF_HOST;
+ curproxy->no_options3 &= ~PR_O3_LOGF_HOST;
switch (kwm) {
case KWM_STD:
- cfg_log_forward->options3 |= value;
+ curproxy->options3 |= value;
break;
case KWM_NO:
- cfg_log_forward->no_options3 |= value;
+ curproxy->no_options3 |= value;
break;
case KWM_DEF: /* already cleared */
break;