0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2025-01-06 22:40:31 -05:00

reverseproxy: Abort active health checks on context cancellation

This commit is contained in:
Matthew Holt 2020-08-31 13:22:34 -06:00
parent 4940325844
commit 724b74d981
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -216,9 +216,8 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, host H
u.Host = net.JoinHostPort(host, portStr) u.Host = net.JoinHostPort(host, portStr)
} }
// attach dialing information to this request - TODO: use caddy.Context's context // attach dialing information to this request
// so it can be canceled on config reload ctx := h.ctx.Context
ctx := context.Background()
ctx = context.WithValue(ctx, caddy.ReplacerCtxKey, caddy.NewReplacer()) ctx = context.WithValue(ctx, caddy.ReplacerCtxKey, caddy.NewReplacer())
ctx = context.WithValue(ctx, caddyhttp.VarsCtxKey, map[string]interface{}{ ctx = context.WithValue(ctx, caddyhttp.VarsCtxKey, map[string]interface{}{
dialInfoVarKey: dialInfo, dialInfoVarKey: dialInfo,