Fix SIGSEGV.

GitOrigin-RevId: 422a9080eaf83c0c35f90ec5044f2833de9837b9
This commit is contained in:
levlam 2019-03-13 04:00:45 +03:00
parent b6bce6b672
commit 376fda96d5
1 changed files with 8 additions and 2 deletions

View File

@ -988,12 +988,18 @@ Status SessionConnection::do_flush() {
TRY_STATUS(raw_connection_->flush(auth_data_->get_auth_key(), *this));
if (last_pong_at_ + ping_disconnect_delay() < Time::now_cached()) {
raw_connection_->stats_callback()->on_error();
auto stats_callback = raw_connection_->stats_callback();
if (stats_callback != nullptr) {
stats_callback->on_error();
}
return Status::Error(PSLICE() << "Ping timeout of " << ping_disconnect_delay() << " seconds expired");
}
if (last_read_at_ + read_disconnect_delay() < Time::now_cached()) {
raw_connection_->stats_callback()->on_error();
auto stats_callback = raw_connection_->stats_callback();
if (stats_callback != nullptr) {
stats_callback->on_error();
}
return Status::Error(PSLICE() << "Read timeout of " << read_disconnect_delay() << " seconds expired");
}