From 399d13040df6664f589a68965639dd8eee14a795 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 16 Mar 2019 23:13:18 +0300 Subject: [PATCH] Better streaming gffset debug. GitOrigin-RevId: bb0f5beea36151840685c8c0e33e6ff553e0d9e5 --- td/telegram/Photo.cpp | 1 + td/telegram/files/PartsManager.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/td/telegram/Photo.cpp b/td/telegram/Photo.cpp index 640299f5a..75e5db7c2 100644 --- a/td/telegram/Photo.cpp +++ b/td/telegram/Photo.cpp @@ -524,6 +524,7 @@ void photo_delete_thumbnail(Photo &photo) { for (size_t i = 0; i < photo.photos.size(); i++) { if (photo.photos[i].type == 't') { photo.photos.erase(photo.photos.begin() + i); + return; } } } diff --git a/td/telegram/files/PartsManager.cpp b/td/telegram/files/PartsManager.cpp index 1513e78ba..78b0b1c4f 100644 --- a/td/telegram/files/PartsManager.cpp +++ b/td/telegram/files/PartsManager.cpp @@ -35,14 +35,15 @@ void PartsManager::set_streaming_offset(int64 offset) { }; if (offset < 0 || need_check_ || (!unknown_size_flag_ && get_size() < offset)) { streaming_offset_ = 0; - LOG(ERROR) << "Ignore streaming_offset (1)"; + LOG(ERROR) << "Ignore streaming_offset " << offset << ", need_check_ = " << need_check_ + << ", unknown_size_flag_ = " << unknown_size_flag_ << ", size = " << get_size(); return; } auto part_i = offset / part_size_; if (use_part_count_limit_ && part_i >= MAX_PART_COUNT) { streaming_offset_ = 0; - LOG(ERROR) << "Ignore streaming_offset (2)"; + LOG(ERROR) << "Ignore streaming_offset " << offset << " in part " << part_i; return; } @@ -54,6 +55,7 @@ void PartsManager::set_streaming_offset(int64 offset) { part_status_.resize(part_count_, PartStatus::Empty); } } + void PartsManager::set_streaming_limit(int64 limit) { streaming_limit_ = limit; streaming_ready_size_ = 0;