Improve "invoke_after_message_id" variable names.

This commit is contained in:
levlam 2023-09-21 15:40:56 +03:00
parent c8e46cae53
commit ec44b3d16c
5 changed files with 16 additions and 15 deletions

View File

@ -142,7 +142,7 @@ class QueryImpl {
storer.store_binary(query_.message_id);
storer.store_binary(query_.seq_no);
InvokeAfter invoke_after(query_.invoke_after_ids);
InvokeAfter invoke_after(query_.invoke_after_message_ids);
auto invoke_after_storer = create_default_storer(invoke_after);
Slice data = query_.packet.as_slice();

View File

@ -17,7 +17,7 @@ struct MtprotoQuery {
int32 seq_no;
BufferSlice packet;
bool gzip_flag;
vector<uint64> invoke_after_ids;
vector<uint64> invoke_after_message_ids;
bool use_quick_ack;
};

View File

@ -791,7 +791,7 @@ void SessionConnection::send_crypto(const Storer &storer, uint64 quick_ack_token
}
Result<uint64> SessionConnection::send_query(BufferSlice buffer, bool gzip_flag, uint64 message_id,
vector<uint64> invoke_after_ids, bool use_quick_ack) {
vector<uint64> invoke_after_message_ids, bool use_quick_ack) {
CHECK(mode_ != Mode::HttpLongPoll); // "LongPoll connection is only for http_wait"
if (message_id == 0) {
message_id = auth_data_->next_message_id(Time::now_cached());
@ -800,10 +800,10 @@ Result<uint64> SessionConnection::send_query(BufferSlice buffer, bool gzip_flag,
if (to_send_.empty()) {
send_before(Time::now_cached() + QUERY_DELAY);
}
to_send_.push_back(
MtprotoQuery{message_id, seq_no, std::move(buffer), gzip_flag, std::move(invoke_after_ids), use_quick_ack});
to_send_.push_back(MtprotoQuery{message_id, seq_no, std::move(buffer), gzip_flag, std::move(invoke_after_message_ids),
use_quick_ack});
VLOG(mtproto) << "Invoke query with msg_id " << format::as_hex(message_id) << " and seq_no " << seq_no << " of size "
<< to_send_.back().packet.size() << " after " << invoke_after_ids
<< to_send_.back().packet.size() << " after " << invoke_after_message_ids
<< (use_quick_ack ? " with quick ack" : "");
return message_id;

View File

@ -68,7 +68,8 @@ class SessionConnection final
// Interface
Result<uint64> TD_WARN_UNUSED_RESULT send_query(BufferSlice buffer, bool gzip_flag, uint64 message_id = 0,
std::vector<uint64> invoke_after_id = {}, bool use_quick_ack = false);
vector<uint64> invoke_after_message_ids = {},
bool use_quick_ack = false);
std::pair<uint64, BufferSlice> encrypted_bind(int64 perm_key, int64 nonce, int32 expires_at);
void get_state_info(uint64 message_id);

View File

@ -1123,14 +1123,14 @@ void Session::connection_send_query(ConnectionInfo *info, NetQueryPtr &&net_quer
}
Span<NetQueryRef> invoke_after = net_query->invoke_after();
vector<uint64> invoke_after_ids;
vector<uint64> invoke_after_message_ids;
for (auto &ref : invoke_after) {
auto invoke_after_id = ref->message_id();
if (ref->session_id() != auth_data_.get_session_id() || invoke_after_id == 0) {
auto invoke_after_message_id = ref->message_id();
if (ref->session_id() != auth_data_.get_session_id() || invoke_after_message_id == 0) {
net_query->set_error_resend_invoke_after();
return return_query(std::move(net_query));
}
invoke_after_ids.push_back(invoke_after_id);
invoke_after_message_ids.push_back(invoke_after_message_id);
}
if (!invoke_after.empty()) {
if (!unknown_queries_.empty()) {
@ -1144,9 +1144,9 @@ void Session::connection_send_query(ConnectionInfo *info, NetQueryPtr &&net_quer
bool immediately_fail_query = false;
if (!immediately_fail_query) {
net_query->debug(PSTRING() << get_name() << ": send to an MTProto connection");
auto r_message_id =
info->connection_->send_query(net_query->query().clone(), net_query->gzip_flag() == NetQuery::GzipFlag::On,
message_id, invoke_after_ids, static_cast<bool>(net_query->quick_ack_promise_));
auto r_message_id = info->connection_->send_query(
net_query->query().clone(), net_query->gzip_flag() == NetQuery::GzipFlag::On, message_id,
invoke_after_message_ids, static_cast<bool>(net_query->quick_ack_promise_));
net_query->on_net_write(net_query->query().size());
@ -1161,7 +1161,7 @@ void Session::connection_send_query(ConnectionInfo *info, NetQueryPtr &&net_quer
}
net_query->set_message_id(message_id);
VLOG(net_query) << "Send query to connection " << net_query
<< tag("invoke_after", transform(invoke_after_ids, [](auto message_id) {
<< tag("invoke_after", transform(invoke_after_message_ids, [](auto message_id) {
return PSTRING() << format::as_hex(message_id);
}));
{