From 675a50326c2a731832c5bd2b239638f711412194 Mon Sep 17 00:00:00 2001 From: Yingxin Cheng Date: Wed, 7 Aug 2019 23:11:19 +0800 Subject: [PATCH] crimson/net: reset handshake status when connecting/accepting Signed-off-by: Yingxin Cheng --- src/crimson/net/ProtocolV2.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index a1e6d2d7cff19..63d682afd3631 100644 --- a/src/crimson/net/ProtocolV2.cc +++ b/src/crimson/net/ProtocolV2.cc @@ -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(); + 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(); + session_stream_handlers = { nullptr, nullptr }; enable_recording(); return banner_exchange() .then([this] (entity_type_t _peer_type, -- 2.39.5