mirror of
https://github.com/isc-projects/bind9.git
synced 2026-07-07 18:50:54 -04:00
ignore 0-byte reads in the TCP read callback
Callbacks for libuv stream reads do not signal zero-length reads as a failure signal but rather as EAGAIN/EWOULDBLOCK. This can trigger an assertion when a zero-length read is pushed onto a PROXYv2 endpoint that has not yet processed the headers as it expects a non-NULL region of positive length.
This commit is contained in:
parent
494874148d
commit
20d3ef1643
1 changed files with 5 additions and 2 deletions
|
|
@ -778,7 +778,10 @@ isc__nm_tcp_read_cb(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
|
|||
goto free;
|
||||
}
|
||||
|
||||
if (nread < 0) {
|
||||
if (nread == 0) {
|
||||
/* EAGAIN/EWOULDBLOCK: no data yet, not an error on libuv. */
|
||||
goto free;
|
||||
} else if (nread < 0) {
|
||||
if (nread != UV_EOF) {
|
||||
isc__nm_incstats(sock, STATID_RECVFAIL);
|
||||
}
|
||||
|
|
@ -837,7 +840,7 @@ isc__nm_tcp_read_cb(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
|
|||
}
|
||||
|
||||
free:
|
||||
if (nread < 0) {
|
||||
if (nread <= 0) {
|
||||
/*
|
||||
* The buffer may be a null buffer on error.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue