summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKefu Chai <tchaikov@gmail.com>2018-07-17 17:31:23 +0200
committerGitHub <noreply@github.com>2018-07-17 17:31:23 +0200
commitde4706dde7177f2a948ead0bf7d78f73946548fd (patch)
tree092b13ed4e5587ca174ec524d4f63b53eb673a16
parentMerge pull request #23057 from liewegas/wip-12.2.7-notes (diff)
parentcrimson/net: use boost::thread_unsafe_counter for refcounting Connection (diff)
downloadceph-de4706dde7177f2a948ead0bf7d78f73946548fd.tar.xz
ceph-de4706dde7177f2a948ead0bf7d78f73946548fd.zip
Merge pull request #23044 from tchaikov/wip-crimson-connection
crimson/connection: misc changes Reviewed-by: Casey Bodley <cbodley@redhat.com>
-rw-r--r--src/crimson/net/Connection.h4
-rw-r--r--src/crimson/net/SocketConnection.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/crimson/net/Connection.h b/src/crimson/net/Connection.h
index f5c0a626c52..3cbe0c1f837 100644
--- a/src/crimson/net/Connection.h
+++ b/src/crimson/net/Connection.h
@@ -24,7 +24,8 @@ namespace ceph::net {
using seq_num_t = uint64_t;
-class Connection : public boost::intrusive_ref_counter<Connection> {
+class Connection : public boost::intrusive_ref_counter<Connection,
+ boost::thread_unsafe_counter> {
protected:
Messenger *const messenger;
entity_addr_t my_addr;
@@ -40,6 +41,7 @@ class Connection : public boost::intrusive_ref_counter<Connection> {
const entity_addr_t& get_my_addr() const { return my_addr; }
const entity_addr_t& get_peer_addr() const { return peer_addr; }
+ virtual int get_peer_type() const = 0;
/// true if the handshake has completed and no errors have been encountered
virtual bool is_connected() = 0;
diff --git a/src/crimson/net/SocketConnection.h b/src/crimson/net/SocketConnection.h
index ac1a7301619..a73329f93d0 100644
--- a/src/crimson/net/SocketConnection.h
+++ b/src/crimson/net/SocketConnection.h
@@ -70,7 +70,7 @@ class SocketConnection : public Connection {
seastar::future<> handle_keepalive2_ack();
bool require_auth_feature() const;
- int get_peer_type() const {
+ int get_peer_type() const override {
return h.connect.host_type;
}
uint32_t get_proto_version(entity_type_t peer_type, bool connec) const;