RefCountedObject *priv;
int peer_type;
entity_addr_t peer_addr;
+ unsigned features;
public:
- Connection() : nref(1), lock("Connection::lock"), priv(NULL), peer_type(-1) {}
+ Connection() : nref(1), lock("Connection::lock"), priv(NULL), peer_type(-1), features(0) {}
~Connection() {
//generic_dout(0) << "~Connection " << this << dendl;
if (priv) {
const entity_addr_t& get_peer_addr() { return peer_addr; }
void set_peer_addr(const entity_addr_t& a) { peer_addr = a; }
+ int get_features() const { return features; }
+ bool has_feature(int f) const { return features & f; }
+ void set_features(unsigned f) { features = f; }
+ void set_feature(unsigned f) { features |= f; }
};
if (policy.lossy)
reply.flags = reply.flags | CEPH_MSG_CONNECT_LOSSY;
+ connection_state->set_features((int)reply.features & (int)connect.features);
+ dout(10) << "accept features " << connection_state->get_features() << dendl;
+
// ok!
register_pipe();
messenger->lock.Unlock();
connect_seq = cseq + 1;
assert(connect_seq == reply.connect_seq);
backoff = utime_t();
- dout(20) << "connect success " << connect_seq << ", lossy = " << policy.lossy << dendl;
+ connection_state->set_features((unsigned)reply.features & (unsigned)connect.features);
+ dout(20) << "connect success " << connect_seq << ", lossy = " << policy.lossy
+ << ", features " << connection_state->get_features() << dendl;
if (!messenger->destination_stopped) {
Connection * cstate = connection_state->get();