diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-11 18:01:13 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-11 18:10:41 +0100 |
commit | f4d8cafc1b034f544ca84b849c23ab99bc1600e7 (patch) | |
tree | f1150b5aeaec4753f2ddfcd17643666b3a82dd9d /src/network | |
parent | e5b422382a512a8267a0eb24e6543a8cf84478d9 (diff) | |
parent | b03133231b99922a72831c4ec23faf55516ef404 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts:
src/3rdparty/harfbuzz-ng/src/hb-private.hh
src/sql/doc/snippets/code/doc_src_sql-driver.cpp
src/sql/doc/src/sql-driver.qdoc
Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/access/qftp.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index 762ef00225..719e3536b4 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -1702,8 +1702,16 @@ int QFtp::connectToHost(const QString &host, quint16 port) int QFtp::login(const QString &user, const QString &password) { QStringList cmds; - cmds << (QLatin1String("USER ") + (user.isNull() ? QLatin1String("anonymous") : user) + QLatin1String("\r\n")); - cmds << (QLatin1String("PASS ") + (password.isNull() ? QLatin1String("anonymous@") : password) + QLatin1String("\r\n")); + + if (user.isNull() || user.compare(QLatin1String("anonymous"), Qt::CaseInsensitive) == 0) { + cmds << (QLatin1String("USER ") + (user.isNull() ? QLatin1String("anonymous") : user) + QLatin1String("\r\n")); + cmds << (QLatin1String("PASS ") + (password.isNull() ? QLatin1String("anonymous@") : password) + QLatin1String("\r\n")); + } else { + cmds << (QLatin1String("USER ") + user + QLatin1String("\r\n")); + if (!password.isNull()) + cmds << (QLatin1String("PASS ") + password + QLatin1String("\r\n")); + } + return d_func()->addCommand(new QFtpCommand(Login, cmds)); } |