int64_t peer_id = -1; // [msgr2 only] the 0 of osd.0, 4567 or client.4567
safe_item_history<entity_addrvec_t> peer_addrs;
utime_t last_keepalive, last_keepalive_ack;
+ bool anon = false; ///< anonymous outgoing connection
private:
- uint64_t features;
+ uint64_t features = 0;
public:
- bool is_loopback;
- bool failed; // true if we are a lossy connection that has failed.
+ bool is_loopback = false;
+ bool failed = false; // true if we are a lossy connection that has failed.
- int rx_buffers_version;
+ int rx_buffers_version = 0;
std::map<ceph_tid_t,std::pair<ceph::buffer::list, int>> rx_buffers;
// authentication state
// create connection
Worker *w = stack->get_worker();
- AsyncConnectionRef conn = new AsyncConnection(cct, this, &dispatch_queue, w,
+ auto conn = ceph::make_ref<AsyncConnection>(cct, this, &dispatch_queue, w,
target.is_msgr2(), false);
+ conn->anon = anon;
conn->connect(addrs, type, target);
- ceph_assert(!conns.count(addrs));
- ldout(cct, 10) << __func__ << " " << conn << " " << addrs << " "
- << *conn->peer_addrs << dendl;
- conns[addrs] = conn;
+ if (anon) {
+ anon_conns.insert(conn);
+ } else {
+ ceph_assert(!conns.count(addrs));
+ ldout(cct, 10) << __func__ << " " << conn << " " << addrs << " "
+ << *conn->peer_addrs << dendl;
+ conns[addrs] = conn;
+ }
w->get_perf_counter()->inc(l_msgr_active_connections);
return conn;