Session: force ack when we received unknown answer
This commit is contained in:
parent
fb1efdbba8
commit
852fe4f24b
@ -838,6 +838,12 @@ std::pair<uint64, BufferSlice> SessionConnection::encrypted_bind(int64 perm_key,
|
||||
return std::make_pair(query.message_id, packet.as_buffer_slice());
|
||||
}
|
||||
|
||||
void SessionConnection::force_ack() {
|
||||
if (!to_ack_.empty()) {
|
||||
send_before(Time::now_cached());
|
||||
}
|
||||
}
|
||||
|
||||
void SessionConnection::send_ack(uint64 message_id) {
|
||||
VLOG(mtproto) << "Send ack: [msg_id:" << format::as_hex(message_id) << "]";
|
||||
if (to_ack_.empty()) {
|
||||
|
@ -91,6 +91,7 @@ class SessionConnection final
|
||||
void destroy_key();
|
||||
|
||||
void set_online(bool online_flag, bool is_main);
|
||||
void force_ack();
|
||||
|
||||
class Callback {
|
||||
public:
|
||||
|
@ -871,6 +871,7 @@ void Session::on_message_result_error(uint64 id, int error_code, string message)
|
||||
}
|
||||
auto it = sent_queries_.find(id);
|
||||
if (it == sent_queries_.end()) {
|
||||
current_info_->connection_->force_ack();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user