Remove unused callback from SessionConnection.

GitOrigin-RevId: d59f2581e57acb8bad96197381d0e0698b932ed2
This commit is contained in:
levlam 2018-12-11 23:34:46 +03:00
parent 6445cf645b
commit 43b61eace0
3 changed files with 9 additions and 12 deletions

View File

@ -186,7 +186,7 @@ class OnPacket {
/*** SessionConnection ***/
BufferSlice SessionConnection::as_buffer_slice(Slice packet) {
return current_buffer_slice->from_slice(packet);
return current_buffer_slice_->from_slice(packet);
}
Status SessionConnection::parse_message(TlParser &parser, MsgInfo *info, Slice *packet, bool crypto_flag) {
@ -694,9 +694,8 @@ void SessionConnection::on_read(size_t size) {
last_read_at_ = Time::now_cached();
}
SessionConnection::SessionConnection(Mode mode, unique_ptr<RawConnection> raw_connection, AuthData *auth_data,
DhCallback *dh_callback)
: raw_connection_(std::move(raw_connection)), auth_data_(auth_data), dh_callback_(dh_callback) {
SessionConnection::SessionConnection(Mode mode, unique_ptr<RawConnection> raw_connection, AuthData *auth_data)
: raw_connection_(std::move(raw_connection)), auth_data_(auth_data) {
state_ = Init;
mode_ = mode;
created_at_ = Time::now();

View File

@ -65,7 +65,7 @@ class SessionConnection
, private RawConnection::Callback {
public:
enum class Mode { Tcp, Http, HttpLongPoll };
SessionConnection(Mode mode, unique_ptr<RawConnection> raw_connection, AuthData *auth_data, DhCallback *dh_callback);
SessionConnection(Mode mode, unique_ptr<RawConnection> raw_connection, AuthData *auth_data);
PollableFdInfo &get_poll_info();
@ -194,16 +194,15 @@ class SessionConnection
unique_ptr<RawConnection> raw_connection_;
AuthData *auth_data_;
SessionConnection::Callback *callback_ = nullptr;
DhCallback *dh_callback_;
BufferSlice *current_buffer_slice;
BufferSlice *current_buffer_slice_;
friend class OnPacket;
BufferSlice as_buffer_slice(Slice packet);
auto set_buffer_slice(BufferSlice *buffer_slice) TD_WARN_UNUSED_RESULT {
auto old_buffer_slice = current_buffer_slice;
current_buffer_slice = buffer_slice;
return ScopeExit() + [&to = current_buffer_slice, from = old_buffer_slice] { to = from; };
auto old_buffer_slice = current_buffer_slice_;
current_buffer_slice_ = buffer_slice;
return ScopeExit() + [&to = current_buffer_slice_, from = old_buffer_slice] { to = from; };
}
Status parse_message(TlParser &parser, MsgInfo *info, Slice *packet, bool crypto_flag = true) TD_WARN_UNUSED_RESULT;

View File

@ -963,8 +963,7 @@ void Session::connection_open_finish(ConnectionInfo *info,
auto name = PSTRING() << get_name() << "::Connect::" << mode_name << "::" << raw_connection->debug_str_;
LOG(INFO) << "connection_open_finish: " << name;
//LOG(ERROR) << "connection_open_finish: " << name;
info->connection =
make_unique<mtproto::SessionConnection>(mode, std::move(raw_connection), &auth_data_, DhCache::instance());
info->connection = make_unique<mtproto::SessionConnection>(mode, std::move(raw_connection), &auth_data_);
info->connection->set_online(connection_online_flag_, is_main_);
info->connection->set_name(name);
Scheduler::subscribe(info->connection->get_poll_info().extract_pollable_fd(this));