diff options
author | Yingxin Cheng <yingxin.cheng@intel.com> | 2023-04-26 11:37:16 +0200 |
---|---|---|
committer | Yingxin Cheng <yingxin.cheng@intel.com> | 2023-06-25 05:57:19 +0200 |
commit | 51636d9954cbbc8c34ed5f0a275ccc08d9899cf1 (patch) | |
tree | 035d1599dae656336294ab268b6745505a841be4 /src/crimson/net/FrameAssemblerV2.cc | |
parent | crimson/net: adjust the IO path in FrameAssemblerV2 with the foreign socket (diff) | |
download | ceph-51636d9954cbbc8c34ed5f0a275ccc08d9899cf1.tar.xz ceph-51636d9954cbbc8c34ed5f0a275ccc08d9899cf1.zip |
crimson/net: clear FrameAssemblerV2 at replace
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
Diffstat (limited to 'src/crimson/net/FrameAssemblerV2.cc')
-rw-r--r-- | src/crimson/net/FrameAssemblerV2.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/crimson/net/FrameAssemblerV2.cc b/src/crimson/net/FrameAssemblerV2.cc index a043fcc5717..f76f6774054 100644 --- a/src/crimson/net/FrameAssemblerV2.cc +++ b/src/crimson/net/FrameAssemblerV2.cc @@ -92,6 +92,9 @@ FrameAssemblerV2::to_replace() { assert(seastar::this_shard_id() == sid); assert(is_socket_valid()); + + clear(); + return mover_t{ move_socket(), std::move(session_stream_handlers), @@ -101,9 +104,9 @@ FrameAssemblerV2::to_replace() seastar::future<> FrameAssemblerV2::replace_by(FrameAssemblerV2::mover_t &&mover) { assert(seastar::this_shard_id() == sid); - record_io = false; - rxbuf.clear(); - txbuf.clear(); + + clear(); + session_stream_handlers = std::move(mover.session_stream_handlers); session_comp_handlers = std::move(mover.session_comp_handlers); if (has_socket()) { @@ -437,4 +440,13 @@ FrameAssemblerV2Ref FrameAssemblerV2::create(SocketConnection &conn) return std::make_unique<FrameAssemblerV2>(conn); } +void FrameAssemblerV2::clear() +{ + record_io = false; + rxbuf.clear(); + txbuf.clear(); + rx_preamble.clear(); + rx_segments_data.clear(); +} + } // namespace crimson::net |