File tree 1 file changed +7
-10
lines changed
1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -65,21 +65,18 @@ func SetTimeoutSockOpt(c MinConn, timeoutms int) bool {
65
65
return false
66
66
}
67
67
68
- func DisableKeepAlive (c MinConn ) bool {
69
- if sc , ok := c .(syscall. Conn ); ok {
68
+ func DisableKeepAlive (c MinConn ) ( done bool ) {
69
+ if sc , ok := c .(PoolableConn ); ok {
70
70
raw , err := sc .SyscallConn ()
71
- if err != nil {
72
- return false
71
+ if raw == nil || err != nil {
72
+ return
73
73
}
74
74
err = raw .Control (func (fd uintptr ) {
75
- syscall .SetsockoptInt (int (fd ), syscall .SOL_SOCKET , syscall .SO_KEEPALIVE , 0 )
75
+ err = syscall .SetsockoptInt (int (fd ), syscall .SOL_SOCKET , syscall .SO_KEEPALIVE , 0 )
76
76
})
77
- if err != nil {
78
- return false
79
- }
80
- return true
77
+ return err == nil
81
78
}
82
- return false
79
+ return
83
80
}
84
81
85
82
// SetKeepAliveConfigSockOpt sets for a TCP connection, SO_KEEPALIVE,
You can’t perform that action at this time.
0 commit comments