ftp: support --contimeout

This commit is contained in:
Nick Craig-Wood 2017-05-18 16:20:26 +01:00
parent 6cc783f20b
commit 9627a6142d
2 changed files with 2 additions and 3 deletions

View file

@ -118,6 +118,6 @@ FTP does not support any checksums.
Note that since FTP isn't HTTP based the following flags don't work Note that since FTP isn't HTTP based the following flags don't work
with it: `--dump-headers`, `--dump-bodies`, `--dump-auth` with it: `--dump-headers`, `--dump-bodies`, `--dump-auth`
Note that `--timeout` and `--contimeout` aren't supported. Note that `--timeout` isn't supported (but `--contimeout` is).
FTP could support server side move but doesn't yet. FTP could support server side move but doesn't yet.

View file

@ -2,7 +2,6 @@
package ftp package ftp
// FIXME Mover and DirMover are possible using c.Rename // FIXME Mover and DirMover are possible using c.Rename
// FIXME support conntimeout
import ( import (
"io" "io"
@ -93,7 +92,7 @@ func (f *Fs) Features() *fs.Features {
// Open a new connection to the FTP server. // Open a new connection to the FTP server.
func (f *Fs) ftpConnection() (*ftp.ServerConn, error) { func (f *Fs) ftpConnection() (*ftp.ServerConn, error) {
fs.Debugf(f, "Connecting to FTP server") fs.Debugf(f, "Connecting to FTP server")
c, err := ftp.DialTimeout(f.dialAddr, 30*time.Second) c, err := ftp.DialTimeout(f.dialAddr, fs.Config.ConnectTimeout)
if err != nil { if err != nil {
fs.Errorf(f, "Error while Dialing %s: %s", f.dialAddr, err) fs.Errorf(f, "Error while Dialing %s: %s", f.dialAddr, err)
return nil, errors.Wrap(err, "ftpConnection Dial") return nil, errors.Wrap(err, "ftpConnection Dial")