Merge pull request #8508 from vbatts/vbatts-too_many_open_files

cleaner handling of client socket access
This commit is contained in:
unclejack 2014-10-11 11:16:23 +03:00
commit 7fa7c42ce2
1 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,14 @@ func (cli *DockerCli) HTTPClient() *http.Client {
return net.DialTimeout(cli.proto, cli.addr, 32*time.Second)
},
}
if cli.proto == "unix" {
// XXX workaround for net/http Transport which caches connections, but is
// intended for tcp connections, not unix sockets.
tr.DisableKeepAlives = true
// no need in compressing for local communications
tr.DisableCompression = true
}
return &http.Client{Transport: tr}
}