Browse code

Merge pull request #8508 from vbatts/vbatts-too_many_open_files

cleaner handling of client socket access

unclejack authored on 2014/10/11 17:16:23
Showing 1 changed files
... ...
@@ -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