2929type state struct {
3030 newRootContext func (contextID uint32 ) RootContext
3131 rootContexts map [uint32 ]* rootContextState
32- newStreamContext func (contextID uint32 ) StreamContext
32+ newStreamContext func (rootContextID , contextID uint32 ) StreamContext
3333 streams map [uint32 ]StreamContext
34- newHttpContext func (contextID uint32 ) HttpContext
34+ newHttpContext func (rootContextID , contextID uint32 ) HttpContext
3535 httpStreams map [uint32 ]HttpContext
3636
3737 contextIDToRooID map [uint32 ]uint32
@@ -49,11 +49,11 @@ func SetNewRootContext(f func(contextID uint32) RootContext) {
4949 currentState .newRootContext = f
5050}
5151
52- func SetNewHttpContext (f func (contextID uint32 ) HttpContext ) {
52+ func SetNewHttpContext (f func (rootContextID , contextID uint32 ) HttpContext ) {
5353 currentState .newHttpContext = f
5454}
5555
56- func SetNewStreamContext (f func (contextID uint32 ) StreamContext ) {
56+ func SetNewStreamContext (f func (rootContextID , contextID uint32 ) StreamContext ) {
5757 currentState .newStreamContext = f
5858}
5959
@@ -84,7 +84,7 @@ func (s *state) createStreamContext(contextID uint32, rootContextID uint32) {
8484 panic ("context id duplicated" )
8585 }
8686
87- ctx := s .newStreamContext (contextID )
87+ ctx := s .newStreamContext (rootContextID , contextID )
8888 s .contextIDToRooID [contextID ] = rootContextID
8989 s .streams [contextID ] = ctx
9090}
@@ -98,7 +98,7 @@ func (s *state) createHttpContext(contextID uint32, rootContextID uint32) {
9898 panic ("context id duplicated" )
9999 }
100100
101- ctx := s .newHttpContext (contextID )
101+ ctx := s .newHttpContext (rootContextID , contextID )
102102 s .contextIDToRooID [contextID ] = rootContextID
103103 s .httpStreams [contextID ] = ctx
104104}
0 commit comments