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:
parent
a2e836f3c1
commit
10646142ae
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user