1
Fork 0

Reduce ping timetout to 45 to 55s.

Thanks to Jeroen van Veen for the debugging.
This commit is contained in:
Juliusz Chroboczek 2021-01-08 14:05:02 +01:00
parent 4b8a509a21
commit 617aee325f
1 changed files with 5 additions and 2 deletions

View File

@ -902,10 +902,13 @@ func clientLoop(c *webClient, ws *websocket.Conn) error {
return errors.New("unexpected action")
}
case <-ticker.C:
if time.Since(readTime) > 90*time.Second {
if time.Since(readTime) > 75*time.Second {
return errors.New("client is dead")
}
if time.Since(readTime) > 60*time.Second {
// Some reverse proxies timeout connexions at 60
// seconds, make sure we generate some activity
// after 55s at most.
if time.Since(readTime) > 45*time.Second {
err := c.write(clientMessage{
Type: "ping",
})