1 Star 0 Fork 47

tmacbb/bind

forked from src-openEuler/bind 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-0014-Add-isc_nmhandle_setwritetimeout-function.patch 2.21 KB
一键复制 编辑 原始数据 按行查看 历史
jinag12 提交于 2022-12-26 15:55 . backport bugfix patches
From 1d0f2eb2c495a079101b6f6fd66ff22d95a4ab04 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= <ondrej@isc.org>
Date: Wed, 9 Feb 2022 19:48:13 +0100
Subject: [PATCH] Add isc_nmhandle_setwritetimeout() function
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)
Conflict: NA
Reference: https://gitlab.isc.org/isc-projects/bind9/-/commit/1d0f2eb2c495a079101b6f6fd66ff22d95a4ab04
---
lib/isc/include/isc/netmgr.h | 3 +++
lib/isc/netmgr/netmgr.c | 8 ++++++++
lib/isc/win32/libisc.def.in | 1 +
3 files changed, 12 insertions(+)
diff --git a/lib/isc/include/isc/netmgr.h b/lib/isc/include/isc/netmgr.h
index f8477b0018..39dba1d376 100644
--- a/lib/isc/include/isc/netmgr.h
+++ b/lib/isc/include/isc/netmgr.h
@@ -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);
diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c
index 6bc8c64337..31917be101 100644
--- a/lib/isc/netmgr/netmgr.c
+++ b/lib/isc/netmgr/netmgr.c
@@ -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) {
diff --git a/lib/isc/win32/libisc.def.in b/lib/isc/win32/libisc.def.in
index de65c63b7d..79e7b64a58 100644
--- a/lib/isc/win32/libisc.def.in
+++ b/lib/isc/win32/libisc.def.in
@@ -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
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/tmacbb/bind.git
git@gitee.com:tmacbb/bind.git
tmacbb
bind
bind
master

搜索帮助