#define CHK_ST_CONFIGURED 0x0002 /* this check is configured and may be enabled */
#define CHK_ST_ENABLED 0x0004 /* this check is currently administratively enabled */
#define CHK_ST_PAUSED 0x0008 /* checks are paused because of maintenance (health only) */
+#define CHK_ST_AGENT 0x0010 /* check is an agent check (otherwise it's a health check) */
/* check status */
enum {
/* Failure to connect to the agent as a secondary check should not
* cause the server to be marked down. So only log status changes
* for HCHK_STATUS_* statuses */
- if (check == &s->agent && check->status < HCHK_STATUS_L7TOUT)
+ if ((check->state & CHK_ST_AGENT) && check->status < HCHK_STATUS_L7TOUT)
return;
if (s->proxy->options2 & PR_O2_LOGHCHKS &&
* The implication here is that failure to connect to the agent
* as a secondary check should not cause the server to be marked
* down. */
- if (check == &s->agent && check->status != HCHK_STATUS_L7STS)
+ if ((check->state & CHK_ST_AGENT) && check->status != HCHK_STATUS_L7STS)
return;
if (check->health > check->rise) {
* configuration of the primary check. Similarly, tcp-check uses
* its own strings.
*/
- if (check->type && check->type != PR_O2_TCPCHK_CHK && check != &s->agent) {
+ if (check->type && check->type != PR_O2_TCPCHK_CHK && !(check->state & CHK_ST_AGENT)) {
bo_putblk(check->bo, s->proxy->check_req, s->proxy->check_len);
/* we want to check if this host replies to HTTP or SSLv3 requests