0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-14 22:13:51 +01:00

Use process context as base context for all HTTP

This commit is contained in:
Neil Alexander 2022-04-27 15:01:57 +01:00
parent 655ac3e8fb
commit cafa2853c5
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -346,6 +346,9 @@ func (b *BaseDendrite) SetupAndServeHTTP(
Addr: string(externalAddr),
WriteTimeout: HTTPServerTimeout,
Handler: externalRouter,
BaseContext: func(_ net.Listener) context.Context {
return b.ProcessContext.Context()
},
}
internalServ := externalServ
@ -361,6 +364,9 @@ func (b *BaseDendrite) SetupAndServeHTTP(
internalServ = &http.Server{
Addr: string(internalAddr),
Handler: h2c.NewHandler(internalRouter, internalH2S),
BaseContext: func(_ net.Listener) context.Context {
return b.ProcessContext.Context()
},
}
}