diff options
author | David Faure <faure@kde.org> | 2009-08-31 17:11:07 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-08-31 17:11:31 (GMT) |
commit | 3b65bb32fda7e34373b64f416ea92a3fa6eb266c (patch) | |
tree | e60347da3d67b6d66173447ed8dcb96def8644a6 | |
parent | cb2913bea73e17c4628974fa5d1f652576c2b52c (diff) | |
download | Qt-3b65bb32fda7e34373b64f416ea92a3fa6eb266c.zip Qt-3b65bb32fda7e34373b64f416ea92a3fa6eb266c.tar.gz Qt-3b65bb32fda7e34373b64f416ea92a3fa6eb266c.tar.bz2 |
Performance: don't call WinHttpGetProxyForUrl for a file URL (e.g. from webkit)
That method can be slow, since it does a DHCP query followed by a DNS query
(sometimes followed by a Netbios query, too)... no point in doing it for every
file URL loaded in webkit.
Merge-request: 1128
Reviewed-by: Thiago Macieira <thiago.macieira@nokia.com>
-rw-r--r-- | src/network/kernel/qnetworkproxy_win.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/network/kernel/qnetworkproxy_win.cpp b/src/network/kernel/qnetworkproxy_win.cpp index 34a702b..8080261 100644 --- a/src/network/kernel/qnetworkproxy_win.cpp +++ b/src/network/kernel/qnetworkproxy_win.cpp @@ -363,8 +363,13 @@ QList<QNetworkProxy> QNetworkProxyFactory::systemProxyForQuery(const QNetworkPro if (sp->isAutoConfig) { WINHTTP_PROXY_INFO proxyInfo; - // try to get the proxy config for the URL, if we have a URL + // try to get the proxy config for the URL QUrl url = query.url(); + // url could be empty, e.g. from QNetworkProxy::applicationProxy(), that's fine, + // we'll still ask for the proxy. + // But for a file url, we know we don't need one. + if (url.scheme() == QLatin1String("file") || url.scheme() == QLatin1String("qrc")) + return sp->defaultResult; if (query.queryType() != QNetworkProxyQuery::UrlRequest) { // change the scheme to https, maybe it'll work url.setScheme(QLatin1String("https")); |