Delete unused AuthKeyHandshake methods.
This commit is contained in:
parent
58c99ed63a
commit
3109848164
@ -51,15 +51,10 @@ void AuthKeyHandshake::clear() {
|
|||||||
state_ = Start;
|
state_ = Start;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AuthKeyHandshake::is_ready_for_start() const {
|
|
||||||
return state_ == Start;
|
|
||||||
}
|
|
||||||
bool AuthKeyHandshake::is_ready_for_message(const UInt128 &message_nonce) const {
|
|
||||||
return state_ != Finish && state_ != Start && nonce_ == message_nonce;
|
|
||||||
}
|
|
||||||
bool AuthKeyHandshake::is_ready_for_finish() const {
|
bool AuthKeyHandshake::is_ready_for_finish() const {
|
||||||
return state_ == Finish;
|
return state_ == Finish;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AuthKeyHandshake::on_finish() {
|
void AuthKeyHandshake::on_finish() {
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
@ -266,17 +261,6 @@ void AuthKeyHandshake::do_send(Callback *connection, const Storer &storer) {
|
|||||||
return connection->send_no_crypto(storer);
|
return connection->send_no_crypto(storer);
|
||||||
}
|
}
|
||||||
|
|
||||||
Status AuthKeyHandshake::start_main(Callback *connection) {
|
|
||||||
mode_ = Mode::Main;
|
|
||||||
return on_start(connection);
|
|
||||||
}
|
|
||||||
|
|
||||||
Status AuthKeyHandshake::start_tmp(Callback *connection, int32 expires_in) {
|
|
||||||
mode_ = Mode::Temp;
|
|
||||||
expires_in_ = expires_in;
|
|
||||||
return on_start(connection);
|
|
||||||
}
|
|
||||||
|
|
||||||
void AuthKeyHandshake::resume(Callback *connection) {
|
void AuthKeyHandshake::resume(Callback *connection) {
|
||||||
if (state_ == Start) {
|
if (state_ == Start) {
|
||||||
return on_start(connection).ignore();
|
return on_start(connection).ignore();
|
||||||
@ -289,7 +273,7 @@ void AuthKeyHandshake::resume(Callback *connection) {
|
|||||||
LOG(ERROR) << "Last query empty! UNREACHABLE " << state_;
|
LOG(ERROR) << "Last query empty! UNREACHABLE " << state_;
|
||||||
return clear();
|
return clear();
|
||||||
}
|
}
|
||||||
LOG(INFO) << "RESUME";
|
LOG(INFO) << "Resume handshake";
|
||||||
do_send(connection, create_storer(last_query_.as_slice()));
|
do_send(connection, create_storer(last_query_.as_slice()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,34 +55,14 @@ class AuthKeyHandshake {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool is_ready_for_start() const;
|
|
||||||
Status start_main(Callback *connection) TD_WARN_UNUSED_RESULT;
|
|
||||||
Status start_tmp(Callback *connection, int32 expires_in) TD_WARN_UNUSED_RESULT;
|
|
||||||
|
|
||||||
bool is_ready_for_message(const UInt128 &message_nonce) const;
|
|
||||||
|
|
||||||
bool is_ready_for_finish() const;
|
bool is_ready_for_finish() const;
|
||||||
|
|
||||||
void on_finish();
|
void on_finish();
|
||||||
|
|
||||||
void init_main() {
|
|
||||||
clear();
|
|
||||||
mode_ = Mode::Main;
|
|
||||||
}
|
|
||||||
|
|
||||||
void init_temp(int32 expires_in) {
|
|
||||||
clear();
|
|
||||||
mode_ = Mode::Temp;
|
|
||||||
expires_in_ = expires_in;
|
|
||||||
}
|
|
||||||
|
|
||||||
void resume(Callback *connection);
|
void resume(Callback *connection);
|
||||||
|
|
||||||
Status on_message(Slice message, Callback *connection, AuthKeyHandshakeContext *context) TD_WARN_UNUSED_RESULT;
|
Status on_message(Slice message, Callback *connection, AuthKeyHandshakeContext *context) TD_WARN_UNUSED_RESULT;
|
||||||
|
|
||||||
bool is_ready() const {
|
|
||||||
return is_ready_for_finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
const AuthKey &get_auth_key() const {
|
const AuthKey &get_auth_key() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user