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)
This commit is contained in:
Markus Goetz 2011-05-05 15:44:00 +02:00 committed by Olivier Goffart
parent a2e836f3c1
commit 10646142ae

View File

@ -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) {