diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2022-02-03 18:33:22 -0500 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2022-02-03 18:33:22 -0500 |
commit | 1d1b2b1509646e07ab4a984c7622fa002a0fcdb7 (patch) | |
tree | fd4078e58bc9ab0b6c2ef1938017ce5844f97744 /vendor/github.com/docker/go-connections/sockets/sockets_unix.go | |
parent | 608b6142edb7a4e179ce6d2ae69707be28f29359 (diff) | |
download | podman-1d1b2b1509646e07ab4a984c7622fa002a0fcdb7.tar.gz podman-1d1b2b1509646e07ab4a984c7622fa002a0fcdb7.tar.bz2 podman-1d1b2b1509646e07ab4a984c7622fa002a0fcdb7.zip |
Update containers/buildah v1.24.1
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
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 } |