Don't send port number to proxy unless it's not the standard FTP port

This commit is contained in:
Dag-Erling Smørgrav 2000-07-21 10:25:33 +00:00
parent 2cf2d5b177
commit 2e88106bd1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63712

View File

@ -651,8 +651,12 @@ _ftp_connect(char *host, int port, char *user, char *pwd, char *flags)
/* send user name and password */
if (!user || !*user)
user = FTP_ANONYMOUS_USER;
e = p ? _ftp_cmd(cd, "USER %s@%s@%d", user, host, port)
: _ftp_cmd(cd, "USER %s", user);
if (p && port == FTP_DEFAULT_PORT)
e = _ftp_cmd(cd, "USER %s@%s", user, host);
else if (p)
e = _ftp_cmd(cd, "USER %s@%s@%d", user, host, port);
else
e = _ftp_cmd(cd, "USER %s", user);
/* did the server request a password? */
if (e == FTP_NEED_PASSWORD) {