#define PR_O_TCPCHK_SSL 0x10000000 /* at least one TCPCHECK connect rule requires SSL */
#define PR_O_CONTSTATS 0x20000000 /* continuous counters */
-#define PR_O_DISABLE404 0x40000000 /* Disable a server on a 404 response to a health-check */
-/* unused: 0x80000000 */
+/* unused: 0x40000000..0x80000000 */
/* bits for proxy->options2 */
#define PR_O2_SPLIC_REQ 0x00000001 /* transfer requests using linux kernel's splice() */
#define PR_O2_NODELAY 0x00020000 /* fully interactive mode, never delay outgoing data */
#define PR_O2_USE_PXHDR 0x00040000 /* use Proxy-Connection for proxy requests */
-#define PR_O2_CHK_SNDST 0x00080000 /* send the state of each server along with HTTP health checks */
+/* unused: 0x00080000 */
#define PR_O2_SRC_ADDR 0x00100000 /* get the source ip and port for logs */
*err_code |= ERR_WARN;
}
- if ((px->options2 & PR_O2_CHK_ANY) == PR_O2_TCPCHK_CHK &&
- px->tcpcheck.rs && (px->tcpcheck.rs->flags & TCPCHK_RULES_PROTO_CHK) != TCPCHK_RULES_HTTP_CHK) {
- if (px->options & PR_O_DISABLE404) {
- ha_warning("'%s' will be ignored for %s '%s' (requires 'option httpchk').\n",
- "disable-on-404", proxy_type_str(px), px->id);
- *err_code |= ERR_WARN;
- px->options &= ~PR_O_DISABLE404;
- }
- if (px->options2 & PR_O2_CHK_SNDST) {
- ha_warning("'%s' will be ignored for %s '%s' (requires 'option httpchk').\n",
- "send-state", proxy_type_str(px), px->id);
- *err_code |= ERR_WARN;
- px->options2 &= ~PR_O2_CHK_SNDST;
- }
- }
-
if ((px->options2 & PR_O2_CHK_ANY) == PR_O2_EXT_CHK) {
if (!global.external_check) {
ha_alert("Proxy '%s' : '%s' unable to find required 'global.external-check'.\n",
}
}
- if (check->proxy->options2 & PR_O2_CHK_SNDST) {
+ if (check->tcpcheck->rs->flags & TCPCHK_RULES_SNDST) {
chunk_reset(tmp);
httpchk_build_status_header(check->server, tmp);
if (!htx_add_header(htx, ist("X-Haproxy-Server-State"), ist2(b_orig(tmp), b_data(tmp))))
check->code = sl->info.res.status;
if (check->server &&
- (check->server->proxy->options & PR_O_DISABLE404) &&
+ (check->tcpcheck->rs->flags & TCPCHK_RULES_DISABLE404) &&
(check->server->next_state != SRV_ST_STOPPED) &&
(check->code == 404)) {
/* 404 may be accepted as "stopping" only if the server was up */
enum healthcheck_status status;
if (check->server &&
- (check->server->proxy->options & PR_O_DISABLE404) &&
+ (check->tcpcheck->rs->flags & TCPCHK_RULES_DISABLE404) &&
(check->server->next_state != SRV_ST_STOPPED) &&
(check->code == 404)) {
set_server_check_status(check, HCHK_STATUS_L7OKCD, NULL);
if (warnifnotcap(curpx, PR_CAP_BE, file, line, args[0], NULL))
ret = 1;
- cur_arg = 1;
- if (strcmp(args[cur_arg], "disable-on-404") == 0) {
- /* enable a graceful server shutdown on an HTTP 404 response */
- curpx->options |= PR_O_DISABLE404;
- if (too_many_args(1, args, errmsg, NULL))
- goto error;
- goto out;
- }
- else if (strcmp(args[cur_arg], "send-state") == 0) {
- /* enable emission of the apparent state of a server in HTTP checks */
- curpx->options2 |= PR_O2_CHK_SNDST;
- if (too_many_args(1, args, errmsg, NULL))
- goto error;
- goto out;
- }
-
/* Deduce the ruleset name from the proxy info */
chunk_printf(&trash, "*http-check-%s_%s-%d",
((curpx == defpx) ? "defaults" : curpx->id),
}
rs->flags |= TCPCHK_RULES_HTTP_CHK;
}
+ cur_arg = 1;
+ if (strcmp(args[cur_arg], "disable-on-404") == 0) {
+ /* enable a graceful server shutdown on an HTTP 404 response */
+ rs->flags |= TCPCHK_RULES_DISABLE404;
+ if (too_many_args(1, args, errmsg, NULL))
+ goto error;
+ goto out;
+ }
+ else if (strcmp(args[cur_arg], "send-state") == 0) {
+ /* enable emission of the apparent state of a server in HTTP checks */
+ rs->flags |= TCPCHK_RULES_SNDST;
+ if (too_many_args(1, args, errmsg, NULL))
+ goto error;
+ goto out;
+ }
index = 0;
if (!LIST_ISEMPTY(&rs->rules)) {