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 306ec30  Fix frame size calculation on splitting STREAM
306ec30 is described below

commit 306ec3059440b493b9ed0aeafb6d0e538e0ed2d6
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Thu Jan 31 20:58:24 2019 +0900

    Fix frame size calculation on splitting STREAM
---
 iocore/net/quic/QUICFrameRetransmitter.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/iocore/net/quic/QUICFrameRetransmitter.cc 
b/iocore/net/quic/QUICFrameRetransmitter.cc
index 7765ccc..02d03a3 100644
--- a/iocore/net/quic/QUICFrameRetransmitter.cc
+++ b/iocore/net/quic/QUICFrameRetransmitter.cc
@@ -110,8 +110,8 @@ 
QUICFrameRetransmitter::_create_stream_frame(QUICFrameInformationUPtr &info, uin
 
   // FIXME MAX_STREAM_FRAME_OVERHEAD is here and there
   // These size calculation should not exist multiple places
-  uint64_t maximmum_data_size = maximum_frame_size - MAX_STREAM_FRAME_OVERHEAD;
-  if (maximmum_data_size > static_cast<uint64_t>(stream_info->block->size())) {
+  uint64_t maximum_data_size = maximum_frame_size - MAX_STREAM_FRAME_OVERHEAD;
+  if (maximum_data_size >= static_cast<uint64_t>(stream_info->block->size())) {
     frame = QUICFrameFactory::create_stream_frame(stream_info->block, 
stream_info->stream_id, stream_info->offset,
                                                   stream_info->has_fin, true, 
true, id, owner);
     ink_assert(frame->size() <= maximum_frame_size);
@@ -121,7 +121,7 @@ 
QUICFrameRetransmitter::_create_stream_frame(QUICFrameInformationUPtr &info, uin
                                                   true, id, owner);
     QUICStreamFrame *stream_frame = static_cast<QUICStreamFrame 
*>(frame.get());
     IOBufferBlock *block          = stream_frame->data();
-    size_t over_length            = stream_frame->size() - maximum_frame_size;
+    size_t over_length            = stream_frame->data_length() - 
maximum_data_size;
     block->_end                   = std::max(block->start(), block->_end - 
over_length);
     if (block->read_avail() == 0) {
       // no payload

Reply via email to