mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 23:31:40 +02:00
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:
parent
594c8c5015
commit
4501c3e099
14
src/checks.c
14
src/checks.c
@ -70,6 +70,7 @@ static int tcpcheck_get_step_id(struct check *);
|
|||||||
static char * tcpcheck_get_step_comment(struct check *, int);
|
static char * tcpcheck_get_step_comment(struct check *, int);
|
||||||
static int tcpcheck_main(struct check *);
|
static int tcpcheck_main(struct check *);
|
||||||
static void __event_srv_chk_w(struct conn_stream *cs);
|
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_email_alert = NULL;
|
||||||
static struct pool_head *pool_head_tcpcheck_rule = 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)
|
static struct task *event_srv_chk_io(struct task *t, void *ctx, unsigned short state)
|
||||||
{
|
{
|
||||||
struct conn_stream *cs = ctx;
|
struct conn_stream *cs = ctx;
|
||||||
struct check *check = cs->data;
|
|
||||||
if (!(cs->wait_list.wait_reason & SUB_CAN_SEND)) {
|
if (!(cs->wait_list.wait_reason & SUB_CAN_SEND))
|
||||||
HA_SPIN_LOCK(SERVER_LOCK, &check->server->lock);
|
wake_srv_chk(cs);
|
||||||
__event_srv_chk_w(cs);
|
|
||||||
HA_SPIN_UNLOCK(SERVER_LOCK, &check->server->lock);
|
|
||||||
}
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2704,6 +2702,10 @@ static int tcpcheck_main(struct check *check)
|
|||||||
}
|
}
|
||||||
break;
|
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)
|
if (&check->current_step->list == head)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user