Skip to content

Commit

Permalink
verify that the connection is currently from the master in PikaBinlog…
Browse files Browse the repository at this point in the history
…ReceiverThread::Handles::AccessHandle() (OpenAtomFoundation#410)
  • Loading branch information
Axlgrep authored Nov 29, 2018
1 parent 150174e commit 44b8868
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/pika_binlog_receiver_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ bool PikaBinlogReceiverThread::Handles::AccessHandle(std::string& ip) const {
ip = g_pika_server->host();
}
LOG(INFO) << "Master Binlog Sender: " << ip << " connecting";
// if (binlog_receiver_->thread_rep_->conn_num() != 0 ||
// if (!g_pika_server->ShouldAccessConnAsMaster(ip)) {
// LOG(WARNING) << "BinlogReceiverThread AccessHandle failed: " << ip;
// return false;
// }
if (!g_pika_server->ShouldAccessConnAsMaster(ip)) {
LOG(WARNING) << "BinlogReceiverThread AccessHandle failed: " << ip;
return false;
}
g_pika_server->PlusMasterConnection();
return true;
}
Expand Down

0 comments on commit 44b8868

Please sign in to comment.