This is an automated email from the ASF dual-hosted git repository.

maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new 50bab2e  Do nothing if retransmission_frames is empty
50bab2e is described below

commit 50bab2eb5288f496b5fabd7c58be9ff34227d5f1
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Tue May 29 12:24:35 2018 +0900

    Do nothing if retransmission_frames is empty
---
 iocore/net/quic/QUICPacketRetransmitter.cc | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/iocore/net/quic/QUICPacketRetransmitter.cc 
b/iocore/net/quic/QUICPacketRetransmitter.cc
index 8951f07..be4c97d 100644
--- a/iocore/net/quic/QUICPacketRetransmitter.cc
+++ b/iocore/net/quic/QUICPacketRetransmitter.cc
@@ -67,19 +67,17 @@ QUICPacketRetransmitter::generate_frame(uint16_t 
connection_credit, uint16_t max
   if (!this->_retransmission_frames.empty()) {
     frame = std::move(this->_retransmission_frames.front());
     this->_retransmission_frames.pop();
-  }
-
-  if (maximum_frame_size >= frame->size()) {
-    return frame;
-  }
 
-  auto new_frame = QUICFrameFactory::split_frame(frame.get(), 
maximum_frame_size);
-  if (new_frame) {
-    this->_retransmission_frames.push(std::move(new_frame));
-    return frame;
+    if (maximum_frame_size < frame->size()) {
+      auto new_frame = QUICFrameFactory::split_frame(frame.get(), 
maximum_frame_size);
+      if (new_frame) {
+        this->_retransmission_frames.push(std::move(new_frame));
+      } else {
+        // failed to split frame return nullptr
+        this->_retransmission_frames.push(std::move(frame));
+        frame = QUICFrameFactory::create_null_frame();
+      }
+    }
   }
-
-  // failed to split frame return nullptr
-  this->_retransmission_frames.push(std::move(frame));
-  return QUICFrameFactory::create_null_frame();
+  return frame;
 }

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to