WAF和其他请求关闭连接时更加快速

This commit is contained in:
GoEdgeLab
2022-08-27 10:49:16 +08:00
parent 328ae09ce7
commit e413adb1b0
3 changed files with 28 additions and 15 deletions

View File

@@ -95,7 +95,12 @@ func (this *BaseClientConn) TCPConn() (tcpConn *net.TCPConn, ok bool) {
// 设置包装前连接
switch conn := this.rawConn.(type) {
case *tls.Conn:
tcpConn, ok = conn.NetConn().(*net.TCPConn)
var internalConn = conn.NetConn()
clientConn, ok := internalConn.(*ClientConn)
if ok {
return clientConn.TCPConn()
}
tcpConn, ok = internalConn.(*net.TCPConn)
default:
tcpConn, ok = this.rawConn.(*net.TCPConn)
}