summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorMartin Petersson <Martin.Petersson@nokia.com>2012-03-27 17:14:24 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-01 14:13:45 +0200
commit3dbf98c715ed6941ca41eb85981a6afccab489a6 (patch)
treeb2447892ba634c9606dbc8769895e0b14faef31e /src/network
parente6f7852bb40b06bb7df469542a2c4c1e2850c43b (diff)
QNetworkAccessFtpBackend: remove entry from QNetworkAccessCache
When FTP login fails we fail to remove the entry from the cache. This is because the cache key is created from the url with the userInfo. So this needs to be set again to match the key used when inserted. Task-number: QTBUG-11824 Change-Id: Ib3fd2d737581653ae59c56d0810d42e2d8dc2176 Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
Diffstat (limited to 'src/network')
-rw-r--r--src/network/access/qnetworkaccessftpbackend.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/network/access/qnetworkaccessftpbackend.cpp b/src/network/access/qnetworkaccessftpbackend.cpp
index 42201aa9a3..4aa491db0c 100644
--- a/src/network/access/qnetworkaccessftpbackend.cpp
+++ b/src/network/access/qnetworkaccessftpbackend.cpp
@@ -223,6 +223,7 @@ void QNetworkAccessFtpBackend::ftpDone()
if (ftp->state() == QFtp::Connected) {
// the login did not succeed
QUrl newUrl = url();
+ QString userInfo = newUrl.userInfo();
newUrl.setUserInfo(QString());
setUrl(newUrl);
@@ -236,6 +237,10 @@ void QNetworkAccessFtpBackend::ftpDone()
return;
}
+ // Re insert the user info so that we can remove the cache entry.
+ newUrl.setUserInfo(userInfo);
+ setUrl(newUrl);
+
error(QNetworkReply::AuthenticationRequiredError,
tr("Logging in to %1 failed: authentication required")
.arg(url().host()));