mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 07:11:20 +02:00
BUG/MEDIUM: checks: Don't attempt to read if we destroyed the connection.
In event_srv_chk_io(), only call __event_srv_chk_r() if we did not subscribe for reading, and if wake_srv_chk() didn't return -1, as it would mean it just destroyed the connection and the conn_stream, and attempting to use those to recv data would lead to a crash. This should be backported to 1.9 and 2.0.
This commit is contained in:
parent
34ce7d075a
commit
bc89ad8d94
@ -716,10 +716,11 @@ static struct task *event_srv_chk_io(struct task *t, void *ctx, unsigned short s
|
|||||||
struct check *check = ctx;
|
struct check *check = ctx;
|
||||||
struct conn_stream *cs = check->cs;
|
struct conn_stream *cs = check->cs;
|
||||||
struct email_alertq *q = container_of(check, typeof(*q), check);
|
struct email_alertq *q = container_of(check, typeof(*q), check);
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
if (!(check->wait_list.events & SUB_RETRY_SEND))
|
if (!(check->wait_list.events & SUB_RETRY_SEND))
|
||||||
wake_srv_chk(cs);
|
ret = wake_srv_chk(cs);
|
||||||
if (!(check->wait_list.events & SUB_RETRY_RECV)) {
|
if (ret == 0 && !(check->wait_list.events & SUB_RETRY_RECV)) {
|
||||||
if (check->server)
|
if (check->server)
|
||||||
HA_SPIN_LOCK(SERVER_LOCK, &check->server->lock);
|
HA_SPIN_LOCK(SERVER_LOCK, &check->server->lock);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user