mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
initialize forwarder after init() to avoid crashes (#11330)
DNSCache dialer is a global value initialized in init(), whereas `go` keeps `var =` before `init()` , also we don't need to keep proxy routers as global entities - register the forwarder as necessary to avoid crashes.
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
|
||||
"github.com/minio/minio-go/v7/pkg/set"
|
||||
"github.com/minio/minio/pkg/bucket/bandwidth"
|
||||
"github.com/minio/minio/pkg/handlers"
|
||||
|
||||
humanize "github.com/dustin/go-humanize"
|
||||
"github.com/minio/minio/cmd/config/cache"
|
||||
@@ -285,6 +286,8 @@ var (
|
||||
globalProxyTransport http.RoundTripper
|
||||
|
||||
globalDNSCache *xhttp.DNSCache
|
||||
|
||||
globalForwarder *handlers.Forwarder
|
||||
// Add new variable global values here.
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user