static isc_tlsctx_t *server_tlsctx = NULL;
static isc_tlsctx_t *client_tlsctx = NULL;
+/* Timeout for soft-timeout tests (0.05 seconds) */
+#define T_SOFT 50
+
#define NSENDS 100
#define NWRITES 10
atomic_fetch_add(&ctimeouts, 1);
if (eresult == ISC_R_TIMEDOUT && atomic_load(&ctimeouts) < 5) {
- isc_nmhandle_settimeout(handle, 50);
+ isc_nmhandle_settimeout(handle, T_SOFT);
return;
}
* Shorten all the TCP client timeouts to 0.05 seconds.
* timeout_retry_cb() will give up after five timeouts.
*/
- isc_nm_settimeouts(connect_nm, 50, 50, 50, 50);
+ isc_nm_settimeouts(connect_nm, T_SOFT, T_SOFT, T_SOFT, T_SOFT);
sockaddr_to_url(&tcp_listen_addr, false, req_url, sizeof(req_url),
DOH_PATH);
isc_nm_httpconnect(connect_nm, NULL, (isc_nmiface_t *)&tcp_listen_addr,
req_url, atomic_load(&POST), timeout_request_cb,
- NULL, ctx, 50, 0);
+ NULL, ctx, T_SOFT, 0);
/*
* Sleep until sends reaches 5.
#define NSENDS 100
+/* Timeout for soft-timeout tests (0.05 seconds) */
+#define T_SOFT 50
+
/* Timeouts in miliseconds */
#define T_INIT 120 * 1000
#define T_IDLE 120 * 1000
F();
if (eresult == ISC_R_TIMEDOUT && atomic_load(&csends) < 5) {
- isc_nmhandle_settimeout(handle, 50);
+ isc_nmhandle_settimeout(handle, T_SOFT);
connect_send(handle);
return;
}
isc_refcount_increment0(&active_cconnects);
isc_nm_udpconnect(connect_nm, (isc_nmiface_t *)&udp_connect_addr,
(isc_nmiface_t *)&udp_listen_addr, connect_connect_cb,
- NULL, 50, 0);
+ NULL, T_SOFT, 0);
WAIT_FOR_EQ(cconnects, 1);
WAIT_FOR_GE(csends, 1);
/*
* Shorten all the client timeouts to 0.05 seconds.
*/
- isc_nm_settimeouts(connect_nm, 50, 50, 50, 50);
+ isc_nm_settimeouts(connect_nm, T_SOFT, T_SOFT, T_SOFT, T_SOFT);
connect_readcb = timeout_retry_cb;
isc_refcount_increment0(&active_cconnects);
- stream_connect(connect_connect_cb, NULL, 50, 0);
+ stream_connect(connect_connect_cb, NULL, T_SOFT, 0);
WAIT_FOR_EQ(cconnects, 1);
WAIT_FOR_GE(csends, 1);
* timeout_retry_cb() will give up after five timeouts.
*/
connect_readcb = timeout_retry_cb;
- isc_nm_settimeouts(connect_nm, 50, 50, 50, 50);
+ isc_nm_settimeouts(connect_nm, T_SOFT, T_SOFT, T_SOFT, T_SOFT);
isc_refcount_increment0(&active_cconnects);
isc_nm_tcpdnsconnect(connect_nm, (isc_nmiface_t *)&tcp_connect_addr,
(isc_nmiface_t *)&tcp_listen_addr,
- connect_connect_cb, NULL, 50, 0);
+ connect_connect_cb, NULL, T_SOFT, 0);
WAIT_FOR_EQ(cconnects, 1);
WAIT_FOR_GE(csends, 1);
* timeout_retry_cb() will give up after five timeouts.
*/
connect_readcb = timeout_retry_cb;
- isc_nm_settimeouts(connect_nm, 50, 50, 50, 50);
+ isc_nm_settimeouts(connect_nm, T_SOFT, T_SOFT, T_SOFT, T_SOFT);
isc_refcount_increment0(&active_cconnects);
isc_nm_tlsdnsconnect(connect_nm, (isc_nmiface_t *)&tcp_connect_addr,
(isc_nmiface_t *)&tcp_listen_addr,
- connect_connect_cb, NULL, 50, 0,
+ connect_connect_cb, NULL, T_SOFT, 0,
tcp_connect_tlsctx);
WAIT_FOR_EQ(cconnects, 1);