Update ftp.go

421 There are too many connected users, please try later
This commit is contained in:
cyal1 2023-04-08 21:35:09 +08:00 committed by GitHub
parent ecb0cd9e5f
commit b9e05d65ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,6 +52,7 @@ func FtpConn(info *common.HostInfo, user string, pass string) (flag bool, err er
Host, Port, Username, Password := info.Host, info.Ports, user, pass
conn, err := ftp.DialTimeout(fmt.Sprintf("%v:%v", Host, Port), time.Duration(common.Timeout)*time.Second)
if err == nil {
defer conn.Quit()
err = conn.Login(Username, Password)
if err == nil {
flag = true