Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKassio Borges <kborges@gitlab.com>2022-04-01 10:55:29 +0300
committerVladimir Shushlin <vshushlin@gitlab.com>2022-04-01 10:55:29 +0300
commit43e42a8b797732a013f4c01cc0193643bff614e0 (patch)
tree55efb31ce95f02d6d95d2e742b44605dbfc6bb08 /server.go
parentf6ada25223c6f9b531a1e30da576ee042b361c2e (diff)
Fix weak timeouts
Diffstat (limited to 'server.go')
-rw-r--r--server.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/server.go b/server.go
index b5aecc37..9a647864 100644
--- a/server.go
+++ b/server.go
@@ -7,7 +7,6 @@ import (
stdlog "log"
"net"
"net/http"
- "time"
"github.com/pires/go-proxyproto"
"github.com/sirupsen/logrus"
@@ -40,8 +39,12 @@ func (a *theApp) listenAndServe(server *http.Server, addr string, h http.Handler
server.TLSConfig.NextProtos = append(server.TLSConfig.NextProtos, "h2")
}
+ server.ReadTimeout = a.config.Server.ReadTimeout
+ server.ReadHeaderTimeout = a.config.Server.ReadHeaderTimeout
+ server.WriteTimeout = a.config.Server.WriteTimeout
+
lc := net.ListenConfig{
- KeepAlive: 3 * time.Minute,
+ KeepAlive: a.config.Server.ListenKeepAlive,
}
l, err := lc.Listen(context.Background(), "tcp", addr)