summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/crimson/net/FrameAssemblerV2.cc18
-rw-r--r--src/crimson/net/FrameAssemblerV2.h2
2 files changed, 17 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
diff --git a/src/crimson/net/FrameAssemblerV2.h b/src/crimson/net/FrameAssemblerV2.h
index c2d3318f87d..a4494384ab1 100644
--- a/src/crimson/net/FrameAssemblerV2.h
+++ b/src/crimson/net/FrameAssemblerV2.h
@@ -141,6 +141,8 @@ private:
SocketFRef move_socket();
+ void clear();
+
void log_main_preamble(const ceph::bufferlist &bl);
#ifdef UNIT_TESTS_BUILT