Better streaming gffset debug.

GitOrigin-RevId: bb0f5beea36151840685c8c0e33e6ff553e0d9e5
This commit is contained in:
levlam 2019-03-16 23:13:18 +03:00
parent bc3e312a1c
commit 399d13040d
2 changed files with 5 additions and 2 deletions

View File

@ -524,6 +524,7 @@ void photo_delete_thumbnail(Photo &photo) {
for (size_t i = 0; i < photo.photos.size(); i++) { for (size_t i = 0; i < photo.photos.size(); i++) {
if (photo.photos[i].type == 't') { if (photo.photos[i].type == 't') {
photo.photos.erase(photo.photos.begin() + i); photo.photos.erase(photo.photos.begin() + i);
return;
} }
} }
} }

View File

@ -35,14 +35,15 @@ void PartsManager::set_streaming_offset(int64 offset) {
}; };
if (offset < 0 || need_check_ || (!unknown_size_flag_ && get_size() < offset)) { if (offset < 0 || need_check_ || (!unknown_size_flag_ && get_size() < offset)) {
streaming_offset_ = 0; 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; return;
} }
auto part_i = offset / part_size_; auto part_i = offset / part_size_;
if (use_part_count_limit_ && part_i >= MAX_PART_COUNT) { if (use_part_count_limit_ && part_i >= MAX_PART_COUNT) {
streaming_offset_ = 0; streaming_offset_ = 0;
LOG(ERROR) << "Ignore streaming_offset (2)"; LOG(ERROR) << "Ignore streaming_offset " << offset << " in part " << part_i;
return; return;
} }
@ -54,6 +55,7 @@ void PartsManager::set_streaming_offset(int64 offset) {
part_status_.resize(part_count_, PartStatus::Empty); part_status_.resize(part_count_, PartStatus::Empty);
} }
} }
void PartsManager::set_streaming_limit(int64 limit) { void PartsManager::set_streaming_limit(int64 limit) {
streaming_limit_ = limit; streaming_limit_ = limit;
streaming_ready_size_ = 0; streaming_ready_size_ = 0;