Add bool is_loopback to avoid checking addrs when send_message.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
private:
uint64_t features;
public:
+ bool is_loopback;
bool failed; // true if we are a lossy connection that has failed.
int rx_buffers_version;
msgr(m),
peer_type(-1),
features(0),
+ is_loopback(false),
failed(false),
rx_buffers_version(0) {
}
else if (m->get_type() == CEPH_MSG_OSD_OPREPLY)
OID_EVENT_TRACE_WITH_MSG(m, "SEND_MSG_OSD_OPREPLY_BEGIN", true);
- if (async_msgr->get_myaddrs() == get_peer_addrs()) { //loopback connection
+ if (is_loopback) { //loopback connection
ldout(async_msgr->cct, 20) << __func__ << " " << *m << " local" << dendl;
std::lock_guard<std::mutex> l(write_lock);
if (protocol->is_connected()) {
*/
void init_local_connection() {
Mutex::Locker l(lock);
+ local_connection->is_loopback = true;
_init_local_connection();
}