mirror of
https://github.com/rclone/rclone.git
synced 2024-12-24 16:09:01 +01:00
c3d6cc91ec
Correcting 9f24639568
26 lines
466 B
Go
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
|
|
}
|