]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/net: reset handshake status when connecting/accepting
authorYingxin Cheng <yingxin.cheng@intel.com>
Wed, 7 Aug 2019 15:11:19 +0000 (23:11 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Mon, 12 Aug 2019 09:02:52 +0000 (17:02 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/net/ProtocolV2.cc

index a1e6d2d7cff195a62beb9238a61732139dd5a7c3..63d682afd36315478b0e80f759549854c4e308cb 100644 (file)
@@ -172,9 +172,8 @@ void ProtocolV2::start_accept(SocketFRef&& sock,
 
 void ProtocolV2::enable_recording()
 {
-  ceph_assert(!rxbuf.length());
-  ceph_assert(!txbuf.length());
-  ceph_assert(!record_io);
+  rxbuf.clear();
+  txbuf.clear();
   record_io = true;
 }
 
@@ -861,7 +860,6 @@ void ProtocolV2::execute_connecting()
             logger().debug("{} UPDATE: gs={}, cc={} for connect",
                            conn, global_seq, client_cookie);
           }
-          enable_recording();
           return Socket::connect(conn.peer_addr);
         }).then([this](SocketFRef sock) {
           logger().debug("{} socket connected", conn);
@@ -874,6 +872,9 @@ void ProtocolV2::execute_connecting()
           }
           return seastar::now();
         }).then([this] {
+          auth_meta = seastar::make_lw_shared<AuthConnectionMeta>();
+          session_stream_handlers = { nullptr, nullptr };
+          enable_recording();
           return banner_exchange();
         }).then([this] (entity_type_t _peer_type,
                         entity_addr_t _my_addr_from_peer) {
@@ -1344,6 +1345,8 @@ void ProtocolV2::execute_accepting()
 {
   trigger_state(state_t::ACCEPTING, write_state_t::none, false);
   seastar::with_gate(pending_dispatch, [this] {
+      auth_meta = seastar::make_lw_shared<AuthConnectionMeta>();
+      session_stream_handlers = { nullptr, nullptr };
       enable_recording();
       return banner_exchange()
         .then([this] (entity_type_t _peer_type,