From cced2bfd3775564a2b0c4919837eea2f5278dd03 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Fri, 8 Mar 2019 17:24:33 +0100 Subject: [PATCH] msg/async, v2: drop the bl onwire space optimization in ControlFrames. BEWARE: this changes the V2 onwire format without preserving backward compatibility! Signed-off-by: Radoslaw Zarzynski --- src/msg/async/frames_v2.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/msg/async/frames_v2.h b/src/msg/async/frames_v2.h index b2b9d91047a..2fade004b30 100644 --- a/src/msg/async/frames_v2.h +++ b/src/msg/async/frames_v2.h @@ -305,9 +305,7 @@ protected: template inline void _encode_payload_each(T &t) { - if constexpr (std::is_same()) { - this->get_payload_segment().claim_append((bufferlist &)t); - } else if constexpr (std::is_same const>()) { + if constexpr (std::is_same const>()) { encode((uint32_t)t.size(), this->get_payload_segment(), features); for (const auto &elem : t) { encode(elem, this->get_payload_segment(), features); @@ -319,11 +317,7 @@ protected: template inline void _decode_payload_each(T &t, bufferlist::const_iterator &ti) const { - if constexpr (std::is_same()) { - if (ti.get_remaining()) { - t.append(ti.get_current_ptr()); - } - } else if constexpr (std::is_same>()) { + if constexpr (std::is_same>()) { uint32_t size; decode(size, ti); t.resize(size); -- 2.39.5