]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/net: create SocketConnection based on address type
authorYingxin Cheng <yingxincheng@gmail.com>
Fri, 15 Feb 2019 07:43:08 +0000 (15:43 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 5 Apr 2019 03:21:18 +0000 (11:21 +0800)
Signed-off-by: Yingxin Cheng <yingxincheng@gmail.com>
src/crimson/net/SocketMessenger.cc

index 5de019a7010548154564ceacf8ee366de0e02069..b10b99975158f4ab92dd746f7fd0ac5c5072b2be 100644 (file)
@@ -154,7 +154,8 @@ seastar::future<> SocketMessenger::do_start(Dispatcher *disp)
 #warning fixme
             // we currently do dangerous i/o from a Connection core, different from the Socket core.
             container().invoke_on(shard, [sock = std::move(socket), peer_addr, this](auto& msgr) mutable {
-                SocketConnectionRef conn = seastar::make_shared<SocketConnection>(msgr, *msgr.dispatcher, false);
+                SocketConnectionRef conn = seastar::make_shared<SocketConnection>(
+                    msgr, *msgr.dispatcher, get_myaddr().is_msgr2());
                 conn->start_accept(std::move(sock), peer_addr);
               });
           });
@@ -175,7 +176,8 @@ SocketMessenger::do_connect(const entity_addr_t& peer_addr, const entity_type_t&
   if (auto found = lookup_conn(peer_addr); found) {
     return seastar::make_foreign(found->shared_from_this());
   }
-  SocketConnectionRef conn = seastar::make_shared<SocketConnection>(*this, *dispatcher, false);
+  SocketConnectionRef conn = seastar::make_shared<SocketConnection>(
+      *this, *dispatcher, peer_addr.is_msgr2());
   conn->start_connect(peer_addr, peer_type);
   return seastar::make_foreign(conn->shared_from_this());
 }