diff --git a/cmd/http/dial_linux.go b/cmd/http/dial_linux.go index d7aad4783..74ce22c21 100644 --- a/cmd/http/dial_linux.go +++ b/cmd/http/dial_linux.go @@ -27,7 +27,7 @@ import ( "golang.org/x/sys/unix" ) -func setTCPParameters(c syscall.RawConn) error { +func setInternalTCPParameters(c syscall.RawConn) error { return c.Control(func(fdPtr uintptr) { // got socket file descriptor to set parameters. fd := int(fdPtr) @@ -67,7 +67,7 @@ func NewCustomDialContext(dialTimeout time.Duration) DialContext { dialer := &net.Dialer{ Timeout: dialTimeout, Control: func(network, address string, c syscall.RawConn) error { - return setTCPParameters(c) + return setInternalTCPParameters(c) }, } return dialer.DialContext(ctx, network, addr) diff --git a/cmd/http/dial_others.go b/cmd/http/dial_others.go index 1925b0470..b1decdbcf 100644 --- a/cmd/http/dial_others.go +++ b/cmd/http/dial_others.go @@ -26,7 +26,7 @@ import ( ) // TODO: if possible implement for non-linux platforms, not a priority at the moment -func setTCPParameters(c syscall.RawConn) error { +func setInternalTCPParameters(c syscall.RawConn) error { return nil } diff --git a/cmd/http/listener.go b/cmd/http/listener.go index 1b0f5ff92..6066aec08 100644 --- a/cmd/http/listener.go +++ b/cmd/http/listener.go @@ -81,10 +81,7 @@ func (listener *httpListener) start() { // Closure to handle single connection. handleConn := func(tcpConn *net.TCPConn, doneCh <-chan struct{}) { - rawConn, err := tcpConn.SyscallConn() - if err == nil { - setTCPParameters(rawConn) - } + tcpConn.SetKeepAlive(true) send(acceptResult{tcpConn, nil}, doneCh) }