]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async, v2: clean the ProtocolV2::epilogue up.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 27 Feb 2019 06:36:34 +0000 (07:36 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 28 Feb 2019 20:42:40 +0000 (21:42 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/msg/async/ProtocolV2.cc
src/msg/async/ProtocolV2.h

index 1721e05802d775c89d19de001c802d8fc73ccccf..f340054f784aef01dfe8587cce538bc5ef9c7ed2 100644 (file)
@@ -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
index 0fe22fd1263773d3270d20f066482e1c77ee45cf..d40887424d873ab62d27a11110968089055ad9ae 100644 (file)
@@ -113,8 +113,6 @@ public:
                                  ceph::msgr::v2::MAX_NUM_SEGMENTS> rx_segments_desc;
   boost::container::static_vector<ceph::bufferlist,
                                  ceph::msgr::v2::MAX_NUM_SEGMENTS> rx_segments_data;
-
-  ceph::bufferlist epilogue;
 private:
 
   ceph::msgr::v2::Tag sent_tag;