]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/Connection: add is_msgr2()
authorSage Weil <sage@redhat.com>
Fri, 12 Apr 2019 19:11:48 +0000 (14:11 -0500)
committerSage Weil <sage@redhat.com>
Mon, 22 Apr 2019 12:07:36 +0000 (07:07 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
src/msg/Connection.h
src/msg/async/AsyncConnection.cc
src/msg/async/AsyncConnection.h

index a00b3292be1f8211eb5ac56fb8f2cd9d4bbcab53..a98e0e12a5347797384dc50543dd04c562dc58f5 100644 (file)
@@ -110,6 +110,10 @@ public:
    */
   virtual bool is_connected() = 0;
 
+  virtual bool is_msgr2() const {
+    return false;
+  }
+
   Messenger *get_messenger() {
     return msgr;
   }
index a364e58add6fece00923b6778b464bac7b91b846..b2150f175b1e7eb209a08b975a0baf2fbbe6cb64 100644 (file)
@@ -152,10 +152,16 @@ AsyncConnection::~AsyncConnection()
   ceph_assert(!delay_state);
 }
 
-int AsyncConnection::get_con_mode() const {
+int AsyncConnection::get_con_mode() const
+{
   return protocol->get_con_mode();
 }
 
+bool AsyncConnection::is_msgr2() const
+{
+  return protocol->proto_type == 2;
+}
+
 void AsyncConnection::maybe_start_delay_thread()
 {
   if (!delay_state) {
index 5b914cc5e639118151dfa9567da0166c24a0a0ef..3ce26e6d52a3925f5a3d8e62b5cbec89fb911160 100644 (file)
@@ -228,6 +228,8 @@ class AsyncConnection : public Connection {
     return logger;
   }
 
+  bool is_msgr2() const override;
+
   friend class Protocol;
   friend class ProtocolV1;
   friend class ProtocolV2;