mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 21:46:03 +03:00
Merge pull request #3174 from nextcloud/bug/avoidAssertEmptyDateHeader
avoid an assert by delaying access to response timestamp when in error
This commit is contained in:
commit
b3daa9b8ab
1 changed files with 2 additions and 2 deletions
|
@ -635,12 +635,10 @@ void PropagateDownloadFile::slotGetFinished()
|
|||
ASSERT(job);
|
||||
|
||||
_item->_httpErrorCode = job->reply()->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||
_item->_responseTimeStamp = job->responseTimestamp();
|
||||
_item->_requestId = job->requestId();
|
||||
|
||||
QNetworkReply::NetworkError err = job->reply()->error();
|
||||
if (err != QNetworkReply::NoError) {
|
||||
|
||||
// If we sent a 'Range' header and get 416 back, we want to retry
|
||||
// without the header.
|
||||
const bool badRangeHeader = job->resumeStart() > 0 && _item->_httpErrorCode == 416;
|
||||
|
@ -711,6 +709,8 @@ void PropagateDownloadFile::slotGetFinished()
|
|||
return;
|
||||
}
|
||||
|
||||
_item->_responseTimeStamp = job->responseTimestamp();
|
||||
|
||||
if (!job->etag().isEmpty()) {
|
||||
// The etag will be empty if we used a direct download URL.
|
||||
// (If it was really empty by the server, the GETFileJob will have errored
|
||||
|
|
Loading…
Reference in a new issue