Skip to content

Commit 4475d0d

Browse files
committed
尝试修复tls.conn问题
1 parent aa91ca6 commit 4475d0d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/pool/conn_check.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package pool
44

55
import (
6+
"crypto/tls"
67
"errors"
78
"io"
89
"net"
@@ -16,6 +17,10 @@ func connCheck(conn net.Conn) error {
1617
// Reset previous timeout.
1718
_ = conn.SetDeadline(time.Time{})
1819

20+
// Check if tls.Conn.
21+
if _, ok := conn.(*tls.Conn); ok {
22+
conn = conn.(*tls.Conn).NetConn()
23+
}
1924
sysConn, ok := conn.(syscall.Conn)
2025
if !ok {
2126
return nil

0 commit comments

Comments
 (0)