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);
}
}
-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) {
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;
}
void
isc__nm_tcp_pauseread(isc_nmhandle_t *handle) {
+ isc__netievent_tcppauseread_t *ievent = NULL;
+ isc_nmsocket_t *sock = NULL;
+
REQUIRE(VALID_NMHANDLE(handle));
- REQUIRE(VALID_NMSOCK(handle->sock));
- isc__netievent_tcppauseread_t *ievent = NULL;
- isc_nmsocket_t *sock = handle->sock;
+ sock = handle->sock;
REQUIRE(VALID_NMSOCK(sock));
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;
}
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;
}
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;
}
}
if (sock->statichandle != NULL) {
- failed_read_cb(sock, ISC_R_CANCELED);
+ isc__nm_tcp_failed_read_cb(sock, ISC_R_CANCELED);
return;
}
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