vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood
2019-02-10 20:55:16 +00:00
parent fb5ee22112
commit 43bc381e90
324 changed files with 37701 additions and 10005 deletions
+13 -8
View File
@@ -188,10 +188,10 @@ func (c *ServerConn) setUTF8() error {
return err
}
// Workaround for FTP servers, that does not support this option.
if code == StatusBadArguments {
return nil
}
// Workaround for FTP servers, that does not support this option.
if code == StatusBadArguments {
return nil
}
// The ftpd "filezilla-server" has FEAT support for UTF8, but always returns
// "202 UTF8 mode is always enabled. No need to send this command." when
@@ -217,7 +217,7 @@ func (c *ServerConn) epsv() (port int, err error) {
start := strings.Index(line, "|||")
end := strings.LastIndex(line, "|")
if start == -1 || end == -1 {
err = errors.New("Invalid EPSV response format")
err = errors.New("invalid EPSV response format")
return
}
port, err = strconv.Atoi(line[start+3 : end])
@@ -235,7 +235,7 @@ func (c *ServerConn) pasv() (host string, port int, err error) {
start := strings.Index(line, "(")
end := strings.LastIndex(line, ")")
if start == -1 || end == -1 {
err = errors.New("Invalid PASV response format")
err = errors.New("invalid PASV response format")
return
}
@@ -243,7 +243,7 @@ func (c *ServerConn) pasv() (host string, port int, err error) {
pasvData := strings.Split(line[start+1:end], ",")
if len(pasvData) < 6 {
err = errors.New("Invalid PASV response format")
err = errors.New("invalid PASV response format")
return
}
@@ -421,7 +421,7 @@ func (c *ServerConn) CurrentDir() (string, error) {
end := strings.LastIndex(msg, "\"")
if start == -1 || end == -1 {
return "", errors.New("Unsuported PWD response format")
return "", errors.New("unsuported PWD response format")
}
return msg[start+1 : end], nil
@@ -516,7 +516,12 @@ func (c *ServerConn) RemoveDirRecur(path string) error {
if err != nil {
return err
}
entries, err := c.List(currentDir)
if err != nil {
return err
}
for _, entry := range entries {
if entry.Name != ".." && entry.Name != "." {
if entry.Type == EntryTypeFolder {
+5 -3
View File
@@ -8,7 +8,9 @@ import (
"time"
)
var errUnsupportedListLine = errors.New("Unsupported LIST line")
var errUnsupportedListLine = errors.New("unsupported LIST line")
var errUnsupportedListDate = errors.New("unsupported LIST date")
var errUnknownListEntryType = errors.New("unknown entry type")
type parseFunc func(string, time.Time, *time.Location) (*Entry, error)
@@ -132,7 +134,7 @@ func parseLsListLine(line string, now time.Time, loc *time.Location) (*Entry, er
case 'l':
e.Type = EntryTypeLink
default:
return nil, errors.New("Unknown entry type")
return nil, errUnknownListEntryType
}
if err := e.setTime(fields[5:8], now, loc); err != nil {
@@ -246,7 +248,7 @@ func (e *Entry) setTime(fields []string, now time.Time, loc *time.Location) (err
} else { // only the date
if len(fields[2]) != 4 {
return errors.New("Invalid year format in time string")
return errUnsupportedListDate
}
timeStr := fmt.Sprintf("%s %s %s 00:00", fields[1], fields[0], fields[2])
e.Time, err = time.ParseInLocation("_2 Jan 2006 15:04", timeStr, loc)
+5
View File
@@ -104,3 +104,8 @@ var statusText = map[int]string{
StatusExceededStorage: "Exceeded storage allocation.",
StatusBadFileName: "File name not allowed.",
}
// StatusText returns a text for the FTP status code. It returns the empty string if the code is unknown.
func StatusText(code int) string {
return statusText[code]
}