CLEANUP: log: Rename Alert/Warning in ha_alert/ha_warning

This commit is contained in:
Christopher Faulet 2017-11-24 16:50:31 +01:00 committed by Willy Tarreau
parent 56803b1c98
commit 767a84bcc0
32 changed files with 1826 additions and 1826 deletions

View File

@ -106,7 +106,7 @@ 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",
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;
}

View File

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

View File

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

View File

@ -422,7 +422,7 @@ 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"
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"
@ -733,7 +733,7 @@ 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"
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"
@ -1271,14 +1271,14 @@ 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",
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",
ha_alert("proxy %s: acl %s %s(): no groups specified.\n",
p->id, acl->name, expr->kw);
cfgerr++;
continue;
@ -1287,7 +1287,7 @@ 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",
ha_alert("proxy %s: acl %s %s(): no groups specified.\n",
p->id, acl->name, expr->kw);
cfgerr++;
continue;
@ -1296,7 +1296,7 @@ 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",
ha_alert("proxy %s: acl %s %s(): invalid group '%s'.\n",
p->id, acl->name, expr->kw, pattern->pat.ptr.str);
cfgerr++;
}
@ -1328,7 +1328,7 @@ 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",
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;

View File

@ -133,7 +133,7 @@ int userlist_postinit()
}
if (!ag) {
Alert("userlist '%s': no such group '%s' specified in user '%s'\n",
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,7 +142,7 @@ 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",
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,7 +170,7 @@ int userlist_postinit()
}
if (!curuser) {
Alert("userlist '%s': no such user '%s' specified in group '%s'\n",
ha_alert("userlist '%s': no such user '%s' specified in group '%s'\n",
curuserlist->name, user, ag->name);
return ERR_ALERT | ERR_FATAL;
}
@ -178,7 +178,7 @@ 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",
ha_alert("userlist '%s': no more memory when trying to allocate the user groups.\n",
curuserlist->name);
return ERR_ALERT | ERR_FATAL;
}

View File

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

View File

@ -609,14 +609,14 @@ 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",
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,7 +738,7 @@ 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 <id> argument\n",
ha_alert("parsing [%s:%d] : '%s' expects an <id> argument\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
@ -752,14 +752,14 @@ 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",
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,7 +859,7 @@ 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",
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,7 +884,7 @@ 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",
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,7 +910,7 @@ int cfg_cache_postparser()
}
if (cache_ptr == fconf->conf) {
Alert("Proxy '%s': unable to find the cache '%s' referenced by the filter 'cache'.\n",
ha_alert("Proxy '%s': unable to find the cache '%s' referenced by the filter 'cache'.\n",
curproxy->id, (char *)fconf->conf);
err++;
}

File diff suppressed because it is too large Load Diff

View File

@ -289,7 +289,7 @@ static void set_server_check_status(struct check *check, short status, const cha
(check->health >= check->rise) ? check->fall : check->rise,
(check->health >= check->rise) ? (s->uweight ? "UP" : "DRAIN") : "DOWN");
Warning("%s.\n", trash.str);
ha_warning("%s.\n", trash.str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", trash.str);
send_email_alert(s, LOG_INFO, "%s", trash.str);
}
@ -1209,7 +1209,7 @@ static void event_srv_chk_r(struct conn_stream *cs)
* an error message is attached, so we can display it
*/
desc = &check->bi->data[7];
//Warning("onlyoneERR: %s\n", desc);
//ha_warning("onlyoneERR: %s\n", desc);
set_server_check_status(check, HCHK_STATUS_L7STS, desc);
}
} else if (check->bi->i > first_packet_len + 4) {
@ -1224,7 +1224,7 @@ static void event_srv_chk_r(struct conn_stream *cs)
/* No error packet */
/* We set the MySQL Version in description for information purpose */
desc = &check->bi->data[5];
//Warning("2packetOK: %s\n", desc);
//ha_warning("2packetOK: %s\n", desc);
set_server_check_status(check, HCHK_STATUS_L7OKD, desc);
}
else {
@ -1232,7 +1232,7 @@ static void event_srv_chk_r(struct conn_stream *cs)
* so we can display it ! :)
*/
desc = &check->bi->data[first_packet_len+11];
//Warning("2packetERR: %s\n", desc);
//ha_warning("2packetERR: %s\n", desc);
set_server_check_status(check, HCHK_STATUS_L7STS, desc);
}
}
@ -1245,7 +1245,7 @@ static void event_srv_chk_r(struct conn_stream *cs)
* it must be a protocol error
*/
desc = &check->bi->data[5];
//Warning("protoerr: %s\n", desc);
//ha_warning("protoerr: %s\n", desc);
set_server_check_status(check, HCHK_STATUS_L7RSP, desc);
}
}
@ -1705,14 +1705,14 @@ static int init_pid_list(void)
return 0;
if (!signal_register_fct(SIGCHLD, sigchld_handler, SIGCHLD)) {
Alert("Failed to set signal handler for external health checks: %s. Aborting.\n",
ha_alert("Failed to set signal handler for external health checks: %s. Aborting.\n",
strerror(errno));
return 1;
}
pool2_pid_list = create_pool("pid_list", sizeof(struct pid_list), MEM_F_SHARED);
if (pool2_pid_list == NULL) {
Alert("Failed to allocate memory pool for external health checks: %s. Aborting.\n",
ha_alert("Failed to allocate memory pool for external health checks: %s. Aborting.\n",
strerror(errno));
return 1;
}
@ -1737,7 +1737,7 @@ static int extchk_setenv(struct check *check, int idx, const char *value)
int vmaxlen;
if (idx < 0 || idx >= EXTCHK_SIZE) {
Alert("Illegal environment variable index %d. Aborting.\n", idx);
ha_alert("Illegal environment variable index %d. Aborting.\n", idx);
return 1;
}
@ -1764,16 +1764,16 @@ static int extchk_setenv(struct check *check, int idx, const char *value)
check->envp[idx] = malloc(len + 1);
if (!check->envp[idx]) {
Alert("Failed to allocate memory for the environment variable '%s'. Aborting.\n", envname);
ha_alert("Failed to allocate memory for the environment variable '%s'. Aborting.\n", envname);
return 1;
}
ret = snprintf(check->envp[idx], len + 1, "%s=%s", envname, value);
if (ret < 0) {
Alert("Failed to store the environment variable '%s'. Reason : %s. Aborting.\n", envname, strerror(errno));
ha_alert("Failed to store the environment variable '%s'. Reason : %s. Aborting.\n", envname, strerror(errno));
return 1;
}
else if (ret > len) {
Alert("Environment variable '%s' was truncated. Aborting.\n", envname);
ha_alert("Environment variable '%s' was truncated. Aborting.\n", envname);
return 1;
}
return 0;
@ -1800,13 +1800,13 @@ static int prepare_external_check(struct check *check)
check->curpid = NULL;
check->envp = calloc((EXTCHK_SIZE + 1), sizeof(char *));
if (!check->envp) {
Alert("Failed to allocate memory for environment variables. Aborting\n");
ha_alert("Failed to allocate memory for environment variables. Aborting\n");
goto err;
}
check->argv = calloc(6, sizeof(char *));
if (!check->argv) {
Alert("Starting [%s:%s] check: out of memory.\n", px->id, s->id);
ha_alert("Starting [%s:%s] check: out of memory.\n", px->id, s->id);
goto err;
}
@ -1831,7 +1831,7 @@ static int prepare_external_check(struct check *check)
check->argv[2] = strdup("NOT_USED");
}
else {
Alert("Starting [%s:%s] check: unsupported address family.\n", px->id, s->id);
ha_alert("Starting [%s:%s] check: unsupported address family.\n", px->id, s->id);
goto err;
}
@ -1846,7 +1846,7 @@ static int prepare_external_check(struct check *check)
for (i = 0; i < 5; i++) {
if (!check->argv[i]) {
Alert("Starting [%s:%s] check: out of memory.\n", px->id, s->id);
ha_alert("Starting [%s:%s] check: out of memory.\n", px->id, s->id);
goto err;
}
}
@ -1913,7 +1913,7 @@ static int connect_proc_chk(struct task *t)
pid = fork();
if (pid < 0) {
Alert("Failed to fork process for external health check: %s. Aborting.\n",
ha_alert("Failed to fork process for external health check: %s. Aborting.\n",
strerror(errno));
set_server_check_status(check, HCHK_STATUS_SOCKERR, strerror(errno));
goto out;
@ -1932,7 +1932,7 @@ static int connect_proc_chk(struct task *t)
environ = check->envp;
extchk_setenv(check, EXTCHK_HAPROXY_SERVER_CURCONN, ultoa_r(s->cur_sess, buf, sizeof(buf)));
execvp(px->check_command, check->argv);
Alert("Failed to exec process for external health check: %s. Aborting.\n",
ha_alert("Failed to exec process for external health check: %s. Aborting.\n",
strerror(errno));
exit(-1);
}
@ -2054,7 +2054,7 @@ static struct task *process_chk_proc(struct task *t)
status = HCHK_STATUS_PROCOK;
} else if (expired) {
status = HCHK_STATUS_PROCTOUT;
Warning("kill %d\n", (int)elem->pid);
ha_warning("kill %d\n", (int)elem->pid);
kill(elem->pid, SIGTERM);
}
set_server_check_status(check, status, NULL);
@ -2290,7 +2290,7 @@ static int start_check_task(struct check *check, int mininter,
struct task *t;
/* task for the check */
if ((t = task_new(MAX_THREADS_MASK)) == NULL) {
Alert("Starting [%s:%s] check: out of memory.\n",
ha_alert("Starting [%s:%s] check: out of memory.\n",
check->server->proxy->id, check->server->id);
return 0;
}
@ -2336,7 +2336,7 @@ static int start_checks()
for (s = px->srv; s; s = s->next) {
if (s->slowstart) {
if ((t = task_new(MAX_THREADS_MASK)) == NULL) {
Alert("Starting [%s:%s] check: out of memory.\n", px->id, s->id);
ha_alert("Starting [%s:%s] check: out of memory.\n", px->id, s->id);
return ERR_ALERT | ERR_FATAL;
}
/* We need a warmup task that will be called when the server
@ -2379,7 +2379,7 @@ static int start_checks()
for (px = proxy; px; px = px->next) {
if ((px->options2 & PR_O2_CHK_ANY) == PR_O2_EXT_CHK) {
if (init_pid_list()) {
Alert("Starting [%s] check: out of memory.\n", px->id);
ha_alert("Starting [%s] check: out of memory.\n", px->id);
return ERR_ALERT | ERR_FATAL;
}
}
@ -3415,7 +3415,7 @@ static void enqueue_email_alert(struct proxy *p, struct server *s, const char *m
for (i = 0, mailer = p->email_alert.mailers.m->mailer_list;
i < p->email_alert.mailers.m->count; i++, mailer = mailer->next) {
if (!enqueue_one_email_alert(p, s, &p->email_alert.queues[i], msg)) {
Alert("Email alert [%s] could not be enqueued: out of memory\n", p->id);
ha_alert("Email alert [%s] could not be enqueued: out of memory\n", p->id);
return;
}
}
@ -3441,7 +3441,7 @@ void send_email_alert(struct server *s, int level, const char *format, ...)
va_end(argp);
if (len < 0 || len >= sizeof(buf)) {
Alert("Email alert [%s] could not format message\n", p->id);
ha_alert("Email alert [%s] could not format message\n", p->id);
return;
}

View File

@ -460,7 +460,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in
chunk_reset(tmp);
if (severity < 0 || severity > 7) {
Warning("socket command feedback with invalid severity %d", severity);
ha_warning("socket command feedback with invalid severity %d", severity);
chunk_printf(tmp, "[%d]: ", severity);
}
else {
@ -472,7 +472,7 @@ static int cli_output_msg(struct channel *chn, const char *msg, int severity, in
chunk_printf(tmp, "[%s]: ", log_levels[severity]);
break;
default:
Warning("Unrecognized severity output %d", severity_output);
ha_warning("Unrecognized severity output %d", severity_output);
}
}
chunk_appendf(tmp, "%s", msg);
@ -1254,16 +1254,16 @@ static int _getsocks(char **args, struct appctx *appctx, void *private)
/* Temporary set the FD in blocking mode, that will make our life easier */
old_fcntl = fcntl(fd, F_GETFL);
if (old_fcntl < 0) {
Warning("Couldn't get the flags for the unix socket\n");
ha_warning("Couldn't get the flags for the unix socket\n");
goto out;
}
cmsgbuf = malloc(CMSG_SPACE(sizeof(int) * MAX_SEND_FD));
if (!cmsgbuf) {
Warning("Failed to allocate memory to send sockets\n");
ha_warning("Failed to allocate memory to send sockets\n");
goto out;
}
if (fcntl(fd, F_SETFL, old_fcntl &~ O_NONBLOCK) == -1) {
Warning("Cannot make the unix socket blocking\n");
ha_warning("Cannot make the unix socket blocking\n");
goto out;
}
setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (void *)&tv, sizeof(tv));
@ -1300,7 +1300,7 @@ static int _getsocks(char **args, struct appctx *appctx, void *private)
msghdr.msg_iovlen = 1;
ret = sendmsg(fd, &msghdr, 0);
if (ret != sizeof(tot_fd_nb)) {
Warning("Failed to send the number of sockets to send\n");
ha_warning("Failed to send the number of sockets to send\n");
goto out;
}
@ -1326,7 +1326,7 @@ static int _getsocks(char **args, struct appctx *appctx, void *private)
*/
tmpbuf = malloc(MAX_SEND_FD * (1 + MAXPATHLEN + 1 + IFNAMSIZ + sizeof(int)));
if (tmpbuf == NULL) {
Warning("Failed to allocate memory to transfer socket informations\n");
ha_warning("Failed to allocate memory to transfer socket informations\n");
goto out;
}
iov.iov_base = tmpbuf;
@ -1370,7 +1370,7 @@ static int _getsocks(char **args, struct appctx *appctx, void *private)
if ((!(i % MAX_SEND_FD))) {
iov.iov_len = curoff;
if (sendmsg(fd, &msghdr, 0) != curoff) {
Warning("Failed to transfer sockets\n");
ha_warning("Failed to transfer sockets\n");
printf("errno %d\n", errno);
goto out;
}
@ -1380,7 +1380,7 @@ static int _getsocks(char **args, struct appctx *appctx, void *private)
sizeof(tot_fd_nb), 0);
} while (ret == -1 && errno == EINTR);
if (ret <= 0) {
Warning("Unexpected error while transferring sockets\n");
ha_warning("Unexpected error while transferring sockets\n");
goto out;
}
curoff = 0;
@ -1394,14 +1394,14 @@ static int _getsocks(char **args, struct appctx *appctx, void *private)
cmsg->cmsg_len = CMSG_LEN((i % MAX_SEND_FD) * sizeof(int));
msghdr.msg_controllen = CMSG_SPACE(sizeof(int) * (i % MAX_SEND_FD));
if (sendmsg(fd, &msghdr, 0) != curoff) {
Warning("Failed to transfer sockets\n");
ha_warning("Failed to transfer sockets\n");
goto out;
}
}
out:
if (old_fcntl >= 0 && fcntl(fd, F_SETFL, old_fcntl) == -1) {
Warning("Cannot make the unix socket non-blocking\n");
ha_warning("Cannot make the unix socket non-blocking\n");
goto out;
}
appctx->st0 = CLI_ST_END;

View File

@ -102,7 +102,7 @@ static void da_haproxy_log(da_severity_t severity, da_status_t status,
if (global_deviceatlas.loglevel && severity <= global_deviceatlas.loglevel) {
char logbuf[256];
vsnprintf(logbuf, sizeof(logbuf), fmt, args);
Warning("deviceatlas : %s.\n", logbuf);
ha_warning("deviceatlas : %s.\n", logbuf);
}
}
@ -122,14 +122,14 @@ static int init_deviceatlas(void)
da_status_t status;
if (global.nbthread > 1) {
Alert("deviceatlas: multithreading is not supported for now.\n");
ha_alert("deviceatlas: multithreading is not supported for now.\n");
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
jsonp = fopen(global_deviceatlas.jsonpath, "r");
if (jsonp == 0) {
Alert("deviceatlas : '%s' json file has invalid path or is not readable.\n",
ha_alert("deviceatlas : '%s' json file has invalid path or is not readable.\n",
global_deviceatlas.jsonpath);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -141,7 +141,7 @@ static int init_deviceatlas(void)
&global_deviceatlas.atlasimgptr, &atlasimglen);
fclose(jsonp);
if (status != DA_OK) {
Alert("deviceatlas : '%s' json file is invalid.\n",
ha_alert("deviceatlas : '%s' json file is invalid.\n",
global_deviceatlas.jsonpath);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -151,7 +151,7 @@ static int init_deviceatlas(void)
global_deviceatlas.atlasimgptr, atlasimglen);
if (status != DA_OK) {
Alert("deviceatlas : data could not be compiled.\n");
ha_alert("deviceatlas : data could not be compiled.\n");
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}

View File

@ -89,13 +89,13 @@ struct dns_srvrq *new_dns_srvrq(struct server *srv, char *fqdn)
fqdn_len = strlen(fqdn);
hostname_dn_len = dns_str_to_dn_label(fqdn, fqdn_len + 1, trash.str, trash.size);
if (hostname_dn_len == -1) {
Alert("config : %s '%s', server '%s': failed to parse FQDN '%s'\n",
ha_alert("config : %s '%s', server '%s': failed to parse FQDN '%s'\n",
proxy_type_str(px), px->id, srv->id, fqdn);
goto err;
}
if ((srvrq = calloc(1, sizeof(*srvrq))) == NULL) {
Alert("config : %s '%s', server '%s': out of memory\n",
ha_alert("config : %s '%s', server '%s': out of memory\n",
proxy_type_str(px), px->id, srv->id);
goto err;
}
@ -105,7 +105,7 @@ struct dns_srvrq *new_dns_srvrq(struct server *srv, char *fqdn)
srvrq->hostname_dn = strdup(trash.str);
srvrq->hostname_dn_len = hostname_dn_len;
if (!srvrq->name || !srvrq->hostname_dn) {
Alert("config : %s '%s', server '%s': out of memory\n",
ha_alert("config : %s '%s', server '%s': out of memory\n",
proxy_type_str(px), px->id, srv->id);
goto err;
}
@ -1852,13 +1852,13 @@ static int dns_finalize_config(void)
/* Check nameserver info */
if ((fd = socket(ns->addr.ss_family, SOCK_DGRAM, IPPROTO_UDP)) == -1) {
Alert("config : resolvers '%s': can't create socket for nameserver '%s'.\n",
ha_alert("config : resolvers '%s': can't create socket for nameserver '%s'.\n",
resolvers->id, ns->id);
err_code |= (ERR_ALERT|ERR_ABORT);
continue;
}
if (connect(fd, (struct sockaddr*)&ns->addr, get_addr_len(&ns->addr)) == -1) {
Alert("config : resolvers '%s': can't connect socket for nameserver '%s'.\n",
ha_alert("config : resolvers '%s': can't connect socket for nameserver '%s'.\n",
resolvers->id, ns->id);
close(fd);
err_code |= (ERR_ALERT|ERR_ABORT);
@ -1869,7 +1869,7 @@ static int dns_finalize_config(void)
/* Create dgram structure that will hold the UPD socket
* and attach it on the current nameserver */
if ((dgram = calloc(1, sizeof(*dgram))) == NULL) {
Alert("config: resolvers '%s' : out of memory.\n",
ha_alert("config: resolvers '%s' : out of memory.\n",
resolvers->id);
err_code |= (ERR_ALERT|ERR_ABORT);
goto err;
@ -1885,7 +1885,7 @@ static int dns_finalize_config(void)
/* Create the task associated to the resolvers section */
if ((t = task_new(MAX_THREADS_MASK)) == NULL) {
Alert("config : resolvers '%s' : out of memory.\n", resolvers->id);
ha_alert("config : resolvers '%s' : out of memory.\n", resolvers->id);
err_code |= (ERR_ALERT|ERR_ABORT);
goto err;
}
@ -1907,7 +1907,7 @@ static int dns_finalize_config(void)
continue;
if ((resolvers = find_resolvers_by_id(srv->resolvers_id)) == NULL) {
Alert("config : %s '%s', server '%s': unable to find required resolvers '%s'\n",
ha_alert("config : %s '%s', server '%s': unable to find required resolvers '%s'\n",
proxy_type_str(px), px->id, srv->id, srv->resolvers_id);
err_code |= (ERR_ALERT|ERR_ABORT);
continue;
@ -1917,14 +1917,14 @@ static int dns_finalize_config(void)
if (srv->srvrq && !srv->srvrq->resolvers) {
srv->srvrq->resolvers = srv->resolvers;
if (dns_link_resolution(srv->srvrq, OBJ_TYPE_SRVRQ, 0) == -1) {
Alert("config : %s '%s' : unable to set DNS resolution for server '%s'.\n",
ha_alert("config : %s '%s' : unable to set DNS resolution for server '%s'.\n",
proxy_type_str(px), px->id, srv->id);
err_code |= (ERR_ALERT|ERR_ABORT);
continue;
}
}
if (dns_link_resolution(srv, OBJ_TYPE_SERVER, 0) == -1) {
Alert("config : %s '%s', unable to set DNS resolution for server '%s'.\n",
ha_alert("config : %s '%s', unable to set DNS resolution for server '%s'.\n",
proxy_type_str(px), px->id, srv->id);
err_code |= (ERR_ALERT|ERR_ABORT);
continue;

View File

@ -291,7 +291,7 @@ flt_init_all()
for (px = proxy; px; px = px->next) {
err_code |= flt_init(px);
if (err_code & (ERR_ABORT|ERR_FATAL)) {
Alert("Failed to initialize filters for proxy '%s'.\n",
ha_alert("Failed to initialize filters for proxy '%s'.\n",
px->id);
return err_code;
}
@ -310,7 +310,7 @@ flt_init_all_per_thread()
for (px = proxy; px; px = px->next) {
err_code = flt_init_per_thread(px);
if (err_code & (ERR_ABORT|ERR_FATAL)) {
Alert("Failed to initialize filters for proxy '%s' for thread %u.\n",
ha_alert("Failed to initialize filters for proxy '%s' for thread %u.\n",
px->id, tid);
return 0;
}

View File

@ -261,7 +261,7 @@ comp_http_forward_data(struct stream *s, struct filter *filter,
/* To work, previous filters MUST forward all data */
if (flt_rsp_fwd(filter) + len != flt_rsp_nxt(filter)) {
Warning("HTTP compression failed: unexpected behavior of previous filters\n");
ha_warning("HTTP compression failed: unexpected behavior of previous filters\n");
return -1;
}
@ -298,7 +298,7 @@ comp_http_forward_data(struct stream *s, struct filter *filter,
if (msg->flags & HTTP_MSGF_TE_CHNK) {
ret = http_compression_buffer_add_data(st, tmpbuf, zbuf, tmpbuf->i);
if (ret != tmpbuf->i) {
Warning("HTTP compression failed: Must consume %d bytes but only %d bytes consumed\n",
ha_warning("HTTP compression failed: Must consume %d bytes but only %d bytes consumed\n",
tmpbuf->i, ret);
return -1;
}
@ -903,7 +903,7 @@ check_legacy_http_comp_flt(struct proxy *proxy)
if (fconf->id == http_comp_flt_id)
goto end;
}
Alert("config: %s '%s': require an explicit filter declaration to use HTTP compression\n",
ha_alert("config: %s '%s': require an explicit filter declaration to use HTTP compression\n",
proxy_type_str(proxy), proxy->id);
err++;
goto end;
@ -911,7 +911,7 @@ check_legacy_http_comp_flt(struct proxy *proxy)
fconf = calloc(1, sizeof(*fconf));
if (!fconf) {
Alert("config: %s '%s': out of memory\n",
ha_alert("config: %s '%s': out of memory\n",
proxy_type_str(proxy), proxy->id);
err++;
goto end;

View File

@ -2893,7 +2893,7 @@ spoe_check(struct proxy *px, struct flt_conf *fconf)
/* Check engine Id. It should be uniq */
if (!strcmp(conf->id, c->id)) {
Alert("Proxy %s : duplicated name for SPOE engine '%s'.\n",
ha_alert("Proxy %s : duplicated name for SPOE engine '%s'.\n",
px->id, conf->id);
return 1;
}
@ -2901,14 +2901,14 @@ spoe_check(struct proxy *px, struct flt_conf *fconf)
target = proxy_be_by_name(conf->agent->b.name);
if (target == NULL) {
Alert("Proxy %s : unknown backend '%s' used by SPOE agent '%s'"
ha_alert("Proxy %s : unknown backend '%s' used by SPOE agent '%s'"
" declared at %s:%d.\n",
px->id, conf->agent->b.name, conf->agent->id,
conf->agent->conf.file, conf->agent->conf.line);
return 1;
}
if (target->mode != PR_MODE_TCP) {
Alert("Proxy %s : backend '%s' used by SPOE agent '%s' declared"
ha_alert("Proxy %s : backend '%s' used by SPOE agent '%s' declared"
" at %s:%d does not support HTTP mode.\n",
px->id, target->id, conf->agent->id,
conf->agent->conf.file, conf->agent->conf.line);
@ -3152,7 +3152,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
if (!strcmp(args[0], "spoe-agent")) { /* new spoe-agent section */
if (!*args[1]) {
Alert("parsing [%s:%d] : missing name for spoe-agent section.\n",
ha_alert("parsing [%s:%d] : missing name for spoe-agent section.\n",
file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
@ -3164,20 +3164,20 @@ cfg_parse_spoe_agent(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",
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;
}
if (curagent != NULL) {
Alert("parsing [%s:%d] : another spoe-agent section previously defined.\n",
ha_alert("parsing [%s:%d] : another spoe-agent section previously defined.\n",
file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
}
if ((curagent = calloc(1, sizeof(*curagent))) == 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;
}
@ -3209,7 +3209,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
LIST_INIT(&curagent->messages);
if ((curagent->rt = calloc(global.nbthread, sizeof(*curagent->rt))) == 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;
}
@ -3226,7 +3226,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
}
else if (!strcmp(args[0], "use-backend")) {
if (!*args[1]) {
Alert("parsing [%s:%d] : '%s' expects a backend name.\n",
ha_alert("parsing [%s:%d] : '%s' expects a backend name.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3243,7 +3243,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
list_for_each_entry(ph, &curmphs, list) {
if (!strcmp(ph->id, args[cur_arg])) {
Alert("parsing [%s:%d]: spoe-message '%s' already used.\n",
ha_alert("parsing [%s:%d]: spoe-message '%s' already used.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3251,7 +3251,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
}
if ((ph = calloc(1, sizeof(*ph))) == 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;
}
@ -3267,7 +3267,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
list_for_each_entry(ph, &curgphs, list) {
if (!strcmp(ph->id, args[cur_arg])) {
Alert("parsing [%s:%d]: spoe-group '%s' already used.\n",
ha_alert("parsing [%s:%d]: spoe-group '%s' already used.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3275,7 +3275,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
}
if ((ph = calloc(1, sizeof(*ph))) == 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;
}
@ -3290,7 +3290,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
unsigned timeout;
if (!*args[1]) {
Alert("parsing [%s:%d] : 'timeout' expects 'hello', 'idle' and 'processing'.\n",
ha_alert("parsing [%s:%d] : 'timeout' expects 'hello', 'idle' and 'processing'.\n",
file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3304,20 +3304,20 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
else if (!strcmp(args[1], "processing"))
tv = &curagent->timeout.processing;
else {
Alert("parsing [%s:%d] : 'timeout' supports 'hello', 'idle' or 'processing' (got %s).\n",
ha_alert("parsing [%s:%d] : 'timeout' supports 'hello', 'idle' or 'processing' (got %s).\n",
file, linenum, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (!*args[2]) {
Alert("parsing [%s:%d] : 'timeout %s' expects an integer value (in milliseconds).\n",
ha_alert("parsing [%s:%d] : 'timeout %s' expects an integer value (in milliseconds).\n",
file, linenum, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
res = parse_time_err(args[2], &timeout, TIME_UNIT_MS);
if (res) {
Alert("parsing [%s:%d] : unexpected character '%c' in 'timeout %s'.\n",
ha_alert("parsing [%s:%d] : unexpected character '%c' in 'timeout %s'.\n",
file, linenum, *res, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3326,7 +3326,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
}
else if (!strcmp(args[0], "option")) {
if (!*args[1]) {
Alert("parsing [%s:%d]: '%s' expects an option name.\n",
ha_alert("parsing [%s:%d]: '%s' expects an option name.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3350,7 +3350,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
if (global.nbthread == 1)
curagent->flags |= SPOE_FL_ASYNC;
else {
Warning("parsing [%s:%d] Async option is not supported with threads.\n",
ha_warning("parsing [%s:%d] Async option is not supported with threads.\n",
file, linenum);
err_code |= ERR_WARN;
}
@ -3369,7 +3369,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
/* Following options does not support negation */
if (kwm == 1) {
Alert("parsing [%s:%d]: negation is not supported for option '%s'.\n",
ha_alert("parsing [%s:%d]: negation is not supported for option '%s'.\n",
file, linenum, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3379,7 +3379,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
char *tmp;
if (!*args[2]) {
Alert("parsing [%s:%d]: '%s %s' expects a value.\n",
ha_alert("parsing [%s:%d]: '%s %s' expects a value.\n",
file, linenum, args[0],
args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
@ -3390,7 +3390,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
tmp = args[2];
while (*tmp) {
if (!isalnum(*tmp) && *tmp != '_' && *tmp != '.') {
Alert("parsing [%s:%d]: '%s %s' only supports [a-zA-Z_-.] chars.\n",
ha_alert("parsing [%s:%d]: '%s %s' only supports [a-zA-Z_-.] chars.\n",
file, linenum, args[0], args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3408,7 +3408,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
char *tmp;
if (!*args[2]) {
Alert("parsing [%s:%d]: '%s %s' expects a value.\n",
ha_alert("parsing [%s:%d]: '%s %s' expects a value.\n",
file, linenum, args[0],
args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
@ -3419,7 +3419,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
tmp = args[2];
while (*tmp) {
if (!isalnum(*tmp) && *tmp != '_' && *tmp != '.') {
Alert("parsing [%s:%d]: '%s %s' only supports [a-zA-Z_-.] chars.\n",
ha_alert("parsing [%s:%d]: '%s %s' only supports [a-zA-Z_-.] chars.\n",
file, linenum, args[0], args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3429,7 +3429,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
curagent->var_on_error = strdup(args[2]);
}
else {
Alert("parsing [%s:%d]: option '%s' is not supported.\n",
ha_alert("parsing [%s:%d]: option '%s' is not supported.\n",
file, linenum, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3437,7 +3437,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
}
else if (!strcmp(args[0], "maxconnrate")) {
if (!*args[1]) {
Alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3448,7 +3448,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
}
else if (!strcmp(args[0], "maxerrrate")) {
if (!*args[1]) {
Alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3459,7 +3459,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
}
else if (!strcmp(args[0], "max-frame-size")) {
if (!*args[1]) {
Alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
ha_alert("parsing [%s:%d] : '%s' expects an integer argument.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3469,14 +3469,14 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm)
curagent->max_frame_size = atol(args[1]);
if (curagent->max_frame_size < MIN_FRAME_SIZE ||
curagent->max_frame_size > MAX_FRAME_SIZE) {
Alert("parsing [%s:%d] : '%s' expects a positive integer argument in the range [%d, %d].\n",
ha_alert("parsing [%s:%d] : '%s' expects a positive integer argument in the range [%d, %d].\n",
file, linenum, args[0], MIN_FRAME_SIZE, MAX_FRAME_SIZE);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
}
else if (*args[0]) {
Alert("parsing [%s:%d] : unknown keyword '%s' in spoe-agent section.\n",
ha_alert("parsing [%s:%d] : unknown keyword '%s' in spoe-agent section.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3498,7 +3498,7 @@ cfg_parse_spoe_group(const char *file, int linenum, char **args, int kwm)
if (!strcmp(args[0], "spoe-group")) { /* new spoe-group section */
if (!*args[1]) {
Alert("parsing [%s:%d] : missing name for spoe-group section.\n",
ha_alert("parsing [%s:%d] : missing name for spoe-group section.\n",
file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
@ -3510,7 +3510,7 @@ cfg_parse_spoe_group(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",
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;
@ -3518,7 +3518,7 @@ cfg_parse_spoe_group(const char *file, int linenum, char **args, int kwm)
list_for_each_entry(grp, &curgrps, list) {
if (!strcmp(grp->id, args[1])) {
Alert("parsing [%s:%d]: spoe-group section '%s' has the same"
ha_alert("parsing [%s:%d]: spoe-group section '%s' has the same"
" name as another one declared at %s:%d.\n",
file, linenum, args[1], grp->conf.file, grp->conf.line);
err_code |= ERR_ALERT | ERR_FATAL;
@ -3527,7 +3527,7 @@ cfg_parse_spoe_group(const char *file, int linenum, char **args, int kwm)
}
if ((curgrp = calloc(1, sizeof(*curgrp))) == 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;
}
@ -3546,7 +3546,7 @@ cfg_parse_spoe_group(const char *file, int linenum, char **args, int kwm)
list_for_each_entry(ph, &curgrp->phs, list) {
if (!strcmp(ph->id, args[cur_arg])) {
Alert("parsing [%s:%d]: spoe-message '%s' already used.\n",
ha_alert("parsing [%s:%d]: spoe-message '%s' already used.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3554,7 +3554,7 @@ cfg_parse_spoe_group(const char *file, int linenum, char **args, int kwm)
}
if ((ph = calloc(1, sizeof(*ph))) == 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;
}
@ -3564,7 +3564,7 @@ cfg_parse_spoe_group(const char *file, int linenum, char **args, int kwm)
}
}
else if (*args[0]) {
Alert("parsing [%s:%d] : unknown keyword '%s' in spoe-group section.\n",
ha_alert("parsing [%s:%d] : unknown keyword '%s' in spoe-group section.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3589,7 +3589,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
if (!strcmp(args[0], "spoe-message")) { /* new spoe-message section */
if (!*args[1]) {
Alert("parsing [%s:%d] : missing name for spoe-message section.\n",
ha_alert("parsing [%s:%d] : missing name for spoe-message section.\n",
file, linenum);
err_code |= ERR_ALERT | ERR_ABORT;
goto out;
@ -3601,7 +3601,7 @@ cfg_parse_spoe_message(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",
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;
@ -3609,7 +3609,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
list_for_each_entry(msg, &curmsgs, list) {
if (!strcmp(msg->id, args[1])) {
Alert("parsing [%s:%d]: spoe-message section '%s' has the same"
ha_alert("parsing [%s:%d]: spoe-message section '%s' has the same"
" name as another one declared at %s:%d.\n",
file, linenum, args[1], msg->conf.file, msg->conf.line);
err_code |= ERR_ALERT | ERR_FATAL;
@ -3618,7 +3618,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
}
if ((curmsg = calloc(1, sizeof(*curmsg))) == 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;
}
@ -3646,7 +3646,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
int idx = 0;
if ((arg = calloc(1, sizeof(*arg))) == 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;
}
@ -3665,7 +3665,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
&idx, file, linenum, &errmsg,
&curproxy->conf.args);
if (arg->expr == NULL) {
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(arg->name);
free(arg);
@ -3681,13 +3681,13 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
else if (!strcmp(args[0], "acl")) {
err = invalid_char(args[1]);
if (err) {
Alert("parsing [%s:%d] : character '%c' is not permitted in acl name '%s'.\n",
ha_alert("parsing [%s:%d] : character '%c' is not permitted in acl name '%s'.\n",
file, linenum, *err, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (parse_acl((const char **)args + 1, &curmsg->acls, &errmsg, &curproxy->conf.args, file, linenum) == NULL) {
Alert("parsing [%s:%d] : error detected while parsing ACL '%s' : %s.\n",
ha_alert("parsing [%s:%d] : error detected while parsing ACL '%s' : %s.\n",
file, linenum, args[1], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3695,7 +3695,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
}
else if (!strcmp(args[0], "event")) {
if (!*args[1]) {
Alert("parsing [%s:%d] : missing event name.\n", file, linenum);
ha_alert("parsing [%s:%d] : missing event name.\n", file, linenum);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
@ -3721,7 +3721,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
else if (!strcmp(args[1], spoe_event_str[SPOE_EV_ON_HTTP_RSP]))
curmsg->event = SPOE_EV_ON_HTTP_RSP;
else {
Alert("parsing [%s:%d] : unkown event '%s'.\n",
ha_alert("parsing [%s:%d] : unkown event '%s'.\n",
file, linenum, args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3734,7 +3734,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
curproxy, (const char **)args+2,
&errmsg);
if (cond == NULL) {
Alert("parsing [%s:%d] : error detected while "
ha_alert("parsing [%s:%d] : error detected while "
"parsing an 'event %s' condition : %s.\n",
file, linenum, args[1], errmsg);
err_code |= ERR_ALERT | ERR_FATAL;
@ -3743,7 +3743,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
curmsg->cond = cond;
}
else if (*args[2]) {
Alert("parsing [%s:%d]: 'event %s' expects either 'if' "
ha_alert("parsing [%s:%d]: 'event %s' expects either 'if' "
"or 'unless' followed by a condition but found '%s'.\n",
file, linenum, args[1], args[2]);
err_code |= ERR_ALERT | ERR_FATAL;
@ -3751,7 +3751,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm)
}
}
else if (!*args[0]) {
Alert("parsing [%s:%d] : unknown keyword '%s' in spoe-message section.\n",
ha_alert("parsing [%s:%d] : unknown keyword '%s' in spoe-message section.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -3856,7 +3856,7 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px,
if (curagent->timeout.hello == TICK_ETERNITY ||
curagent->timeout.idle == TICK_ETERNITY ||
curagent->timeout.processing == TICK_ETERNITY) {
Warning("Proxy '%s': missing timeouts for SPOE agent '%s' declare at %s:%d.\n"
ha_warning("Proxy '%s': missing timeouts for SPOE agent '%s' declare at %s:%d.\n"
" | While not properly invalid, you will certainly encounter various problems\n"
" | with such a configuration. To fix this, please ensure that all following\n"
" | timeouts are set to a non-zero value: 'hello', 'idle', 'processing'.\n",
@ -3880,7 +3880,7 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px,
curagent->engine_id = generate_pseudo_uuid();
if (LIST_ISEMPTY(&curmphs) && LIST_ISEMPTY(&curgphs)) {
Warning("Proxy '%s': No message/group used by SPOE agent '%s' declared at %s:%d.\n",
ha_warning("Proxy '%s': No message/group used by SPOE agent '%s' declared at %s:%d.\n",
px->id, curagent->id, curagent->conf.file, curagent->conf.line);
goto finish;
}
@ -3902,12 +3902,12 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px,
if (!(px->cap & PR_CAP_FE) && (msg->event == SPOE_EV_ON_CLIENT_SESS ||
msg->event == SPOE_EV_ON_TCP_REQ_FE ||
msg->event == SPOE_EV_ON_HTTP_REQ_FE)) {
Warning("Proxy '%s': frontend event used on a backend proxy at %s:%d.\n",
ha_warning("Proxy '%s': frontend event used on a backend proxy at %s:%d.\n",
px->id, msg->conf.file, msg->conf.line);
goto next_mph;
}
if (msg->event == SPOE_EV_NONE) {
Warning("Proxy '%s': Ignore SPOE message '%s' without event at %s:%d.\n",
ha_warning("Proxy '%s': Ignore SPOE message '%s' without event at %s:%d.\n",
px->id, msg->id, msg->conf.file, msg->conf.line);
goto next_mph;
}

View File

@ -685,14 +685,14 @@ static void mworker_reload()
next_argv[next_argc++] = NULL;
}
Warning("Reexecuting Master process\n");
ha_warning("Reexecuting Master process\n");
execvp(next_argv[0], next_argv);
Warning("Failed to reexecute the master process [%d]: %s\n", pid, strerror(errno));
ha_warning("Failed to reexecute the master process [%d]: %s\n", pid, strerror(errno));
return;
alloc_error:
Warning("Failed to reexecute the master processs [%d]: Cannot allocate memory\n", pid);
ha_warning("Failed to reexecute the master processs [%d]: Cannot allocate memory\n", pid);
return;
}
@ -730,7 +730,7 @@ static void mworker_wait()
sd_notify(0, "STOPPING=1");
}
#endif
Warning("Exiting Master process...\n");
ha_warning("Exiting Master process...\n");
mworker_kill(sig);
mworker_unregister_signals();
}
@ -738,7 +738,7 @@ static void mworker_wait()
}
if (exitpid == -1 && errno == ECHILD) {
Warning("All workers are left. Leaving... (%d)\n", status);
ha_warning("All workers are left. Leaving... (%d)\n", status);
atexit_flag = 0;
exit(status); /* parent must leave using the latest status code known */
}
@ -753,18 +753,18 @@ static void mworker_wait()
status = 255;
if (!children) {
Warning("Worker %d left with exit code %d\n", exitpid, status);
ha_warning("Worker %d left with exit code %d\n", exitpid, status);
} else {
/* check if exited child was in the current children list */
if (current_child(exitpid)) {
Alert("Current worker %d left with exit code %d\n", exitpid, status);
ha_alert("Current worker %d left with exit code %d\n", exitpid, status);
if (status != 0 && status != 130 && status != 143
&& global.tune.options & GTUNE_EXIT_ONFAILURE) {
Alert("exit-on-failure: killing every workers with SIGTERM\n");
ha_alert("exit-on-failure: killing every workers with SIGTERM\n");
mworker_kill(SIGTERM);
}
} else {
Warning("Former worker %d left with exit code %d\n", exitpid, status);
ha_warning("Former worker %d left with exit code %d\n", exitpid, status);
delete_oldpid(exitpid);
}
}
@ -782,7 +782,7 @@ void reexec_on_failure()
setenv("HAPROXY_MWORKER_WAIT_ONLY", "1", 1);
Warning("Reexecuting Master process in waitpid mode\n");
ha_warning("Reexecuting Master process in waitpid mode\n");
mworker_reload();
}
@ -823,7 +823,7 @@ static void sig_dump_state(struct sig_handler *sh)
{
struct proxy *p = proxy;
Warning("SIGHUP received, dumping servers states.\n");
ha_warning("SIGHUP received, dumping servers states.\n");
while (p) {
struct server *s = p->srv;
@ -834,7 +834,7 @@ static void sig_dump_state(struct sig_handler *sh)
p->id, s->id,
(s->cur_state != SRV_ST_STOPPED) ? "UP" : "DOWN",
s->cur_sess, s->nbpend, s->counters.cum_sess);
Warning("%s\n", trash.str);
ha_warning("%s\n", trash.str);
send_log(p, LOG_NOTICE, "%s\n", trash.str);
s = s->next;
}
@ -858,7 +858,7 @@ static void sig_dump_state(struct sig_handler *sh)
p->id, p->srv_act, p->srv_bck,
p->feconn, p->beconn, p->totpend, p->nbpend, p->fe_counters.cum_conn, p->be_counters.cum_conn);
}
Warning("%s\n", trash.str);
ha_warning("%s\n", trash.str);
send_log(p, LOG_NOTICE, "%s\n", trash.str);
p = p->next;
@ -891,7 +891,7 @@ static void cfgfiles_expand_directories(void)
int dir_entries_it;
if (stat(wl->s, &file_stat)) {
Alert("Cannot open configuration file/directory %s : %s\n",
ha_alert("Cannot open configuration file/directory %s : %s\n",
wl->s,
strerror(errno));
exit(1);
@ -904,7 +904,7 @@ static void cfgfiles_expand_directories(void)
dir_entries_nb = scandir(wl->s, &dir_entries, NULL, alphasort);
if (dir_entries_nb < 0) {
Alert("Cannot open configuration directory %s : %s\n",
ha_alert("Cannot open configuration directory %s : %s\n",
wl->s,
strerror(errno));
exit(1);
@ -924,13 +924,13 @@ static void cfgfiles_expand_directories(void)
goto next_dir_entry;
if (!memprintf(&filename, "%s/%s", wl->s, dir_entry->d_name)) {
Alert("Cannot load configuration files %s : out of memory.\n",
ha_alert("Cannot load configuration files %s : out of memory.\n",
filename);
exit(1);
}
if (stat(filename, &file_stat)) {
Alert("Cannot open configuration file %s : %s\n",
ha_alert("Cannot open configuration file %s : %s\n",
wl->s,
strerror(errno));
exit(1);
@ -943,7 +943,7 @@ static void cfgfiles_expand_directories(void)
goto next_dir_entry;
if (!list_append_word(&wl->list, filename, &err)) {
Alert("Cannot load configuration files %s : %s\n",
ha_alert("Cannot load configuration files %s : %s\n",
filename,
err);
exit(1);
@ -986,12 +986,12 @@ static int get_old_sockets(const char *unixsocket)
memset(&msghdr, 0, sizeof(msghdr));
cmsgbuf = malloc(CMSG_SPACE(sizeof(int)) * MAX_SEND_FD);
if (!cmsgbuf) {
Warning("Failed to allocate memory to send sockets\n");
ha_warning("Failed to allocate memory to send sockets\n");
goto out;
}
sock = socket(PF_UNIX, SOCK_STREAM, 0);
if (sock < 0) {
Warning("Failed to connect to the old process socket '%s'\n",
ha_warning("Failed to connect to the old process socket '%s'\n",
unixsocket);
goto out;
}
@ -1000,7 +1000,7 @@ static int get_old_sockets(const char *unixsocket)
addr.sun_family = PF_UNIX;
ret = connect(sock, (struct sockaddr *)&addr, sizeof(addr));
if (ret < 0) {
Warning("Failed to connect to the old process socket '%s'\n",
ha_warning("Failed to connect to the old process socket '%s'\n",
unixsocket);
goto out;
}
@ -1012,7 +1012,7 @@ static int get_old_sockets(const char *unixsocket)
send(sock, "_getsocks\n", strlen("_getsocks\n"), 0);
/* First, get the number of file descriptors to be received */
if (recvmsg(sock, &msghdr, MSG_WAITALL) != sizeof(fd_nb)) {
Warning("Failed to get the number of sockets to be transferred !\n");
ha_warning("Failed to get the number of sockets to be transferred !\n");
goto out;
}
if (fd_nb == 0) {
@ -1021,12 +1021,12 @@ static int get_old_sockets(const char *unixsocket)
}
tmpbuf = malloc(fd_nb * (1 + MAXPATHLEN + 1 + IFNAMSIZ + sizeof(int)));
if (tmpbuf == NULL) {
Warning("Failed to allocate memory while receiving sockets\n");
ha_warning("Failed to allocate memory while receiving sockets\n");
goto out;
}
tmpfd = malloc(fd_nb * sizeof(int));
if (tmpfd == NULL) {
Warning("Failed to allocate memory while receiving sockets\n");
ha_warning("Failed to allocate memory while receiving sockets\n");
goto out;
}
msghdr.msg_control = cmsgbuf;
@ -1054,7 +1054,7 @@ static int get_old_sockets(const char *unixsocket)
size_t totlen = cmsg->cmsg_len -
CMSG_LEN(0);
if (totlen / sizeof(int) + got_fd > fd_nb) {
Warning("Got to many sockets !\n");
ha_warning("Got to many sockets !\n");
goto out;
}
/*
@ -1069,7 +1069,7 @@ static int get_old_sockets(const char *unixsocket)
} while (got_fd < fd_nb);
if (got_fd != fd_nb) {
Warning("We didn't get the expected number of sockets (expecting %d got %d)\n",
ha_warning("We didn't get the expected number of sockets (expecting %d got %d)\n",
fd_nb, got_fd);
goto out;
}
@ -1082,32 +1082,32 @@ static int get_old_sockets(const char *unixsocket)
xfer_sock = calloc(1, sizeof(*xfer_sock));
if (!xfer_sock) {
Warning("Failed to allocate memory in get_old_sockets() !\n");
ha_warning("Failed to allocate memory in get_old_sockets() !\n");
break;
}
xfer_sock->fd = -1;
socklen = sizeof(xfer_sock->addr);
if (getsockname(fd, (struct sockaddr *)&xfer_sock->addr, &socklen) != 0) {
Warning("Failed to get socket address\n");
ha_warning("Failed to get socket address\n");
free(xfer_sock);
xfer_sock = NULL;
continue;
}
if (curoff >= maxoff) {
Warning("Inconsistency while transferring sockets\n");
ha_warning("Inconsistency while transferring sockets\n");
goto out;
}
len = tmpbuf[curoff++];
if (len > 0) {
/* We have a namespace */
if (curoff + len > maxoff) {
Warning("Inconsistency while transferring sockets\n");
ha_warning("Inconsistency while transferring sockets\n");
goto out;
}
xfer_sock->namespace = malloc(len + 1);
if (!xfer_sock->namespace) {
Warning("Failed to allocate memory while transferring sockets\n");
ha_warning("Failed to allocate memory while transferring sockets\n");
goto out;
}
memcpy(xfer_sock->namespace, &tmpbuf[curoff], len);
@ -1115,19 +1115,19 @@ static int get_old_sockets(const char *unixsocket)
curoff += len;
}
if (curoff >= maxoff) {
Warning("Inconsistency while transferring sockets\n");
ha_warning("Inconsistency while transferring sockets\n");
goto out;
}
len = tmpbuf[curoff++];
if (len > 0) {
/* We have an interface */
if (curoff + len > maxoff) {
Warning("Inconsistency while transferring sockets\n");
ha_warning("Inconsistency while transferring sockets\n");
goto out;
}
xfer_sock->iface = malloc(len + 1);
if (!xfer_sock->iface) {
Warning("Failed to allocate memory while transferring sockets\n");
ha_warning("Failed to allocate memory while transferring sockets\n");
goto out;
}
memcpy(xfer_sock->iface, &tmpbuf[curoff], len);
@ -1135,7 +1135,7 @@ static int get_old_sockets(const char *unixsocket)
curoff += len;
}
if (curoff + sizeof(int) > maxoff) {
Warning("Inconsistency while transferring sockets\n");
ha_warning("Inconsistency while transferring sockets\n");
goto out;
}
memcpy(&xfer_sock->options, &tmpbuf[curoff],
@ -1189,7 +1189,7 @@ static char **copy_argv(int argc, char **argv)
newargv = calloc(argc + 2, sizeof(char *));
if (newargv == NULL) {
Warning("Cannot allocate memory\n");
ha_warning("Cannot allocate memory\n");
return NULL;
}
@ -1231,7 +1231,7 @@ static void init(int argc, char **argv)
next_argv = copy_argv(argc, argv);
if (!init_trash_buffers(1)) {
Alert("failed to initialize trash buffers.\n");
ha_alert("failed to initialize trash buffers.\n");
exit(1);
}
@ -1367,7 +1367,7 @@ static void init(int argc, char **argv)
#if defined(USE_SYSTEMD)
global.tune.options |= GTUNE_USE_SYSTEMD;
#else
Alert("master-worker mode with systemd support (-Ws) requested, but not compiled. Use master-worker mode (-W) if you are not using Type=notify in your unit file or recompile with USE_SYSTEMD=1.\n\n");
ha_alert("master-worker mode with systemd support (-Ws) requested, but not compiled. Use master-worker mode (-W) if you are not using Type=notify in your unit file or recompile with USE_SYSTEMD=1.\n\n");
usage(progname);
#endif
}
@ -1377,11 +1377,11 @@ static void init(int argc, char **argv)
arg_mode |= MODE_QUIET;
else if (*flag == 'x') {
if (argc <= 1 || argv[1][0] == '-') {
Alert("Unix socket path expected with the -x flag\n\n");
ha_alert("Unix socket path expected with the -x flag\n\n");
usage(progname);
}
if (old_unixsocket)
Warning("-x option already set, overwriting the value\n");
ha_warning("-x option already set, overwriting the value\n");
old_unixsocket = argv[1];
argv++;
@ -1397,7 +1397,7 @@ static void init(int argc, char **argv)
while (argc > 1 && argv[1][0] != '-') {
oldpids = realloc(oldpids, (nb_oldpids + 1) * sizeof(int));
if (!oldpids) {
Alert("Cannot allocate old pid : out of memory.\n");
ha_alert("Cannot allocate old pid : out of memory.\n");
exit(1);
}
argc--; argv++;
@ -1412,7 +1412,7 @@ static void init(int argc, char **argv)
argv++; argc--;
while (argc > 0) {
if (!list_append_word(&cfg_cfgfiles, *argv, &err_msg)) {
Alert("Cannot load configuration file/directory %s : %s\n",
ha_alert("Cannot load configuration file/directory %s : %s\n",
*argv,
err_msg);
exit(1);
@ -1434,7 +1434,7 @@ static void init(int argc, char **argv)
case 'L' : strncpy(localpeer, *argv, sizeof(localpeer) - 1); break;
case 'f' :
if (!list_append_word(&cfg_cfgfiles, *argv, &err_msg)) {
Alert("Cannot load configuration file/directory %s : %s\n",
ha_alert("Cannot load configuration file/directory %s : %s\n",
*argv,
err_msg);
exit(1);
@ -1466,7 +1466,7 @@ static void init(int argc, char **argv)
}
if (change_dir && chdir(change_dir) < 0) {
Alert("Could not change to directory %s : %s\n", change_dir, strerror(errno));
ha_alert("Could not change to directory %s : %s\n", change_dir, strerror(errno));
exit(1);
}
@ -1485,12 +1485,12 @@ static void init(int argc, char **argv)
ret = readcfgfile(wl->s);
if (ret == -1) {
Alert("Could not open configuration file %s : %s\n",
ha_alert("Could not open configuration file %s : %s\n",
wl->s, strerror(errno));
exit(1);
}
if (ret & (ERR_ABORT|ERR_FATAL))
Alert("Error(s) found in configuration file : %s\n", wl->s);
ha_alert("Error(s) found in configuration file : %s\n", wl->s);
err_code |= ret;
if (err_code & ERR_ABORT)
exit(1);
@ -1501,7 +1501,7 @@ static void init(int argc, char **argv)
* or failed memory allocations.
*/
if (err_code & (ERR_ABORT|ERR_FATAL)) {
Alert("Fatal errors found in configuration.\n");
ha_alert("Fatal errors found in configuration.\n");
exit(1);
}
@ -1509,7 +1509,7 @@ static void init(int argc, char **argv)
err_code |= check_config_validity();
if (err_code & (ERR_ABORT|ERR_FATAL)) {
Alert("Fatal errors found in configuration.\n");
ha_alert("Fatal errors found in configuration.\n");
exit(1);
}
@ -1532,7 +1532,7 @@ static void init(int argc, char **argv)
#ifdef CONFIG_HAP_NS
err_code |= netns_init();
if (err_code & (ERR_ABORT|ERR_FATAL)) {
Alert("Failed to initialize namespace support.\n");
ha_alert("Failed to initialize namespace support.\n");
exit(1);
}
#endif
@ -1546,7 +1546,7 @@ static void init(int argc, char **argv)
/* Apply servers' configured address */
err_code |= srv_init_addr();
if (err_code & (ERR_ABORT|ERR_FATAL)) {
Alert("Failed to initialize server(s) addr.\n");
ha_alert("Failed to initialize server(s) addr.\n");
exit(1);
}
@ -1573,7 +1573,7 @@ static void init(int argc, char **argv)
global_listener_queue_task = task_new(MAX_THREADS_MASK);
if (!global_listener_queue_task) {
Alert("Out of memory when initializing global task\n");
ha_alert("Out of memory when initializing global task\n");
exit(1);
}
/* very simple initialization, users will queue the task if needed */
@ -1679,7 +1679,7 @@ static void init(int argc, char **argv)
global.maxsslconn = round_2dig(global.maxsslconn);
if (sslmem <= 0 || global.maxsslconn < sides) {
Alert("Cannot compute the automatic maxsslconn because global.maxconn is already too "
ha_alert("Cannot compute the automatic maxsslconn because global.maxconn is already too "
"high for the global.memmax value (%d MB). The absolute maximum possible value "
"without SSL is %d, but %d was found and SSL is in use.\n",
global.rlimit_memmax,
@ -1719,7 +1719,7 @@ static void init(int argc, char **argv)
#endif /* SYSTEM_MAXCONN */
if (clearmem <= 0 || !global.maxconn) {
Alert("Cannot compute the automatic maxconn because global.maxsslconn is already too "
ha_alert("Cannot compute the automatic maxconn because global.maxsslconn is already too "
"high for the global.memmax value (%d MB). The absolute maximum possible value "
"is %d, but %d was found.\n",
global.rlimit_memmax,
@ -1803,13 +1803,13 @@ static void init(int argc, char **argv)
global.mode |= (arg_mode & (MODE_QUIET | MODE_VERBOSE));
if ((global.mode & MODE_DEBUG) && (global.mode & (MODE_DAEMON | MODE_QUIET))) {
Warning("<debug> mode incompatible with <quiet> and <daemon>. Keeping <debug> only.\n");
ha_warning("<debug> mode incompatible with <quiet> and <daemon>. Keeping <debug> only.\n");
global.mode &= ~(MODE_DAEMON | MODE_QUIET);
}
if ((global.nbproc > 1) && !(global.mode & (MODE_DAEMON | MODE_MWORKER))) {
if (!(global.mode & (MODE_FOREGROUND | MODE_DEBUG)))
Warning("<nbproc> is only meaningful in daemon mode or master-worker mode. Setting limit to 1 process.\n");
ha_warning("<nbproc> is only meaningful in daemon mode or master-worker mode. Setting limit to 1 process.\n");
global.nbproc = 1;
}
@ -1821,12 +1821,12 @@ static void init(int argc, char **argv)
/* Realloc trash buffers because global.tune.bufsize may have changed */
if (!init_trash_buffers(0)) {
Alert("failed to initialize trash buffers.\n");
ha_alert("failed to initialize trash buffers.\n");
exit(1);
}
if (!init_log_buffers()) {
Alert("failed to initialize log buffers.\n");
ha_alert("failed to initialize log buffers.\n");
exit(1);
}
@ -1856,7 +1856,7 @@ static void init(int argc, char **argv)
}
if (!init_pollers()) {
Alert("No polling mechanism available.\n"
ha_alert("No polling mechanism available.\n"
" It is likely that haproxy was built with TARGET=generic and that FD_SETSIZE\n"
" is too low on this platform to support maxconn and the number of listeners\n"
" and servers. You should rebuild haproxy specifying your system using TARGET=\n"
@ -2362,7 +2362,7 @@ static void *run_thread_poll_loop(void *data)
list_for_each_entry(ptif, &per_thread_init_list, list) {
if (!ptif->fct()) {
Alert("failed to initialize thread %u.\n", tid);
ha_alert("failed to initialize thread %u.\n", tid);
exit(1);
}
}
@ -2448,7 +2448,7 @@ int main(int argc, char **argv)
if (setrlimit(RLIMIT_NOFILE, &limit) != -1)
getrlimit(RLIMIT_NOFILE, &limit);
Warning("[%s.main()] Cannot raise FD limit to %d, limit is %d.\n", argv[0], global.rlimit_nofile, (int)limit.rlim_cur);
ha_warning("[%s.main()] Cannot raise FD limit to %d, limit is %d.\n", argv[0], global.rlimit_nofile, (int)limit.rlim_cur);
global.rlimit_nofile = limit.rlim_cur;
}
}
@ -2458,12 +2458,12 @@ int main(int argc, char **argv)
global.rlimit_memmax * 1048576ULL;
#ifdef RLIMIT_AS
if (setrlimit(RLIMIT_AS, &limit) == -1) {
Warning("[%s.main()] Cannot fix MEM limit to %d megs.\n",
ha_warning("[%s.main()] Cannot fix MEM limit to %d megs.\n",
argv[0], global.rlimit_memmax);
}
#else
if (setrlimit(RLIMIT_DATA, &limit) == -1) {
Warning("[%s.main()] Cannot fix MEM limit to %d megs.\n",
ha_warning("[%s.main()] Cannot fix MEM limit to %d megs.\n",
argv[0], global.rlimit_memmax);
}
#endif
@ -2472,7 +2472,7 @@ int main(int argc, char **argv)
if (old_unixsocket) {
if (strcmp("/dev/null", old_unixsocket) != 0) {
if (get_old_sockets(old_unixsocket) != 0) {
Alert("Failed to get the sockets from the old process!\n");
ha_alert("Failed to get the sockets from the old process!\n");
if (!(global.mode & MODE_MWORKER))
exit(1);
}
@ -2521,7 +2521,7 @@ int main(int argc, char **argv)
}
if (listeners == 0) {
Alert("[%s.main()] No enabled listener found (check for 'bind' directives) ! Exiting.\n", argv[0]);
ha_alert("[%s.main()] No enabled listener found (check for 'bind' directives) ! Exiting.\n", argv[0]);
/* Note: we don't have to send anything to the old pids because we
* never stopped them. */
exit(1);
@ -2530,15 +2530,15 @@ int main(int argc, char **argv)
err = protocol_bind_all(errmsg, sizeof(errmsg));
if ((err & ~ERR_WARN) != ERR_NONE) {
if ((err & ERR_ALERT) || (err & ERR_WARN))
Alert("[%s.main()] %s.\n", argv[0], errmsg);
ha_alert("[%s.main()] %s.\n", argv[0], errmsg);
Alert("[%s.main()] Some protocols failed to start their listeners! Exiting.\n", argv[0]);
ha_alert("[%s.main()] Some protocols failed to start their listeners! Exiting.\n", argv[0]);
protocol_unbind_all(); /* cleanup everything we can */
if (nb_oldpids)
tell_old_pids(SIGTTIN);
exit(1);
} else if (err & ERR_WARN) {
Alert("[%s.main()] %s.\n", argv[0], errmsg);
ha_alert("[%s.main()] %s.\n", argv[0], errmsg);
}
/* Ok, all listener should now be bound, close any leftover sockets
* the previous process gave us, we don't need them anymore
@ -2568,7 +2568,7 @@ int main(int argc, char **argv)
unlink(global.pidfile);
pidfd = open(global.pidfile, O_CREAT | O_WRONLY | O_TRUNC, 0644);
if (pidfd < 0) {
Alert("[%s.main()] Cannot create pidfile %s\n", argv[0], global.pidfile);
ha_alert("[%s.main()] Cannot create pidfile %s\n", argv[0], global.pidfile);
if (nb_oldpids)
tell_old_pids(SIGTTIN);
protocol_unbind_all();
@ -2577,7 +2577,7 @@ int main(int argc, char **argv)
}
if ((global.last_checks & LSTCHK_NETADM) && global.uid) {
Alert("[%s.main()] Some configuration options require full privileges, so global.uid cannot be changed.\n"
ha_alert("[%s.main()] Some configuration options require full privileges, so global.uid cannot be changed.\n"
"", argv[0]);
protocol_unbind_all();
exit(1);
@ -2587,7 +2587,7 @@ int main(int argc, char **argv)
* but we inform him that unexpected behaviour may occur.
*/
if ((global.last_checks & LSTCHK_NETADM) && getuid())
Warning("[%s.main()] Some options which require full privileges"
ha_warning("[%s.main()] Some options which require full privileges"
" might not work well.\n"
"", argv[0]);
@ -2596,7 +2596,7 @@ int main(int argc, char **argv)
/* chroot if needed */
if (global.chroot != NULL) {
if (chroot(global.chroot) == -1 || chdir("/") == -1) {
Alert("[%s.main()] Cannot chroot(%s).\n", argv[0], global.chroot);
ha_alert("[%s.main()] Cannot chroot(%s).\n", argv[0], global.chroot);
if (nb_oldpids)
tell_old_pids(SIGTTIN);
protocol_unbind_all();
@ -2623,18 +2623,18 @@ int main(int argc, char **argv)
/* setgid / setuid */
if (global.gid) {
if (getgroups(0, NULL) > 0 && setgroups(0, NULL) == -1)
Warning("[%s.main()] Failed to drop supplementary groups. Using 'gid'/'group'"
ha_warning("[%s.main()] Failed to drop supplementary groups. Using 'gid'/'group'"
" without 'uid'/'user' is generally useless.\n", argv[0]);
if (setgid(global.gid) == -1) {
Alert("[%s.main()] Cannot set gid %d.\n", argv[0], global.gid);
ha_alert("[%s.main()] Cannot set gid %d.\n", argv[0], global.gid);
protocol_unbind_all();
exit(1);
}
}
if (global.uid && setuid(global.uid) == -1) {
Alert("[%s.main()] Cannot set uid %d.\n", argv[0], global.uid);
ha_alert("[%s.main()] Cannot set uid %d.\n", argv[0], global.uid);
protocol_unbind_all();
exit(1);
}
@ -2643,7 +2643,7 @@ int main(int argc, char **argv)
limit.rlim_cur = limit.rlim_max = 0;
getrlimit(RLIMIT_NOFILE, &limit);
if (limit.rlim_cur < global.maxsock) {
Warning("[%s.main()] FD limit (%d) too low for maxconn=%d/maxsock=%d. Please raise 'ulimit-n' to %d or more to avoid any trouble.\n",
ha_warning("[%s.main()] FD limit (%d) too low for maxconn=%d/maxsock=%d. Please raise 'ulimit-n' to %d or more to avoid any trouble.\n",
argv[0], (int)limit.rlim_cur, global.maxconn, global.maxsock, global.maxsock);
}
@ -2664,7 +2664,7 @@ int main(int argc, char **argv)
&& (global.mode & MODE_DAEMON)) {
ret = fork();
if (ret < 0) {
Alert("[%s.main()] Cannot fork.\n", argv[0]);
ha_alert("[%s.main()] Cannot fork.\n", argv[0]);
protocol_unbind_all();
exit(1); /* there has been an error */
}
@ -2679,7 +2679,7 @@ int main(int argc, char **argv)
/* master pipe to ensure the master is still alive */
ret = pipe(mworker_pipe);
if (ret < 0) {
Warning("[%s.main()] Cannot create master pipe.\n", argv[0]);
ha_warning("[%s.main()] Cannot create master pipe.\n", argv[0]);
} else {
memprintf(&msg, "%d", mworker_pipe[0]);
setenv("HAPROXY_MWORKER_PIPE_RD", msg, 1);
@ -2691,7 +2691,7 @@ int main(int argc, char **argv)
mworker_pipe[0] = atol(getenv("HAPROXY_MWORKER_PIPE_RD"));
mworker_pipe[1] = atol(getenv("HAPROXY_MWORKER_PIPE_WR"));
if (mworker_pipe[0] <= 0 || mworker_pipe[1] <= 0) {
Warning("[%s.main()] Cannot get master pipe FDs.\n", argv[0]);
ha_warning("[%s.main()] Cannot get master pipe FDs.\n", argv[0]);
}
}
}
@ -2707,7 +2707,7 @@ int main(int argc, char **argv)
for (proc = 0; proc < global.nbproc; proc++) {
ret = fork();
if (ret < 0) {
Alert("[%s.main()] Cannot fork.\n", argv[0]);
ha_alert("[%s.main()] Cannot fork.\n", argv[0]);
protocol_unbind_all();
exit(1); /* there has been an error */
}
@ -2774,7 +2774,7 @@ int main(int argc, char **argv)
/* chroot if needed */
if (global.chroot != NULL) {
if (chroot(global.chroot) == -1 || chdir("/") == -1) {
Alert("[%s.main()] Cannot chroot1(%s).\n", argv[0], global.chroot);
ha_alert("[%s.main()] Cannot chroot1(%s).\n", argv[0], global.chroot);
if (nb_oldpids)
tell_old_pids(SIGTTIN);
protocol_unbind_all();
@ -2788,18 +2788,18 @@ int main(int argc, char **argv)
/* setgid / setuid */
if (global.gid) {
if (getgroups(0, NULL) > 0 && setgroups(0, NULL) == -1)
Warning("[%s.main()] Failed to drop supplementary groups. Using 'gid'/'group'"
ha_warning("[%s.main()] Failed to drop supplementary groups. Using 'gid'/'group'"
" without 'uid'/'user' is generally useless.\n", argv[0]);
if (setgid(global.gid) == -1) {
Alert("[%s.main()] Cannot set gid %d.\n", argv[0], global.gid);
ha_alert("[%s.main()] Cannot set gid %d.\n", argv[0], global.gid);
protocol_unbind_all();
exit(1);
}
}
if (global.uid && setuid(global.uid) == -1) {
Alert("[%s.main()] Cannot set uid %d.\n", argv[0], global.uid);
ha_alert("[%s.main()] Cannot set uid %d.\n", argv[0], global.uid);
protocol_unbind_all();
exit(1);
}

View File

@ -259,7 +259,7 @@ __LJMP static int hlua_http_get_headers(lua_State *L, struct hlua_txn *htxn, str
do { \
send_log(__be, LOG_ERR, __fmt, ## __args); \
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE)) \
Alert(__fmt, ## __args); \
ha_alert(__fmt, ## __args); \
} while (0)
/* Used to check an Lua function type in the stack. It creates and
@ -7291,15 +7291,15 @@ int hlua_post_init()
lua_pop(gL.T, -1);
return 1;
case HLUA_E_AGAIN:
Alert("lua init: yield not allowed.\n");
ha_alert("lua init: yield not allowed.\n");
return 0;
case HLUA_E_ERRMSG:
msg = lua_tostring(gL.T, -1);
Alert("lua init: %s.\n", msg);
ha_alert("lua init: %s.\n", msg);
return 0;
case HLUA_E_ERR:
default:
Alert("lua init: unknown runtime error.\n");
ha_alert("lua init: unknown runtime error.\n");
return 0;
}
}

View File

@ -176,9 +176,9 @@ static int __resume_listener(struct listener *l)
err = l->proto->bind(l, msg, sizeof(msg));
if (err & ERR_ALERT)
Alert("Resuming listener: %s\n", msg);
ha_alert("Resuming listener: %s\n", msg);
else if (err & ERR_WARN)
Warning("Resuming listener: %s\n", msg);
ha_warning("Resuming listener: %s\n", msg);
if (err & (ERR_FATAL | ERR_ABORT)) {
ret = 0;

View File

@ -388,7 +388,7 @@ int parse_logformat_var(char *arg, int arg_len, char *var, int var_len, struct p
LIST_ADDQ(list_format, &node->list);
}
if (logformat_keywords[j].replace_by)
Warning("parsing [%s:%d] : deprecated variable '%s' in '%s', please replace it with '%s'.\n",
ha_warning("parsing [%s:%d] : deprecated variable '%s' in '%s', please replace it with '%s'.\n",
curproxy->conf.args.file, curproxy->conf.args.line,
logformat_keywords[j].name, fmt_directive(curproxy), logformat_keywords[j].replace_by);
return 1;
@ -698,7 +698,7 @@ static void print_message(const char *label, const char *fmt, va_list argp)
* 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, ...)
{
va_list argp;
@ -713,7 +713,7 @@ void Alert(const char *fmt, ...)
/*
* Displays the message on stderr with the date and pid.
*/
void Warning(const char *fmt, ...)
void ha_warning(const char *fmt, ...)
{
va_list argp;
@ -1168,7 +1168,7 @@ void __send_log(struct proxy *p, int level, char *message, size_t size, char *sd
int proto = logsrv->addr.ss_family == AF_UNIX ? 0 : IPPROTO_UDP;
if ((*plogfd = socket(logsrv->addr.ss_family, SOCK_DGRAM, proto)) < 0) {
Alert("socket for logger #%d failed: %s (errno=%d)\n",
ha_alert("socket for logger #%d failed: %s (errno=%d)\n",
nblogger, strerror(errno), errno);
continue;
}
@ -1296,7 +1296,7 @@ void __send_log(struct proxy *p, int level, char *message, size_t size, char *sd
sent = sendmsg(*plogfd, &msghdr, MSG_DONTWAIT | MSG_NOSIGNAL);
if (sent < 0) {
Alert("sendmsg logger #%d failed: %s (errno=%d)\n",
ha_alert("sendmsg logger #%d failed: %s (errno=%d)\n",
nblogger, strerror(errno), errno);
}
}

View File

@ -52,7 +52,7 @@ int netns_init(void)
* is not needed either */
if (!eb_is_empty(&namespace_tree_root)) {
if (init_default_namespace() < 0) {
Alert("Failed to open the default namespace.\n");
ha_alert("Failed to open the default namespace.\n");
err_code |= ERR_ALERT | ERR_FATAL;
}
}

View File

@ -1891,12 +1891,12 @@ static struct appctx *peer_session_create(struct peers *peers, struct peer *peer
sess = session_new(p, NULL, &appctx->obj_type);
if (!sess) {
Alert("out of memory in peer_session_create().\n");
ha_alert("out of memory in peer_session_create().\n");
goto out_free_appctx;
}
if ((s = stream_new(sess, &appctx->obj_type)) == NULL) {
Alert("Failed to initialize stream in peer_session_create().\n");
ha_alert("Failed to initialize stream in peer_session_create().\n");
goto out_free_sess;
}

View File

@ -406,7 +406,7 @@ void init_proto_http()
for (msg = 0; msg < HTTP_ERR_SIZE; msg++) {
if (!http_err_msgs[msg]) {
Alert("Internal error: no message defined for HTTP return code %d. Aborting.\n", msg);
ha_alert("Internal error: no message defined for HTTP return code %d. Aborting.\n", msg);
abort();
}
@ -1227,7 +1227,7 @@ void capture_headers(char *som, struct hdr_idx *idx,
pool_alloc2(h->pool);
if (cap[h->index] == NULL) {
Alert("HTTP capture : out of memory.\n");
ha_alert("HTTP capture : out of memory.\n");
continue;
}
@ -1969,7 +1969,7 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit)
if (!(s->logs.logwait &= ~(LW_REQ|LW_INIT)))
s->do_log(s);
} else {
Alert("HTTP logging : out of memory.\n");
ha_alert("HTTP logging : out of memory.\n");
}
}
@ -5897,7 +5897,7 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s
if (sess->listener->counters)
HA_ATOMIC_ADD(&sess->listener->counters->denied_resp, 1);
Alert("Blocking cacheable cookie in response from instance %s, server %s.\n",
ha_alert("Blocking cacheable cookie in response from instance %s, server %s.\n",
s->be->id, objt_server(s->target) ? objt_server(s->target)->id : "<dispatch>");
send_log(s->be, LOG_ALERT,
"Blocking cacheable cookie in response from instance %s, server %s.\n",
@ -6891,7 +6891,7 @@ void manage_client_side_cookies(struct stream *s, struct channel *req)
int log_len = val_end - att_beg;
if ((txn->cli_cookie = pool_alloc2(pool2_capture)) == NULL) {
Alert("HTTP logging : out of memory.\n");
ha_alert("HTTP logging : out of memory.\n");
} else {
if (log_len > sess->fe->capture_len)
log_len = sess->fe->capture_len;
@ -7543,7 +7543,7 @@ void manage_server_side_cookies(struct stream *s, struct channel *res)
memcmp(att_beg, sess->fe->capture_name, sess->fe->capture_namelen) == 0) {
int log_len = val_end - att_beg;
if ((txn->srv_cookie = pool_alloc2(pool2_capture)) == NULL) {
Alert("HTTP logging : out of memory.\n");
ha_alert("HTTP logging : out of memory.\n");
}
else {
if (log_len > sess->fe->capture_len)
@ -8185,7 +8185,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
rule = calloc(1, sizeof(*rule));
if (!rule) {
Alert("parsing [%s:%d]: out of memory.\n", file, linenum);
ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum);
goto out_err;
}
@ -8208,7 +8208,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (strcmp(args[cur_arg], "deny_status") == 0) {
cur_arg++;
if (!args[cur_arg]) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : missing status code.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : missing status code.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0]);
goto out_err;
}
@ -8223,7 +8223,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
}
if (hc >= HTTP_ERR_SIZE) {
Warning("parsing [%s:%d] : status code %d not handled, using default code %d.\n",
ha_warning("parsing [%s:%d] : status code %d not handled, using default code %d.\n",
file, linenum, code, http_err_codes[rule->deny_status]);
}
}
@ -8245,7 +8245,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg + 1] && strcmp(args[cur_arg + 1], "if") != 0 && strcmp(args[cur_arg + 1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument (integer value).\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument (integer value).\n",
file, linenum, args[0]);
goto out_err;
}
@ -8263,20 +8263,20 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg + 1] && strcmp(args[cur_arg + 1], "if") != 0 && strcmp(args[cur_arg + 1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument (integer/hex value).\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument (integer/hex value).\n",
file, linenum, args[0]);
goto out_err;
}
rule->arg.tos = strtol(args[cur_arg], &err, 0);
if (err && *err != '\0') {
Alert("parsing [%s:%d]: invalid character starting at '%s' in 'http-request %s' (integer/hex value expected).\n",
ha_alert("parsing [%s:%d]: invalid character starting at '%s' in 'http-request %s' (integer/hex value expected).\n",
file, linenum, err, args[0]);
goto out_err;
}
cur_arg++;
#else
Alert("parsing [%s:%d]: 'http-request %s' is not supported on this platform (IP_TOS undefined).\n", file, linenum, args[0]);
ha_alert("parsing [%s:%d]: 'http-request %s' is not supported on this platform (IP_TOS undefined).\n", file, linenum, args[0]);
goto out_err;
#endif
} else if (!strcmp(args[0], "set-mark")) {
@ -8287,21 +8287,21 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg + 1] && strcmp(args[cur_arg + 1], "if") != 0 && strcmp(args[cur_arg + 1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument (integer/hex value).\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument (integer/hex value).\n",
file, linenum, args[0]);
goto out_err;
}
rule->arg.mark = strtoul(args[cur_arg], &err, 0);
if (err && *err != '\0') {
Alert("parsing [%s:%d]: invalid character starting at '%s' in 'http-request %s' (integer/hex value expected).\n",
ha_alert("parsing [%s:%d]: invalid character starting at '%s' in 'http-request %s' (integer/hex value expected).\n",
file, linenum, err, args[0]);
goto out_err;
}
cur_arg++;
global.last_checks |= LSTCHK_NETADM;
#else
Alert("parsing [%s:%d]: 'http-request %s' is not supported on this platform (SO_MARK undefined).\n", file, linenum, args[0]);
ha_alert("parsing [%s:%d]: 'http-request %s' is not supported on this platform (SO_MARK undefined).\n", file, linenum, args[0]);
goto out_err;
#endif
} else if (!strcmp(args[0], "set-log-level")) {
@ -8311,7 +8311,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg + 1] && strcmp(args[cur_arg + 1], "if") != 0 && strcmp(args[cur_arg + 1], "unless") != 0)) {
bad_log_level:
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument (log level name or 'silent').\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument (log level name or 'silent').\n",
file, linenum, args[0]);
goto out_err;
}
@ -8326,7 +8326,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] || !*args[cur_arg+1] ||
(*args[cur_arg+2] && strcmp(args[cur_arg+2], "if") != 0 && strcmp(args[cur_arg+2], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 2 arguments.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 2 arguments.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8339,7 +8339,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.hdr_add.fmt, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-request %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-request %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8354,7 +8354,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] || !*args[cur_arg+1] || !*args[cur_arg+2] ||
(*args[cur_arg+3] && strcmp(args[cur_arg+3], "if") != 0 && strcmp(args[cur_arg+3], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 3 arguments.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 3 arguments.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8365,7 +8365,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
error = NULL;
if (!regex_comp(args[cur_arg + 1], &rule->arg.hdr_add.re, 1, 1, &error)) {
Alert("parsing [%s:%d] : '%s' : %s.\n", file, linenum,
ha_alert("parsing [%s:%d] : '%s' : %s.\n", file, linenum,
args[cur_arg + 1], error);
free(error);
goto out_err;
@ -8375,7 +8375,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg + 2], proxy, &rule->arg.hdr_add.fmt, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-request %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-request %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8391,7 +8391,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg+1] && strcmp(args[cur_arg+1], "if") != 0 && strcmp(args[cur_arg+1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8416,7 +8416,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
expr = sample_parse_expr((char **)args, &cur_arg, file, linenum, &err, &proxy->conf.args);
if (!expr) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : %s.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], err);
free(err);
goto out_err;
@ -8429,7 +8429,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
where |= SMP_VAL_BE_HRQ_HDR;
if (!(expr->fetch->val & where)) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule :"
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule :"
" fetch method '%s' extracts information from '%s', none of which is available here.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0],
args[cur_arg-1], sample_src_names(expr->fetch->use));
@ -8440,7 +8440,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (strcmp(args[cur_arg], "table") == 0) {
cur_arg++;
if (!args[cur_arg]) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : missing table name.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : missing table name.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0]);
free(expr);
goto out_err;
@ -8457,7 +8457,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
char *errmsg = NULL;
if ((redir = http_parse_redirect_rule(file, linenum, proxy, (const char **)args + 1, &errmsg, 1, 0)) == NULL) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : %s.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], errmsg);
goto out_err;
}
@ -8484,7 +8484,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg+1] && strcmp(args[cur_arg+1], "if") != 0 && strcmp(args[cur_arg+1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8494,7 +8494,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.map.key, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-request %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-request %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8516,7 +8516,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg+1] && strcmp(args[cur_arg+1], "if") != 0 && strcmp(args[cur_arg+1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8526,7 +8526,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.map.key, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-request %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-request %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8548,7 +8548,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg+1] && strcmp(args[cur_arg+1], "if") != 0 && strcmp(args[cur_arg+1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 1 argument.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8558,7 +8558,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.map.key, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-request %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-request %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8580,7 +8580,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
if (!*args[cur_arg] || !*args[cur_arg+1] ||
(*args[cur_arg+2] && strcmp(args[cur_arg+2], "if") != 0 && strcmp(args[cur_arg+2], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-request %s' expects exactly 2 arguments.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' expects exactly 2 arguments.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8593,7 +8593,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.map.key, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-request %s' key: %s.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' key: %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8603,7 +8603,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.map.value, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-request %s' pattern: %s.\n",
ha_alert("parsing [%s:%d]: 'http-request %s' pattern: %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8620,14 +8620,14 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
rule->from = ACT_F_HTTP_REQ;
rule->kw = custom;
if (custom->parse(args, &cur_arg, proxy, rule, &errmsg) == ACT_RET_PRS_ERR) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : %s.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-request %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], errmsg);
free(errmsg);
goto out_err;
}
} else {
action_build_list(&http_req_keywords.list, &trash);
Alert("parsing [%s:%d]: 'http-request' expects 'allow', 'deny', 'auth', 'redirect', "
ha_alert("parsing [%s:%d]: 'http-request' expects 'allow', 'deny', 'auth', 'redirect', "
"'tarpit', 'add-header', 'set-header', 'replace-header', 'replace-value', 'set-nice', "
"'set-tos', 'set-mark', 'set-log-level', 'add-acl', 'del-acl', 'del-map', 'set-map', 'track-sc*'"
"%s%s, but got '%s'%s.\n",
@ -8640,7 +8640,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
char *errmsg = NULL;
if ((cond = build_acl_cond(file, linenum, &proxy->acl, proxy, args+cur_arg, &errmsg)) == NULL) {
Alert("parsing [%s:%d] : error detected while parsing an 'http-request %s' condition : %s.\n",
ha_alert("parsing [%s:%d] : error detected while parsing an 'http-request %s' condition : %s.\n",
file, linenum, args[0], errmsg);
free(errmsg);
goto out_err;
@ -8648,7 +8648,7 @@ struct act_rule *parse_http_req_cond(const char **args, const char *file, int li
rule->cond = cond;
}
else if (*args[cur_arg]) {
Alert("parsing [%s:%d]: 'http-request %s' expects 'realm' for 'auth' or"
ha_alert("parsing [%s:%d]: 'http-request %s' expects 'realm' for 'auth' or"
" either 'if' or 'unless' followed by a condition but found '%s'.\n",
file, linenum, args[0], args[cur_arg]);
goto out_err;
@ -8670,7 +8670,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
rule = calloc(1, sizeof(*rule));
if (!rule) {
Alert("parsing [%s:%d]: out of memory.\n", file, linenum);
ha_alert("parsing [%s:%d]: out of memory.\n", file, linenum);
goto out_err;
}
@ -8686,7 +8686,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg + 1] && strcmp(args[cur_arg + 1], "if") != 0 && strcmp(args[cur_arg + 1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument (integer value).\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument (integer value).\n",
file, linenum, args[0]);
goto out_err;
}
@ -8704,20 +8704,20 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg + 1] && strcmp(args[cur_arg + 1], "if") != 0 && strcmp(args[cur_arg + 1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument (integer/hex value).\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument (integer/hex value).\n",
file, linenum, args[0]);
goto out_err;
}
rule->arg.tos = strtol(args[cur_arg], &err, 0);
if (err && *err != '\0') {
Alert("parsing [%s:%d]: invalid character starting at '%s' in 'http-response %s' (integer/hex value expected).\n",
ha_alert("parsing [%s:%d]: invalid character starting at '%s' in 'http-response %s' (integer/hex value expected).\n",
file, linenum, err, args[0]);
goto out_err;
}
cur_arg++;
#else
Alert("parsing [%s:%d]: 'http-response %s' is not supported on this platform (IP_TOS undefined).\n", file, linenum, args[0]);
ha_alert("parsing [%s:%d]: 'http-response %s' is not supported on this platform (IP_TOS undefined).\n", file, linenum, args[0]);
goto out_err;
#endif
} else if (!strcmp(args[0], "set-mark")) {
@ -8728,21 +8728,21 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg + 1] && strcmp(args[cur_arg + 1], "if") != 0 && strcmp(args[cur_arg + 1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument (integer/hex value).\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument (integer/hex value).\n",
file, linenum, args[0]);
goto out_err;
}
rule->arg.mark = strtoul(args[cur_arg], &err, 0);
if (err && *err != '\0') {
Alert("parsing [%s:%d]: invalid character starting at '%s' in 'http-response %s' (integer/hex value expected).\n",
ha_alert("parsing [%s:%d]: invalid character starting at '%s' in 'http-response %s' (integer/hex value expected).\n",
file, linenum, err, args[0]);
goto out_err;
}
cur_arg++;
global.last_checks |= LSTCHK_NETADM;
#else
Alert("parsing [%s:%d]: 'http-response %s' is not supported on this platform (SO_MARK undefined).\n", file, linenum, args[0]);
ha_alert("parsing [%s:%d]: 'http-response %s' is not supported on this platform (SO_MARK undefined).\n", file, linenum, args[0]);
goto out_err;
#endif
} else if (!strcmp(args[0], "set-log-level")) {
@ -8752,7 +8752,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg + 1] && strcmp(args[cur_arg + 1], "if") != 0 && strcmp(args[cur_arg + 1], "unless") != 0)) {
bad_log_level:
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument (log level name or 'silent').\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument (log level name or 'silent').\n",
file, linenum, args[0]);
goto out_err;
}
@ -8767,7 +8767,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] || !*args[cur_arg+1] ||
(*args[cur_arg+2] && strcmp(args[cur_arg+2], "if") != 0 && strcmp(args[cur_arg+2], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 2 arguments.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 2 arguments.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8780,7 +8780,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.hdr_add.fmt, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-response %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-response %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8795,7 +8795,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] || !*args[cur_arg+1] || !*args[cur_arg+2] ||
(*args[cur_arg+3] && strcmp(args[cur_arg+3], "if") != 0 && strcmp(args[cur_arg+3], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 3 arguments.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 3 arguments.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8806,7 +8806,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
error = NULL;
if (!regex_comp(args[cur_arg + 1], &rule->arg.hdr_add.re, 1, 1, &error)) {
Alert("parsing [%s:%d] : '%s' : %s.\n", file, linenum,
ha_alert("parsing [%s:%d] : '%s' : %s.\n", file, linenum,
args[cur_arg + 1], error);
free(error);
goto out_err;
@ -8816,7 +8816,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg + 2], proxy, &rule->arg.hdr_add.fmt, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-response %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-response %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8832,7 +8832,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg+1] && strcmp(args[cur_arg+1], "if") != 0 && strcmp(args[cur_arg+1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8858,7 +8858,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg+1] && strcmp(args[cur_arg+1], "if") != 0 && strcmp(args[cur_arg+1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8868,7 +8868,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.map.key, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-response %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-response %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8891,7 +8891,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg+1] && strcmp(args[cur_arg+1], "if") != 0 && strcmp(args[cur_arg+1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8901,7 +8901,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.map.key, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-response %s': %s.\n",
ha_alert("parsing [%s:%d]: 'http-response %s': %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8923,7 +8923,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] ||
(*args[cur_arg+1] && strcmp(args[cur_arg+1], "if") != 0 && strcmp(args[cur_arg+1], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 1 argument.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8933,7 +8933,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.map.key, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-response %s' %s.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8955,7 +8955,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (!*args[cur_arg] || !*args[cur_arg+1] ||
(*args[cur_arg+2] && strcmp(args[cur_arg+2], "if") != 0 && strcmp(args[cur_arg+2], "unless") != 0)) {
Alert("parsing [%s:%d]: 'http-response %s' expects exactly 2 arguments.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' expects exactly 2 arguments.\n",
file, linenum, args[0]);
goto out_err;
}
@ -8969,7 +8969,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg], proxy, &rule->arg.map.key, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-response %s' name: %s.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' name: %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8979,7 +8979,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
error = NULL;
if (!parse_logformat_string(args[cur_arg + 1], proxy, &rule->arg.map.value, LOG_OPT_HTTP,
(proxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, &error)) {
Alert("parsing [%s:%d]: 'http-response %s' value: %s.\n",
ha_alert("parsing [%s:%d]: 'http-response %s' value: %s.\n",
file, linenum, args[0], error);
free(error);
goto out_err;
@ -8995,7 +8995,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
char *errmsg = NULL;
if ((redir = http_parse_redirect_rule(file, linenum, proxy, (const char **)args + 1, &errmsg, 1, 1)) == NULL) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : %s.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], errmsg);
goto out_err;
}
@ -9021,7 +9021,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
expr = sample_parse_expr((char **)args, &cur_arg, file, linenum, &err, &proxy->conf.args);
if (!expr) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : %s.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], err);
free(err);
goto out_err;
@ -9034,7 +9034,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
where |= SMP_VAL_BE_HRS_HDR;
if (!(expr->fetch->val & where)) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule :"
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule :"
" fetch method '%s' extracts information from '%s', none of which is available here.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0],
args[cur_arg-1], sample_src_names(expr->fetch->use));
@ -9045,7 +9045,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
if (strcmp(args[cur_arg], "table") == 0) {
cur_arg++;
if (!args[cur_arg]) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : missing table name.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : missing table name.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0]);
free(expr);
goto out_err;
@ -9064,14 +9064,14 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
rule->from = ACT_F_HTTP_RES;
rule->kw = custom;
if (custom->parse(args, &cur_arg, proxy, rule, &errmsg) == ACT_RET_PRS_ERR) {
Alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : %s.\n",
ha_alert("parsing [%s:%d] : error detected in %s '%s' while parsing 'http-response %s' rule : %s.\n",
file, linenum, proxy_type_str(proxy), proxy->id, args[0], errmsg);
free(errmsg);
goto out_err;
}
} else {
action_build_list(&http_res_keywords.list, &trash);
Alert("parsing [%s:%d]: 'http-response' expects 'allow', 'deny', 'redirect', "
ha_alert("parsing [%s:%d]: 'http-response' expects 'allow', 'deny', 'redirect', "
"'add-header', 'del-header', 'set-header', 'replace-header', 'replace-value', 'set-nice', "
"'set-tos', 'set-mark', 'set-log-level', 'add-acl', 'del-acl', 'del-map', 'set-map', 'track-sc*'"
"%s%s, but got '%s'%s.\n",
@ -9084,7 +9084,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
char *errmsg = NULL;
if ((cond = build_acl_cond(file, linenum, &proxy->acl, proxy, args+cur_arg, &errmsg)) == NULL) {
Alert("parsing [%s:%d] : error detected while parsing an 'http-response %s' condition : %s.\n",
ha_alert("parsing [%s:%d] : error detected while parsing an 'http-response %s' condition : %s.\n",
file, linenum, args[0], errmsg);
free(errmsg);
goto out_err;
@ -9092,7 +9092,7 @@ struct act_rule *parse_http_res_cond(const char **args, const char *file, int li
rule->cond = cond;
}
else if (*args[cur_arg]) {
Alert("parsing [%s:%d]: 'http-response %s' expects"
ha_alert("parsing [%s:%d]: 'http-response %s' expects"
" either 'if' or 'unless' followed by a condition but found '%s'.\n",
file, linenum, args[0], args[cur_arg]);
goto out_err;

View File

@ -344,7 +344,7 @@ int tcp_connect_server(struct connection *conn, int data, int delack)
/* do not log anything there, it's a normal condition when this option
* is used to serialize connections to a server !
*/
Alert("socket(): not enough free sockets. Raise -n argument. Giving up.\n");
ha_alert("socket(): not enough free sockets. Raise -n argument. Giving up.\n");
close(fd);
conn->err_code = CO_ER_CONF_FDLIM;
conn->flags |= CO_FL_ERROR;
@ -447,13 +447,13 @@ int tcp_connect_server(struct connection *conn, int data, int delack)
close(fd);
if (ret == 1) {
Alert("Cannot bind to source address before connect() for backend %s. Aborting.\n",
ha_alert("Cannot bind to source address before connect() for backend %s. Aborting.\n",
be->id);
send_log(be, LOG_EMERG,
"Cannot bind to source address before connect() for backend %s.\n",
be->id);
} else {
Alert("Cannot bind to tproxy source address before connect() for backend %s. Aborting.\n",
ha_alert("Cannot bind to tproxy source address before connect() for backend %s. Aborting.\n",
be->id);
send_log(be, LOG_EMERG,
"Cannot bind to tproxy source address before connect() for backend %s.\n",
@ -851,11 +851,11 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
default_tcp_maxseg = -2;
fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (fd < 0)
Warning("Failed to create a temporary socket!\n");
ha_warning("Failed to create a temporary socket!\n");
else {
if (getsockopt(fd, IPPROTO_TCP, TCP_MAXSEG, &default_tcp_maxseg,
&ready_len) == -1)
Warning("Failed to get the default value of TCP_MAXSEG\n");
ha_warning("Failed to get the default value of TCP_MAXSEG\n");
}
close(fd);
}
@ -865,7 +865,7 @@ int tcp_bind_listener(struct listener *listener, char *errmsg, int errlen)
if (fd >= 0) {
if (getsockopt(fd, IPPROTO_TCP, TCP_MAXSEG, &default_tcp6_maxseg,
&ready_len) == -1)
Warning("Failed ot get the default value of TCP_MAXSEG for IPv6\n");
ha_warning("Failed ot get the default value of TCP_MAXSEG for IPv6\n");
close(fd);
}
}
@ -1898,7 +1898,7 @@ static int bind_parse_namespace(char **args, int cur_arg, struct proxy *px, stru
l->netns = netns_store_insert(namespace);
if (l->netns == NULL) {
Alert("Cannot open namespace '%s'.\n", args[cur_arg + 1]);
ha_alert("Cannot open namespace '%s'.\n", args[cur_arg + 1]);
return ERR_ALERT | ERR_FATAL;
}
}

View File

@ -482,7 +482,7 @@ static int uxst_connect_server(struct connection *conn, int data, int delack)
/* do not log anything there, it's a normal condition when this option
* is used to serialize connections to a server !
*/
Alert("socket(): not enough free sockets. Raise -n argument. Giving up.\n");
ha_alert("socket(): not enough free sockets. Raise -n argument. Giving up.\n");
close(fd);
conn->err_code = CO_ER_CONF_FDLIM;
conn->flags |= CO_FL_ERROR;

View File

@ -661,7 +661,7 @@ struct server *findserver(const struct proxy *px, const char *name) {
continue;
}
Alert("Refusing to use duplicated server '%s' found in proxy: %s!\n",
ha_alert("Refusing to use duplicated server '%s' found in proxy: %s!\n",
name, px->id);
return NULL;
@ -679,30 +679,30 @@ struct server *findserver(const struct proxy *px, const char *name) {
int proxy_cfg_ensure_no_http(struct proxy *curproxy)
{
if (curproxy->cookie_name != NULL) {
Warning("config : cookie will be ignored for %s '%s' (needs 'mode http').\n",
ha_warning("config : cookie will be ignored for %s '%s' (needs 'mode http').\n",
proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->rsp_exp != NULL) {
Warning("config : server regular expressions will be ignored for %s '%s' (needs 'mode http').\n",
ha_warning("config : server regular expressions will be ignored for %s '%s' (needs 'mode http').\n",
proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->req_exp != NULL) {
Warning("config : client regular expressions will be ignored for %s '%s' (needs 'mode http').\n",
ha_warning("config : client regular expressions will be ignored for %s '%s' (needs 'mode http').\n",
proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->monitor_uri != NULL) {
Warning("config : monitor-uri will be ignored for %s '%s' (needs 'mode http').\n",
ha_warning("config : monitor-uri will be ignored for %s '%s' (needs 'mode http').\n",
proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->lbprm.algo & BE_LB_NEED_HTTP) {
curproxy->lbprm.algo &= ~BE_LB_ALGO;
curproxy->lbprm.algo |= BE_LB_ALGO_RR;
Warning("config : Layer 7 hash not possible for %s '%s' (needs 'mode http'). Falling back to round robin.\n",
ha_warning("config : Layer 7 hash not possible for %s '%s' (needs 'mode http'). Falling back to round robin.\n",
proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->to_log & (LW_REQ | LW_RESP)) {
curproxy->to_log &= ~(LW_REQ | LW_RESP);
Warning("parsing [%s:%d] : HTTP log/header format not usable with %s '%s' (needs 'mode http').\n",
ha_warning("parsing [%s:%d] : HTTP log/header format not usable with %s '%s' (needs 'mode http').\n",
curproxy->conf.lfs_file, curproxy->conf.lfs_line,
proxy_type_str(curproxy), curproxy->id);
}
@ -710,7 +710,7 @@ int proxy_cfg_ensure_no_http(struct proxy *curproxy)
curproxy->conf.logformat_string == clf_http_log_format) {
/* Note: we don't change the directive's file:line number */
curproxy->conf.logformat_string = default_tcp_log_format;
Warning("parsing [%s:%d] : 'option httplog' not usable with %s '%s' (needs 'mode http'). Falling back to 'option tcplog'.\n",
ha_warning("parsing [%s:%d] : 'option httplog' not usable with %s '%s' (needs 'mode http'). Falling back to 'option tcplog'.\n",
curproxy->conf.lfs_file, curproxy->conf.lfs_line,
proxy_type_str(curproxy), curproxy->id);
}
@ -797,10 +797,10 @@ int start_proxies(int verbose)
/* errors are reported if <verbose> is set or if they are fatal */
if (verbose || (lerr & (ERR_FATAL | ERR_ABORT))) {
if (lerr & ERR_ALERT)
Alert("Starting %s %s: %s\n",
ha_alert("Starting %s %s: %s\n",
proxy_type_str(curproxy), curproxy->id, msg);
else if (lerr & ERR_WARN)
Warning("Starting %s %s: %s\n",
ha_warning("Starting %s %s: %s\n",
proxy_type_str(curproxy), curproxy->id, msg);
}
@ -849,7 +849,7 @@ struct task *manage_proxy(struct task *t)
int t;
t = tick_remain(now_ms, p->stop_time);
if (t == 0) {
Warning("Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
ha_warning("Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
p->id, p->fe_counters.cum_conn, p->be_counters.cum_conn);
send_log(p, LOG_WARNING, "Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
p->id, p->fe_counters.cum_conn, p->be_counters.cum_conn);
@ -940,19 +940,19 @@ struct task *hard_stop(struct task *t)
struct stream *s;
if (killed) {
Warning("Some tasks resisted to hard-stop, exiting now.\n");
ha_warning("Some tasks resisted to hard-stop, exiting now.\n");
send_log(NULL, LOG_WARNING, "Some tasks resisted to hard-stop, exiting now.\n");
/* Do some cleanup and explicitely quit */
deinit();
exit(0);
}
Warning("soft-stop running for too long, performing a hard-stop.\n");
ha_warning("soft-stop running for too long, performing a hard-stop.\n");
send_log(NULL, LOG_WARNING, "soft-stop running for too long, performing a hard-stop.\n");
p = proxy;
while (p) {
if ((p->cap & PR_CAP_FE) && (p->feconn > 0)) {
Warning("Proxy %s hard-stopped (%d remaining conns will be closed).\n",
ha_warning("Proxy %s hard-stopped (%d remaining conns will be closed).\n",
p->id, p->feconn);
send_log(p, LOG_WARNING, "Proxy %s hard-stopped (%d remaining conns will be closed).\n",
p->id, p->feconn);
@ -987,7 +987,7 @@ void soft_stop(void)
task_schedule(task, tick_add(now_ms, global.hard_stop_after));
}
else {
Alert("out of memory trying to allocate the hard-stop task.\n");
ha_alert("out of memory trying to allocate the hard-stop task.\n");
}
}
p = proxy;
@ -1007,7 +1007,7 @@ void soft_stop(void)
}
if (p->state != PR_STSTOPPED) {
Warning("Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace);
ha_warning("Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace);
send_log(p, LOG_WARNING, "Stopping %s %s in %d ms.\n", proxy_cap_str(p->cap), p->id, p->grace);
p->stop_time = tick_add(now_ms, p->grace);
@ -1048,7 +1048,7 @@ int pause_proxy(struct proxy *p)
p->state == PR_STSTOPPED || p->state == PR_STPAUSED)
return 1;
Warning("Pausing %s %s.\n", proxy_cap_str(p->cap), p->id);
ha_warning("Pausing %s %s.\n", proxy_cap_str(p->cap), p->id);
send_log(p, LOG_WARNING, "Pausing %s %s.\n", proxy_cap_str(p->cap), p->id);
list_for_each_entry(l, &p->conf.listeners, by_fe) {
@ -1057,7 +1057,7 @@ int pause_proxy(struct proxy *p)
}
if (p->state == PR_STERROR) {
Warning("%s %s failed to enter pause mode.\n", proxy_cap_str(p->cap), p->id);
ha_warning("%s %s failed to enter pause mode.\n", proxy_cap_str(p->cap), p->id);
send_log(p, LOG_WARNING, "%s %s failed to enter pause mode.\n", proxy_cap_str(p->cap), p->id);
return 0;
}
@ -1137,7 +1137,7 @@ int resume_proxy(struct proxy *p)
if (p->state != PR_STPAUSED)
return 1;
Warning("Enabling %s %s.\n", proxy_cap_str(p->cap), p->id);
ha_warning("Enabling %s %s.\n", proxy_cap_str(p->cap), p->id);
send_log(p, LOG_WARNING, "Enabling %s %s.\n", proxy_cap_str(p->cap), p->id);
fail = 0;
@ -1147,13 +1147,13 @@ int resume_proxy(struct proxy *p)
port = get_host_port(&l->addr);
if (port) {
Warning("Port %d busy while trying to enable %s %s.\n",
ha_warning("Port %d busy while trying to enable %s %s.\n",
port, proxy_cap_str(p->cap), p->id);
send_log(p, LOG_WARNING, "Port %d busy while trying to enable %s %s.\n",
port, proxy_cap_str(p->cap), p->id);
}
else {
Warning("Bind on socket %d busy while trying to enable %s %s.\n",
ha_warning("Bind on socket %d busy while trying to enable %s %s.\n",
l->luid, proxy_cap_str(p->cap), p->id);
send_log(p, LOG_WARNING, "Bind on socket %d busy while trying to enable %s %s.\n",
l->luid, proxy_cap_str(p->cap), p->id);
@ -1201,7 +1201,7 @@ void pause_proxies(void)
}
if (err) {
Warning("Some proxies refused to pause, performing soft stop now.\n");
ha_warning("Some proxies refused to pause, performing soft stop now.\n");
send_log(p, LOG_WARNING, "Some proxies refused to pause, performing soft stop now.\n");
soft_stop();
}
@ -1235,7 +1235,7 @@ void resume_proxies(void)
}
if (err) {
Warning("Some proxies refused to resume, a restart is probably needed to resume safe operations.\n");
ha_warning("Some proxies refused to resume, a restart is probably needed to resume safe operations.\n");
send_log(p, LOG_WARNING, "Some proxies refused to resume, a restart is probably needed to resume safe operations.\n");
}
}
@ -1706,7 +1706,7 @@ static int cli_parse_shutdown_frontend(char **args, struct appctx *appctx, void
return 1;
}
Warning("Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
ha_warning("Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
px->id, px->fe_counters.cum_conn, px->be_counters.cum_conn);
send_log(px, LOG_WARNING, "Proxy %s stopped (FE: %lld conns, BE: %lld conns).\n",
px->id, px->fe_counters.cum_conn, px->be_counters.cum_conn);

View File

@ -114,7 +114,7 @@ const char *check_replace_string(const char *str)
err = NULL;
}
else {
Warning("'\\%c' : deprecated use of a backslash before something not '\\','x' or a digit.\n", *str);
ha_warning("'\\%c' : deprecated use of a backslash before something not '\\','x' or a digit.\n", *str);
err = NULL;
}
}

View File

@ -1142,7 +1142,7 @@ int smp_resolve_args(struct proxy *p)
switch (arg->type) {
case ARGT_SRV:
if (!arg->data.str.len) {
Alert("parsing [%s:%d] : missing server name in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : missing server name in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1158,7 +1158,7 @@ int smp_resolve_args(struct proxy *p)
px = proxy_be_by_name(pname);
if (!px) {
Alert("parsing [%s:%d] : unable to find proxy '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : unable to find proxy '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line, pname,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1170,7 +1170,7 @@ int smp_resolve_args(struct proxy *p)
srv = findserver(px, sname);
if (!srv) {
Alert("parsing [%s:%d] : unable to find server '%s' in proxy '%s', referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : unable to find server '%s' in proxy '%s', referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line, sname, pname,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1190,7 +1190,7 @@ int smp_resolve_args(struct proxy *p)
}
if (!px) {
Alert("parsing [%s:%d] : unable to find frontend '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : unable to find frontend '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line, pname,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1198,7 +1198,7 @@ int smp_resolve_args(struct proxy *p)
}
if (!(px->cap & PR_CAP_FE)) {
Alert("parsing [%s:%d] : proxy '%s', referenced in arg %d of %s%s%s%s '%s' %s proxy '%s', has not frontend capability.\n",
ha_alert("parsing [%s:%d] : proxy '%s', referenced in arg %d of %s%s%s%s '%s' %s proxy '%s', has not frontend capability.\n",
cur->file, cur->line, pname,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1218,7 +1218,7 @@ int smp_resolve_args(struct proxy *p)
}
if (!px) {
Alert("parsing [%s:%d] : unable to find backend '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : unable to find backend '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line, pname,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1226,7 +1226,7 @@ int smp_resolve_args(struct proxy *p)
}
if (!(px->cap & PR_CAP_BE)) {
Alert("parsing [%s:%d] : proxy '%s', referenced in arg %d of %s%s%s%s '%s' %s proxy '%s', has not backend capability.\n",
ha_alert("parsing [%s:%d] : proxy '%s', referenced in arg %d of %s%s%s%s '%s' %s proxy '%s', has not backend capability.\n",
cur->file, cur->line, pname,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1246,7 +1246,7 @@ int smp_resolve_args(struct proxy *p)
}
if (!px) {
Alert("parsing [%s:%d] : unable to find table '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : unable to find table '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line, pname,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1254,7 +1254,7 @@ int smp_resolve_args(struct proxy *p)
}
if (!px->table.size) {
Alert("parsing [%s:%d] : no table in proxy '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : no table in proxy '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line, pname,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1269,7 +1269,7 @@ int smp_resolve_args(struct proxy *p)
case ARGT_USR:
if (!arg->data.str.len) {
Alert("parsing [%s:%d] : missing userlist name in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : missing userlist name in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1283,7 +1283,7 @@ int smp_resolve_args(struct proxy *p)
ul = auth_find_userlist(arg->data.str.str);
if (!ul) {
Alert("parsing [%s:%d] : unable to find userlist '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : unable to find userlist '%s' referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line, arg->data.str.str,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1298,7 +1298,7 @@ int smp_resolve_args(struct proxy *p)
case ARGT_REG:
if (!arg->data.str.len) {
Alert("parsing [%s:%d] : missing regex in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : missing regex in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1307,7 +1307,7 @@ int smp_resolve_args(struct proxy *p)
reg = calloc(1, sizeof(*reg));
if (!reg) {
Alert("parsing [%s:%d] : not enough memory to build regex in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
ha_alert("parsing [%s:%d] : not enough memory to build regex in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
cur->file, cur->line,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
@ -1319,7 +1319,7 @@ int smp_resolve_args(struct proxy *p)
err = NULL;
if (!regex_comp(arg->data.str.str, reg, !(rflags & REG_ICASE), 1 /* capture substr */, &err)) {
Alert("parsing [%s:%d] : error in regex '%s' in arg %d of %s%s%s%s '%s' %s proxy '%s' : %s.\n",
ha_alert("parsing [%s:%d] : error in regex '%s' in arg %d of %s%s%s%s '%s' %s proxy '%s' : %s.\n",
cur->file, cur->line,
arg->data.str.str,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id, err);

View File

@ -146,7 +146,7 @@ void srv_set_dyncookie(struct server *s)
continue;
if (tmpserv->cookie &&
strcmp(tmpserv->cookie, s->cookie) == 0) {
Warning("We generated two equal cookies for two different servers.\n"
ha_warning("We generated two equal cookies for two different servers.\n"
"Please change the secret key for '%s'.\n",
s->proxy->id);
}
@ -581,7 +581,7 @@ static int srv_parse_source(char **args, int *cur_arg,
proto = protocol_by_family(sk->ss_family);
if (!proto || !proto->connect) {
Alert("'%s %s' : connect() not supported for this address family.\n",
ha_alert("'%s %s' : connect() not supported for this address family.\n",
args[*cur_arg], args[*cur_arg + 1]);
goto err;
}
@ -593,7 +593,7 @@ static int srv_parse_source(char **args, int *cur_arg,
int i;
if (!port_low || !port_high) {
Alert("'%s' does not support port offsets (found '%s').\n",
ha_alert("'%s' does not support port offsets (found '%s').\n",
args[*cur_arg], args[*cur_arg + 1]);
goto err;
}
@ -601,7 +601,7 @@ static int srv_parse_source(char **args, int *cur_arg,
if (port_low <= 0 || port_low > 65535 ||
port_high <= 0 || port_high > 65535 ||
port_low > port_high) {
Alert("'%s': invalid source port range %d-%d.\n", args[*cur_arg], port_low, port_high);
ha_alert("'%s': invalid source port range %d-%d.\n", args[*cur_arg], port_low, port_high);
goto err;
}
newsrv->conn_src.sport_range = port_range_alloc_range(port_high - port_low + 1);
@ -614,7 +614,7 @@ static int srv_parse_source(char **args, int *cur_arg,
if (!strcmp(args[*cur_arg], "usesrc")) { /* address to use outside */
#if defined(CONFIG_HAP_TRANSPARENT)
if (!*args[*cur_arg + 1]) {
Alert("'usesrc' expects <addr>[:<port>], 'client', 'clientip', "
ha_alert("'usesrc' expects <addr>[:<port>], 'client', 'clientip', "
"or 'hdr_ip(name,#)' as argument.\n");
goto err;
}
@ -660,7 +660,7 @@ static int srv_parse_source(char **args, int *cur_arg,
}
if (newsrv->conn_src.bind_hdr_occ < -MAX_HDR_HISTORY) {
Alert("usesrc hdr_ip(name,num) does not support negative"
ha_alert("usesrc hdr_ip(name,num) does not support negative"
" occurrences values smaller than %d.\n", MAX_HDR_HISTORY);
goto err;
}
@ -672,19 +672,19 @@ static int srv_parse_source(char **args, int *cur_arg,
/* 'sk' is statically allocated (no need to be freed). */
sk = str2sa_range(args[*cur_arg + 1], NULL, &port1, &port2, &errmsg, NULL, NULL, 1);
if (!sk) {
Alert("'%s %s' : %s\n", args[*cur_arg], args[*cur_arg + 1], errmsg);
ha_alert("'%s %s' : %s\n", args[*cur_arg], args[*cur_arg + 1], errmsg);
goto err;
}
proto = protocol_by_family(sk->ss_family);
if (!proto || !proto->connect) {
Alert("'%s %s' : connect() not supported for this address family.\n",
ha_alert("'%s %s' : connect() not supported for this address family.\n",
args[*cur_arg], args[*cur_arg + 1]);
goto err;
}
if (port1 != port2) {
Alert("'%s' : port ranges and offsets are not allowed in '%s'\n",
ha_alert("'%s' : port ranges and offsets are not allowed in '%s'\n",
args[*cur_arg], args[*cur_arg + 1]);
goto err;
}
@ -695,7 +695,7 @@ static int srv_parse_source(char **args, int *cur_arg,
*cur_arg += 2;
continue;
#else /* no TPROXY support */
Alert("'usesrc' not allowed here because support for TPROXY was not compiled in.\n");
ha_alert("'usesrc' not allowed here because support for TPROXY was not compiled in.\n");
goto err;
#endif /* defined(CONFIG_HAP_TRANSPARENT) */
} /* "usesrc" */
@ -703,7 +703,7 @@ static int srv_parse_source(char **args, int *cur_arg,
if (!strcmp(args[*cur_arg], "interface")) { /* specifically bind to this interface */
#ifdef SO_BINDTODEVICE
if (!*args[*cur_arg + 1]) {
Alert("'%s' : missing interface name.\n", args[0]);
ha_alert("'%s' : missing interface name.\n", args[0]);
goto err;
}
free(newsrv->conn_src.iface_name);
@ -711,7 +711,7 @@ static int srv_parse_source(char **args, int *cur_arg,
newsrv->conn_src.iface_len = strlen(newsrv->conn_src.iface_name);
global.last_checks |= LSTCHK_NETADM;
#else
Alert("'%s' : '%s' option not implemented.\n", args[0], args[*cur_arg]);
ha_alert("'%s' : '%s' option not implemented.\n", args[0], args[*cur_arg]);
goto err;
#endif
*cur_arg += 2;
@ -1294,10 +1294,10 @@ static void display_parser_err(const char *file, int linenum, char **args, int c
{
if (err && *err) {
indent_msg(err, 2);
Alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], *err);
ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], *err);
}
else
Alert("parsing [%s:%d] : '%s %s' : error encountered while processing '%s'.\n",
ha_alert("parsing [%s:%d] : '%s %s' : error encountered while processing '%s'.\n",
file, linenum, args[0], args[1], args[cur_arg]);
}
@ -1579,7 +1579,7 @@ static int server_healthcheck_validate(const char *file, int linenum, struct ser
r = (struct tcpcheck_rule *)srv->proxy->tcpcheck_rules.n;
if (!r) {
Alert("parsing [%s:%d] : server %s has neither service port nor check port. "
ha_alert("parsing [%s:%d] : server %s has neither service port nor check port. "
"Check has been disabled.\n",
file, linenum, srv->id);
return -1;
@ -1593,7 +1593,7 @@ static int server_healthcheck_validate(const char *file, int linenum, struct ser
}
if ((r->action != TCPCHK_ACT_CONNECT) || !r->port) {
Alert("parsing [%s:%d] : server %s has neither service port nor check port "
ha_alert("parsing [%s:%d] : server %s has neither service port nor check port "
"nor tcp_check rule 'connect' with port information. Check has been disabled.\n",
file, linenum, srv->id);
return -1;
@ -1603,7 +1603,7 @@ static int server_healthcheck_validate(const char *file, int linenum, struct ser
l = &srv->proxy->tcpcheck_rules;
list_for_each_entry(r, l, list) {
if ((r->action == TCPCHK_ACT_CONNECT) && (!r->port)) {
Alert("parsing [%s:%d] : server %s has neither service port nor check port, "
ha_alert("parsing [%s:%d] : server %s has neither service port nor check port, "
"and a tcp_check rule 'connect' with no port information. Check has been disabled.\n",
file, linenum, srv->id);
return -1;
@ -1643,7 +1643,7 @@ static int server_health_check_init(const char *file, int linenum,
return 0;
if (srv->trackit) {
Alert("parsing [%s:%d]: unable to enable checks and tracking at the same time!\n",
ha_alert("parsing [%s:%d]: unable to enable checks and tracking at the same time!\n",
file, linenum);
return ERR_ALERT | ERR_FATAL;
}
@ -1654,7 +1654,7 @@ static int server_health_check_init(const char *file, int linenum,
/* note: check type will be set during the config review phase */
ret = do_health_check_init(srv, 0, CHK_ST_CONFIGURED | CHK_ST_ENABLED);
if (ret) {
Alert("parsing [%s:%d] : %s.\n", file, linenum, ret);
ha_alert("parsing [%s:%d] : %s.\n", file, linenum, ret);
return ERR_ALERT | ERR_ABORT;
}
@ -1694,14 +1694,14 @@ static int server_agent_check_init(const char *file, int linenum,
return 0;
if (!srv->agent.port) {
Alert("parsing [%s:%d] : server %s does not have agent port. Agent check has been disabled.\n",
ha_alert("parsing [%s:%d] : server %s does not have agent port. Agent check has been disabled.\n",
file, linenum, srv->id);
return ERR_ALERT | ERR_FATAL;
}
ret = do_server_agent_check_init(srv, CHK_ST_CONFIGURED | CHK_ST_ENABLED | CHK_ST_AGENT);
if (ret) {
Alert("parsing [%s:%d] : %s.\n", file, linenum, ret);
ha_alert("parsing [%s:%d] : %s.\n", file, linenum, ret);
return ERR_ALERT | ERR_ABORT;
}
@ -1876,7 +1876,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
int tmpl_range_low = 0, tmpl_range_high = 0;
if (!defsrv && curproxy == defproxy) {
Alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, linenum, args[0]);
ha_alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
@ -1887,7 +1887,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
if (srv) {
if (!*args[2]) {
/* 'server' line number of argument check. */
Alert("parsing [%s:%d] : '%s' expects <name> and <addr>[:<port>] as arguments.\n",
ha_alert("parsing [%s:%d] : '%s' expects <name> and <addr>[:<port>] as arguments.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -1898,7 +1898,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
else if (srv_tmpl) {
if (!*args[3]) {
/* 'server-template' line number of argument check. */
Alert("parsing [%s:%d] : '%s' expects <prefix> <nb | range> <addr>[:<port>] as arguments.\n",
ha_alert("parsing [%s:%d] : '%s' expects <prefix> <nb | range> <addr>[:<port>] as arguments.\n",
file, linenum, args[0]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -1908,7 +1908,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
}
if (err) {
Alert("parsing [%s:%d] : character '%c' is not permitted in %s %s '%s'.\n",
ha_alert("parsing [%s:%d] : character '%c' is not permitted in %s %s '%s'.\n",
file, linenum, *err, args[0], srv ? "name" : "prefix", args[1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -1918,7 +1918,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
if (srv_tmpl) {
/* Parse server-template <nb | range> arg. */
if (srv_tmpl_parse_range(newsrv, args[cur_arg], &tmpl_range_low, &tmpl_range_high) < 0) {
Alert("parsing [%s:%d] : Wrong %s number or range arg '%s'.\n",
ha_alert("parsing [%s:%d] : Wrong %s number or range arg '%s'.\n",
file, linenum, args[0], args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -1933,7 +1933,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
newsrv = new_server(curproxy);
if (!newsrv) {
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;
}
@ -1966,14 +1966,14 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
*/
sk = str2sa_range(args[cur_arg], &port, &port1, &port2, &errmsg, NULL, &fqdn, 0);
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 (!fqdn && (!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;
@ -1985,7 +1985,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
}
else if (port1 != port2) {
/* port range */
Alert("parsing [%s:%d] : '%s %s' : port ranges are not allowed in '%s'\n",
ha_alert("parsing [%s:%d] : '%s %s' : port ranges are not allowed in '%s'\n",
file, linenum, args[0], args[1], args[2]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2003,7 +2003,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
}
}
else if (srv_prepare_for_resolution(newsrv, fqdn) == -1) {
Alert("parsing [%s:%d] : Can't create DNS resolution for server '%s'\n",
ha_alert("parsing [%s:%d] : Can't create DNS resolution for server '%s'\n",
file, linenum, newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2014,7 +2014,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
newsrv->svc_port = port;
if (!newsrv->srvrq && !newsrv->hostname && !protocol_by_family(newsrv->addr.ss_family)) {
Alert("parsing [%s:%d] : Unknown protocol family %d '%s'\n",
ha_alert("parsing [%s:%d] : Unknown protocol family %d '%s'\n",
file, linenum, newsrv->addr.ss_family, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2034,13 +2034,13 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
if (!strcmp(args[cur_arg], "agent-inter")) {
const char *err = parse_time_err(args[cur_arg + 1], &val, TIME_UNIT_MS);
if (err) {
Alert("parsing [%s:%d] : unexpected character '%c' in 'agent-inter' argument of server %s.\n",
ha_alert("parsing [%s:%d] : unexpected character '%c' in 'agent-inter' argument of server %s.\n",
file, linenum, *err, newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (val <= 0) {
Alert("parsing [%s:%d]: invalid value %d for argument '%s' of server %s.\n",
ha_alert("parsing [%s:%d]: invalid value %d for argument '%s' of server %s.\n",
file, linenum, val, args[cur_arg], newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2050,7 +2050,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
}
else if (!strcmp(args[cur_arg], "agent-addr")) {
if(str2ip(args[cur_arg + 1], &newsrv->agent.addr) == NULL) {
Alert("parsing agent-addr failed. Check if %s is correct address.\n", args[cur_arg + 1]);
ha_alert("parsing agent-addr failed. Check if %s is correct address.\n", args[cur_arg + 1]);
goto out;
}
@ -2095,7 +2095,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
}
else if (str2ip2(p, &sa, 0)) {
if (is_addr(&newsrv->init_addr)) {
Alert("parsing [%s:%d]: '%s' : initial address already specified, cannot add '%s'.\n",
ha_alert("parsing [%s:%d]: '%s' : initial address already specified, cannot add '%s'.\n",
file, linenum, args[cur_arg], p);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2104,13 +2104,13 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
done = srv_append_initaddr(&newsrv->init_addr_methods, SRV_IADDR_IP);
}
else {
Alert("parsing [%s:%d]: '%s' : unknown init-addr method '%s', supported methods are 'libc', 'last', 'none'.\n",
ha_alert("parsing [%s:%d]: '%s' : unknown init-addr method '%s', supported methods are 'libc', 'last', 'none'.\n",
file, linenum, args[cur_arg], p);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (!done) {
Alert("parsing [%s:%d]: '%s' : too many init-addr methods when trying to add '%s'\n",
ha_alert("parsing [%s:%d]: '%s' : too many init-addr methods when trying to add '%s'\n",
file, linenum, args[cur_arg], p);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2129,7 +2129,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
else if (!strcmp(args[cur_arg + 1], "ipv6"))
newsrv->dns_opts.family_prio = AF_INET6;
else {
Alert("parsing [%s:%d]: '%s' expects either ipv4 or ipv6 as argument.\n",
ha_alert("parsing [%s:%d]: '%s' expects either ipv4 or ipv6 as argument.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2142,7 +2142,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
struct dns_options *opt;
if (!args[cur_arg + 1] || args[cur_arg + 1][0] == '\0') {
Alert("parsing [%s:%d]: '%s' expects a list of networks.\n",
ha_alert("parsing [%s:%d]: '%s' expects a list of networks.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2158,7 +2158,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
while (*p != '\0') {
/* If no room avalaible, return error. */
if (opt->pref_net_nb >= SRV_MAX_PREF_NET) {
Alert("parsing [%s:%d]: '%s' exceed %d networks.\n",
ha_alert("parsing [%s:%d]: '%s' exceed %d networks.\n",
file, linenum, args[cur_arg], SRV_MAX_PREF_NET);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2181,7 +2181,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
opt->pref_net[opt->pref_net_nb].family = AF_INET6;
} else {
/* All network conversions fail, retrun error. */
Alert("parsing [%s:%d]: '%s': invalid network '%s'.\n",
ha_alert("parsing [%s:%d]: '%s': invalid network '%s'.\n",
file, linenum, args[cur_arg], p);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2194,7 +2194,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
}
else if (!strcmp(args[cur_arg], "rise")) {
if (!*args[cur_arg + 1]) {
Alert("parsing [%s:%d]: '%s' expects an integer argument.\n",
ha_alert("parsing [%s:%d]: '%s' expects an integer argument.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2202,7 +2202,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
newsrv->check.rise = atol(args[cur_arg + 1]);
if (newsrv->check.rise <= 0) {
Alert("parsing [%s:%d]: '%s' has to be > 0.\n",
ha_alert("parsing [%s:%d]: '%s' has to be > 0.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2216,14 +2216,14 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
newsrv->check.fall = atol(args[cur_arg + 1]);
if (!*args[cur_arg + 1]) {
Alert("parsing [%s:%d]: '%s' expects an integer argument.\n",
ha_alert("parsing [%s:%d]: '%s' expects an integer argument.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (newsrv->check.fall <= 0) {
Alert("parsing [%s:%d]: '%s' has to be > 0.\n",
ha_alert("parsing [%s:%d]: '%s' has to be > 0.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2234,13 +2234,13 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
else if (!strcmp(args[cur_arg], "inter")) {
const char *err = parse_time_err(args[cur_arg + 1], &val, TIME_UNIT_MS);
if (err) {
Alert("parsing [%s:%d] : unexpected character '%c' in 'inter' argument of server %s.\n",
ha_alert("parsing [%s:%d] : unexpected character '%c' in 'inter' argument of server %s.\n",
file, linenum, *err, newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (val <= 0) {
Alert("parsing [%s:%d]: invalid value %d for argument '%s' of server %s.\n",
ha_alert("parsing [%s:%d]: invalid value %d for argument '%s' of server %s.\n",
file, linenum, val, args[cur_arg], newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2251,13 +2251,13 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
else if (!strcmp(args[cur_arg], "fastinter")) {
const char *err = parse_time_err(args[cur_arg + 1], &val, TIME_UNIT_MS);
if (err) {
Alert("parsing [%s:%d]: unexpected character '%c' in 'fastinter' argument of server %s.\n",
ha_alert("parsing [%s:%d]: unexpected character '%c' in 'fastinter' argument of server %s.\n",
file, linenum, *err, newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (val <= 0) {
Alert("parsing [%s:%d]: invalid value %d for argument '%s' of server %s.\n",
ha_alert("parsing [%s:%d]: invalid value %d for argument '%s' of server %s.\n",
file, linenum, val, args[cur_arg], newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2268,13 +2268,13 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
else if (!strcmp(args[cur_arg], "downinter")) {
const char *err = parse_time_err(args[cur_arg + 1], &val, TIME_UNIT_MS);
if (err) {
Alert("parsing [%s:%d]: unexpected character '%c' in 'downinter' argument of server %s.\n",
ha_alert("parsing [%s:%d]: unexpected character '%c' in 'downinter' argument of server %s.\n",
file, linenum, *err, newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
}
if (val <= 0) {
Alert("parsing [%s:%d]: invalid value %d for argument '%s' of server %s.\n",
ha_alert("parsing [%s:%d]: invalid value %d for argument '%s' of server %s.\n",
file, linenum, val, args[cur_arg], newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2291,7 +2291,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
int w;
w = atol(args[cur_arg + 1]);
if (w < 0 || w > SRV_UWGHT_MAX) {
Alert("parsing [%s:%d] : weight of server %s is not within 0 and %d (%d).\n",
ha_alert("parsing [%s:%d] : weight of server %s is not within 0 and %d (%d).\n",
file, linenum, newsrv->id, SRV_UWGHT_MAX, w);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2315,7 +2315,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
/* slowstart is stored in seconds */
const char *err = parse_time_err(args[cur_arg + 1], &val, TIME_UNIT_MS);
if (err) {
Alert("parsing [%s:%d] : unexpected character '%c' in 'slowstart' argument of server %s.\n",
ha_alert("parsing [%s:%d] : unexpected character '%c' in 'slowstart' argument of server %s.\n",
file, linenum, *err, newsrv->id);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2333,7 +2333,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
else if (!strcmp(args[cur_arg + 1], "mark-down"))
newsrv->onerror = HANA_ONERR_MARKDWN;
else {
Alert("parsing [%s:%d]: '%s' expects one of 'fastinter', "
ha_alert("parsing [%s:%d]: '%s' expects one of 'fastinter', "
"'fail-check', 'sudden-death' or 'mark-down' but got '%s'\n",
file, linenum, args[cur_arg], args[cur_arg + 1]);
err_code |= ERR_ALERT | ERR_FATAL;
@ -2346,7 +2346,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
if (!strcmp(args[cur_arg + 1], "shutdown-sessions"))
newsrv->onmarkeddown = HANA_ONMARKEDDOWN_SHUTDOWNSESSIONS;
else {
Alert("parsing [%s:%d]: '%s' expects 'shutdown-sessions' but got '%s'\n",
ha_alert("parsing [%s:%d]: '%s' expects 'shutdown-sessions' but got '%s'\n",
file, linenum, args[cur_arg], args[cur_arg + 1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2358,7 +2358,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
if (!strcmp(args[cur_arg + 1], "shutdown-backup-sessions"))
newsrv->onmarkedup = HANA_ONMARKEDUP_SHUTDOWNBACKUPSESSIONS;
else {
Alert("parsing [%s:%d]: '%s' expects 'shutdown-backup-sessions' but got '%s'\n",
ha_alert("parsing [%s:%d]: '%s' expects 'shutdown-backup-sessions' but got '%s'\n",
file, linenum, args[cur_arg], args[cur_arg + 1]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2368,7 +2368,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
}
else if (!strcmp(args[cur_arg], "error-limit")) {
if (!*args[cur_arg + 1]) {
Alert("parsing [%s:%d]: '%s' expects an integer argument.\n",
ha_alert("parsing [%s:%d]: '%s' expects an integer argument.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2377,7 +2377,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
newsrv->consecutive_errors_limit = atoi(args[cur_arg + 1]);
if (newsrv->consecutive_errors_limit <= 0) {
Alert("parsing [%s:%d]: %s has to be > 0.\n",
ha_alert("parsing [%s:%d]: %s has to be > 0.\n",
file, linenum, args[cur_arg]);
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2385,7 +2385,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
cur_arg += 2;
}
else if (!strcmp(args[cur_arg], "usesrc")) { /* address to use outside: needs "source" first */
Alert("parsing [%s:%d] : '%s' only allowed after a '%s' statement.\n",
ha_alert("parsing [%s:%d] : '%s' only allowed after a '%s' statement.\n",
file, linenum, "usesrc", "source");
err_code |= ERR_ALERT | ERR_FATAL;
goto out;
@ -2401,7 +2401,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
int code;
if (!kw->parse) {
Alert("parsing [%s:%d] : '%s %s' : '%s' option is not implemented in this version (check build options).\n",
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]);
if (kw->skip != -1)
cur_arg += 1 + kw->skip ;
@ -2410,7 +2410,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
}
if (defsrv && !kw->default_ok) {
Alert("parsing [%s:%d] : '%s %s' : '%s' option is not accepted in default-server sections.\n",
ha_alert("parsing [%s:%d] : '%s %s' : '%s' option is not accepted in default-server sections.\n",
file, linenum, args[0], args[1], args[cur_arg]);
if (kw->skip != -1)
cur_arg += 1 + kw->skip ;
@ -2443,7 +2443,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
srv_dumped = 1;
}
Alert("parsing [%s:%d] : '%s %s' unknown keyword '%s'.%s%s\n",
ha_alert("parsing [%s:%d] : '%s %s' unknown keyword '%s'.%s%s\n",
file, linenum, args[0], args[1], args[cur_arg],
err ? " Registered keywords :" : "", err ? err : "");
free(err);
@ -2923,7 +2923,7 @@ static void srv_update_state(struct server *srv, int version, char **params)
out:
if (msg->len) {
chunk_appendf(msg, "\n");
Warning("server-state application failed for server '%s/%s'%s",
ha_warning("server-state application failed for server '%s/%s'%s",
srv->proxy->id, srv->id, msg->str);
}
}
@ -3084,7 +3084,7 @@ void apply_server_state(void)
errno = 0;
f = fopen(filepath, "r");
if (errno && fileopenerr)
Warning("Can't open server state file '%s': %s\n", filepath, strerror(errno));
ha_warning("Can't open server state file '%s': %s\n", filepath, strerror(errno));
if (!f)
continue;
@ -3094,7 +3094,7 @@ void apply_server_state(void)
/* first character of first line of the file must contain the version of the export */
if (fgets(mybuf, SRV_STATE_LINE_MAXLEN, f) == NULL) {
Warning("Can't read first line of the server state file '%s'\n", filepath);
ha_warning("Can't read first line of the server state file '%s'\n", filepath);
goto fileclose;
}
@ -3130,7 +3130,7 @@ void apply_server_state(void)
/* truncated lines */
if (mybuf[mybuflen - 1] != '\n') {
Warning("server-state file '%s': truncated line\n", filepath);
ha_warning("server-state file '%s': truncated line\n", filepath);
continue;
}
@ -3200,11 +3200,11 @@ void apply_server_state(void)
if (!check_id && !check_name)
continue;
else if (!check_id && check_name) {
Warning("backend ID mismatch: from server state file: '%s', from running config '%d'\n", params[0], bk->uuid);
ha_warning("backend ID mismatch: from server state file: '%s', from running config '%d'\n", params[0], bk->uuid);
send_log(bk, LOG_NOTICE, "backend ID mismatch: from server state file: '%s', from running config '%d'\n", params[0], bk->uuid);
}
else if (check_id && !check_name) {
Warning("backend name mismatch: from server state file: '%s', from running config '%s'\n", params[1], bk->id);
ha_warning("backend name mismatch: from server state file: '%s', from running config '%s'\n", params[1], bk->id);
send_log(bk, LOG_NOTICE, "backend name mismatch: from server state file: '%s', from running config '%s'\n", params[1], bk->id);
/* if name doesn't match, we still want to update curproxy if the backend id
* was forced in previous the previous configuration */
@ -3219,19 +3219,19 @@ void apply_server_state(void)
if (!srv) {
/* if no server found, then warning and continue with next line */
Warning("can't find server '%s' with id '%s' in backend with id '%s' or name '%s'\n",
ha_warning("can't find server '%s' with id '%s' in backend with id '%s' or name '%s'\n",
params[3], params[2], params[0], params[1]);
send_log(bk, LOG_NOTICE, "can't find server '%s' with id '%s' in backend with id '%s' or name '%s'\n",
params[3], params[2], params[0], params[1]);
continue;
}
else if (diff & PR_FBM_MISMATCH_ID) {
Warning("In backend '%s' (id: '%d'): server ID mismatch: from server state file: '%s', from running config %d\n", bk->id, bk->uuid, params[2], srv->puid);
ha_warning("In backend '%s' (id: '%d'): server ID mismatch: from server state file: '%s', from running config %d\n", bk->id, bk->uuid, params[2], srv->puid);
send_log(bk, LOG_NOTICE, "In backend '%s' (id: %d): server ID mismatch: from server state file: '%s', from running config %d\n", bk->id, bk->uuid, params[2], srv->puid);
continue;
}
else if (diff & PR_FBM_MISMATCH_NAME) {
Warning("In backend '%s' (id: %d): server name mismatch: from server state file: '%s', from running config '%s'\n", bk->id, bk->uuid, params[3], srv->id);
ha_warning("In backend '%s' (id: %d): server name mismatch: from server state file: '%s', from running config '%s'\n", bk->id, bk->uuid, params[3], srv->id);
send_log(bk, LOG_NOTICE, "In backend '%s' (id: %d): server name mismatch: from server state file: '%s', from running config '%s'\n", bk->id, bk->uuid, params[3], srv->id);
continue;
}
@ -3289,7 +3289,7 @@ int update_server_addr(struct server *s, void *ip, int ip_sin_family, const char
s->proxy->id, s->id, oldip, newip, updater);
/* write the buffer on stderr */
Warning("%s.\n", trash.str);
ha_warning("%s.\n", trash.str);
/* send a log */
send_log(s->proxy, LOG_NOTICE, "%s.\n", trash.str);
@ -3519,7 +3519,7 @@ int snr_update_srv_status(struct server *s, int has_no_ip)
chunk_printf(&trash, "Server %s/%s administratively READY thanks to valid DNS answer",
s->proxy->id, s->id);
Warning("%s.\n", trash.str);
ha_warning("%s.\n", trash.str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", trash.str);
return 0;
@ -3885,7 +3885,7 @@ static int srv_iterate_initaddr(struct server *srv)
case SRV_IADDR_NONE:
srv_set_admin_flag(srv, SRV_ADMF_RMAINT, NULL);
if (return_code) {
Warning("parsing [%s:%d] : 'server %s' : could not resolve address '%s', disabling server.\n",
ha_warning("parsing [%s:%d] : 'server %s' : could not resolve address '%s', disabling server.\n",
srv->conf.file, srv->conf.line, srv->id, srv->hostname);
}
return return_code;
@ -3893,7 +3893,7 @@ static int srv_iterate_initaddr(struct server *srv)
case SRV_IADDR_IP:
ipcpy(&srv->init_addr, &srv->addr);
if (return_code) {
Warning("parsing [%s:%d] : 'server %s' : could not resolve address '%s', falling back to configured address.\n",
ha_warning("parsing [%s:%d] : 'server %s' : could not resolve address '%s', falling back to configured address.\n",
srv->conf.file, srv->conf.line, srv->id, srv->hostname);
}
goto out;
@ -3904,11 +3904,11 @@ static int srv_iterate_initaddr(struct server *srv)
}
if (!return_code) {
Alert("parsing [%s:%d] : 'server %s' : no method found to resolve address '%s'\n",
ha_alert("parsing [%s:%d] : 'server %s' : no method found to resolve address '%s'\n",
srv->conf.file, srv->conf.line, srv->id, srv->hostname);
}
else {
Alert("parsing [%s:%d] : 'server %s' : could not resolve address '%s'.\n",
ha_alert("parsing [%s:%d] : 'server %s' : could not resolve address '%s'.\n",
srv->conf.file, srv->conf.line, srv->id, srv->hostname);
}
@ -4472,7 +4472,7 @@ void srv_update_status(struct server *s)
s->proxy->id, s->id);
srv_append_status(tmptrash, s, NULL, xferred, 0);
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
/* we don't send an alert if the server was previously paused */
log_level = srv_was_stopping ? LOG_NOTICE : LOG_ALERT;
@ -4505,7 +4505,7 @@ void srv_update_status(struct server *s)
srv_append_status(tmptrash, s, NULL, xferred, 0);
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
free_trash_chunk(tmptrash);
tmptrash = NULL;
@ -4563,7 +4563,7 @@ void srv_update_status(struct server *s)
s->proxy->id, s->id);
srv_append_status(tmptrash, s, NULL, xferred, 0);
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
send_email_alert(s, LOG_NOTICE, "%s", tmptrash->str);
free_trash_chunk(tmptrash);
@ -4618,7 +4618,7 @@ void srv_update_status(struct server *s)
srv_append_status(tmptrash, s, NULL, -1, (s->next_admin & SRV_ADMF_FMAINT));
if (!(global.mode & MODE_STARTING)) {
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
}
free_trash_chunk(tmptrash);
@ -4652,7 +4652,7 @@ void srv_update_status(struct server *s)
srv_append_status(tmptrash, s, NULL, xferred, (s->next_admin & SRV_ADMF_FMAINT));
if (!(global.mode & MODE_STARTING)) {
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, srv_was_stopping ? LOG_NOTICE : LOG_ALERT, "%s.\n", tmptrash->str);
}
free_trash_chunk(tmptrash);
@ -4728,7 +4728,7 @@ void srv_update_status(struct server *s)
(s->next_state == SRV_ST_STOPPED) ? "DOWN" : "UP",
(s->next_admin & SRV_ADMF_DRAIN) ? "DRAIN" : "READY");
}
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
free_trash_chunk(tmptrash);
tmptrash = NULL;
@ -4766,7 +4766,7 @@ void srv_update_status(struct server *s)
if (s->track) /* normally it's mandatory here */
chunk_appendf(tmptrash, " via %s/%s",
s->track->proxy->id, s->track->id);
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
free_trash_chunk(tmptrash);
tmptrash = NULL;
@ -4783,7 +4783,7 @@ void srv_update_status(struct server *s)
if (s->track) /* normally it's mandatory here */
chunk_appendf(tmptrash, " via %s/%s",
s->track->proxy->id, s->track->id);
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
free_trash_chunk(tmptrash);
tmptrash = NULL;
@ -4796,7 +4796,7 @@ void srv_update_status(struct server *s)
"%sServer %s/%s remains in forced maintenance",
s->flags & SRV_F_BACKUP ? "Backup " : "",
s->proxy->id, s->id);
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
free_trash_chunk(tmptrash);
tmptrash = NULL;
@ -4830,7 +4830,7 @@ void srv_update_status(struct server *s)
srv_append_status(tmptrash, s, NULL, xferred, (s->next_admin & SRV_ADMF_FDRAIN));
if (!(global.mode & MODE_STARTING)) {
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
send_email_alert(s, LOG_NOTICE, "%s", tmptrash->str);
}
@ -4874,7 +4874,7 @@ void srv_update_status(struct server *s)
s->track->proxy->id, s->track->id);
}
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
free_trash_chunk(tmptrash);
tmptrash = NULL;
@ -4913,7 +4913,7 @@ void srv_update_status(struct server *s)
s->flags & SRV_F_BACKUP ? "Backup " : "",
s->proxy->id, s->id);
}
Warning("%s.\n", tmptrash->str);
ha_warning("%s.\n", tmptrash->str);
send_log(s->proxy, LOG_NOTICE, "%s.\n", tmptrash->str);
free_trash_chunk(tmptrash);
tmptrash = NULL;

View File

@ -393,18 +393,18 @@ static int ssl_init_single_engine(const char *engine_id, const char *def_algorit
/* grab the structural reference to the engine */
engine = ENGINE_by_id(engine_id);
if (engine == NULL) {
Alert("ssl-engine %s: failed to get structural reference\n", engine_id);
ha_alert("ssl-engine %s: failed to get structural reference\n", engine_id);
goto fail_get;
}
if (!ENGINE_init(engine)) {
/* the engine couldn't initialise, release it */
Alert("ssl-engine %s: failed to initialize\n", engine_id);
ha_alert("ssl-engine %s: failed to initialize\n", engine_id);
goto fail_init;
}
if (ENGINE_set_default_string(engine, def_algorithms) == 0) {
Alert("ssl-engine %s: failed on ENGINE_set_default_string\n", engine_id);
ha_alert("ssl-engine %s: failed on ENGINE_set_default_string\n", engine_id);
goto fail_set_method;
}
@ -1169,7 +1169,7 @@ static int ssl_sock_load_ocsp(SSL_CTX *ctx, const char *cert_path)
warn = NULL;
if (ssl_sock_load_ocsp_response_from_file(ocsp_path, iocsp, cid, &warn)) {
memprintf(&warn, "Loading '%s': %s. Content will be ignored", ocsp_path, warn ? warn : "failure");
Warning("%s.\n", warn);
ha_warning("%s.\n", warn);
}
out:
@ -1210,7 +1210,7 @@ static int ssl_sock_set_ocsp_response_from_file(SSL_CTX *ctx, const char *cert_p
fd = open(ocsp_path, O_RDONLY);
if (fd == -1) {
Warning("Error opening OCSP response file %s.\n", ocsp_path);
ha_warning("Error opening OCSP response file %s.\n", ocsp_path);
return -1;
}
@ -1220,7 +1220,7 @@ static int ssl_sock_set_ocsp_response_from_file(SSL_CTX *ctx, const char *cert_p
if (r < 0) {
if (errno == EINTR)
continue;
Warning("Error reading OCSP response from file %s.\n", ocsp_path);
ha_warning("Error reading OCSP response from file %s.\n", ocsp_path);
close(fd);
return -1;
}
@ -3698,7 +3698,7 @@ ssl_sock_initial_ctx(struct bind_conf *bind_conf)
bind_conf->initial_ctx = ctx;
if (conf_ssl_methods->flags && (conf_ssl_methods->min || conf_ssl_methods->max))
Warning("Proxy '%s': no-sslv3/no-tlsv1x are ignored for bind '%s' at [%s:%d]. "
ha_warning("Proxy '%s': no-sslv3/no-tlsv1x are ignored for bind '%s' at [%s:%d]. "
"Use only 'ssl-min-ver' and 'ssl-max-ver' to fix.\n",
bind_conf->frontend->id, bind_conf->arg, bind_conf->file, bind_conf->line);
else
@ -3722,7 +3722,7 @@ ssl_sock_initial_ctx(struct bind_conf *bind_conf)
if (methodVersions[i].option && !(flags & methodVersions[i].flag)) {
if (min) {
if (hole) {
Warning("Proxy '%s': SSL/TLS versions range not contiguous for bind '%s' at [%s:%d]. "
ha_warning("Proxy '%s': SSL/TLS versions range not contiguous for bind '%s' at [%s:%d]. "
"Hole find for %s. Use only 'ssl-min-ver' and 'ssl-max-ver' to fix.\n",
bind_conf->frontend->id, bind_conf->arg, bind_conf->file, bind_conf->line,
methodVersions[hole].name);
@ -3739,7 +3739,7 @@ ssl_sock_initial_ctx(struct bind_conf *bind_conf)
hole = i;
}
if (!min) {
Alert("Proxy '%s': all SSL/TLS versions are disabled for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': all SSL/TLS versions are disabled for bind '%s' at [%s:%d].\n",
bind_conf->frontend->id, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr += 1;
}
@ -4068,7 +4068,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
conf_ssl_methods->min = min;
conf_ssl_methods->max = max;
if (!min) {
Alert("Proxy '%s': all SSL/TLS versions are disabled for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': all SSL/TLS versions are disabled for bind '%s' at [%s:%d].\n",
bind_conf->frontend->id, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr += 1;
}
@ -4092,7 +4092,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
if (ca_file) {
/* load CAfile to verify */
if (!SSL_CTX_load_verify_locations(ctx, ca_file, NULL)) {
Alert("Proxy '%s': unable to load CA file '%s' for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': unable to load CA file '%s' for bind '%s' at [%s:%d].\n",
curproxy->id, ca_file, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr++;
}
@ -4102,7 +4102,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
}
}
else {
Alert("Proxy '%s': verify is enabled but no CA file specified for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': verify is enabled but no CA file specified for bind '%s' at [%s:%d].\n",
curproxy->id, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr++;
}
@ -4111,7 +4111,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
X509_STORE *store = SSL_CTX_get_cert_store(ctx);
if (!store || !X509_STORE_load_locations(store, crl_file, NULL)) {
Alert("Proxy '%s': unable to configure CRL file '%s' for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': unable to configure CRL file '%s' for bind '%s' at [%s:%d].\n",
curproxy->id, crl_file, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr++;
}
@ -4125,7 +4125,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
#if (defined SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB && TLS_TICKETS_NO > 0)
if(bind_conf->keys_ref) {
if (!SSL_CTX_set_tlsext_ticket_key_cb(ctx, ssl_tlsext_ticket_key_cb)) {
Alert("Proxy '%s': unable to set callback for TLS ticket validation for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': unable to set callback for TLS ticket validation for bind '%s' at [%s:%d].\n",
curproxy->id, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr++;
}
@ -4136,7 +4136,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
conf_ciphers = (ssl_conf && ssl_conf->ciphers) ? ssl_conf->ciphers : bind_conf->ssl_conf.ciphers;
if (conf_ciphers &&
!SSL_CTX_set_cipher_list(ctx, conf_ciphers)) {
Alert("Proxy '%s': unable to set SSL cipher list to '%s' for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': unable to set SSL cipher list to '%s' for bind '%s' at [%s:%d].\n",
curproxy->id, conf_ciphers, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr++;
}
@ -4183,7 +4183,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
}
if (dhe_found) {
Warning("Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to make this warning disappear.\n");
ha_warning("Setting tune.ssl.default-dh-param to 1024 by default, if your workload permits it you should set it to at least 2048. Please set a value >= 1024 to make this warning disappear.\n");
}
global_ssl.default_dh_param = 1024;
@ -4233,7 +4233,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
conf_curves = (ssl_conf && ssl_conf->curves) ? ssl_conf->curves : bind_conf->ssl_conf.curves;
if (conf_curves) {
if (!SSL_CTX_set1_curves_list(ctx, conf_curves)) {
Alert("Proxy '%s': unable to set SSL curves list to '%s' for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': unable to set SSL curves list to '%s' for bind '%s' at [%s:%d].\n",
curproxy->id, conf_curves, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr++;
}
@ -4263,7 +4263,7 @@ int ssl_sock_prepare_ctx(struct bind_conf *bind_conf, struct ssl_bind_conf *ssl_
i = OBJ_sn2nid(ecdhe);
if (!i || ((ecdh = EC_KEY_new_by_curve_name(i)) == NULL)) {
Alert("Proxy '%s': unable to set elliptic named curve to '%s' for bind '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': unable to set elliptic named curve to '%s' for bind '%s' at [%s:%d].\n",
curproxy->id, ecdhe, bind_conf->arg, bind_conf->file, bind_conf->line);
cfgerr++;
}
@ -4440,7 +4440,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
/* Make sure openssl opens /dev/urandom before the chroot */
if (!ssl_initialize_random()) {
Alert("OpenSSL random data generator initialization failed.\n");
ha_alert("OpenSSL random data generator initialization failed.\n");
cfgerr++;
}
@ -4450,7 +4450,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
/* Initiate SSL context for current server */
if (!srv->ssl_ctx.reused_sess) {
if ((srv->ssl_ctx.reused_sess = calloc(1, global.nbthread*sizeof(*srv->ssl_ctx.reused_sess))) == NULL) {
Alert("Proxy '%s', server '%s' [%s:%d] out of memory.\n",
ha_alert("Proxy '%s', server '%s' [%s:%d] out of memory.\n",
curproxy->id, srv->id,
srv->conf.file, srv->conf.line);
cfgerr++;
@ -4464,7 +4464,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
ctx = SSL_CTX_new(SSLv23_client_method());
if (!ctx) {
Alert("config : %s '%s', server '%s': unable to allocate ssl context.\n",
ha_alert("config : %s '%s', server '%s': unable to allocate ssl context.\n",
proxy_type_str(curproxy), curproxy->id,
srv->id);
cfgerr++;
@ -4472,7 +4472,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
}
if (conf_ssl_methods->flags && (conf_ssl_methods->min || conf_ssl_methods->max))
Warning("config : %s '%s': no-sslv3/no-tlsv1x are ignored for server '%s'. "
ha_warning("config : %s '%s': no-sslv3/no-tlsv1x are ignored for server '%s'. "
"Use only 'ssl-min-ver' and 'ssl-max-ver' to fix.\n",
proxy_type_str(curproxy), curproxy->id, srv->id);
else
@ -4492,7 +4492,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
if (methodVersions[i].option && !(flags & methodVersions[i].flag)) {
if (min) {
if (hole) {
Warning("config : %s '%s': SSL/TLS versions range not contiguous for server '%s'. "
ha_warning("config : %s '%s': SSL/TLS versions range not contiguous for server '%s'. "
"Hole find for %s. Use only 'ssl-min-ver' and 'ssl-max-ver' to fix.\n",
proxy_type_str(curproxy), curproxy->id, srv->id,
methodVersions[hole].name);
@ -4509,7 +4509,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
hole = i;
}
if (!min) {
Alert("config : %s '%s': all SSL/TLS versions are disabled for server '%s'.\n",
ha_alert("config : %s '%s': all SSL/TLS versions are disabled for server '%s'.\n",
proxy_type_str(curproxy), curproxy->id, srv->id);
cfgerr += 1;
}
@ -4542,19 +4542,19 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
if (srv->ssl_ctx.client_crt) {
if (SSL_CTX_use_PrivateKey_file(srv->ssl_ctx.ctx, srv->ssl_ctx.client_crt, SSL_FILETYPE_PEM) <= 0) {
Alert("config : %s '%s', server '%s': unable to load SSL private key from PEM file '%s'.\n",
ha_alert("config : %s '%s', server '%s': unable to load SSL private key from PEM file '%s'.\n",
proxy_type_str(curproxy), curproxy->id,
srv->id, srv->ssl_ctx.client_crt);
cfgerr++;
}
else if (SSL_CTX_use_certificate_chain_file(srv->ssl_ctx.ctx, srv->ssl_ctx.client_crt) <= 0) {
Alert("config : %s '%s', server '%s': unable to load ssl certificate from PEM file '%s'.\n",
ha_alert("config : %s '%s', server '%s': unable to load ssl certificate from PEM file '%s'.\n",
proxy_type_str(curproxy), curproxy->id,
srv->id, srv->ssl_ctx.client_crt);
cfgerr++;
}
else if (SSL_CTX_check_private_key(srv->ssl_ctx.ctx) <= 0) {
Alert("config : %s '%s', server '%s': inconsistencies between private key and certificate loaded from PEM file '%s'.\n",
ha_alert("config : %s '%s', server '%s': inconsistencies between private key and certificate loaded from PEM file '%s'.\n",
proxy_type_str(curproxy), curproxy->id,
srv->id, srv->ssl_ctx.client_crt);
cfgerr++;
@ -4578,7 +4578,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
if (srv->ssl_ctx.ca_file) {
/* load CAfile to verify */
if (!SSL_CTX_load_verify_locations(srv->ssl_ctx.ctx, srv->ssl_ctx.ca_file, NULL)) {
Alert("Proxy '%s', server '%s' [%s:%d] unable to load CA file '%s'.\n",
ha_alert("Proxy '%s', server '%s' [%s:%d] unable to load CA file '%s'.\n",
curproxy->id, srv->id,
srv->conf.file, srv->conf.line, srv->ssl_ctx.ca_file);
cfgerr++;
@ -4586,11 +4586,11 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
}
else {
if (global.ssl_server_verify == SSL_SERVER_VERIFY_REQUIRED)
Alert("Proxy '%s', server '%s' [%s:%d] verify is enabled by default but no CA file specified. If you're running on a LAN where you're certain to trust the server's certificate, please set an explicit 'verify none' statement on the 'server' line, or use 'ssl-server-verify none' in the global section to disable server-side verifications by default.\n",
ha_alert("Proxy '%s', server '%s' [%s:%d] verify is enabled by default but no CA file specified. If you're running on a LAN where you're certain to trust the server's certificate, please set an explicit 'verify none' statement on the 'server' line, or use 'ssl-server-verify none' in the global section to disable server-side verifications by default.\n",
curproxy->id, srv->id,
srv->conf.file, srv->conf.line);
else
Alert("Proxy '%s', server '%s' [%s:%d] verify is enabled but no CA file specified.\n",
ha_alert("Proxy '%s', server '%s' [%s:%d] verify is enabled but no CA file specified.\n",
curproxy->id, srv->id,
srv->conf.file, srv->conf.line);
cfgerr++;
@ -4600,7 +4600,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
X509_STORE *store = SSL_CTX_get_cert_store(srv->ssl_ctx.ctx);
if (!store || !X509_STORE_load_locations(store, srv->ssl_ctx.crl_file, NULL)) {
Alert("Proxy '%s', server '%s' [%s:%d] unable to configure CRL file '%s'.\n",
ha_alert("Proxy '%s', server '%s' [%s:%d] unable to configure CRL file '%s'.\n",
curproxy->id, srv->id,
srv->conf.file, srv->conf.line, srv->ssl_ctx.crl_file);
cfgerr++;
@ -4617,7 +4617,7 @@ int ssl_sock_prepare_srv_ctx(struct server *srv)
SSL_CTX_sess_set_new_cb(srv->ssl_ctx.ctx, ssl_sess_new_srv_cb);
if (srv->ssl_ctx.ciphers &&
!SSL_CTX_set_cipher_list(srv->ssl_ctx.ctx, srv->ssl_ctx.ciphers)) {
Alert("Proxy '%s', server '%s' [%s:%d] : unable to set SSL cipher list to '%s'.\n",
ha_alert("Proxy '%s', server '%s' [%s:%d] : unable to set SSL cipher list to '%s'.\n",
curproxy->id, srv->id,
srv->conf.file, srv->conf.line, srv->ssl_ctx.ciphers);
cfgerr++;
@ -4641,7 +4641,7 @@ int ssl_sock_prepare_all_ctx(struct bind_conf *bind_conf)
/* Make sure openssl opens /dev/urandom before the chroot */
if (!ssl_initialize_random()) {
Alert("OpenSSL random data generator initialization failed.\n");
ha_alert("OpenSSL random data generator initialization failed.\n");
err++;
}
/* Create initial_ctx used to start the ssl connection before do switchctx */
@ -4689,18 +4689,18 @@ int ssl_sock_prepare_bind_conf(struct bind_conf *bind_conf)
if (!bind_conf->is_ssl) {
if (bind_conf->default_ctx) {
Warning("Proxy '%s': A certificate was specified but SSL was not enabled on bind '%s' at [%s:%d] (use 'ssl').\n",
ha_warning("Proxy '%s': A certificate was specified but SSL was not enabled on bind '%s' at [%s:%d] (use 'ssl').\n",
px->id, bind_conf->arg, bind_conf->file, bind_conf->line);
}
return 0;
}
if (!bind_conf->default_ctx) {
if (bind_conf->strict_sni && !bind_conf->generate_certs) {
Warning("Proxy '%s': no SSL certificate specified for bind '%s' at [%s:%d], ssl connections will fail (use 'crt').\n",
ha_warning("Proxy '%s': no SSL certificate specified for bind '%s' at [%s:%d], ssl connections will fail (use 'crt').\n",
px->id, bind_conf->arg, bind_conf->file, bind_conf->line);
}
else {
Alert("Proxy '%s': no SSL certificate specified for bind '%s' at [%s:%d] (use 'crt').\n",
ha_alert("Proxy '%s': no SSL certificate specified for bind '%s' at [%s:%d] (use 'crt').\n",
px->id, bind_conf->arg, bind_conf->file, bind_conf->line);
return -1;
}
@ -4712,9 +4712,9 @@ int ssl_sock_prepare_bind_conf(struct bind_conf *bind_conf)
((global.nbthread > 1) || (!global_ssl.private_cache && (global.nbproc > 1))) ? 1 : 0);
if (alloc_ctx < 0) {
if (alloc_ctx == SHCTX_E_INIT_LOCK)
Alert("Unable to initialize the lock for the shared SSL session cache. You can retry using the global statement 'tune.ssl.force-private-cache' but it could increase CPU usage due to renegotiations if nbproc > 1.\n");
ha_alert("Unable to initialize the lock for the shared SSL session cache. You can retry using the global statement 'tune.ssl.force-private-cache' but it could increase CPU usage due to renegotiations if nbproc > 1.\n");
else
Alert("Unable to allocate SSL session cache.\n");
ha_alert("Unable to allocate SSL session cache.\n");
return -1;
}
/* free block callback */
@ -4825,7 +4825,7 @@ ssl_sock_load_ca(struct bind_conf *bind_conf)
#endif
if (!bind_conf->ca_sign_file) {
Alert("Proxy '%s': cannot enable certificate generation, "
ha_alert("Proxy '%s': cannot enable certificate generation, "
"no CA certificate File configured at [%s:%d].\n",
px->id, bind_conf->file, bind_conf->line);
goto load_error;
@ -4833,18 +4833,18 @@ ssl_sock_load_ca(struct bind_conf *bind_conf)
/* read in the CA certificate */
if (!(fp = fopen(bind_conf->ca_sign_file, "r"))) {
Alert("Proxy '%s': Failed to read CA certificate file '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': Failed to read CA certificate file '%s' at [%s:%d].\n",
px->id, bind_conf->ca_sign_file, bind_conf->file, bind_conf->line);
goto load_error;
}
if (!(cacert = PEM_read_X509(fp, NULL, NULL, NULL))) {
Alert("Proxy '%s': Failed to read CA certificate file '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': Failed to read CA certificate file '%s' at [%s:%d].\n",
px->id, bind_conf->ca_sign_file, bind_conf->file, bind_conf->line);
goto read_error;
}
rewind(fp);
if (!(capkey = PEM_read_PrivateKey(fp, NULL, NULL, bind_conf->ca_sign_pass))) {
Alert("Proxy '%s': Failed to read CA private key file '%s' at [%s:%d].\n",
ha_alert("Proxy '%s': Failed to read CA private key file '%s' at [%s:%d].\n",
px->id, bind_conf->ca_sign_file, bind_conf->file, bind_conf->line);
goto read_error;
}
@ -7312,7 +7312,7 @@ static int parse_tls_method_minmax(char **args, int cur_arg, struct tls_version_
static int ssl_bind_parse_tls_method_minmax(char **args, int cur_arg, struct proxy *px, struct ssl_bind_conf *conf, char **err)
{
#if (OPENSSL_VERSION_NUMBER < 0x10101000L) || !defined(OPENSSL_IS_BORINGSSL)
Warning("crt-list: ssl-min-ver and ssl-max-ver are not supported with this Openssl version (skipped).\n");
ha_warning("crt-list: ssl-min-ver and ssl-max-ver are not supported with this Openssl version (skipped).\n");
#endif
return parse_tls_method_minmax(args, cur_arg, &conf->ssl_methods, err);
}
@ -7990,7 +7990,7 @@ static int ssl_check_async_engine_count(void) {
int err_code = 0;
if (global_ssl.async && (openssl_engines_initialized > 32)) {
Alert("ssl-mode-async only supports a maximum of 32 engines.\n");
ha_alert("ssl-mode-async only supports a maximum of 32 engines.\n");
err_code = ERR_ABORT;
}
return err_code;

View File

@ -237,7 +237,7 @@ struct uri_auth *stats_add_auth(struct uri_auth **root, char *user)
for (newuser = u->userlist->users; newuser; newuser = newuser->next)
if (!strcmp(newuser->user, user)) {
Warning("uri auth: ignoring duplicated user '%s'.\n",
ha_warning("uri auth: ignoring duplicated user '%s'.\n",
user);
return u;
}

View File

@ -662,7 +662,7 @@ static enum act_return action_store(struct act_rule *rule, struct proxy *px,
default:
send_log(px, LOG_ERR, "Vars: internal error while execute action store.");
if (!(global.mode & MODE_QUIET) || (global.mode & MODE_VERBOSE))
Alert("Vars: internal error while execute action store.\n");
ha_alert("Vars: internal error while execute action store.\n");
return ACT_RET_CONT;
}

View File

@ -299,7 +299,7 @@ static int ha_wurfl_init(void)
global_wurfl.handle = wurfl_create();
if (global_wurfl.handle == NULL) {
Warning("WURFL: Engine handler creation failed");
ha_warning("WURFL: Engine handler creation failed");
send_log(NULL, LOG_WARNING, "WURFL: Engine handler creation failed\n");
return ERR_WARN;
}
@ -308,18 +308,18 @@ static int ha_wurfl_init(void)
// set wurfl data file
if (global_wurfl.data_file == NULL) {
Warning("WURFL: missing wurfl-data-file parameter in global configuration\n");
ha_warning("WURFL: missing wurfl-data-file parameter in global configuration\n");
send_log(NULL, LOG_WARNING, "WURFL: missing wurfl-data-file parameter in global configuration\n");
return ERR_WARN;
}
if (global.nbthread > 1) {
Alert("WURFL: multithreading is not supported for now.\n");
ha_alert("WURFL: multithreading is not supported for now.\n");
return (ERR_FATAL | ERR_ALERT);
}
if (wurfl_set_root(global_wurfl.handle, global_wurfl.data_file) != WURFL_OK) {
Warning("WURFL: Engine setting root file failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
ha_warning("WURFL: Engine setting root file failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
send_log(NULL, LOG_WARNING, "WURFL: Engine setting root file failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
return ERR_WARN;
}
@ -330,7 +330,7 @@ static int ha_wurfl_init(void)
// load wurfl data needed ( and filter whose are supposed to be capabilities )
if (LIST_ISEMPTY(&global_wurfl.information_list)) {
Warning("WURFL: missing wurfl-information-list parameter in global configuration\n");
ha_warning("WURFL: missing wurfl-information-list parameter in global configuration\n");
send_log(NULL, LOG_WARNING, "WURFL: missing wurfl-information-list parameter in global configuration\n");
return ERR_WARN;
} else {
@ -352,7 +352,7 @@ static int ha_wurfl_init(void)
wi->data.type = HA_WURFL_DATA_TYPE_CAP;
if (wurfl_add_requested_capability(global_wurfl.handle, wi->data.name) != WURFL_OK) {
Warning("WURFL: capability filtering failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
ha_warning("WURFL: capability filtering failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
send_log(NULL, LOG_WARNING, "WURFL: capability filtering failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
return ERR_WARN;
}
@ -366,7 +366,7 @@ static int ha_wurfl_init(void)
wn = malloc(sizeof(wurfl_data_t) + len + 1);
if (wn == NULL) {
Warning("WURFL: Error allocating memory for information tree element.\n");
ha_warning("WURFL: Error allocating memory for information tree element.\n");
send_log(NULL, LOG_WARNING, "WURFL: Error allocating memory for information tree element.\n");
return ERR_WARN;
}
@ -378,7 +378,7 @@ static int ha_wurfl_init(void)
wn->nd.key[len] = 0;
if (!ebst_insert(&global_wurfl.btree, &wn->nd)) {
Warning("WURFL: [%s] not inserted in btree\n",wn->name);
ha_warning("WURFL: [%s] not inserted in btree\n",wn->name);
send_log(NULL, LOG_WARNING, "WURFL: [%s] not inserted in btree\n",wn->name);
return ERR_WARN;
}
@ -402,7 +402,7 @@ static int ha_wurfl_init(void)
if (ebst_lookup(&global_wurfl.btree, name) == NULL) {
if (wurfl_add_requested_capability(global_wurfl.handle, name) != WURFL_OK) {
Warning("WURFL: Engine adding mandatory capability [%s] failed - %s\n", name, wurfl_get_error_message(global_wurfl.handle));
ha_warning("WURFL: Engine adding mandatory capability [%s] failed - %s\n", name, wurfl_get_error_message(global_wurfl.handle));
send_log(NULL, LOG_WARNING, "WURFL: Adding mandatory capability [%s] failed - %s\n", name, wurfl_get_error_message(global_wurfl.handle));
return ERR_WARN;
}
@ -423,7 +423,7 @@ static int ha_wurfl_init(void)
list_for_each_entry(wp, &global_wurfl.patch_file_list, list) {
if (wurfl_add_patch(global_wurfl.handle, wp->patch_file_path) != WURFL_OK) {
Warning("WURFL: Engine adding patch file failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
ha_warning("WURFL: Engine adding patch file failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
send_log(NULL, LOG_WARNING, "WURFL: Adding engine patch file failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
return ERR_WARN;
}
@ -447,7 +447,7 @@ static int ha_wurfl_init(void)
}
if (wurfl_result_code != WURFL_OK) {
Warning("WURFL: Setting cache to [%s] failed - %s\n", global_wurfl.cache_size, wurfl_get_error_message(global_wurfl.handle));
ha_warning("WURFL: Setting cache to [%s] failed - %s\n", global_wurfl.cache_size, wurfl_get_error_message(global_wurfl.handle));
send_log(NULL, LOG_WARNING, "WURFL: Setting cache to [%s] failed - %s\n", global_wurfl.cache_size, wurfl_get_error_message(global_wurfl.handle));
return ERR_WARN;
}
@ -458,7 +458,7 @@ static int ha_wurfl_init(void)
// setting engine mode if specified in cfg, otherwise let engine choose
if (global_wurfl.engine_mode != -1) {
if (wurfl_set_engine_target(global_wurfl.handle, global_wurfl.engine_mode) != WURFL_OK ) {
Warning("WURFL: Setting engine target failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
ha_warning("WURFL: Setting engine target failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
send_log(NULL, LOG_WARNING, "WURFL: Setting engine target failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
return ERR_WARN;
}
@ -470,7 +470,7 @@ static int ha_wurfl_init(void)
// setting ua priority if specified in cfg, otherwise let engine choose
if (global_wurfl.useragent_priority != -1) {
if (wurfl_set_useragent_priority(global_wurfl.handle, global_wurfl.useragent_priority) != WURFL_OK ) {
Warning("WURFL: Setting engine useragent priority failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
ha_warning("WURFL: Setting engine useragent priority failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
send_log(NULL, LOG_WARNING, "WURFL: Setting engine useragent priority failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
return ERR_WARN;
}
@ -481,7 +481,7 @@ static int ha_wurfl_init(void)
// loading WURFL engine
if (wurfl_load(global_wurfl.handle) != WURFL_OK) {
Warning("WURFL: Engine load failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
ha_warning("WURFL: Engine load failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
send_log(NULL, LOG_WARNING, "WURFL: Engine load failed - %s\n", wurfl_get_error_message(global_wurfl.handle));
return ERR_WARN;
}