Check background requests are allowed before starting
authorShane Kearns <ext-shane.2.kearns@nokia.com>
Wed, 4 Apr 2012 17:37:54 +0000 (18:37 +0100)
committerQt by Nokia <qt-info@nokia.com>
Wed, 11 Apr 2012 20:19:35 +0000 (22:19 +0200)
commitb0c7f34c90b57efd6a5714cd492b19f9a7eb6b5a
treea75875fe36fedfbf26d938886ce04d453e0f0620
parent6957b8d1ede105c88c22045685e3b9ce845c3c0c
Check background requests are allowed before starting

If background requests are not allowed, don't even attempt to start
the network session, just fail the request immediately.

After this change, a QNAM with mixed requests queued should behave
as follows when background requests are disabled:
 - background requests at head of the queue fail
 - first foreground request starts the session and succeeds
 - remaining background requests fail
 - remaining foreground requests succeed

If policy is changed on the fly, then running background requests
are not aborted. However queued background requests won't be started.

Change-Id: Ic9aba1eb59ca41b166a08d2ed09418e1b6af6b60
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
src/network/access/qnetworkreplyhttpimpl.cpp
src/network/access/qnetworkreplyimpl.cpp