diff options
author | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-03 00:59:12 (GMT) |
---|---|---|
committer | Aaron McCarthy <aaron.mccarthy@nokia.com> | 2010-02-03 07:00:49 (GMT) |
commit | 130a461c07ed35d1aeb27c8110efca773773c614 (patch) | |
tree | c6c95025f089302dba50eca6854ccddc8ea8c6df | |
parent | 280a68446c1f96ae9d19134e4201bc78ee0b072a (diff) | |
download | Qt-130a461c07ed35d1aeb27c8110efca773773c614.zip Qt-130a461c07ed35d1aeb27c8110efca773773c614.tar.gz Qt-130a461c07ed35d1aeb27c8110efca773773c614.tar.bz2 |
Don't try to resolve names to determine if dest is localhost.
-rw-r--r-- | src/network/access/qnetworkaccessbackend.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/network/access/qnetworkaccessbackend.cpp b/src/network/access/qnetworkaccessbackend.cpp index f35cb59..2eebcf9 100644 --- a/src/network/access/qnetworkaccessbackend.cpp +++ b/src/network/access/qnetworkaccessbackend.cpp @@ -349,14 +349,14 @@ void QNetworkAccessBackend::sslErrors(const QList<QSslError> &errors) */ bool QNetworkAccessBackend::start() { - QHostInfo hostInfo = QHostInfo::fromName(reply->url.host()); - foreach (const QHostAddress &address, hostInfo.addresses()) { - if (address == QHostAddress::LocalHost || - address == QHostAddress::LocalHostIPv6) { - // Don't need session for local host access. - open(); - return true; - } + // This is not ideal. + const QString host = reply->url.host(); + if (host == QLatin1String("localhost") || + QHostAddress(host) == QHostAddress::LocalHost || + QHostAddress(host) == QHostAddress::LocalHostIPv6) { + // Don't need an open session for localhost access. + open(); + return true; } if (manager->session->isOpen()) { |