diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-02-04 08:53:42 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 08:53:42 -0500 |
commit | 320e2935c8468b21a3ce6dee1b5201c2ed3f738a (patch) | |
tree | fd4078e58bc9ab0b6c2ef1938017ce5844f97744 /vendor/github.com/docker/go-connections/sockets/sockets_unix.go | |
parent | 608b6142edb7a4e179ce6d2ae69707be28f29359 (diff) | |
parent | 1d1b2b1509646e07ab4a984c7622fa002a0fcdb7 (diff) | |
download | podman-320e2935c8468b21a3ce6dee1b5201c2ed3f738a.tar.gz podman-320e2935c8468b21a3ce6dee1b5201c2ed3f738a.tar.bz2 podman-320e2935c8468b21a3ce6dee1b5201c2ed3f738a.zip |
Merge pull request #13136 from rhatdan/VENDOR
Update containers/buildah v1.24.1
Diffstat (limited to 'vendor/github.com/docker/go-connections/sockets/sockets_unix.go')
-rw-r--r-- | vendor/github.com/docker/go-connections/sockets/sockets_unix.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/vendor/github.com/docker/go-connections/sockets/sockets_unix.go b/vendor/github.com/docker/go-connections/sockets/sockets_unix.go index 386cf0dbb..10d763426 100644 --- a/vendor/github.com/docker/go-connections/sockets/sockets_unix.go +++ b/vendor/github.com/docker/go-connections/sockets/sockets_unix.go @@ -3,6 +3,7 @@ package sockets import ( + "context" "fmt" "net" "net/http" @@ -10,7 +11,10 @@ import ( "time" ) -const maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path) +const ( + defaultTimeout = 10 * time.Second + maxUnixSocketPathSize = len(syscall.RawSockaddrUnix{}.Path) +) func configureUnixTransport(tr *http.Transport, proto, addr string) error { if len(addr) > maxUnixSocketPathSize { @@ -18,8 +22,11 @@ func configureUnixTransport(tr *http.Transport, proto, addr string) error { } // No need for compression in local communications. tr.DisableCompression = true - tr.Dial = func(_, _ string) (net.Conn, error) { - return net.DialTimeout(proto, addr, defaultTimeout) + dialer := &net.Dialer{ + Timeout: defaultTimeout, + } + tr.DialContext = func(ctx context.Context, _, _ string) (net.Conn, error) { + return dialer.DialContext(ctx, proto, addr) } return nil } |