mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-22 05:22:58 +00:00
[BUG] checks: don't report an error when recv() returns an error after data
This happens when a server immediately closes the connection after the response without lingering or when we close before the end of the data. We get an RST which translates into a late error. We must not declare an error without checking that the contents are OK.
This commit is contained in:
parent
2c7ace07ad
commit
c1a07960a6
15
src/checks.c
15
src/checks.c
@ -898,10 +898,17 @@ static int event_srv_chk_r(int fd)
|
|||||||
fdtab[fd].ev &= ~FD_POLL_IN;
|
fdtab[fd].ev &= ~FD_POLL_IN;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* network error, report it */
|
|
||||||
if (!(s->result & SRV_CHK_ERROR))
|
/* Report network errors only if we got no other data. Otherwise
|
||||||
set_server_check_status(s, HCHK_STATUS_SOCKERR, NULL);
|
* we'll let the upper layers decide whether the response is OK
|
||||||
goto out_wakeup;
|
* or not. It is very common that an RST sent by the server is
|
||||||
|
* reported as an error just after the last data chunk.
|
||||||
|
*/
|
||||||
|
if (!s->check_data_len) {
|
||||||
|
if (!(s->result & SRV_CHK_ERROR))
|
||||||
|
set_server_check_status(s, HCHK_STATUS_SOCKERR, NULL);
|
||||||
|
goto out_wakeup;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Full response received.
|
/* Full response received.
|
||||||
|
Loading…
Reference in New Issue
Block a user