auto priv = con->get_priv();
auto s = static_cast<Session*>(priv.get());
if (!s) {
- s = new Session{cct};
+ s = new Session{cct, con};
con->set_priv(RefCountedPtr{s, false});
- s->con = con;
dout(10) << " new session (outgoing) " << s << " con=" << s->con
<< " addr=" << s->con->get_peer_addr() << dendl;
// we don't connect to clients
auto priv = con->get_priv();
auto s = static_cast<Session*>(priv.get());
if (!s) {
- s = new Session{cct};
+ s = new Session{cct, con};
con->set_priv(RefCountedPtr{s, false});
- s->con = con;
dout(10) << "new session (incoming)" << s << " con=" << con
<< " addr=" << con->get_peer_addr()
<< " must have raced with connect" << dendl;
auto priv = con->get_priv();
auto s = static_cast<Session*>(priv.get());
if (!s) {
- s = new Session{cct};
+ s = new Session{cct, con};
con->set_priv(RefCountedPtr{s, false});
- s->con = con;
dout(10) << " new session " << s << " con=" << s->con
<< " addr=" << con->get_peer_addr() << dendl;
}
OSDCap caps;
int64_t auid;
ConnectionRef con;
+ entity_addr_t socket_addr;
WatchConState wstate;
Mutex session_dispatch_lock;
std::atomic<uint64_t> backoff_seq = {0};
- explicit Session(CephContext *cct) :
+ explicit Session(CephContext *cct, Connection *con_) :
RefCountedObject(cct),
- auid(-1), con(0),
+ auid(-1), con(con_),
+ socket_addr(con_->get_peer_socket_addr()),
wstate(cct),
session_dispatch_lock("Session::session_dispatch_lock"),
last_sent_epoch(0), received_map_epoch(0),
backoff_lock("Session::backoff_lock")
{}
+ entity_addr_t& get_peer_socket_addr() {
+ return socket_addr;
+ }
+
void ack_backoff(
CephContext *cct,
spg_t pgid,