From 3183a465d71a13535e52589bb85b987176872fcd Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 31 May 2021 07:18:11 +0100 Subject: Make modules/context.Context a context.Context (#16031) * Make modules/context.Context a context.Context Signed-off-by: Andrew Thornton * Simplify context calls Signed-off-by: Andrew Thornton * Set the base context for requests to the HammerContext Signed-off-by: Andrew Thornton Co-authored-by: Lunny Xiao --- modules/graceful/server_http.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/graceful/server_http.go') diff --git a/modules/graceful/server_http.go b/modules/graceful/server_http.go index b101a10d91..4471e379ef 100644 --- a/modules/graceful/server_http.go +++ b/modules/graceful/server_http.go @@ -5,7 +5,9 @@ package graceful import ( + "context" "crypto/tls" + "net" "net/http" ) @@ -16,6 +18,7 @@ func newHTTPServer(network, address, name string, handler http.Handler) (*Server WriteTimeout: DefaultWriteTimeOut, MaxHeaderBytes: DefaultMaxHeaderBytes, Handler: handler, + BaseContext: func(net.Listener) context.Context { return GetManager().HammerContext() }, } server.OnShutdown = func() { httpServer.SetKeepAlivesEnabled(false) -- cgit v1.2.3