Remove total_timeout_limit parameter from NetQuery creator.
GitOrigin-RevId: 5c5a15654176061a64c0f167633a7842192200ba
This commit is contained in:
parent
a157cbf8d7
commit
b4138231ec
@ -505,8 +505,8 @@ ActorOwn<> get_full_config(DcOption option, Promise<FullConfig> promise, ActorSh
|
|||||||
false /*need_destroy_auth_key*/, mtproto::AuthKey(),
|
false /*need_destroy_auth_key*/, mtproto::AuthKey(),
|
||||||
std::vector<mtproto::ServerSalt>());
|
std::vector<mtproto::ServerSalt>());
|
||||||
auto query = G()->net_query_creator().create(create_storer(telegram_api::help_getConfig()), DcId::empty(),
|
auto query = G()->net_query_creator().create(create_storer(telegram_api::help_getConfig()), DcId::empty(),
|
||||||
NetQuery::Type::Common, NetQuery::AuthFlag::Off,
|
NetQuery::Type::Common, NetQuery::AuthFlag::Off);
|
||||||
NetQuery::GzipFlag::On, 60 * 60 * 24);
|
query->total_timeout_limit = 60 * 60 * 24;
|
||||||
query->set_callback(actor_shared(this));
|
query->set_callback(actor_shared(this));
|
||||||
query->dispatch_ttl = 0;
|
query->dispatch_ttl = 0;
|
||||||
send_closure(session_, &Session::send, std::move(query));
|
send_closure(session_, &Session::send, std::move(query));
|
||||||
@ -932,11 +932,10 @@ void ConfigManager::get_app_config(Promise<td_api::object_ptr<td_api::JsonValue>
|
|||||||
|
|
||||||
get_app_config_queries_.push_back(std::move(promise));
|
get_app_config_queries_.push_back(std::move(promise));
|
||||||
if (get_app_config_queries_.size() == 1) {
|
if (get_app_config_queries_.size() == 1) {
|
||||||
G()->net_query_dispatcher().dispatch_with_callback(
|
auto query = G()->net_query_creator().create(create_storer(telegram_api::help_getAppConfig()), DcId::main(),
|
||||||
G()->net_query_creator().create(create_storer(telegram_api::help_getAppConfig()), DcId::main(),
|
NetQuery::Type::Common, NetQuery::AuthFlag::Off);
|
||||||
NetQuery::Type::Common, NetQuery::AuthFlag::Off, NetQuery::GzipFlag::On,
|
query->total_timeout_limit = 60 * 60 * 24;
|
||||||
60 * 60 * 24),
|
G()->net_query_dispatcher().dispatch_with_callback(std::move(query), actor_shared(this, 1));
|
||||||
actor_shared(this, 1));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -992,10 +991,10 @@ void ConfigManager::on_dc_options_update(DcOptions dc_options) {
|
|||||||
|
|
||||||
void ConfigManager::request_config_from_dc_impl(DcId dc_id) {
|
void ConfigManager::request_config_from_dc_impl(DcId dc_id) {
|
||||||
config_sent_cnt_++;
|
config_sent_cnt_++;
|
||||||
G()->net_query_dispatcher().dispatch_with_callback(
|
auto query = G()->net_query_creator().create(create_storer(telegram_api::help_getConfig()), dc_id,
|
||||||
G()->net_query_creator().create(create_storer(telegram_api::help_getConfig()), dc_id, NetQuery::Type::Common,
|
NetQuery::Type::Common, NetQuery::AuthFlag::Off);
|
||||||
NetQuery::AuthFlag::Off, NetQuery::GzipFlag::On, 60 * 60 * 24),
|
query->total_timeout_limit = 60 * 60 * 24;
|
||||||
actor_shared(this, 0));
|
G()->net_query_dispatcher().dispatch_with_callback(std::move(query), actor_shared(this, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigManager::set_ignore_sensitive_content_restrictions(bool ignore_sensitive_content_restrictions) {
|
void ConfigManager::set_ignore_sensitive_content_restrictions(bool ignore_sensitive_content_restrictions) {
|
||||||
|
@ -171,11 +171,10 @@ void DcAuthManager::dc_loop(DcInfo &dc) {
|
|||||||
// send auth.exportAuthorization to auth_dc
|
// send auth.exportAuthorization to auth_dc
|
||||||
VLOG(dc) << "Send exportAuthorization to " << dc.dc_id;
|
VLOG(dc) << "Send exportAuthorization to " << dc.dc_id;
|
||||||
auto id = UniqueId::next();
|
auto id = UniqueId::next();
|
||||||
G()->net_query_dispatcher().dispatch_with_callback(
|
auto query = G()->net_query_creator().create(
|
||||||
G()->net_query_creator().create(
|
id, create_storer(telegram_api::auth_exportAuthorization(dc.dc_id.get_raw_id())));
|
||||||
id, create_storer(telegram_api::auth_exportAuthorization(dc.dc_id.get_raw_id())), DcId::main(),
|
query->total_timeout_limit = 60 * 60 * 24;
|
||||||
NetQuery::Type::Common, NetQuery::AuthFlag::On, NetQuery::GzipFlag::On, 60 * 60 * 24),
|
G()->net_query_dispatcher().dispatch_with_callback(std::move(query), actor_shared(this, dc.dc_id.get_raw_id()));
|
||||||
actor_shared(this, dc.dc_id.get_raw_id()));
|
|
||||||
dc.wait_id = id;
|
dc.wait_id = id;
|
||||||
dc.export_id = -1;
|
dc.export_id = -1;
|
||||||
dc.state = DcInfo::State::Import;
|
dc.state = DcInfo::State::Import;
|
||||||
@ -188,21 +187,19 @@ void DcAuthManager::dc_loop(DcInfo &dc) {
|
|||||||
}
|
}
|
||||||
uint64 id = UniqueId::next();
|
uint64 id = UniqueId::next();
|
||||||
VLOG(dc) << "Send importAuthorization to " << dc.dc_id;
|
VLOG(dc) << "Send importAuthorization to " << dc.dc_id;
|
||||||
G()->net_query_dispatcher().dispatch_with_callback(
|
auto query = G()->net_query_creator().create(
|
||||||
G()->net_query_creator().create(
|
id, create_storer(telegram_api::auth_importAuthorization(dc.export_id, std::move(dc.export_bytes))), dc.dc_id,
|
||||||
id, create_storer(telegram_api::auth_importAuthorization(dc.export_id, std::move(dc.export_bytes))),
|
NetQuery::Type::Common, NetQuery::AuthFlag::Off);
|
||||||
dc.dc_id, NetQuery::Type::Common, NetQuery::AuthFlag::Off, NetQuery::GzipFlag::On, 60 * 60 * 24),
|
query->total_timeout_limit = 60 * 60 * 24;
|
||||||
actor_shared(this, dc.dc_id.get_raw_id()));
|
G()->net_query_dispatcher().dispatch_with_callback(std::move(query), actor_shared(this, dc.dc_id.get_raw_id()));
|
||||||
dc.wait_id = id;
|
dc.wait_id = id;
|
||||||
dc.state = DcInfo::State::BeforeOk;
|
dc.state = DcInfo::State::BeforeOk;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DcInfo::State::BeforeOk: {
|
case DcInfo::State::BeforeOk:
|
||||||
break;
|
break;
|
||||||
}
|
case DcInfo::State::Ok:
|
||||||
case DcInfo::State::Ok: {
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,8 +14,7 @@
|
|||||||
namespace td {
|
namespace td {
|
||||||
|
|
||||||
NetQueryCreator::Ptr NetQueryCreator::create(uint64 id, const Storer &storer, DcId dc_id, NetQuery::Type type,
|
NetQueryCreator::Ptr NetQueryCreator::create(uint64 id, const Storer &storer, DcId dc_id, NetQuery::Type type,
|
||||||
NetQuery::AuthFlag auth_flag, NetQuery::GzipFlag gzip_flag,
|
NetQuery::AuthFlag auth_flag, NetQuery::GzipFlag gzip_flag) {
|
||||||
double total_timeout_limit) {
|
|
||||||
BufferSlice slice(storer.size());
|
BufferSlice slice(storer.size());
|
||||||
auto real_size = storer.store(slice.as_slice().ubegin());
|
auto real_size = storer.store(slice.as_slice().ubegin());
|
||||||
LOG_CHECK(real_size == slice.size()) << real_size << " " << slice.size() << " "
|
LOG_CHECK(real_size == slice.size()) << real_size << " " << slice.size() << " "
|
||||||
@ -39,7 +38,6 @@ NetQueryCreator::Ptr NetQueryCreator::create(uint64 id, const Storer &storer, Dc
|
|||||||
auto query = object_pool_.create(NetQuery::State::Query, id, std::move(slice), BufferSlice(), dc_id, type, auth_flag,
|
auto query = object_pool_.create(NetQuery::State::Query, id, std::move(slice), BufferSlice(), dc_id, type, auth_flag,
|
||||||
gzip_flag, tl_constructor);
|
gzip_flag, tl_constructor);
|
||||||
query->set_cancellation_token(query.generation());
|
query->set_cancellation_token(query.generation());
|
||||||
query->total_timeout_limit = total_timeout_limit;
|
|
||||||
return query;
|
return query;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,12 +36,12 @@ class NetQueryCreator {
|
|||||||
|
|
||||||
Ptr create(const Storer &storer, DcId dc_id = DcId::main(), NetQuery::Type type = NetQuery::Type::Common,
|
Ptr create(const Storer &storer, DcId dc_id = DcId::main(), NetQuery::Type type = NetQuery::Type::Common,
|
||||||
NetQuery::AuthFlag auth_flag = NetQuery::AuthFlag::On,
|
NetQuery::AuthFlag auth_flag = NetQuery::AuthFlag::On,
|
||||||
NetQuery::GzipFlag gzip_flag = NetQuery::GzipFlag::On, double total_timeout_limit = 60) {
|
NetQuery::GzipFlag gzip_flag = NetQuery::GzipFlag::On) {
|
||||||
return create(UniqueId::next(), storer, dc_id, type, auth_flag, gzip_flag, total_timeout_limit);
|
return create(UniqueId::next(), storer, dc_id, type, auth_flag, gzip_flag);
|
||||||
}
|
}
|
||||||
Ptr create(uint64 id, const Storer &storer, DcId dc_id = DcId::main(), NetQuery::Type type = NetQuery::Type::Common,
|
Ptr create(uint64 id, const Storer &storer, DcId dc_id = DcId::main(), NetQuery::Type type = NetQuery::Type::Common,
|
||||||
NetQuery::AuthFlag auth_flag = NetQuery::AuthFlag::On,
|
NetQuery::AuthFlag auth_flag = NetQuery::AuthFlag::On,
|
||||||
NetQuery::GzipFlag gzip_flag = NetQuery::GzipFlag::On, double total_timeout_limit = 60);
|
NetQuery::GzipFlag gzip_flag = NetQuery::GzipFlag::On);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ObjectPool<NetQuery> object_pool_;
|
ObjectPool<NetQuery> object_pool_;
|
||||||
|
@ -68,11 +68,9 @@ void PublicRsaKeyWatchdog::loop() {
|
|||||||
}
|
}
|
||||||
flood_control_.add_event(static_cast<int32>(Time::now_cached()));
|
flood_control_.add_event(static_cast<int32>(Time::now_cached()));
|
||||||
has_query_ = true;
|
has_query_ = true;
|
||||||
G()->net_query_dispatcher().dispatch_with_callback(
|
auto query = G()->net_query_creator().create(create_storer(telegram_api::help_getCdnConfig()));
|
||||||
G()->net_query_creator().create(create_storer(telegram_api::help_getCdnConfig()), DcId::main(),
|
query->total_timeout_limit = 60 * 60 * 24;
|
||||||
NetQuery::Type::Common, NetQuery::AuthFlag::On, NetQuery::GzipFlag::On,
|
G()->net_query_dispatcher().dispatch_with_callback(std::move(query), actor_shared(this));
|
||||||
60 * 60 * 24),
|
|
||||||
actor_shared(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PublicRsaKeyWatchdog::on_result(NetQueryPtr net_query) {
|
void PublicRsaKeyWatchdog::on_result(NetQueryPtr net_query) {
|
||||||
|
Reference in New Issue
Block a user