mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-16 16:17:38 +03:00
Allow TimeoutHandler connections to be kept alive (#864)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user