Skip to content

Commit

Permalink
PartsManager: fix wrong FILE_DOWLOAD_LIMIT error
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 89a22ae3a494c66dcb0a19abf0cd243e3ffc1875
  • Loading branch information
arseny30 committed Aug 21, 2020
1 parent 4f41cfc commit e3fa28d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions td/telegram/files/PartsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ string PartsManager::get_bitmask() {
}

bool PartsManager::is_part_in_streaming_limit(int part_i) const {
CHECK(part_i < part_count_);
auto offset_begin = static_cast<int64>(part_i) * static_cast<int64>(get_part_size());
auto offset_end = offset_begin + static_cast<int64>(get_part(part_i).size);

Expand Down Expand Up @@ -264,6 +265,9 @@ bool PartsManager::is_streaming_limit_reached() {
if (!unknown_size_flag_ && part_i == part_count_) {
part_i = first_not_ready_part_;
}
if (part_i == part_count_) {
return false;
}
return !is_part_in_streaming_limit(part_i);
}

Expand Down

0 comments on commit e3fa28d

Please sign in to comment.