MINOR: checks: Call wake_srv_chk() when we can finally send data.

Instead of calling __event_srv_chk_w, call wake_srv_chk(), which will then
either call tcpcheck_main() or __event_srv_chk_w().
Also make tcpcheck_main() subscribe if it can't send.
This commit is contained in:
Olivier Houchard 2018-08-28 19:36:18 +02:00 committed by Willy Tarreau
parent 594c8c5015
commit 4501c3e099

View File

@ -70,6 +70,7 @@ static int tcpcheck_get_step_id(struct check *);
static char * tcpcheck_get_step_comment(struct check *, int);
static int tcpcheck_main(struct check *);
static void __event_srv_chk_w(struct conn_stream *cs);
static int wake_srv_chk(struct conn_stream *cs);
static struct pool_head *pool_head_email_alert = NULL;
static struct pool_head *pool_head_tcpcheck_rule = NULL;
@ -709,12 +710,9 @@ static void chk_report_conn_err(struct check *check, int errno_bck, int expired)
static struct task *event_srv_chk_io(struct task *t, void *ctx, unsigned short state)
{
struct conn_stream *cs = ctx;
struct check *check = cs->data;
if (!(cs->wait_list.wait_reason & SUB_CAN_SEND)) {
HA_SPIN_LOCK(SERVER_LOCK, &check->server->lock);
__event_srv_chk_w(cs);
HA_SPIN_UNLOCK(SERVER_LOCK, &check->server->lock);
}
if (!(cs->wait_list.wait_reason & SUB_CAN_SEND))
wake_srv_chk(cs);
return NULL;
}
@ -2704,6 +2702,10 @@ static int tcpcheck_main(struct check *check)
}
break;
}
if (b_data(&check->bo)) {
cs->conn->mux->subscribe(cs, SUB_CAN_SEND, &cs->wait_list);
goto out;
}
}
if (&check->current_step->list == head)