From 9034afa72c8fd9fc038d1959b907f1b94bc315b7 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Wed, 27 Feb 2019 07:36:34 +0100 Subject: [PATCH] msg/async, v2: clean the ProtocolV2::epilogue up. Signed-off-by: Radoslaw Zarzynski --- src/msg/async/ProtocolV2.cc | 15 +++++---------- src/msg/async/ProtocolV2.h | 2 -- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/msg/async/ProtocolV2.cc b/src/msg/async/ProtocolV2.cc index 1721e05802d77..f340054f784ae 100644 --- a/src/msg/async/ProtocolV2.cc +++ b/src/msg/async/ProtocolV2.cc @@ -1377,7 +1377,6 @@ CtPtr ProtocolV2::handle_message() { front.clear(); middle.clear(); data.clear(); - epilogue.clear(); current_header = header; // front @@ -1458,15 +1457,10 @@ CtPtr ProtocolV2::handle_read_frame_epilogue_main(char *buffer, int r) { return _fault(); } - if (session_stream_handlers.rx) { - ceph_assert(session_stream_handlers.rx && session_stream_handlers.tx && - auth_meta->is_mode_secure()); - ceph_assert(FRAME_EPILOGUE_SIZE == \ - session_stream_handlers.rx->get_extra_size_at_final()); + // I expect that ::temp_buffer is being used here. + ceph::bufferlist epilogue; + epilogue.push_back(buffer::create_static(FRAME_EPILOGUE_SIZE, buffer)); - // I expect that ::temp_buffer is being used here. - epilogue.push_back(buffer::create_static(FRAME_EPILOGUE_SIZE, buffer)); - } // FIXME: if (auth_meta->is_mode_secure()) { if (session_stream_handlers.rx) { @@ -1476,6 +1470,8 @@ CtPtr ProtocolV2::handle_read_frame_epilogue_main(char *buffer, int r) { << FRAME_EPILOGUE_SIZE << dendl; ceph_assert(session_stream_handlers.rx); + ceph_assert(FRAME_EPILOGUE_SIZE == \ + session_stream_handlers.rx->get_extra_size_at_final()); try { session_stream_handlers.rx->authenticated_decrypt_update_final( std::move(epilogue), segment_t::DEFAULT_ALIGNMENT); @@ -1660,7 +1656,6 @@ CtPtr ProtocolV2::handle_message_complete() { front.clear(); middle.clear(); data.clear(); - epilogue.clear(); // we might have been reused by another connection // let's check if that is the case diff --git a/src/msg/async/ProtocolV2.h b/src/msg/async/ProtocolV2.h index 0fe22fd126377..d40887424d873 100644 --- a/src/msg/async/ProtocolV2.h +++ b/src/msg/async/ProtocolV2.h @@ -113,8 +113,6 @@ public: ceph::msgr::v2::MAX_NUM_SEGMENTS> rx_segments_desc; boost::container::static_vector rx_segments_data; - - ceph::bufferlist epilogue; private: ceph::msgr::v2::Tag sent_tag; -- 2.39.5