Ensure that PTS/QTS updates are null after processing.

This commit is contained in:
levlam 2023-01-09 13:27:28 +03:00
parent fd53a81603
commit ac0de06b5f
2 changed files with 4 additions and 0 deletions

View File

@ -8093,6 +8093,7 @@ void MessagesManager::process_pts_update(tl_object_ptr<telegram_api::Update> &&u
default: default:
UNREACHABLE(); UNREACHABLE();
} }
update_ptr = nullptr;
CHECK(!td_->updates_manager_->running_get_difference()); CHECK(!td_->updates_manager_->running_get_difference());
} }

View File

@ -2301,8 +2301,10 @@ void UpdatesManager::process_updates(vector<tl_object_ptr<telegram_api::Update>>
} }
process_pts_update(std::move(update)); process_pts_update(std::move(update));
CHECK(update == nullptr);
} else if (is_qts_update(update.get())) { } else if (is_qts_update(update.get())) {
process_qts_update(std::move(update), 0, get_promise()); process_qts_update(std::move(update), 0, get_promise());
CHECK(update == nullptr);
} else if (update->get_id() == telegram_api::updateChannelTooLong::ID) { } else if (update->get_id() == telegram_api::updateChannelTooLong::ID) {
td_->messages_manager_->on_update_channel_too_long( td_->messages_manager_->on_update_channel_too_long(
move_tl_object_as<telegram_api::updateChannelTooLong>(update), true); move_tl_object_as<telegram_api::updateChannelTooLong>(update), true);
@ -2331,6 +2333,7 @@ void UpdatesManager::process_pts_update(tl_object_ptr<telegram_api::Update> &&up
if (!check_pts_update(update)) { if (!check_pts_update(update)) {
LOG(ERROR) << "Receive wrong pts update: " << oneline(to_string(update)); LOG(ERROR) << "Receive wrong pts update: " << oneline(to_string(update));
update = nullptr;
return; return;
} }