summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2011-05-05 15:44:00 +0200
committerOlivier Goffart <olivier.goffart@nokia.com>2011-05-11 16:39:29 +0200
commit10646142aec3b332507b9e7e0028f001c2757a7d (patch)
treee9a6c3ebe6c8890085c93a190581370a222321f8
parenta2e836f3c1acaef5e41893d1c4eb1ef8674b315e (diff)
QNAM: Re-order checks in migrateBackend()
Do the easy checks first, will avoid a crash in the HTTP code if request is serviced from the cache. Task-number: QTBUG-18770 Reviewed-by: Peter Hartmann (cherry picked from commit d03a28a289cf0665290e6ea0375b31cbb2d6649e)
-rw-r--r--src/network/access/qnetworkreplyimpl.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/access/qnetworkreplyimpl.cpp b/src/network/access/qnetworkreplyimpl.cpp
index e50f3d627d..ac51119ce7 100644
--- a/src/network/access/qnetworkreplyimpl.cpp
+++ b/src/network/access/qnetworkreplyimpl.cpp
@@ -1018,10 +1018,6 @@ bool QNetworkReplyImplPrivate::migrateBackend()
if (state == Finished || state == Aborted)
return true;
- // Backend does not support resuming download.
- if (!backend->canResume())
- return false;
-
// Request has outgoing data, not migrating.
if (outgoingData)
return false;
@@ -1030,6 +1026,10 @@ bool QNetworkReplyImplPrivate::migrateBackend()
if (copyDevice)
return true;
+ // Backend does not support resuming download.
+ if (!backend->canResume())
+ return false;
+
state = QNetworkReplyImplPrivate::Reconnecting;
if (backend) {