}
cur_arg = 2;
- while (*(args[cur_arg])) {
- struct bind_kw *kw;
- const char *best;
-
- kw = bind_find_kw(args[cur_arg]);
- if (kw) {
- char *err = NULL;
- int code;
-
- if (!kw->parse) {
- ha_alert("parsing [%s:%d] : '%s %s' : '%s' option is not implemented in this version (check build options).\n",
- file, linenum, args[0], args[1], args[cur_arg]);
- cur_arg += 1 + kw->skip ;
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
-
- code = kw->parse(args, cur_arg, curproxy, bind_conf, &err);
- err_code |= code;
-
- if (code) {
- if (err && *err) {
- indent_msg(&err, 2);
- if (((code & (ERR_WARN|ERR_ALERT)) == ERR_WARN))
- ha_warning("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], err);
- else
- ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], err);
- }
- else
- ha_alert("parsing [%s:%d] : '%s %s' : error encountered while processing '%s'.\n",
- file, linenum, args[0], args[1], args[cur_arg]);
- if (code & ERR_FATAL) {
- free(err);
- cur_arg += 1 + kw->skip;
- goto out;
- }
- }
- free(err);
- cur_arg += 1 + kw->skip;
- continue;
- }
-
- best = bind_find_best_kw(args[cur_arg]);
- if (best)
- ha_alert("parsing [%s:%d] : '%s %s' unknown keyword '%s'; did you mean '%s' maybe ?\n",
- file, linenum, args[0], args[1], args[cur_arg], best);
- else
- ha_alert("parsing [%s:%d] : '%s %s' unknown keyword '%s'.\n",
- file, linenum, args[0], args[1], args[cur_arg]);
-
- err_code |= ERR_ALERT | ERR_FATAL;
- goto out;
- }
+ err_code |= bind_parse_args_list(bind_conf, args, cur_arg, cursection, file, linenum);
goto out;
}
else if (strcmp(args[0], "monitor-net") == 0) { /* set the range of IPs to ignore */
if (strcmp(args[0], "bind") == 0 || strcmp(args[0], "default-bind") == 0) {
int cur_arg;
struct bind_conf *bind_conf;
- struct bind_kw *kw;
+ int ret;
cur_arg = 1;
cur_arg++;
}
- while (*args[cur_arg] && (kw = bind_find_kw(args[cur_arg]))) {
- int ret;
-
- ret = kw->parse(args, cur_arg, curpeers->peers_fe, bind_conf, &errmsg);
- err_code |= ret;
- if (ret) {
- if (errmsg && *errmsg) {
- indent_msg(&errmsg, 2);
- ha_alert("parsing [%s:%d] : %s\n", file, linenum, errmsg);
- }
- else
- ha_alert("parsing [%s:%d]: error encountered while processing '%s'\n",
- file, linenum, args[cur_arg]);
- if (ret & ERR_FATAL)
- goto out;
- }
- cur_arg += 1 + kw->skip;
- }
- if (*args[cur_arg] != 0) {
- const char *best = bind_find_best_kw(args[cur_arg]);
- if (best)
- ha_alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section; did you mean '%s' maybe ?\n",
- file, linenum, args[cur_arg], cursection, best);
- else
- ha_alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section.\n",
- file, linenum, args[cur_arg], cursection);
- err_code |= ERR_ALERT | ERR_FATAL;
+ ret = bind_parse_args_list(bind_conf, args, cur_arg, cursection, file, linenum);
+ err_code |= ret;
+ if (ret != 0)
goto out;
- }
}
else if (strcmp(args[0], "default-server") == 0) {
if (init_peers_frontend(file, -1, NULL, curpeers) != 0) {