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)
|
if (state == Finished || state == Aborted)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Backend does not support resuming download.
|
|
||||||
if (!backend->canResume())
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// Request has outgoing data, not migrating.
|
// Request has outgoing data, not migrating.
|
||||||
if (outgoingData)
|
if (outgoingData)
|
||||||
return false;
|
return false;
|
||||||
@ -1030,6 +1026,10 @@ bool QNetworkReplyImplPrivate::migrateBackend()
|
|||||||
if (copyDevice)
|
if (copyDevice)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
// Backend does not support resuming download.
|
||||||
|
if (!backend->canResume())
|
||||||
|
return false;
|
||||||
|
|
||||||
state = QNetworkReplyImplPrivate::Reconnecting;
|
state = QNetworkReplyImplPrivate::Reconnecting;
|
||||||
|
|
||||||
if (backend) {
|
if (backend) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user