From a157cbf8d742a72dc1aa37dbf4df21ccb003eb86 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 15 Mar 2020 01:24:11 +0300 Subject: [PATCH] Replace NetQueryCreator.create_result with create_update. GitOrigin-RevId: 21523bbd42a847b26359e49d6b70556599319121 --- td/telegram/net/NetQueryCreator.h | 13 +++---------- td/telegram/net/Session.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/td/telegram/net/NetQueryCreator.h b/td/telegram/net/NetQueryCreator.h index a7ca101f4..db5c1b40c 100644 --- a/td/telegram/net/NetQueryCreator.h +++ b/td/telegram/net/NetQueryCreator.h @@ -29,16 +29,9 @@ class NetQueryCreator { object_pool_.set_check_empty(false); } - Ptr create_result(BufferSlice &&buffer, DcId dc_id = DcId::main(), - NetQuery::AuthFlag auth_flag = NetQuery::AuthFlag::On, - NetQuery::GzipFlag gzip_flag = NetQuery::GzipFlag::Off) { - return create_result(0, std::move(buffer), dc_id, auth_flag, gzip_flag); - } - Ptr create_result(uint64 id, BufferSlice &&buffer, DcId dc_id = DcId::main(), - NetQuery::AuthFlag auth_flag = NetQuery::AuthFlag::On, - NetQuery::GzipFlag gzip_flag = NetQuery::GzipFlag::Off) { - return object_pool_.create(NetQuery::State::OK, id, BufferSlice(), std::move(buffer), dc_id, NetQuery::Type::Common, - auth_flag, gzip_flag, 0); + Ptr create_update(BufferSlice &&buffer) { + return object_pool_.create(NetQuery::State::OK, 0, BufferSlice(), std::move(buffer), DcId::main(), + NetQuery::Type::Common, NetQuery::AuthFlag::On, NetQuery::GzipFlag::Off, 0); } Ptr create(const Storer &storer, DcId dc_id = DcId::main(), NetQuery::Type type = NetQuery::Type::Common, diff --git a/td/telegram/net/Session.cpp b/td/telegram/net/Session.cpp index b4f340735..391e189ef 100644 --- a/td/telegram/net/Session.cpp +++ b/td/telegram/net/Session.cpp @@ -540,12 +540,12 @@ void Session::on_session_created(uint64 unique_id, uint64 first_id) { LOG(INFO) << "New session " << unique_id << " created with first message_id " << first_id; if (is_main_) { LOG(DEBUG) << "Sending updatesTooLong to force getDifference"; - telegram_api::updatesTooLong too_long_; - auto storer = create_storer(too_long_); + telegram_api::updatesTooLong too_long; + auto storer = create_storer(too_long); BufferSlice packet(storer.size()); auto real_size = storer.store(packet.as_slice().ubegin()); CHECK(real_size == packet.size()); - return_query(G()->net_query_creator().create_result(0, std::move(packet))); + return_query(G()->net_query_creator().create_update(std::move(packet))); } for (auto it = sent_queries_.begin(); it != sent_queries_.end();) { @@ -682,7 +682,7 @@ Status Session::on_message_result_ok(uint64 id, BufferSlice packet, size_t origi if (is_cdn_) { return Status::Error("Got update from CDN connection"); } - return_query(G()->net_query_creator().create_result(0, std::move(packet))); + return_query(G()->net_query_creator().create_update(std::move(packet))); return Status::OK(); }