Skip to content

Commit acb083a

Browse files
VG-1354 backport of golang#35750
1 parent 5ffd591 commit acb083a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/net/http/server.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2893,16 +2893,17 @@ func (srv *Server) Serve(l net.Listener) error {
28932893
}
28942894
return e
28952895
}
2896+
connCtx := ctx
28962897
if cc := srv.ConnContext; cc != nil {
2897-
ctx = cc(ctx, rw)
2898-
if ctx == nil {
2898+
connCtx = cc(connCtx, rw)
2899+
if connCtx == nil {
28992900
panic("ConnContext returned nil")
29002901
}
29012902
}
29022903
tempDelay = 0
29032904
c := srv.newConn(rw)
29042905
c.setState(c.rwc, StateNew) // before Serve can return
2905-
go c.serve(ctx)
2906+
go c.serve(connCtx)
29062907
}
29072908
}
29082909

0 commit comments

Comments
 (0)