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 c3d89e4  maximum_frame_size is for STREAM data size
c3d89e4 is described below

commit c3d89e4e5299d29be1049ed9a3725f998ac8077a
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Fri Jun 1 22:34:42 2018 +0900

    maximum_frame_size is for STREAM data size
---
 iocore/net/quic/QUICPacketRetransmitter.cc | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/iocore/net/quic/QUICPacketRetransmitter.cc 
b/iocore/net/quic/QUICPacketRetransmitter.cc
index e1bd163..5fcd4a8 100644
--- a/iocore/net/quic/QUICPacketRetransmitter.cc
+++ b/iocore/net/quic/QUICPacketRetransmitter.cc
@@ -67,7 +67,19 @@ QUICPacketRetransmitter::generate_frame(uint64_t 
connection_credit, uint16_t max
     frame = std::move(this->_retransmission_frames.front());
     this->_retransmission_frames.pop();
 
-    if (maximum_frame_size < frame->size()) {
+    // maximum_frame_size is actually for payload size. So we should compare it
+    // with data_length(). Howeever, because data_length() is STREAM frame
+    // specific, we need a branch here.
+    // See also where maximum_frame_size come from.
+    bool split = false;
+    if (frame->type() == QUICFrameType::STREAM) {
+      QUICStreamFrame *stream_frame = static_cast<QUICStreamFrame 
*>(frame.get());
+      split                         = stream_frame->data_length() > 
maximum_frame_size;
+    } else {
+      split = frame->size() > maximum_frame_size;
+    }
+
+    if (split) {
       auto new_frame = QUICFrameFactory::split_frame(frame.get(), 
maximum_frame_size);
       if (new_frame) {
         this->_retransmission_frames.push(std::move(new_frame));

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

Reply via email to