1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

[NetworkProxy] Always use direct connection as fallback.

This commit is contained in:
nowrep 2013-03-29 19:40:15 +01:00
parent a9326eadc5
commit 41616486a6

View File

@ -58,25 +58,28 @@ PacManager* NetworkProxyFactory::pacManager() const
QList<QNetworkProxy> NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &query) QList<QNetworkProxy> NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &query)
{ {
QNetworkProxy proxy; QList<QNetworkProxy> proxyList;
if (m_proxyExceptions.contains(query.url().host(), Qt::CaseInsensitive)) { if (m_proxyExceptions.contains(query.url().host(), Qt::CaseInsensitive)) {
return QList<QNetworkProxy>() << QNetworkProxy::NoProxy; proxyList.append(QNetworkProxy::NoProxy);
return proxyList;
} }
switch (m_proxyPreference) { switch (m_proxyPreference) {
case SystemProxy: case SystemProxy:
return systemProxyForQuery(query); proxyList.append(systemProxyForQuery(query));
break;
case NoProxy: case NoProxy:
proxy = QNetworkProxy::NoProxy; proxyList.append(QNetworkProxy::NoProxy);
break; break;
case ProxyAutoConfig: case ProxyAutoConfig:
return m_pacManager->queryProxy(query.url()); proxyList.append(m_pacManager->queryProxy(query.url()));
break;
case DefinedProxy: case DefinedProxy: {
proxy = m_proxyType; QNetworkProxy proxy(m_proxyType);
if (m_useDifferentProxyForHttps && query.protocolTag() == QLatin1String("https")) { if (m_useDifferentProxyForHttps && query.protocolTag() == QLatin1String("https")) {
proxy.setHostName(m_httpsHostName); proxy.setHostName(m_httpsHostName);
@ -95,12 +98,18 @@ QList<QNetworkProxy> NetworkProxyFactory::queryProxy(const QNetworkProxyQuery &q
proxy = QNetworkProxy::NoProxy; proxy = QNetworkProxy::NoProxy;
} }
proxyList.append(proxy);
break; break;
}
default: default:
qWarning("NetworkProxyFactory::queryProxy Unknown proxy type!"); qWarning("NetworkProxyFactory::queryProxy Unknown proxy type!");
break; break;
} }
return QList<QNetworkProxy>() << proxy; if (!proxyList.contains(QNetworkProxy::NoProxy)) {
proxyList.append(QNetworkProxy::NoProxy);
}
return proxyList;
} }