diff options
Diffstat (limited to 'src/network/access/qnetworkreplyimpl.cpp')
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index 8505a41..edd6889 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -232,10 +232,20 @@ void QNetworkReplyImplPrivate::_q_bufferOutgoingData() } } -void QNetworkReplyImplPrivate::_q_networkSessionOnline() +void QNetworkReplyImplPrivate::_q_networkSessionConnected() { Q_Q(QNetworkReplyImpl); + if (manager.isNull()) + return; + + QNetworkSession *session = manager->d_func()->networkSession; + if (!session) + return; + + if (session->state() != QNetworkSession::Connected) + return; + switch (state) { case QNetworkReplyImplPrivate::Buffering: case QNetworkReplyImplPrivate::Working: @@ -308,11 +318,15 @@ void QNetworkReplyImplPrivate::setup(QNetworkAccessManager::Operation op, const // for HTTP, we want to send out the request as fast as possible to the network, without // invoking methods in a QueuedConnection +#ifndef QT_NO_HTTP if (qobject_cast<QNetworkAccessHttpBackend *>(backend)) { _q_startOperation(); } else { QMetaObject::invokeMethod(q, "_q_startOperation", Qt::QueuedConnection); } +#else + QMetaObject::invokeMethod(q, "_q_startOperation", Qt::QueuedConnection); +#endif // QT_NO_HTTP } q->QIODevice::open(QIODevice::ReadOnly); @@ -862,11 +876,15 @@ bool QNetworkReplyImplPrivate::migrateBackend() backend->setResumeOffset(bytesDownloaded); } +#ifndef QT_NO_HTTP if (qobject_cast<QNetworkAccessHttpBackend *>(backend)) { _q_startOperation(); } else { QMetaObject::invokeMethod(q, "_q_startOperation", Qt::QueuedConnection); } +#else + QMetaObject::invokeMethod(q, "_q_startOperation", Qt::QueuedConnection); +#endif // QT_NO_HTTP return true; } |