Skip to content

Commit

Permalink
VG-1354 backport of golang#35750
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly-kandasoft committed May 4, 2020
1 parent 5ffd591 commit acb083a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/net/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2893,16 +2893,17 @@ func (srv *Server) Serve(l net.Listener) error {
}
return e
}
connCtx := ctx
if cc := srv.ConnContext; cc != nil {
ctx = cc(ctx, rw)
if ctx == nil {
connCtx = cc(connCtx, rw)
if connCtx == nil {
panic("ConnContext returned nil")
}
}
tempDelay = 0
c := srv.newConn(rw)
c.setState(c.rwc, StateNew) // before Serve can return
go c.serve(ctx)
go c.serve(connCtx)
}
}

Expand Down

0 comments on commit acb083a

Please sign in to comment.