From 0e327efc7ce81d028870e9815d848b3bd4a92dff Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 26 Aug 2020 12:33:48 +0300 Subject: [PATCH] Do not cancel already cancelled download/upload queries. GitOrigin-RevId: 7a601fa4370a9afd6f81271abfb63edab4f31394 --- td/telegram/files/FileLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td/telegram/files/FileLoader.cpp b/td/telegram/files/FileLoader.cpp index 2485d4abe..c1b7fd290 100644 --- a/td/telegram/files/FileLoader.cpp +++ b/td/telegram/files/FileLoader.cpp @@ -74,7 +74,7 @@ void FileLoader::update_downloaded_part(int64 offset, int64 limit) { auto end_part_id = begin_part_id + td::min(max_parts, new_end_part_id - begin_part_id); VLOG(files) << "Protect parts " << begin_part_id << " ... " << end_part_id - 1; for (auto &it : part_map_) { - if (!(begin_part_id <= it.second.first.id && it.second.first.id < end_part_id)) { + if (!it.second.second.empty() && !(begin_part_id <= it.second.first.id && it.second.first.id < end_part_id)) { VLOG(files) << "Cancel part " << it.second.first.id; it.second.second.reset(); // cancel_query(it.second.second); }