diff --git a/include/common/cfgparse.h b/include/common/cfgparse.h index 1ce7251e8..c3355ca44 100644 --- a/include/common/cfgparse.h +++ b/include/common/cfgparse.h @@ -106,8 +106,8 @@ static inline int warnifnotcap(struct proxy *proxy, int cap, const char *file, i } if (!(proxy->cap & cap)) { - Warning("parsing [%s:%d] : '%s' ignored because %s '%s' has %s capability.%s\n", - file, line, arg, proxy_type_str(proxy), proxy->id, msg, hint ? hint : ""); + ha_warning("parsing [%s:%d] : '%s' ignored because %s '%s' has %s capability.%s\n", + file, line, arg, proxy_type_str(proxy), proxy->id, msg, hint ? hint : ""); return 1; } return 0; diff --git a/include/proto/log.h b/include/proto/log.h index ec0080911..95c17018b 100644 --- a/include/proto/log.h +++ b/include/proto/log.h @@ -86,13 +86,13 @@ int parse_logformat_string(const char *str, struct proxy *curproxy, struct list * Displays the message on stderr with the date and pid. Overrides the quiet * mode during startup. */ -void Alert(const char *fmt, ...) +void ha_alert(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); /* * Displays the message on stderr with the date and pid. */ -void Warning(const char *fmt, ...) +void ha_warning(const char *fmt, ...) __attribute__ ((format(printf, 1, 2))); /* diff --git a/src/51d.c b/src/51d.c index baeb2c277..a36333ef5 100644 --- a/src/51d.c +++ b/src/51d.c @@ -548,7 +548,7 @@ static int init_51degrees(void) return 0; if (global.nbthread > 1) { - Alert("51Degrees: multithreading is not supported for now.\n"); + ha_alert("51Degrees: multithreading is not supported for now.\n"); return (ERR_FATAL | ERR_ALERT); } @@ -616,9 +616,9 @@ static int init_51degrees(void) } if (_51d_dataset_status != DATA_SET_INIT_STATUS_SUCCESS) { if (temp->len) - Alert("51Degrees Setup - Error reading 51Degrees data file. %s\n", temp->str); + ha_alert("51Degrees Setup - Error reading 51Degrees data file. %s\n", temp->str); else - Alert("51Degrees Setup - Error reading 51Degrees data file.\n"); + ha_alert("51Degrees Setup - Error reading 51Degrees data file.\n"); return ERR_ALERT | ERR_FATAL; } free(_51d_property_list); diff --git a/src/acl.c b/src/acl.c index bc1f2e215..f19b2d201 100644 --- a/src/acl.c +++ b/src/acl.c @@ -422,13 +422,13 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list * /* Additional check to protect against common mistakes */ if (expr->pat.parse && cur_type != SMP_T_BOOL && !*args[1]) { - Warning("parsing acl keyword '%s' :\n" - " no pattern to match against were provided, so this ACL will never match.\n" - " If this is what you intended, please add '--' to get rid of this warning.\n" - " If you intended to match only for existence, please use '-m found'.\n" - " If you wanted to force an int to match as a bool, please use '-m bool'.\n" - "\n", - args[0]); + ha_warning("parsing acl keyword '%s' :\n" + " no pattern to match against were provided, so this ACL will never match.\n" + " If this is what you intended, please add '--' to get rid of this warning.\n" + " If you intended to match only for existence, please use '-m found'.\n" + " If you wanted to force an int to match as a bool, please use '-m bool'.\n" + "\n", + args[0]); } args++; @@ -733,12 +733,12 @@ struct acl *parse_acl(const char **args, struct list *known_acl, char **err, str * emit a warning, so let's do so. */ if (!strchr(args[1], '(') && *args[2] == '(') - Warning("parsing acl '%s' :\n" - " matching '%s' for pattern '%s' is likely a mistake and probably\n" - " not what you want. Maybe you need to remove the extraneous space before '('.\n" - " If you are really sure this is not an error, please insert '--' between the\n" - " match and the pattern to make this warning message disappear.\n", - args[0], args[1], args[2]); + ha_warning("parsing acl '%s' :\n" + " matching '%s' for pattern '%s' is likely a mistake and probably\n" + " not what you want. Maybe you need to remove the extraneous space before '('.\n" + " If you are really sure this is not an error, please insert '--' between the\n" + " match and the pattern to make this warning message disappear.\n", + args[0], args[1], args[2]); if (*args[0]) cur_acl = find_acl_by_name(args[0], known_acl); @@ -1271,15 +1271,15 @@ int acl_find_targets(struct proxy *p) * by smp_resolve_args(). */ if (expr->smp->arg_p->unresolved) { - Alert("Internal bug in proxy %s: %sacl %s %s() makes use of unresolved userlist '%s'. Please report this.\n", - p->id, *acl->name ? "" : "anonymous ", acl->name, expr->kw, expr->smp->arg_p->data.str.str); + ha_alert("Internal bug in proxy %s: %sacl %s %s() makes use of unresolved userlist '%s'. Please report this.\n", + p->id, *acl->name ? "" : "anonymous ", acl->name, expr->kw, expr->smp->arg_p->data.str.str); cfgerr++; continue; } if (LIST_ISEMPTY(&expr->pat.head)) { - Alert("proxy %s: acl %s %s(): no groups specified.\n", - p->id, acl->name, expr->kw); + ha_alert("proxy %s: acl %s %s(): no groups specified.\n", + p->id, acl->name, expr->kw); cfgerr++; continue; } @@ -1287,8 +1287,8 @@ int acl_find_targets(struct proxy *p) /* For each pattern, check if the group exists. */ list_for_each_entry(pexp, &expr->pat.head, list) { if (LIST_ISEMPTY(&pexp->expr->patterns)) { - Alert("proxy %s: acl %s %s(): no groups specified.\n", - p->id, acl->name, expr->kw); + ha_alert("proxy %s: acl %s %s(): no groups specified.\n", + p->id, acl->name, expr->kw); cfgerr++; continue; } @@ -1296,8 +1296,8 @@ int acl_find_targets(struct proxy *p) list_for_each_entry(pattern, &pexp->expr->patterns, list) { /* this keyword only has one argument */ if (!check_group(expr->smp->arg_p->data.usr, pattern->pat.ptr.str)) { - Alert("proxy %s: acl %s %s(): invalid group '%s'.\n", - p->id, acl->name, expr->kw, pattern->pat.ptr.str); + ha_alert("proxy %s: acl %s %s(): invalid group '%s'.\n", + p->id, acl->name, expr->kw, pattern->pat.ptr.str); cfgerr++; } } @@ -1328,8 +1328,8 @@ int init_acl() smp = find_sample_fetch(name, strlen(name)); if (!smp) { - Alert("Critical internal error: ACL keyword '%s' relies on sample fetch '%s' which was not registered!\n", - kwl->kw[index].kw, name); + ha_alert("Critical internal error: ACL keyword '%s' relies on sample fetch '%s' which was not registered!\n", + kwl->kw[index].kw, name); err++; continue; } diff --git a/src/auth.c b/src/auth.c index b0418892e..a2c689f76 100644 --- a/src/auth.c +++ b/src/auth.c @@ -133,8 +133,8 @@ int userlist_postinit() } if (!ag) { - Alert("userlist '%s': no such group '%s' specified in user '%s'\n", - curuserlist->name, group, curuser->user); + ha_alert("userlist '%s': no such group '%s' specified in user '%s'\n", + curuserlist->name, group, curuser->user); free(groups); return ERR_ALERT | ERR_FATAL; } @@ -142,8 +142,8 @@ int userlist_postinit() /* Add this group at the group userlist. */ grl = calloc(1, sizeof(*grl)); if (!grl) { - Alert("userlist '%s': no more memory when trying to allocate the user groups.\n", - curuserlist->name); + ha_alert("userlist '%s': no more memory when trying to allocate the user groups.\n", + curuserlist->name); free(groups); return ERR_ALERT | ERR_FATAL; } @@ -170,16 +170,16 @@ int userlist_postinit() } if (!curuser) { - Alert("userlist '%s': no such user '%s' specified in group '%s'\n", - curuserlist->name, user, ag->name); + ha_alert("userlist '%s': no such user '%s' specified in group '%s'\n", + curuserlist->name, user, ag->name); return ERR_ALERT | ERR_FATAL; } /* Add this group at the group userlist. */ grl = calloc(1, sizeof(*grl)); if (!grl) { - Alert("userlist '%s': no more memory when trying to allocate the user groups.\n", - curuserlist->name); + ha_alert("userlist '%s': no more memory when trying to allocate the user groups.\n", + curuserlist->name); return ERR_ALERT | ERR_FATAL; } diff --git a/src/backend.c b/src/backend.c index 4231c3470..2b6167dc2 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1359,7 +1359,7 @@ void set_backend_down(struct proxy *be) HA_ATOMIC_ADD(&be->down_trans, 1); if (!(global.mode & MODE_STARTING)) { - Alert("%s '%s' has no server available!\n", proxy_type_str(be), be->id); + ha_alert("%s '%s' has no server available!\n", proxy_type_str(be), be->id); send_log(be, LOG_EMERG, "%s %s has no server available!\n", proxy_type_str(be), be->id); } } diff --git a/src/cache.c b/src/cache.c index 7ae3267e5..97861d761 100644 --- a/src/cache.c +++ b/src/cache.c @@ -609,15 +609,15 @@ enum act_parse_ret parse_cache_store(const char **args, int *orig_arg, struct pr rule->arg.act.p[0] = strdup(args[cur_arg]); if (!rule->arg.act.p[0]) { - Alert("config: %s '%s': out of memory\n", proxy_type_str(proxy), proxy->id); + ha_alert("config: %s '%s': out of memory\n", proxy_type_str(proxy), proxy->id); err++; goto err; } /* register a filter to fill the cache buffer */ fconf = calloc(1, sizeof(*fconf)); if (!fconf) { - Alert("config: %s '%s': out of memory\n", - proxy_type_str(proxy), proxy->id); + ha_alert("config: %s '%s': out of memory\n", + proxy_type_str(proxy), proxy->id); err++; goto err; } @@ -718,7 +718,7 @@ enum act_parse_ret parse_cache_use(const char **args, int *orig_arg, struct prox rule->arg.act.p[0] = strdup(args[cur_arg]); if (!rule->arg.act.p[0]) { - Alert("config: %s '%s': out of memory\n", proxy_type_str(proxy), proxy->id); + ha_alert("config: %s '%s': out of memory\n", proxy_type_str(proxy), proxy->id); err++; goto err; } @@ -738,8 +738,8 @@ int cfg_parse_cache(const char *file, int linenum, char **args, int kwm) if (strcmp(args[0], "cache") == 0) { /* new cache section */ if (!*args[1]) { - Alert("parsing [%s:%d] : '%s' expects an argument\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an argument\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -752,15 +752,15 @@ int cfg_parse_cache(const char *file, int linenum, char **args, int kwm) if (tmp_cache_config == NULL) { tmp_cache_config = calloc(1, sizeof(*tmp_cache_config)); if (!tmp_cache_config) { - Alert("parsing [%s:%d]: out of memory.\n", file, linenum); + ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum); err_code |= ERR_ALERT | ERR_ABORT; goto out; } strlcpy2(tmp_cache_config->id, args[1], 33); if (strlen(args[1]) > 32) { - Warning("parsing [%s:%d]: cache id is limited to 32 characters, truncate to '%s'.\n", - file, linenum, tmp_cache_config->id); + ha_warning("parsing [%s:%d]: cache id is limited to 32 characters, truncate to '%s'.\n", + file, linenum, tmp_cache_config->id); err_code |= ERR_WARN; } @@ -779,7 +779,7 @@ int cfg_parse_cache(const char *file, int linenum, char **args, int kwm) tmp_cache_config->maxblocks = maxsize; } else if (*args[0] != 0) { - Alert("parsing [%s:%d] : unknown keyword '%s' in 'cache' section\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : unknown keyword '%s' in 'cache' section\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -799,7 +799,7 @@ int cfg_post_parse_section_cache() struct cache *cache; if (tmp_cache_config->maxblocks <= 0) { - Alert("Size not specified for cache '%s'\n", tmp_cache_config->id); + ha_alert("Size not specified for cache '%s'\n", tmp_cache_config->id); err_code |= ERR_FATAL | ERR_ALERT; goto out; } @@ -808,9 +808,9 @@ int cfg_post_parse_section_cache() if (ret_shctx < 0) { if (ret_shctx == SHCTX_E_INIT_LOCK) - Alert("Unable to initialize the lock for the cache.\n"); + ha_alert("Unable to initialize the lock for the cache.\n"); else - Alert("Unable to allocate cache.\n"); + ha_alert("Unable to allocate cache.\n"); err_code |= ERR_FATAL | ERR_ALERT; goto out; @@ -859,8 +859,8 @@ int cfg_cache_postparser() } if (cache_ptr == hresrule->arg.act.p[0]) { - Alert("Proxy '%s': unable to find the cache '%s' referenced by http-response cache-store rule.\n", - curproxy->id, (char *)hresrule->arg.act.p[0]); + ha_alert("Proxy '%s': unable to find the cache '%s' referenced by http-response cache-store rule.\n", + curproxy->id, (char *)hresrule->arg.act.p[0]); err++; } @@ -884,8 +884,8 @@ int cfg_cache_postparser() } if (cache_ptr == hrqrule->arg.act.p[0]) { - Alert("Proxy '%s': unable to find the cache '%s' referenced by http-request cache-use rule.\n", - curproxy->id, (char *)hrqrule->arg.act.p[0]); + ha_alert("Proxy '%s': unable to find the cache '%s' referenced by http-request cache-use rule.\n", + curproxy->id, (char *)hrqrule->arg.act.p[0]); err++; } @@ -910,8 +910,8 @@ int cfg_cache_postparser() } if (cache_ptr == fconf->conf) { - Alert("Proxy '%s': unable to find the cache '%s' referenced by the filter 'cache'.\n", - curproxy->id, (char *)fconf->conf); + ha_alert("Proxy '%s': unable to find the cache '%s' referenced by the filter 'cache'.\n", + curproxy->id, (char *)fconf->conf); err++; } fconf->conf = cache_ptr; diff --git a/src/cfgparse.c b/src/cfgparse.c index 1a75686cb..685fbe9b0 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -366,7 +366,7 @@ int alertif_too_many_args_idx(int maxarg, int index, const char *file, int linen memprintf(&kw, "%s %s", kw, args[i]); } - Alert("parsing [%s:%d] : '%s' cannot handle unexpected argument '%s'.\n", file, linenum, kw, args[index + maxarg + 1]); + ha_alert("parsing [%s:%d] : '%s' cannot handle unexpected argument '%s'.\n", file, linenum, kw, args[index + maxarg + 1]); free(kw); *err_code |= ERR_ALERT | ERR_FATAL; return 1; @@ -386,8 +386,8 @@ int alertif_too_many_args(int maxarg, const char *file, int linenum, char **args int warnif_rule_after_tcp_sess(struct proxy *proxy, const char *file, int line, const char *arg) { if (!LIST_ISEMPTY(&proxy->tcp_req.l5_rules)) { - Warning("parsing [%s:%d] : a '%s' rule placed after a 'tcp-request session' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'tcp-request session' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -399,8 +399,8 @@ int warnif_rule_after_tcp_sess(struct proxy *proxy, const char *file, int line, int warnif_rule_after_tcp_cont(struct proxy *proxy, const char *file, int line, const char *arg) { if (!LIST_ISEMPTY(&proxy->tcp_req.inspect_rules)) { - Warning("parsing [%s:%d] : a '%s' rule placed after a 'tcp-request content' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'tcp-request content' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -412,8 +412,8 @@ int warnif_rule_after_tcp_cont(struct proxy *proxy, const char *file, int line, int warnif_rule_after_block(struct proxy *proxy, const char *file, int line, const char *arg) { if (!LIST_ISEMPTY(&proxy->block_rules)) { - Warning("parsing [%s:%d] : a '%s' rule placed after a 'block' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'block' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -425,8 +425,8 @@ int warnif_rule_after_block(struct proxy *proxy, const char *file, int line, con int warnif_rule_after_http_req(struct proxy *proxy, const char *file, int line, const char *arg) { if (!LIST_ISEMPTY(&proxy->http_req_rules)) { - Warning("parsing [%s:%d] : a '%s' rule placed after an 'http-request' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after an 'http-request' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -438,8 +438,8 @@ int warnif_rule_after_http_req(struct proxy *proxy, const char *file, int line, int warnif_rule_after_reqxxx(struct proxy *proxy, const char *file, int line, const char *arg) { if (proxy->req_exp) { - Warning("parsing [%s:%d] : a '%s' rule placed after a 'reqxxx' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'reqxxx' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -451,8 +451,8 @@ int warnif_rule_after_reqxxx(struct proxy *proxy, const char *file, int line, co int warnif_rule_after_reqadd(struct proxy *proxy, const char *file, int line, const char *arg) { if (!LIST_ISEMPTY(&proxy->req_add)) { - Warning("parsing [%s:%d] : a '%s' rule placed after a 'reqadd' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'reqadd' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -464,8 +464,8 @@ int warnif_rule_after_reqadd(struct proxy *proxy, const char *file, int line, co int warnif_rule_after_redirect(struct proxy *proxy, const char *file, int line, const char *arg) { if (!LIST_ISEMPTY(&proxy->redirect_rules)) { - Warning("parsing [%s:%d] : a '%s' rule placed after a 'redirect' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'redirect' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -477,8 +477,8 @@ int warnif_rule_after_redirect(struct proxy *proxy, const char *file, int line, int warnif_rule_after_use_backend(struct proxy *proxy, const char *file, int line, const char *arg) { if (!LIST_ISEMPTY(&proxy->switching_rules)) { - Warning("parsing [%s:%d] : a '%s' rule placed after a 'use_backend' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'use_backend' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -490,8 +490,8 @@ int warnif_rule_after_use_backend(struct proxy *proxy, const char *file, int lin int warnif_rule_after_use_server(struct proxy *proxy, const char *file, int line, const char *arg) { if (!LIST_ISEMPTY(&proxy->server_rules)) { - Warning("parsing [%s:%d] : a '%s' rule placed after a 'use-server' rule will still be processed before.\n", - file, line, arg); + ha_warning("parsing [%s:%d] : a '%s' rule placed after a 'use-server' rule will still be processed before.\n", + file, line, arg); return 1; } return 0; @@ -569,22 +569,22 @@ static int warnif_cond_conflicts(const struct acl_cond *cond, unsigned int where acl = acl_cond_conflicts(cond, where); if (acl) { if (acl->name && *acl->name) - Warning("parsing [%s:%d] : acl '%s' will never match because it only involves keywords that are incompatible with '%s'\n", - file, line, acl->name, sample_ckp_names(where)); + ha_warning("parsing [%s:%d] : acl '%s' will never match because it only involves keywords that are incompatible with '%s'\n", + file, line, acl->name, sample_ckp_names(where)); else - Warning("parsing [%s:%d] : anonymous acl will never match because it uses keyword '%s' which is incompatible with '%s'\n", - file, line, LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw, sample_ckp_names(where)); + ha_warning("parsing [%s:%d] : anonymous acl will never match because it uses keyword '%s' which is incompatible with '%s'\n", + file, line, LIST_ELEM(acl->expr.n, struct acl_expr *, list)->kw, sample_ckp_names(where)); return ERR_WARN; } if (!acl_cond_kw_conflicts(cond, where, &acl, &kw)) return 0; if (acl->name && *acl->name) - Warning("parsing [%s:%d] : acl '%s' involves keywords '%s' which is incompatible with '%s'\n", - file, line, acl->name, kw, sample_ckp_names(where)); + ha_warning("parsing [%s:%d] : acl '%s' involves keywords '%s' which is incompatible with '%s'\n", + file, line, acl->name, kw, sample_ckp_names(where)); else - Warning("parsing [%s:%d] : anonymous acl involves keyword '%s' which is incompatible with '%s'\n", - file, line, kw, sample_ckp_names(where)); + ha_warning("parsing [%s:%d] : anonymous acl involves keyword '%s' which is incompatible with '%s'\n", + file, line, kw, sample_ckp_names(where)); return ERR_WARN; } @@ -719,7 +719,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (!strcmp(args[1], "exit-on-failure")) { global.tune.options |= GTUNE_EXIT_ONFAILURE; } else { - Alert("parsing [%s:%d] : '%s' only supports 'exit-on-failure' option.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' only supports 'exit-on-failure' option.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -770,12 +770,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.tune.maxpollevents != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -785,12 +785,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.tune.maxaccept != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -800,7 +800,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -810,7 +810,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -820,7 +820,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -836,7 +836,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -850,13 +850,13 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } global.tune.bufsize = atol(args[1]); if (global.tune.bufsize <= 0) { - Alert("parsing [%s:%d] : '%s' expects a positive integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a positive integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -865,13 +865,13 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } global.tune.maxrewrite = atol(args[1]); if (global.tune.maxrewrite < 0) { - Alert("parsing [%s:%d] : '%s' expects a positive integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a positive integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -883,21 +883,21 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects a timer value between 0 and 65535 ms.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a timer value between 0 and 65535 ms.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } res = parse_time_err(args[1], &idle, TIME_UNIT_MS); if (res) { - Alert("parsing [%s:%d]: unexpected character '%c' in argument to <%s>.\n", + ha_alert("parsing [%s:%d]: unexpected character '%c' in argument to <%s>.\n", file, linenum, *res, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if (idle > 65535) { - Alert("parsing [%s:%d] : '%s' expects a timer value between 0 and 65535 ms.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a timer value between 0 and 65535 ms.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -907,12 +907,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.tune.client_rcvbuf != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -922,12 +922,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.tune.server_rcvbuf != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -937,12 +937,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.tune.client_sndbuf != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -952,12 +952,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.tune.server_sndbuf != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -967,7 +967,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -977,7 +977,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -987,7 +987,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -997,14 +997,14 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } global.tune.max_http_hdr = atoi(args[1]); if (global.tune.max_http_hdr < 1 || global.tune.max_http_hdr > 32767) { - Alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 32767\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 32767\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1015,14 +1015,14 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (*args[1]) { global.tune.comp_maxlevel = atoi(args[1]); if (global.tune.comp_maxlevel < 1 || global.tune.comp_maxlevel > 9) { - Alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 9\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 9\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } } else { - Alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 9\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a numeric value between 1 and 9\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1031,14 +1031,14 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (*args[1]) { global.tune.pattern_cache = atoi(args[1]); if (global.tune.pattern_cache < 0) { - Alert("parsing [%s:%d] : '%s' expects a positive numeric value\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a positive numeric value\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } } else { - Alert("parsing [%s:%d] : '%s' expects a positive numeric value\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a positive numeric value\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1047,17 +1047,17 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.uid != 0) { - Alert("parsing [%s:%d] : user/uid already specified. Continuing.\n", file, linenum); + ha_alert("parsing [%s:%d] : user/uid already specified. Continuing.\n", file, linenum); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if (strl2irc(args[1], strlen(args[1]), &global.uid) != 0) { - Warning("parsing [%s:%d] : uid: string '%s' is not a number.\n | You might want to use the 'user' parameter to use a system user name.\n", file, linenum, args[1]); + ha_warning("parsing [%s:%d] : uid: string '%s' is not a number.\n | You might want to use the 'user' parameter to use a system user name.\n", file, linenum, args[1]); err_code |= ERR_WARN; goto out; } @@ -1067,17 +1067,17 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.gid != 0) { - Alert("parsing [%s:%d] : group/gid already specified. Continuing.\n", file, linenum); + ha_alert("parsing [%s:%d] : group/gid already specified. Continuing.\n", file, linenum); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if (strl2irc(args[1], strlen(args[1]), &global.gid) != 0) { - Warning("parsing [%s:%d] : gid: string '%s' is not a number.\n | You might want to use the 'group' parameter to use a system group name.\n", file, linenum, args[1]); + ha_warning("parsing [%s:%d] : gid: string '%s' is not a number.\n | You might want to use the 'group' parameter to use a system group name.\n", file, linenum, args[1]); err_code |= ERR_WARN; goto out; } @@ -1093,7 +1093,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.uid != 0) { - Alert("parsing [%s:%d] : user/uid already specified. Continuing.\n", file, linenum); + ha_alert("parsing [%s:%d] : user/uid already specified. Continuing.\n", file, linenum); err_code |= ERR_ALERT; goto out; } @@ -1103,7 +1103,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) global.uid = (int)ha_user->pw_uid; } else { - Alert("parsing [%s:%d] : cannot find user id for '%s' (%d:%s)\n", file, linenum, args[1], errno, strerror(errno)); + ha_alert("parsing [%s:%d] : cannot find user id for '%s' (%d:%s)\n", file, linenum, args[1], errno, strerror(errno)); err_code |= ERR_ALERT | ERR_FATAL; } } @@ -1112,7 +1112,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.gid != 0) { - Alert("parsing [%s:%d] : gid/group was already specified. Continuing.\n", file, linenum); + ha_alert("parsing [%s:%d] : gid/group was already specified. Continuing.\n", file, linenum); err_code |= ERR_ALERT; goto out; } @@ -1122,7 +1122,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) global.gid = (int)ha_group->gr_gid; } else { - Alert("parsing [%s:%d] : cannot find group id for '%s' (%d:%s)\n", file, linenum, args[1], errno, strerror(errno)); + ha_alert("parsing [%s:%d] : cannot find group id for '%s' (%d:%s)\n", file, linenum, args[1], errno, strerror(errno)); err_code |= ERR_ALERT | ERR_FATAL; } } @@ -1131,14 +1131,14 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } global.nbproc = atol(args[1]); if (global.nbproc < 1 || global.nbproc > LONGBITS) { - Alert("parsing [%s:%d] : '%s' must be between 1 and %d (was %d).\n", - file, linenum, args[0], LONGBITS, global.nbproc); + ha_alert("parsing [%s:%d] : '%s' must be between 1 and %d (was %d).\n", + file, linenum, args[0], LONGBITS, global.nbproc); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1147,20 +1147,20 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } global.nbthread = atol(args[1]); if (global.nbthread < 1 || global.nbthread > LONGBITS) { - Alert("parsing [%s:%d] : '%s' must be between 1 and %d (was %d).\n", - file, linenum, args[0], LONGBITS, global.nbthread); + ha_alert("parsing [%s:%d] : '%s' must be between 1 and %d (was %d).\n", + file, linenum, args[0], LONGBITS, global.nbthread); err_code |= ERR_ALERT | ERR_FATAL; goto out; } #ifndef USE_THREAD if (global.nbthread > 1) { - Alert("HAProxy is not compiled with threads support, please check build options for USE_THREAD.\n"); + ha_alert("HAProxy is not compiled with threads support, please check build options for USE_THREAD.\n"); global.nbthread = 1; err_code |= ERR_ALERT | ERR_FATAL; goto out; @@ -1171,19 +1171,19 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.maxconn != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } global.maxconn = atol(args[1]); #ifdef SYSTEM_MAXCONN if (global.maxconn > DEFAULT_MAXCONN && cfg_maxconn <= DEFAULT_MAXCONN) { - Alert("parsing [%s:%d] : maxconn value %d too high for this system.\nLimiting to %d. Please use '-n' to force the value.\n", file, linenum, global.maxconn, DEFAULT_MAXCONN); + ha_alert("parsing [%s:%d] : maxconn value %d too high for this system.\nLimiting to %d. Please use '-n' to force the value.\n", file, linenum, global.maxconn, DEFAULT_MAXCONN); global.maxconn = DEFAULT_MAXCONN; err_code |= ERR_ALERT; } @@ -1193,7 +1193,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1202,7 +1202,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) else if (strcmp(args[1],"required") == 0) global.ssl_server_verify = SSL_SERVER_VERIFY_REQUIRED; else { - Alert("parsing [%s:%d] : '%s' expects 'none' or 'required' as argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects 'none' or 'required' as argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1211,12 +1211,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.cps_lim != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1226,12 +1226,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.sps_lim != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1241,12 +1241,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.ssl_lim != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1256,7 +1256,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument in kb/s.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument in kb/s.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1266,12 +1266,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.maxpipes != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1281,7 +1281,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1291,13 +1291,13 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument between 0 and 100.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument between 0 and 100.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } compress_min_idle = 100 - atoi(args[1]); if (compress_min_idle > 100) { - Alert("parsing [%s:%d] : '%s' expects an integer argument between 0 and 100.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument between 0 and 100.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1307,12 +1307,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.rlimit_nofile != 0) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1322,12 +1322,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.chroot != NULL) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects a directory as an argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a directory as an argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1338,8 +1338,8 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) char *d; if (!*args[1]) { - Alert("parsing [%s:%d]: '%s' expects a string argument.\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d]: '%s' expects a string argument.\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1371,9 +1371,9 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) } if (!i || args[1][i]) { - Alert("parsing [%s:%d]: '%s' requires valid node name - non-empty string" - " with digits(0-9), letters(A-Z, a-z), dot(.), hyphen(-) or underscode(_).\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d]: '%s' requires valid node name - non-empty string" + " with digits(0-9), letters(A-Z, a-z), dot(.), hyphen(-) or underscode(_).\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1387,12 +1387,12 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.pidfile != NULL) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects a file name as an argument.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a file name as an argument.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1403,14 +1403,14 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) while (*(args[cur_arg])) { if (!strcmp(args[cur_arg], "prefix")) { if (global.unix_bind.prefix != NULL) { - Alert("parsing [%s:%d] : unix-bind '%s' already specified. Continuing.\n", file, linenum, args[cur_arg]); + ha_alert("parsing [%s:%d] : unix-bind '%s' already specified. Continuing.\n", file, linenum, args[cur_arg]); err_code |= ERR_ALERT; cur_arg += 2; continue; } if (*(args[cur_arg+1]) == 0) { - Alert("parsing [%s:%d] : unix_bind '%s' expects a path as an argument.\n", file, linenum, args[cur_arg]); + ha_alert("parsing [%s:%d] : unix_bind '%s' expects a path as an argument.\n", file, linenum, args[cur_arg]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1445,8 +1445,8 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) user = getpwnam(args[cur_arg + 1]); if (!user) { - Alert("parsing [%s:%d] : '%s' : '%s' unknown user.\n", - file, linenum, args[0], args[cur_arg + 1 ]); + ha_alert("parsing [%s:%d] : '%s' : '%s' unknown user.\n", + file, linenum, args[0], args[cur_arg + 1 ]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1461,8 +1461,8 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) group = getgrnam(args[cur_arg + 1]); if (!group) { - Alert("parsing [%s:%d] : '%s' : '%s' unknown group.\n", - file, linenum, args[0], args[cur_arg + 1 ]); + ha_alert("parsing [%s:%d] : '%s' : '%s' unknown group.\n", + file, linenum, args[0], args[cur_arg + 1 ]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1472,8 +1472,8 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) continue; } - Alert("parsing [%s:%d] : '%s' only supports the 'prefix', 'mode', 'uid', 'gid', 'user' and 'group' options.\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' only supports the 'prefix', 'mode', 'uid', 'gid', 'user' and 'group' options.\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1484,7 +1484,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) struct logsrv *tmp; if (*(args[1]) != 0) { - Alert("parsing [%s:%d]:%s : 'no log' does not expect arguments.\n", file, linenum, args[1]); + ha_alert("parsing [%s:%d]:%s : 'no log' does not expect arguments.\n", file, linenum, args[1]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1505,7 +1505,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) goto out; if (*(args[1]) == 0 || *(args[2]) == 0) { - Alert("parsing [%s:%d] : '%s' expects
and as arguments.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects
and as arguments.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1516,8 +1516,8 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (strcmp(args[arg+2], "len") == 0) { len = atoi(args[arg+3]); if (len < 80 || len > 65535) { - Alert("parsing [%s:%d] : invalid log length '%s', must be between 80 and 65535.\n", - file, linenum, args[arg+3]); + ha_alert("parsing [%s:%d] : invalid log length '%s', must be between 80 and 65535.\n", + file, linenum, args[arg+3]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1536,7 +1536,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (strcmp(args[arg+2], "format") == 0) { logsrv->format = get_log_format(args[arg+3]); if (logsrv->format < 0) { - Alert("parsing [%s:%d] : unknown log format '%s'\n", file, linenum, args[arg+3]); + ha_alert("parsing [%s:%d] : unknown log format '%s'\n", file, linenum, args[arg+3]); err_code |= ERR_ALERT | ERR_FATAL; free(logsrv); goto out; @@ -1553,7 +1553,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) logsrv->facility = get_log_facility(args[arg+2]); if (logsrv->facility < 0) { - Alert("parsing [%s:%d] : unknown log facility '%s'\n", file, linenum, args[arg+2]); + ha_alert("parsing [%s:%d] : unknown log facility '%s'\n", file, linenum, args[arg+2]); err_code |= ERR_ALERT | ERR_FATAL; logsrv->facility = 0; } @@ -1562,7 +1562,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (*(args[arg+3])) { logsrv->level = get_log_level(args[arg+3]); if (logsrv->level < 0) { - Alert("parsing [%s:%d] : unknown optional log level '%s'\n", file, linenum, args[arg+3]); + ha_alert("parsing [%s:%d] : unknown optional log level '%s'\n", file, linenum, args[arg+3]); err_code |= ERR_ALERT | ERR_FATAL; logsrv->level = 0; } @@ -1572,7 +1572,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (*(args[arg+4])) { logsrv->minlvl = get_log_level(args[arg+4]); if (logsrv->minlvl < 0) { - Alert("parsing [%s:%d] : unknown optional minimum log level '%s'\n", file, linenum, args[arg+4]); + ha_alert("parsing [%s:%d] : unknown optional minimum log level '%s'\n", file, linenum, args[arg+4]); err_code |= ERR_ALERT | ERR_FATAL; logsrv->minlvl = 0; } @@ -1580,7 +1580,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) sk = str2sa_range(args[1], NULL, &port1, &port2, &errmsg, NULL, NULL, 1); if (!sk) { - Alert("parsing [%s:%d] : '%s': %s\n", file, linenum, args[0], errmsg); + ha_alert("parsing [%s:%d] : '%s': %s\n", file, linenum, args[0], errmsg); err_code |= ERR_ALERT | ERR_FATAL; free(logsrv); goto out; @@ -1589,8 +1589,8 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (sk->ss_family == AF_INET || sk->ss_family == AF_INET6) { if (port1 != port2) { - Alert("parsing [%s:%d] : '%s' : port ranges and offsets are not allowed in '%s'\n", - file, linenum, args[0], args[1]); + ha_alert("parsing [%s:%d] : '%s' : port ranges and offsets are not allowed in '%s'\n", + file, linenum, args[0], args[1]); err_code |= ERR_ALERT | ERR_FATAL; free(logsrv); goto out; @@ -1607,7 +1607,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) char *name; if (global.log_send_hostname != NULL) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } @@ -1622,13 +1622,13 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) } else if (!strcmp(args[0], "server-state-base")) { /* path base where HAProxy can find server state files */ if (global.server_state_base != NULL) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (!*(args[1])) { - Alert("parsing [%s:%d] : '%s' expects one argument: a directory path.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects one argument: a directory path.\n", file, linenum, args[0]); err_code |= ERR_FATAL; goto out; } @@ -1637,13 +1637,13 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) } else if (!strcmp(args[0], "server-state-file")) { /* path to the file where HAProxy can load the server states */ if (global.server_state_file != NULL) { - Alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' already specified. Continuing.\n", file, linenum, args[0]); err_code |= ERR_ALERT; goto out; } if (!*(args[1])) { - Alert("parsing [%s:%d] : '%s' expect one argument: a file path.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expect one argument: a file path.\n", file, linenum, args[0]); err_code |= ERR_FATAL; goto out; } @@ -1654,7 +1654,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d] : '%s' expects a tag for use in syslog.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects a tag for use in syslog.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1665,18 +1665,18 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (global.spread_checks != 0) { - Alert("parsing [%s:%d]: spread-checks already specified. Continuing.\n", file, linenum); + ha_alert("parsing [%s:%d]: spread-checks already specified. Continuing.\n", file, linenum); err_code |= ERR_ALERT; goto out; } if (*(args[1]) == 0) { - Alert("parsing [%s:%d]: '%s' expects an integer argument (0..50).\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d]: '%s' expects an integer argument (0..50).\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } global.spread_checks = atol(args[1]); if (global.spread_checks < 0 || global.spread_checks > 50) { - Alert("parsing [%s:%d]: 'spread-checks' needs a positive value in range 0..50.\n", file, linenum); + ha_alert("parsing [%s:%d]: 'spread-checks' needs a positive value in range 0..50.\n", file, linenum); err_code |= ERR_ALERT | ERR_FATAL; } } @@ -1687,19 +1687,19 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (alertif_too_many_args(1, file, linenum, args, &err_code)) goto out; if (*(args[1]) == 0) { - Alert("parsing [%s:%d]: '%s' expects an integer argument (0..50).\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d]: '%s' expects an integer argument (0..50).\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } err = parse_time_err(args[1], &val, TIME_UNIT_MS); if (err) { - Alert("parsing [%s:%d]: unsupported character '%c' in '%s' (wants an integer delay).\n", file, linenum, *err, args[0]); + ha_alert("parsing [%s:%d]: unsupported character '%c' in '%s' (wants an integer delay).\n", file, linenum, *err, args[0]); err_code |= ERR_ALERT | ERR_FATAL; } global.max_spread_checks = val; if (global.max_spread_checks < 0) { - Alert("parsing [%s:%d]: '%s' needs a positive delay in milliseconds.\n",file, linenum, args[0]); + ha_alert("parsing [%s:%d]: '%s' needs a positive delay in milliseconds.\n",file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; } } @@ -1711,10 +1711,10 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) int i, j, n, autoinc; if (!*args[1] || !*args[2]) { - Alert("parsing [%s:%d] : %s expects a process number " - " ('all', 'odd', 'even', a number from 1 to %d or a range), " - " followed by a list of CPU ranges with numbers from 0 to %d.\n", - file, linenum, args[0], LONGBITS, LONGBITS - 1); + ha_alert("parsing [%s:%d] : %s expects a process number " + " ('all', 'odd', 'even', a number from 1 to %d or a range), " + " followed by a list of CPU ranges with numbers from 0 to %d.\n", + file, linenum, args[0], LONGBITS, LONGBITS - 1); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1723,30 +1723,30 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) *slash = 0; if (parse_process_number(args[1], &proc, &autoinc, &errmsg)) { - Alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg); + ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if (slash) { if (parse_process_number(slash+1, &thread, NULL, &errmsg)) { - Alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg); + ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg); err_code |= ERR_ALERT | ERR_FATAL; goto out; } *slash = '/'; if (autoinc && my_popcountl(proc) != 1 && my_popcountl(thread) != 1) { - Alert("parsing [%s:%d] : %s : '%s' : unable to automatically bind " - "a process range _AND_ a thread range\n", - file, linenum, args[0], args[1]); + ha_alert("parsing [%s:%d] : %s : '%s' : unable to automatically bind " + "a process range _AND_ a thread range\n", + file, linenum, args[0], args[1]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } } if (parse_cpu_set((const char **)args+2, &cpus, &errmsg)) { - Alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg); + ha_alert("parsing [%s:%d] : %s : %s\n", file, linenum, args[0], errmsg); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1754,9 +1754,9 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (autoinc && my_popcountl(proc) != my_popcountl(cpus) && my_popcountl(thread) != my_popcountl(cpus)) { - Alert("parsing [%s:%d] : %s : PROC/THREAD range and CPU sets " - "must have the same size to be automatically bound\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : %s : PROC/THREAD range and CPU sets " + "must have the same size to be automatically bound\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1792,8 +1792,8 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) } } #else - Alert("parsing [%s:%d] : '%s' is not enabled, please check build options for USE_CPU_AFFINITY.\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' is not enabled, please check build options for USE_CPU_AFFINITY.\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; #endif /* ! USE_CPU_AFFINITY */ @@ -1803,14 +1803,14 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) goto out; if (*(args[2]) == 0) { - Alert("parsing [%s:%d]: '%s' expects a name and a value.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d]: '%s' expects a name and a value.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } /* "setenv" overwrites, "presetenv" only sets if not yet set */ if (setenv(args[1], args[2], (args[0][0] == 's')) != 0) { - Alert("parsing [%s:%d]: '%s' failed on variable '%s' : %s.\n", file, linenum, args[0], args[1], strerror(errno)); + ha_alert("parsing [%s:%d]: '%s' failed on variable '%s' : %s.\n", file, linenum, args[0], args[1], strerror(errno)); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1819,14 +1819,14 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) int arg; if (*(args[1]) == 0) { - Alert("parsing [%s:%d]: '%s' expects at least one variable name.\n", file, linenum, args[0]); + ha_alert("parsing [%s:%d]: '%s' expects at least one variable name.\n", file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } for (arg = 1; *args[arg]; arg++) { if (unsetenv(args[arg]) != 0) { - Alert("parsing [%s:%d]: '%s' failed on variable '%s' : %s.\n", file, linenum, args[0], args[arg], strerror(errno)); + ha_alert("parsing [%s:%d]: '%s' failed on variable '%s' : %s.\n", file, linenum, args[0], args[arg], strerror(errno)); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1852,7 +1852,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) char *delim = strchr(*env, '='); if (!delim || delim - *env >= trash.size) { - Alert("parsing [%s:%d]: '%s' failed to unset invalid variable '%s'.\n", file, linenum, args[0], *env); + ha_alert("parsing [%s:%d]: '%s' failed to unset invalid variable '%s'.\n", file, linenum, args[0], *env); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1861,7 +1861,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) trash.str[delim - *env] = 0; if (unsetenv(trash.str) != 0) { - Alert("parsing [%s:%d]: '%s' failed to unset variable '%s' : %s.\n", file, linenum, args[0], *env, strerror(errno)); + ha_alert("parsing [%s:%d]: '%s' failed to unset variable '%s' : %s.\n", file, linenum, args[0], *env, strerror(errno)); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -1882,11 +1882,11 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) if (strcmp(kwl->kw[index].kw, args[0]) == 0) { rc = kwl->kw[index].parse(args, CFG_GLOBAL, NULL, NULL, file, linenum, &errmsg); if (rc < 0) { - Alert("parsing [%s:%d] : %s\n", file, linenum, errmsg); + ha_alert("parsing [%s:%d] : %s\n", file, linenum, errmsg); err_code |= ERR_ALERT | ERR_FATAL; } else if (rc > 0) { - Warning("parsing [%s:%d] : %s\n", file, linenum, errmsg); + ha_warning("parsing [%s:%d] : %s\n", file, linenum, errmsg); err_code |= ERR_WARN; goto out; } @@ -1895,7 +1895,7 @@ int cfg_parse_global(const char *file, int linenum, char **args, int kwm) } } - Alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section\n", file, linenum, args[0], "global"); + ha_alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section\n", file, linenum, args[0], "global"); err_code |= ERR_ALERT | ERR_FATAL; } @@ -1958,13 +1958,13 @@ static int create_cond_regex_rule(const char *file, int line, int cap; if (px == &defproxy) { - Alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, line, cmd); + ha_alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, line, cmd); ret_code |= ERR_ALERT | ERR_FATAL; goto err; } if (*reg == 0) { - Alert("parsing [%s:%d] : '%s' expects as an argument.\n", file, line, cmd); + ha_alert("parsing [%s:%d] : '%s' expects as an argument.\n", file, line, cmd); ret_code |= ERR_ALERT | ERR_FATAL; goto err; } @@ -1975,15 +1975,15 @@ static int create_cond_regex_rule(const char *file, int line, if (cond_start && (strcmp(*cond_start, "if") == 0 || strcmp(*cond_start, "unless") == 0)) { if ((cond = build_acl_cond(file, line, &px->acl, px, cond_start, &errmsg)) == NULL) { - Alert("parsing [%s:%d] : error detected while parsing a '%s' condition : %s.\n", - file, line, cmd, errmsg); + ha_alert("parsing [%s:%d] : error detected while parsing a '%s' condition : %s.\n", + file, line, cmd, errmsg); ret_code |= ERR_ALERT | ERR_FATAL; goto err; } } else if (cond_start && **cond_start) { - Alert("parsing [%s:%d] : '%s' : Expecting nothing, 'if', or 'unless', got '%s'.\n", - file, line, cmd, *cond_start); + ha_alert("parsing [%s:%d] : '%s' : Expecting nothing, 'if', or 'unless', got '%s'.\n", + file, line, cmd, *cond_start); ret_code |= ERR_ALERT | ERR_FATAL; goto err; } @@ -1996,7 +1996,7 @@ static int create_cond_regex_rule(const char *file, int line, preg = calloc(1, sizeof(*preg)); if (!preg) { - Alert("parsing [%s:%d] : '%s' : not enough memory to build regex.\n", file, line, cmd); + ha_alert("parsing [%s:%d] : '%s' : not enough memory to build regex.\n", file, line, cmd); ret_code = ERR_ALERT | ERR_FATAL; goto err; } @@ -2005,7 +2005,7 @@ static int create_cond_regex_rule(const char *file, int line, cap = !(flags & REG_NOSUB); error = NULL; if (!regex_comp(reg, preg, cs, cap, &error)) { - Alert("parsing [%s:%d] : '%s' : regular expression '%s' : %s\n", file, line, cmd, reg, error); + ha_alert("parsing [%s:%d] : '%s' : regular expression '%s' : %s\n", file, line, cmd, reg, error); free(error); ret_code = ERR_ALERT | ERR_FATAL; goto err; @@ -2014,8 +2014,8 @@ static int create_cond_regex_rule(const char *file, int line, err = chain_regex((dir == SMP_OPT_DIR_REQ) ? &px->req_exp : &px->rsp_exp, preg, action, repl ? strdup(repl) : NULL, cond); if (repl && err) { - Alert("parsing [%s:%d] : '%s' : invalid character or unterminated sequence in replacement string near '%c'.\n", - file, line, cmd, *err); + ha_alert("parsing [%s:%d] : '%s' : invalid character or unterminated sequence in replacement string near '%c'.\n", + file, line, cmd, *err); ret_code |= ERR_ALERT | ERR_FATAL; goto err_free; } @@ -2055,7 +2055,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) if (strcmp(args[0], "peers") == 0) { /* new peers section */ if (!*args[1]) { - Alert("parsing [%s:%d] : missing name for peers section.\n", file, linenum); + ha_alert("parsing [%s:%d] : missing name for peers section.\n", file, linenum); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -2065,8 +2065,8 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) err = invalid_char(args[1]); if (err) { - Alert("parsing [%s:%d] : character '%c' is not permitted in '%s' name '%s'.\n", - file, linenum, *err, args[0], args[1]); + ha_alert("parsing [%s:%d] : character '%c' is not permitted in '%s' name '%s'.\n", + file, linenum, *err, args[0], args[1]); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -2077,14 +2077,14 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) * combinations are allowed: */ if (strcmp(curpeers->id, args[1]) == 0) { - Alert("Parsing [%s:%d]: peers section '%s' has the same name as another peers section declared at %s:%d.\n", - file, linenum, args[1], curpeers->conf.file, curpeers->conf.line); + ha_alert("Parsing [%s:%d]: peers section '%s' has the same name as another peers section declared at %s:%d.\n", + file, linenum, args[1], curpeers->conf.file, curpeers->conf.line); err_code |= ERR_ALERT | ERR_FATAL; } } if ((curpeers = calloc(1, sizeof(*curpeers))) == NULL) { - Alert("parsing [%s:%d] : out of memory.\n", file, linenum); + ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -2103,22 +2103,22 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) struct protocol *proto; if (!*args[2]) { - Alert("parsing [%s:%d] : '%s' expects and [:] as arguments.\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects and [:] as arguments.\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } err = invalid_char(args[1]); if (err) { - Alert("parsing [%s:%d] : character '%c' is not permitted in server name '%s'.\n", - file, linenum, *err, args[1]); + ha_alert("parsing [%s:%d] : character '%c' is not permitted in server name '%s'.\n", + file, linenum, *err, args[1]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if ((newpeer = calloc(1, sizeof(*newpeer))) == NULL) { - Alert("parsing [%s:%d] : out of memory.\n", file, linenum); + ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -2135,29 +2135,29 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) sk = str2sa_range(args[2], NULL, &port1, &port2, &errmsg, NULL, NULL, 1); if (!sk) { - Alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg); + ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg); err_code |= ERR_ALERT | ERR_FATAL; goto out; } proto = protocol_by_family(sk->ss_family); if (!proto || !proto->connect) { - Alert("parsing [%s:%d] : '%s %s' : connect() not supported for this address family.\n", - file, linenum, args[0], args[1]); + ha_alert("parsing [%s:%d] : '%s %s' : connect() not supported for this address family.\n", + file, linenum, args[0], args[1]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if (port1 != port2) { - Alert("parsing [%s:%d] : '%s %s' : port ranges and offsets are not allowed in '%s'\n", - file, linenum, args[0], args[1], args[2]); + ha_alert("parsing [%s:%d] : '%s %s' : port ranges and offsets are not allowed in '%s'\n", + file, linenum, args[0], args[1], args[2]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if (!port1) { - Alert("parsing [%s:%d] : '%s %s' : missing or invalid port in '%s'\n", - file, linenum, args[0], args[1], args[2]); + ha_alert("parsing [%s:%d] : '%s %s' : missing or invalid port in '%s'\n", + file, linenum, args[0], args[1], args[2]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -2175,7 +2175,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) if (!curpeers->peers_fe) { if ((curpeers->peers_fe = calloc(1, sizeof(struct proxy))) == NULL) { - Alert("parsing [%s:%d] : out of memory.\n", file, linenum); + ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -2192,11 +2192,11 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) if (!str2listener(args[2], curpeers->peers_fe, bind_conf, file, linenum, &errmsg)) { if (errmsg && *errmsg) { indent_msg(&errmsg, 2); - Alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg); + ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg); } else - Alert("parsing [%s:%d] : '%s %s' : error encountered while parsing listening address %s.\n", - file, linenum, args[0], args[1], args[2]); + ha_alert("parsing [%s:%d] : '%s %s' : error encountered while parsing listening address %s.\n", + file, linenum, args[0], args[1], args[2]); err_code |= ERR_FATAL; goto out; } @@ -2213,9 +2213,9 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) } } else { - Alert("parsing [%s:%d] : '%s %s' : local peer name already referenced at %s:%d.\n", - file, linenum, args[0], args[1], - curpeers->peers_fe->conf.file, curpeers->peers_fe->conf.line); + ha_alert("parsing [%s:%d] : '%s %s' : local peer name already referenced at %s:%d.\n", + file, linenum, args[0], args[1], + curpeers->peers_fe->conf.file, curpeers->peers_fe->conf.line); err_code |= ERR_FATAL; goto out; } @@ -2228,7 +2228,7 @@ int cfg_parse_peers(const char *file, int linenum, char **args, int kwm) curpeers->state = PR_STNEW; } else if (*args[0] != 0) { - Alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section\n", file, linenum, args[0], cursection); + ha_alert("parsing [%s:%d] : unknown keyword '%s' in '%s' section\n", file, linenum, args[0], cursection); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -2258,15 +2258,15 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) if (strcmp(args[0], "resolvers") == 0) { /* new resolvers section */ if (!*args[1]) { - Alert("parsing [%s:%d] : missing name for resolvers section.\n", file, linenum); + ha_alert("parsing [%s:%d] : missing name for resolvers section.\n", file, linenum); err_code |= ERR_ALERT | ERR_ABORT; goto out; } err = invalid_char(args[1]); if (err) { - Alert("parsing [%s:%d] : character '%c' is not permitted in '%s' name '%s'.\n", - file, linenum, *err, args[0], args[1]); + ha_alert("parsing [%s:%d] : character '%c' is not permitted in '%s' name '%s'.\n", + file, linenum, *err, args[0], args[1]); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -2274,14 +2274,14 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) list_for_each_entry(curr_resolvers, &dns_resolvers, list) { /* Error if two resolvers owns the same name */ if (strcmp(curr_resolvers->id, args[1]) == 0) { - Alert("Parsing [%s:%d]: resolvers '%s' has same name as another resolvers (declared at %s:%d).\n", - file, linenum, args[1], curr_resolvers->conf.file, curr_resolvers->conf.line); + ha_alert("Parsing [%s:%d]: resolvers '%s' has same name as another resolvers (declared at %s:%d).\n", + file, linenum, args[1], curr_resolvers->conf.file, curr_resolvers->conf.line); err_code |= ERR_ALERT | ERR_ABORT; } } if ((curr_resolvers = calloc(1, sizeof(*curr_resolvers))) == NULL) { - Alert("parsing [%s:%d] : out of memory.\n", file, linenum); + ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -2317,16 +2317,16 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) struct protocol *proto; if (!*args[2]) { - Alert("parsing [%s:%d] : '%s' expects and [:] as arguments.\n", - file, linenum, args[0]); + ha_alert("parsing [%s:%d] : '%s' expects and [:] as arguments.\n", + file, linenum, args[0]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } err = invalid_char(args[1]); if (err) { - Alert("parsing [%s:%d] : character '%c' is not permitted in server name '%s'.\n", - file, linenum, *err, args[1]); + ha_alert("parsing [%s:%d] : character '%c' is not permitted in server name '%s'.\n", + file, linenum, *err, args[1]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -2334,14 +2334,14 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) list_for_each_entry(newnameserver, &curr_resolvers->nameservers, list) { /* Error if two resolvers owns the same name */ if (strcmp(newnameserver->id, args[1]) == 0) { - Alert("Parsing [%s:%d]: nameserver '%s' has same name as another nameserver (declared at %s:%d).\n", - file, linenum, args[1], curr_resolvers->conf.file, curr_resolvers->conf.line); + ha_alert("Parsing [%s:%d]: nameserver '%s' has same name as another nameserver (declared at %s:%d).\n", + file, linenum, args[1], curr_resolvers->conf.file, curr_resolvers->conf.line); err_code |= ERR_ALERT | ERR_FATAL; } } if ((newnameserver = calloc(1, sizeof(*newnameserver))) == NULL) { - Alert("parsing [%s:%d] : out of memory.\n", file, linenum); + ha_alert("parsing [%s:%d] : out of memory.\n", file, linenum); err_code |= ERR_ALERT | ERR_ABORT; goto out; } @@ -2355,29 +2355,29 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) sk = str2sa_range(args[2], NULL, &port1, &port2, &errmsg, NULL, NULL, 1); if (!sk) { - Alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg); + ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], errmsg); err_code |= ERR_ALERT | ERR_FATAL; goto out; } proto = protocol_by_family(sk->ss_family); if (!proto || !proto->connect) { - Alert("parsing [%s:%d] : '%s %s' : connect() not supported for this address family.\n", + ha_alert("parsing [%s:%d] : '%s %s' : connect() not supported for this address family.\n", file, linenum, args[0], args[1]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if (port1 != port2) { - Alert("parsing [%s:%d] : '%s %s' : port ranges and offsets are not allowed in '%s'\n", - file, linenum, args[0], args[1], args[2]); + ha_alert("parsing [%s:%d] : '%s %s' : port ranges and offsets are not allowed in '%s'\n", + file, linenum, args[0], args[1], args[2]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } if (!port1 && !port2) { - Alert("parsing [%s:%d] : '%s %s' : no UDP port specified\n", - file, linenum, args[0], args[1]); + ha_alert("parsing [%s:%d] : '%s %s' : no UDP port specified\n", + file, linenum, args[0], args[1]); err_code |= ERR_ALERT | ERR_FATAL; goto out; } @@ -2389,16 +2389,16 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) unsigned int time; if (!*args[2]) { - Alert("parsing [%s:%d] : '%s' expects an and a