summaryrefslogtreecommitdiffstats
path: root/src/network/access/qnetworkaccessmanager.cpp
diff options
context:
space:
mode:
authorMårten Nordheim <morten242@gmail.com>2020-06-12 12:07:54 +0200
committerMårten Nordheim <marten.nordheim@qt.io>2020-06-15 12:29:19 +0200
commita0bfa4e1f8e223927cbb285bb17d1a00a5c2d4b6 (patch)
tree70485146b53954db668c093050cc5a829d56f2b1 /src/network/access/qnetworkaccessmanager.cpp
parent6be9830d865be32f224e15d13ddefd9c7e176553 (diff)
QNAM: Remove network connectivity pre-check
The connectivity pre-check has been around for a long time, and it has caused various issues in that time. Certain scenarios, like using certain VPN configurations, might confuse the OS into thinking you don't have and network connectivity at all and abort the connection. Especially noticeable/frustrating when the connection was going to a host inside the local network. The negative impact of this change would at worst be that we might try to connect and it will wait some amount of time before the OS tells us the connection failed in situations where it would previously have been aborted before it started. But the false-negatives are not really an OK sacrifice in that case. Fixes: QTBUG-84907 Change-Id: I37fc69051e39df3c1a1fecb56ef54521a4d3d0c3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/access/qnetworkaccessmanager.cpp')
-rw-r--r--src/network/access/qnetworkaccessmanager.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/network/access/qnetworkaccessmanager.cpp b/src/network/access/qnetworkaccessmanager.cpp
index ea05514932..8bc0159b9d 100644
--- a/src/network/access/qnetworkaccessmanager.cpp
+++ b/src/network/access/qnetworkaccessmanager.cpp
@@ -422,14 +422,6 @@ QNetworkAccessManager::QNetworkAccessManager(QObject *parent)
#endif
qRegisterMetaType<QNetworkReply::NetworkError>();
qRegisterMetaType<QSharedPointer<char> >();
-
- Q_D(QNetworkAccessManager);
-
- if (QNetworkStatusMonitor::isEnabled()) {
- connect(&d->statusMonitor, SIGNAL(onlineStateChanged(bool)),
- SLOT(_q_onlineStateChanged(bool)));
- d->networkAccessible = d->statusMonitor.isNetworkAccessible();
- }
}
/*!
@@ -1199,25 +1191,6 @@ QNetworkReply *QNetworkAccessManager::createRequest(QNetworkAccessManager::Opera
return reply;
}
}
-
- if (d->statusMonitor.isEnabled()) {
- if (!d->statusMonitor.isMonitoring() && !d->statusMonitor.start())
- qWarning(lcNetMon, "failed to start network status monitoring");
-
- // See the code in ctor - QNetworkStatusMonitor allows us to
- // immediately set 'networkAccessible' even before we start
- // the monitor. If the monitor is unable to monitor then let's
- // assume there's something wrong with the monitor and keep going.
- if (d->statusMonitor.isMonitoring() && !d->networkAccessible && !isLocalFile) {
- QHostAddress dest;
- QString host = req.url().host().toLower();
- if (!(dest.setAddress(host) && dest.isLoopback())
- && host != QLatin1String("localhost")
- && host != QHostInfo::localHostName().toLower()) {
- return new QDisabledNetworkReply(this, req, op);
- }
- }
- }
#endif
QNetworkRequest request = req;
if (!request.header(QNetworkRequest::ContentLengthHeader).isValid() &&
@@ -1676,11 +1649,6 @@ void QNetworkAccessManagerPrivate::destroyThread()
}
}
-void QNetworkAccessManagerPrivate::_q_onlineStateChanged(bool isOnline)
-{
- networkAccessible = isOnline;
-}
-
#if QT_CONFIG(http)
QNetworkRequest QNetworkAccessManagerPrivate::prepareMultipart(const QNetworkRequest &request, QHttpMultiPart *multiPart)
{