#include <proto/checks.h>
#include <proto/httperr.h>
#include <proto/log.h>
+#include <proto/proxy.h>
#include <proto/server.h>
#include <proto/task.h>
if (!(proxy->cap & cap)) {
Warning("parsing [%s:%d] : '%s' ignored because %s '%s' has %s capability.%s\n",
- file, line, arg, proxy_type_str(proxy->cap), proxy->id, msg, hint ? hint : "");
+ file, line, arg, proxy_type_str(proxy), proxy->id, msg, hint ? hint : "");
return 1;
}
return 0;
if (curproxy->cap & PR_CAP_FE && curproxy->listen == NULL) {
Alert("parsing %s : %s '%s' has no listen address. Please either specify a valid address on the <listen> line, or use the <bind> keyword.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
cfgerr++;
}
else if (curproxy->cap & PR_CAP_BE &&
!(curproxy->options & (PR_O_TRANSP | PR_O_BALANCE)) &&
(*(int *)&curproxy->dispatch_addr.sin_addr == 0))) {
Alert("parsing %s : %s '%s' has no dispatch address and is not in transparent or balance mode.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
cfgerr++;
}
else if ((curproxy->mode != PR_MODE_HEALTH) && (curproxy->options & PR_O_BALANCE)) {
if (curproxy->options & PR_O_TRANSP) {
Alert("parsing %s : %s '%s' cannot use both transparent and balance mode.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
cfgerr++;
}
#ifdef WE_DONT_SUPPORT_SERVERLESS_LISTENERS
else if (curproxy->srv == NULL) {
Alert("parsing %s : %s '%s' needs at least 1 server in balance mode.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
cfgerr++;
}
#endif
else if (*(int *)&curproxy->dispatch_addr.sin_addr != 0) {
Warning("parsing %s : dispatch address of %s '%s' will be ignored in balance mode.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
}
}
else if (curproxy->mode == PR_MODE_TCP || curproxy->mode == PR_MODE_HEALTH) { /* TCP PROXY or HEALTH CHECK */
if (curproxy->cookie_name != NULL) {
Warning("parsing %s : cookie will be ignored for %s '%s'.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
}
if ((newsrv = curproxy->srv) != NULL) {
Warning("parsing %s : servers will be ignored for %s '%s'.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->rsp_exp != NULL) {
Warning("parsing %s : server regular expressions will be ignored for %s '%s'.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->req_exp != NULL) {
Warning("parsing %s : client regular expressions will be ignored for %s '%s'.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->monitor_uri != NULL) {
Warning("parsing %s : monitor-uri will be ignored for %s '%s'.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
}
}
else if (curproxy->mode == PR_MODE_HTTP) { /* HTTP PROXY */
}
if (target == NULL) {
Alert("parsing %s : backend '%s' in HTTP %s '%s' was not found !\n",
- file, exp->replace, proxy_type_str(curproxy->cap), curproxy->id);
+ file, exp->replace, proxy_type_str(curproxy), curproxy->id);
cfgerr++;
} else if (target == curproxy) {
Alert("parsing %s : loop detected for backend %s !\n", file, exp->replace);
cfgerr++;
} else if (!(target->cap & PR_CAP_BE)) {
Alert("parsing %s : target '%s' in HTTP %s '%s' has no backend capability !\n",
- file, exp->replace, proxy_type_str(curproxy->cap), curproxy->id);
+ file, exp->replace, proxy_type_str(curproxy), curproxy->id);
cfgerr++;
} else if (target->mode != PR_MODE_HTTP) {
Alert("parsing %s : backend '%s' in HTTP %s '%s' is not HTTP (use 'mode http') !\n",
- file, exp->replace, proxy_type_str(curproxy->cap), curproxy->id);
+ file, exp->replace, proxy_type_str(curproxy), curproxy->id);
cfgerr++;
} else {
free((void *)exp->replace);
" | While not properly invalid, you will certainly encounter various problems\n"
" | with such a configuration. To fix this, please ensure that all following\n"
" | values are set to a non-zero value: clitimeout, contimeout, srvtimeout.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id);
+ file, proxy_type_str(curproxy), curproxy->id);
}
if (curproxy->options & PR_O_SSL3_CHK) {
newsrv->minconn = newsrv->maxconn;
} else if (newsrv->minconn != newsrv->maxconn && !curproxy->fullconn) {
Alert("parsing %s, %s '%s' : fullconn is mandatory when minconn is set on a server.\n",
- file, proxy_type_str(curproxy->cap), curproxy->id, linenum);
+ file, proxy_type_str(curproxy), curproxy->id, linenum);
return -1;
}
#include <proto/fd.h>
#include <proto/log.h>
#include <proto/queue.h>
+#include <proto/proxy.h>
#include <proto/server.h>
#include <proto/task.h>
send_log(s->proxy, LOG_ALERT, "%s", trash);
if (s->proxy->srv_bck == 0 && s->proxy->srv_act == 0) {
- Alert("Proxy %s has no server available !\n", s->proxy->id);
- send_log(s->proxy, LOG_EMERG, "Proxy %s has no server available !\n", s->proxy->id);
+ Alert("%s '%s' has no server available !\n", proxy_type_str(s->proxy), s->proxy->id);
+ send_log(s->proxy, LOG_EMERG, "%s %s has no server available !\n", proxy_type_str(s->proxy), s->proxy->id);
}
s->down_trans++;
}
else if (s->proxy->options & PR_O_BIND_SRC) {
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (char *) &one, sizeof(one));
if (bind(fd, (struct sockaddr *)&s->proxy->source_addr, sizeof(s->proxy->source_addr)) == -1) {
- Alert("Cannot bind to source address before connect() for proxy %s. Aborting.\n",
- s->proxy->id);
+ Alert("Cannot bind to source address before connect() for %s '%s'. Aborting.\n",
+ proxy_type_str(s->proxy), s->proxy->id);
s->result = -1;
}
#ifdef CONFIG_HAP_CTTPROXY
if (setsockopt(fd, SOL_IP, IP_TPROXY, &itp1, sizeof(itp1)) == -1 ||
setsockopt(fd, SOL_IP, IP_TPROXY, &itp2, sizeof(itp2)) == -1) {
- Alert("Cannot bind to tproxy source address before connect() for proxy %s. Aborting.\n",
- s->proxy->id);
+ Alert("Cannot bind to tproxy source address before connect() for %s '%s'. Aborting.\n",
+ proxy_type_str(s->proxy), s->proxy->id);
s->result = -1;
}
}