Skip to content

Commit

Permalink
Add small margin for the maximum number of file parts on download.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Nov 16, 2020
1 parent 56bba7c commit 52a47b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion td/telegram/files/PartsManager.cpp
Original file line number Diff line number Diff line change
@@ -285,7 +285,7 @@ Result<Part> PartsManager::start_part() {
if (part_i == part_count_) {
if (unknown_size_flag_) {
part_count_++;
if (part_count_ > MAX_PART_COUNT) {
if (part_count_ > MAX_PART_COUNT + (use_part_count_limit_ ? 0 : 64)) {
if (!is_upload_) {
// Caller will try to increase part size if it is possible
return Status::Error("FILE_DOWNLOAD_RESTART_INCREASE_PART_SIZE");

0 comments on commit 52a47b5

Please sign in to comment.