Fix one more crash in CDN file download.

The sessionTimedOut could remove a session right between a request
for a file part and a request for additional cdn file hashes.

In this case requestData.sessionIndex was not updated and this
was leading to an assertion violation in changeRequestedAmount.
This commit is contained in:
John Preston 2020-01-22 16:13:47 +03:00
parent 63020ec302
commit 960f50824d
1 changed files with 3 additions and 1 deletions

View File

@ -252,7 +252,9 @@ void DownloadManagerMtproto::requestSucceeded(
if (duration >= kBadRequestDurationThreshold) {
DEBUG_LOG(("Duration too large, signaling time out."));
sessionTimedOut(dcId, index);
crl::on_main(this, [=] {
sessionTimedOut(dcId, index);
});
return;
}
if (amountAtRequestStart == data.maxWaitedAmount