2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 21:17:54 +00:00

fix TCP timeout recovery

removed an unnecessary assert in the failed_read_cb() function.
also renamed to isc__nm_tcp_failed_read_cb() to match the practice
in other modules.
This commit is contained in:
Evan Hunt 2021-04-21 10:27:46 -07:00
parent 25ef0547a9
commit c90da99180

View File

@ -654,10 +654,10 @@ isc__nm_async_tcpstop(isc__networker_t *worker, isc__netievent_t *ev0) {
stop_tcp_parent(sock);
}
static void
failed_read_cb(isc_nmsocket_t *sock, isc_result_t result) {
void
isc__nm_tcp_failed_read_cb(isc_nmsocket_t *sock, isc_result_t result) {
REQUIRE(VALID_NMSOCK(sock));
REQUIRE(sock->statichandle != NULL);
REQUIRE(result != ISC_R_SUCCESS);
isc__nmsocket_timer_stop(sock);
isc__nm_stop_reading(sock);
@ -685,11 +685,6 @@ destroy:
}
}
void
isc__nm_tcp_failed_read_cb(isc_nmsocket_t *sock, isc_result_t result) {
failed_read_cb(sock, result);
}
static void
failed_send_cb(isc_nmsocket_t *sock, isc__nm_uvreq_t *req,
isc_result_t eresult) {
@ -752,7 +747,7 @@ isc__nm_async_tcpstartread(isc__networker_t *worker, isc__netievent_t *ev0) {
if (isc__nmsocket_closing(sock)) {
sock->reading = true;
failed_read_cb(sock, ISC_R_CANCELED);
isc__nm_tcp_failed_read_cb(sock, ISC_R_CANCELED);
return;
}
@ -762,11 +757,12 @@ isc__nm_async_tcpstartread(isc__networker_t *worker, isc__netievent_t *ev0) {
void
isc__nm_tcp_pauseread(isc_nmhandle_t *handle) {
REQUIRE(VALID_NMHANDLE(handle));
REQUIRE(VALID_NMSOCK(handle->sock));
isc__netievent_tcppauseread_t *ievent = NULL;
isc_nmsocket_t *sock = handle->sock;
isc_nmsocket_t *sock = NULL;
REQUIRE(VALID_NMHANDLE(handle));
sock = handle->sock;
REQUIRE(VALID_NMSOCK(sock));
@ -814,7 +810,7 @@ isc__nm_tcp_resumeread(isc_nmhandle_t *handle) {
if (!isc__nmsocket_active(sock)) {
sock->reading = true;
failed_read_cb(sock, ISC_R_CANCELED);
isc__nm_tcp_failed_read_cb(sock, ISC_R_CANCELED);
return;
}
@ -840,7 +836,7 @@ isc__nm_tcp_read_cb(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
REQUIRE(buf != NULL);
if (isc__nmsocket_closing(sock)) {
failed_read_cb(sock, ISC_R_CANCELED);
isc__nm_tcp_failed_read_cb(sock, ISC_R_CANCELED);
goto free;
}
@ -850,7 +846,7 @@ isc__nm_tcp_read_cb(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
sock->statsindex[STATID_RECVFAIL]);
}
failed_read_cb(sock, isc__nm_uverr2result(nread));
isc__nm_tcp_failed_read_cb(sock, isc__nm_uverr2result(nread));
goto free;
}
@ -1339,7 +1335,7 @@ isc__nm_tcp_shutdown(isc_nmsocket_t *sock) {
}
if (sock->statichandle != NULL) {
failed_read_cb(sock, ISC_R_CANCELED);
isc__nm_tcp_failed_read_cb(sock, ISC_R_CANCELED);
return;
}
@ -1379,7 +1375,7 @@ isc__nm_async_tcpcancel(isc__networker_t *worker, isc__netievent_t *ev0) {
uv_timer_stop(&sock->timer);
failed_read_cb(sock, ISC_R_EOF);
isc__nm_tcp_failed_read_cb(sock, ISC_R_EOF);
}
int_fast32_t