]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add isc_nmhandle_setwritetimeout() function
authorOndřej Surý <ondrej@isc.org>
Wed, 9 Feb 2022 18:48:13 +0000 (19:48 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 17 Feb 2022 10:26:16 +0000 (11:26 +0100)
In some situations (unit test and forthcoming XFR timeouts MR), we need
to modify the write timeout independently of the read timeout.  Add a
isc_nmhandle_setwritetimeout() function that could be called before
isc_nm_send() to specify a custom write timeout interval.

(cherry picked from commit a89d9e0fa68b8d915c6a1c416543dd157d8b0b5a)

lib/isc/include/isc/netmgr.h
lib/isc/netmgr/netmgr.c
lib/isc/win32/libisc.def.in

index f8477b001824eba9def67636469820555eb9befb..39dba1d376daf38390ee2433ff7beb3bb9a96a24 100644 (file)
@@ -489,3 +489,6 @@ isc__nm_force_tid(int tid);
  * Force the thread ID to 'tid'. This is STRICTLY for use in unit
  * tests and should not be used in any production code.
  */
+
+void
+isc_nmhandle_setwritetimeout(isc_nmhandle_t *handle, uint64_t write_timeout);
index 6bc8c6433767dd54ac430cfc4a8afa262a2af109..31917be101451481f7dee45c3e2845505a78a16b 100644 (file)
@@ -639,6 +639,14 @@ isc_nm_maxudp(isc_nm_t *mgr, uint32_t maxudp) {
        atomic_store(&mgr->maxudp, maxudp);
 }
 
+void
+isc_nmhandle_setwritetimeout(isc_nmhandle_t *handle, uint64_t write_timeout) {
+       REQUIRE(VALID_NMHANDLE(handle));
+       REQUIRE(VALID_NMSOCK(handle->sock));
+
+       handle->sock->write_timeout = write_timeout;
+}
+
 void
 isc_nm_settimeouts(isc_nm_t *mgr, uint32_t init, uint32_t idle,
                   uint32_t keepalive, uint32_t advertised) {
index de65c63b7d52689669295aca5dd72b0296ffa1b0..79e7b64a58642848236ac0088ab039db3449c629 100644 (file)
@@ -457,6 +457,7 @@ isc_nmhandle_localaddr
 isc_nmhandle_peeraddr
 isc_nmhandle_setdata
 isc_nmhandle_settimeout
+isc_nmhandle_setwritetimeout
 isc_nm_attach
 isc_nm_cancelread
 isc_nm_detach