Vendor engine-api v0.3.2 in release 1.11.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera 2016-03-30 13:13:35 -04:00
parent 048db1da22
commit 34fca93daf
3 changed files with 17 additions and 16 deletions

View file

@ -24,7 +24,7 @@ clone git golang.org/x/net 47990a1ba55743e6ef1affd3a14e5bac8553615d https://gith
clone git golang.org/x/sys eb2c74142fd19a79b3f237334c7384d5167b1b46 https://github.com/golang/sys.git
clone git github.com/docker/go-units 651fc226e7441360384da338d0fd37f2440ffbe3
clone git github.com/docker/go-connections v0.2.0
clone git github.com/docker/engine-api v0.3.1
clone git github.com/docker/engine-api v0.3.2
clone git github.com/RackSec/srslog 259aed10dfa74ea2961eddd1d9847619f6e98837
clone git github.com/imdario/mergo 0.2.1

View file

@ -46,8 +46,7 @@ func (cli *Client) postHijacked(ctx context.Context, path string, query url.Valu
req.Header.Set("Connection", "Upgrade")
req.Header.Set("Upgrade", "tcp")
tlsConfig := cli.transport.TLSConfig()
conn, err := dial(cli.proto, cli.addr, tlsConfig)
conn, err := dial(cli.proto, cli.addr, cli.transport.TLSConfig())
if err != nil {
if strings.Contains(err.Error(), "connection refused") {
return types.HijackedResponse{}, fmt.Errorf("Cannot connect to the Docker daemon. Is 'docker daemon' running on this host?")
@ -126,6 +125,21 @@ func tlsDialWithDialer(dialer *net.Dialer, network, addr string, config *tls.Con
tcpConn.SetKeepAlivePeriod(30 * time.Second)
}
colonPos := strings.LastIndex(addr, ":")
if colonPos == -1 {
colonPos = len(addr)
}
hostname := addr[:colonPos]
// If no ServerName is set, infer the ServerName
// from the hostname we're connecting to.
if config.ServerName == "" {
// Make a copy to avoid polluting argument or default.
c := *config
c.ServerName = hostname
config = &c
}
conn := tls.Client(rawConn, config)
if timeout == 0 {

View file

@ -4,7 +4,6 @@ package transport
import (
"fmt"
"net/http"
"strings"
"github.com/docker/go-connections/sockets"
)
@ -35,10 +34,6 @@ func NewTransportWithHTTP(proto, addr string, client *http.Client) (Client, erro
}
}
if transport.TLSClientConfig != nil && transport.TLSClientConfig.ServerName == "" {
transport.TLSClientConfig.ServerName = hostname(addr)
}
return &apiTransport{
Client: client,
tlsInfo: &tlsInfo{transport.TLSClientConfig},
@ -59,12 +54,4 @@ func defaultTransport(proto, addr string) *http.Transport {
return tr
}
func hostname(addr string) string {
colonPos := strings.LastIndex(addr, ":")
if colonPos == -1 {
return addr
}
return addr[:colonPos]
}
var _ Client = &apiTransport{}