Fix crash in CDN file download.

This commit is contained in:
John Preston 2020-01-20 13:04:12 +03:00
parent 6820b0b3b3
commit 12873f8be0
1 changed files with 6 additions and 3 deletions

View File

@ -495,11 +495,14 @@ void DownloadMtprotoTask::removeSession(int sessionIndex) {
}
}
for (const auto &[requestId, offset] : redirect) {
const auto needMakeRequest = (requestId != _cdnHashesRequestId);
cancelRequest(requestId);
if (needMakeRequest) {
const auto newIndex = _owner->chooseSessionIndex(dcId());
Assert(newIndex < sessionIndex);
makeRequest({ offset, newIndex });
}
}
}
mtpRequestId DownloadMtprotoTask::sendRequest(