src/backend.c
static int
smp_fetch_srv_is_up(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
                    const struct arg *args, struct sample *smp)
{
	struct server *srv = args->data.srv;

	smp->flags = SMP_F_VOL_TEST;
	smp->type = SMP_T_BOOL;
	if (!(srv->state & SRV_MAINTAIN) &&
	    (!(srv->state & SRV_CHECKED) || (srv->state & SRV_RUNNING)))
		smp->data.uint = 1;
	else
		smp->data.uint = 0;
	return 1;
}
/* report in smp->flags a success or failure depending on the designated
 * server's state. There is no match function involved since there's no pattern.
 * Accepts exactly 1 argument. Argument is a server, other types will lead to
 * undefined behaviour.
 */
report in smp->flags a success or failure depending on the designated
server's state. There is no match function involved since there's no pattern.
Accepts exactly 1 argument. Argument is a server, other types will lead to
undefined behaviour.
report in smp - > flags a success or failure depending on the designated server ' s state . There is no match function involved since there ' s no pattern . Accepts exactly 1 argument . Argument is a server other types will lead to undefined behaviour .
static int
smp_fetch_srv_is_up(struct proxy *px, struct session *l4, void *l7, unsigned int opt,
                    const struct arg *args, struct sample *smp)
{
	struct server *srv = args->data.srv;
	smp->flags = SMP_F_VOL_TEST;
	smp->type = SMP_T_BOOL;
	if (!(srv->state & SRV_MAINTAIN) &&
	    (!(srv->state & SRV_CHECKED) || (srv->state & SRV_RUNNING)))
		smp->data.uint = 1;
	else
		smp->data.uint = 0;
	return 1;
}
static int smp_fetch_srv_is_up ( struct proxy * px , struct session * l4 , void * l7 , unsigned int opt , const struct arg * args , struct sample * smp ) { struct server * srv = args -> data . srv ; smp -> flags = SMP_F_VOL_TEST ; smp -> type = SMP_T_BOOL ; if ( ! ( srv -> state & SRV_MAINTAIN ) && ( ! ( srv -> state & SRV_CHECKED ) || ( srv -> state & SRV_RUNNING ) ) ) smp -> data . uint = 1 ; else smp -> data . uint = 0 ; return 1 ; }
report in smp->flags a success or failure depending on the designated
 server's state.
report in smp - > flags a success or failure depending on the designated server ' s state .