From 0b7ef076f3f1adc512ba89ee1d8af7079af963b7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 17 Feb 2019 09:41:56 -0600 Subject: [PATCH] msg/Connection: add get_con_mode() Signed-off-by: Sage Weil --- src/msg/Connection.h | 4 ++++ src/msg/async/AsyncConnection.cc | 4 ++++ src/msg/async/AsyncConnection.h | 2 ++ src/msg/async/Protocol.h | 4 ++++ 4 files changed, 14 insertions(+) diff --git a/src/msg/Connection.h b/src/msg/Connection.h index 20148749c8c..c245180ceee 100644 --- a/src/msg/Connection.h +++ b/src/msg/Connection.h @@ -209,6 +209,10 @@ public: void set_features(uint64_t f) { features = f; } void set_feature(uint64_t f) { features |= f; } + virtual int get_con_mode() const { + return CEPH_CON_MODE_CRC; + } + void post_rx_buffer(ceph_tid_t tid, bufferlist& bl) { Mutex::Locker l(lock); ++rx_buffers_version; diff --git a/src/msg/async/AsyncConnection.cc b/src/msg/async/AsyncConnection.cc index 18a9c00c4d1..b4763f138c7 100644 --- a/src/msg/async/AsyncConnection.cc +++ b/src/msg/async/AsyncConnection.cc @@ -150,6 +150,10 @@ AsyncConnection::~AsyncConnection() ceph_assert(!delay_state); } +int AsyncConnection::get_con_mode() const { + return protocol->get_con_mode(); +} + void AsyncConnection::maybe_start_delay_thread() { if (!delay_state) { diff --git a/src/msg/async/AsyncConnection.h b/src/msg/async/AsyncConnection.h index 4b089fa02d5..7b5f080bc32 100644 --- a/src/msg/async/AsyncConnection.h +++ b/src/msg/async/AsyncConnection.h @@ -136,6 +136,8 @@ class AsyncConnection : public Connection { return target_addr; } + int get_con_mode() const override; + private: enum { STATE_NONE, diff --git a/src/msg/async/Protocol.h b/src/msg/async/Protocol.h index 981722f6627..e971448532e 100644 --- a/src/msg/async/Protocol.h +++ b/src/msg/async/Protocol.h @@ -104,6 +104,10 @@ public: virtual void read_event() = 0; virtual void write_event() = 0; virtual bool is_queued() = 0; + + int get_con_mode() const { + return auth_meta->con_mode; + } }; #endif /* _MSG_ASYNC_PROTOCOL_ */ -- 2.39.5