atomic_int_fast32_t active_child_connections;
bool barrier_initialised;
+ bool manual_read_timer;
#ifdef NETMGR_TRACE
void *backtrace[TRACE_SIZE];
int backtrace_size;
* Set the read timeout for the TCP socket associated with 'handle'.
*/
+void
+isc__nmhandle_tcp_set_manual_timer(isc_nmhandle_t *handle, const bool manual);
+
void
isc__nm_async_tcplisten(isc__networker_t *worker, isc__netievent_t *ev0);
void
void
isc__nmhandle_log(const isc_nmhandle_t *handle, int level, const char *fmt, ...)
ISC_FORMAT_PRINTF(3, 4);
+
+void
+isc__nmhandle_set_manual_timer(isc_nmhandle_t *handle, const bool manual);
+/*
+ * Set manual read timer control mode - so that it will not get reset
+ * automatically on read nor get started when read is initiated.
+ */
isc__nmsocket_log(handle->sock, level, "handle %p: %s", handle, msgbuf);
}
+void
+isc__nmhandle_set_manual_timer(isc_nmhandle_t *handle, const bool manual) {
+ isc_nmsocket_t *sock;
+
+ REQUIRE(VALID_NMHANDLE(handle));
+ sock = handle->sock;
+ REQUIRE(VALID_NMSOCK(sock));
+
+ switch (sock->type) {
+ case isc_nm_tcpsocket:
+ isc__nmhandle_tcp_set_manual_timer(handle, manual);
+ return;
+ default:
+ break;
+ };
+
+ UNREACHABLE();
+}
+
#ifdef NETMGR_TRACE
/*
* Dump all active sockets in netmgr. We output to stderr
goto failure;
}
- isc__nmsocket_timer_start(sock);
+ if (!sock->manual_read_timer) {
+ isc__nmsocket_timer_start(sock);
+ }
return;
failure:
isc__nm_readcb(sock, req, ISC_R_SUCCESS, false);
/* The readcb could have paused the reading */
- if (sock->reading) {
+ if (sock->reading && !sock->manual_read_timer) {
/* The timer will be updated */
isc__nmsocket_timer_restart(sock);
}
isc__nmsocket_prep_destroy(sock);
}
}
+
+void
+isc__nmhandle_tcp_set_manual_timer(isc_nmhandle_t *handle, const bool manual) {
+ isc_nmsocket_t *sock;
+
+ REQUIRE(VALID_NMHANDLE(handle));
+ sock = handle->sock;
+ REQUIRE(VALID_NMSOCK(sock));
+ REQUIRE(sock->type == isc_nm_tcpsocket);
+ REQUIRE(sock->tid == isc_tid());
+ REQUIRE(!sock->reading);
+ REQUIRE(!sock->recv_read);
+
+ sock->manual_read_timer = manual;
+}