From 09160a68917237ee3bc7713b81d40d5bb010a903 Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Mon, 18 Mar 2024 17:26:09 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=85=B3=E9=97=AD=20idle=5Ft?= =?UTF-8?q?imeout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/base/config.go | 2 +- server/conf/server-sample.toml | 4 ++-- server/handler/link_dtls.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/base/config.go b/server/base/config.go index 4623cdb..7f111f2 100644 --- a/server/base/config.go +++ b/server/base/config.go @@ -59,7 +59,7 @@ var configs = []config{ {Typ: cfgInt, Name: "mobile_keepalive", Usage: "移动端keepalive接检测时间(秒)", ValInt: 40}, {Typ: cfgInt, Name: "mobile_dpd", Usage: "移动端死链接检测时间(秒)", ValInt: 60}, {Typ: cfgInt, Name: "mtu", Usage: "最大传输单元MTU", ValInt: 1460}, - {Typ: cfgInt, Name: "idle_timeout", Usage: "空闲链接超时时间(秒)-超时后断开链接,0关闭此功能", ValInt: 1800}, + {Typ: cfgInt, Name: "idle_timeout", Usage: "空闲链接超时时间(秒)-超时后断开链接,0关闭此功能", ValInt: 0}, {Typ: cfgInt, Name: "session_timeout", Usage: "session过期时间(秒)-用于断线重连,0永不过期", ValInt: 3600}, // {Typ: cfgInt, Name: "auth_timeout", Usage: "auth_timeout", ValInt: 0}, {Typ: cfgInt, Name: "audit_interval", Usage: "审计去重间隔(秒),-1关闭", ValInt: 600}, diff --git a/server/conf/server-sample.toml b/server/conf/server-sample.toml index 726ba39..2950341 100644 --- a/server/conf/server-sample.toml +++ b/server/conf/server-sample.toml @@ -82,10 +82,10 @@ default_domain = "example.com" #default_domain = "example.com abc.example.com" #空闲链接超时时间(秒)-超时后断开链接,0关闭此功能 -idle_timeout = 1800 +idle_timeout = 0 #session过期时间,用于断线重连,0永不过期 session_timeout = 3600 -auth_timeout = 0 +#auth_timeout = 0 audit_interval = 600 show_sql = false diff --git a/server/handler/link_dtls.go b/server/handler/link_dtls.go index c87a8f0..308462d 100644 --- a/server/handler/link_dtls.go +++ b/server/handler/link_dtls.go @@ -62,7 +62,7 @@ func LinkDtls(conn net.Conn, cSess *sessdata.ConnSession) { base.Debug("DISCONNECT DTLS", cSess.Username, cSess.IpAddr, conn.RemoteAddr()) return case 0x03: // DPD-REQ - base.Trace("recv LinkDtls DPD-REQ", cSess.Username, cSess.IpAddr, conn.RemoteAddr(), n, pl.Data[:n]) + base.Trace("recv LinkDtls DPD-REQ", cSess.Username, cSess.IpAddr, conn.RemoteAddr(), n, pl.Data[:n], string(pl.Data[1:n])) pl.PType = 0x04 // 从零开始 可以直接赋值 pl.Data = pl.Data[:n]