diff options
author | Shane Kearns <[email protected]> | 2012-04-04 15:45:22 +0100 |
---|---|---|
committer | Qt by Nokia <[email protected]> | 2012-04-11 22:18:29 +0200 |
commit | ade5adaab82607593cf17d84fefc330c9fd2a3e0 (patch) | |
tree | 0309ba4f4849dfde508a2466a9e7d5920c149b36 /src | |
parent | 2eccb1888901f6fbd1d10e0eba925c0affc83b42 (diff) |
Set ConnectInBackground based on request
Set the QNetworkSession attribute to match the QNetworkRequest that
triggered it.
Currently if there are a mix of normal and background requests queued
and background connections are not allowed by policy:
- background requests at the head of the queue should fail
- first foreground request should successfully start a connection
- remaining requests succeed regardless of background attribute
Change-Id: If0e3ec0b8a5096e3d7cd6df85884c6f53172d233
Reviewed-by: Lars Knoll <[email protected]>
Reviewed-by: Martin Petersson <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/network/access/qnetworkreplyimpl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp index c65d790fece..9fdc29a88ac 100644 --- a/src/network/access/qnetworkreplyimpl.cpp +++ b/src/network/access/qnetworkreplyimpl.cpp @@ -105,8 +105,11 @@ void QNetworkReplyImplPrivate::_q_startOperation() QObject::connect(session, SIGNAL(error(QNetworkSession::SessionError)), q, SLOT(_q_networkSessionFailed())); - if (!session->isOpen()) + if (!session->isOpen()) { + session->setSessionProperty(QStringLiteral("ConnectInBackground"), + backend->request().attribute(QNetworkRequest::BackgroundRequestAttribute, QVariant::fromValue(false))); session->open(); + } } else { qWarning("Backend is waiting for QNetworkSession to connect, but there is none!"); state = Working; |