cleaner handling of client socket access
| ... | ... |
@@ -40,6 +40,14 @@ func (cli *DockerCli) HTTPClient() *http.Client {
|
| 40 | 40 |
return net.DialTimeout(cli.proto, cli.addr, 32*time.Second) |
| 41 | 41 |
}, |
| 42 | 42 |
} |
| 43 |
+ if cli.proto == "unix" {
|
|
| 44 |
+ // XXX workaround for net/http Transport which caches connections, but is |
|
| 45 |
+ // intended for tcp connections, not unix sockets. |
|
| 46 |
+ tr.DisableKeepAlives = true |
|
| 47 |
+ |
|
| 48 |
+ // no need in compressing for local communications |
|
| 49 |
+ tr.DisableCompression = true |
|
| 50 |
+ } |
|
| 43 | 51 |
return &http.Client{Transport: tr}
|
| 44 | 52 |
} |
| 45 | 53 |
|