[httputil] return error from keep alive methods within httputil pkg
@@ -52,7 +52,14 @@ func (ln tcpKeepAliveListener) Accept() (net.Conn, error) {
if err != nil {
return nil, err
}
- tc.SetKeepAlive(true)
- tc.SetKeepAlivePeriod(3 * time.Minute)
+
+ if err = tc.SetKeepAlive(true); err != nil {
+ return nil, err
+ }
+
+ if err = tc.SetKeepAlivePeriod(3 * time.Minute); err != nil {
+ return nil, err
+ }
+
return tc, nil
}
