Allow TimeoutHandler connections to be kept alive (#864)

This commit is contained in:
Erik Dubbelboer
2020-08-16 09:21:00 +02:00
committed by GitHub
parent a995d43d9c
commit 01acd76daf
2 changed files with 43 additions and 4 deletions
+1 -4
View File
@@ -2170,12 +2170,9 @@ func (s *Server) serveConn(c net.Conn) (err error) {
timeoutResponse = ctx.timeoutResponse
if timeoutResponse != nil {
// Acquire a new ctx because the old one will still be in use by the timeout out handler.
ctx = s.acquireCtx(c)
timeoutResponse.CopyTo(&ctx.Response)
if br != nil {
// Close connection, since br may be attached to the old ctx via ctx.fbr.
ctx.SetConnectionClose()
}
}
if !ctx.IsGet() && ctx.IsHead() {