1
0
mirror of https://github.com/rclone/rclone.git synced 2025-01-24 12:56:36 +02:00
rclone/fs/http_old.go
Nick Craig-Wood c3d6cc91ec Fix --bind flag changes under go1.6
Correcting 9f2463956884c0e995cf6f7140af0dc06af096e0
2017-07-23 22:36:32 +01:00

26 lines
466 B
Go

// HTTP parts pre go1.7
//+build !go1.7
package fs
import (
"net"
"net/http"
)
// dial with timeouts
func (ci *ConfigInfo) dialTimeout(network, address string) (net.Conn, error) {
dialer := ci.NewDialer()
c, err := dialer.Dial(network, address)
if err != nil {
return c, err
}
return newTimeoutConn(c, ci.Timeout), nil
}
// Initialise the http.Transport for pre go1.7
func (ci *ConfigInfo) initTransport(t *http.Transport) {
t.Dial = ci.dialTimeout
}