Since XioLoopbackConnection is a RefCountedObject, it can't be
an expanded member of XioMessenger.
Fixes cleanup/shutdown errors.
Signed-off-by: Matt Benjamin <matt@cohortfs.com>
(cherry picked from commit
f5735b28d154612b339cf5d3b558e4dc5eaa2884)
}
};
-typedef boost::intrusive_ptr<XioLoopbackConnection> LoopbackConnectionRef;
+typedef boost::intrusive_ptr<XioLoopbackConnection> XioLoopbackConnectionRef;
#endif /* XIO_CONNECTION_H */
shutdown_called(false),
portals(this, cct->_conf->xio_portal_threads),
dispatch_strategy(ds),
- loop_con(this),
+ loop_con(new XioLoopbackConnection(this)),
special_handling(0),
sh_mtx("XioMessenger session mutex"),
sh_cond()
int XioMessenger::_send_message(Message *m, Connection *con)
{
- if (con == &loop_con) {
+ if (con == loop_con.get() /* intrusive_ptr get() */) {
m->set_connection(con);
m->set_src(get_myinst().name);
- XioLoopbackConnection *xlcon = static_cast<XioLoopbackConnection*>(con);
- m->set_seq(xlcon->next_seq());
+ m->set_seq(loop_con->next_seq());
ds_dispatch(m);
return 0;
}
XioConnection::EntitySet conns_entity_map;
XioPortals portals;
DispatchStrategy* dispatch_strategy;
- XioLoopbackConnection loop_con;
+ XioLoopbackConnectionRef loop_con;
uint32_t special_handling;
Mutex sh_mtx;
Cond sh_cond;
virtual void set_myaddr(const entity_addr_t& a) {
Messenger::set_myaddr(a);
- loop_con.set_peer_addr(a);
+ loop_con->set_peer_addr(a);
}
int _send_message(Message *m, const entity_inst_t &dest);