From 963f1f8d5ab3fe080ba64452a5cab4722d137b0c Mon Sep 17 00:00:00 2001 From: Nick Pocock Date: Tue, 14 Jun 2022 20:18:55 +0200 Subject: [PATCH] [httputil] return error from keep alive methods within httputil pkg (#3439) --- pkg/util/httputil/httputil.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/util/httputil/httputil.go b/pkg/util/httputil/httputil.go index 323426655d..d5dbea833b 100644 --- a/pkg/util/httputil/httputil.go +++ b/pkg/util/httputil/httputil.go @@ -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 }