You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/01/25 03:45:32 UTC

[trafficserver] branch quic-latest updated: Allow empty Stream Data with FIN bit

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

masaori 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 9d47df2  Allow empty Stream Data with FIN bit
9d47df2 is described below

commit 9d47df294e2ea29a33dc91b89be936c6df1b8c27
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Thu Jan 25 14:45:15 2018 +1100

    Allow empty Stream Data with FIN bit
---
 iocore/net/quic/QUICIncomingFrameBuffer.cc           |  2 +-
 iocore/net/quic/test/test_QUICIncomingFrameBuffer.cc | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/iocore/net/quic/QUICIncomingFrameBuffer.cc b/iocore/net/quic/QUICIncomingFrameBuffer.cc
index ba9cc51..a00d6d7 100644
--- a/iocore/net/quic/QUICIncomingFrameBuffer.cc
+++ b/iocore/net/quic/QUICIncomingFrameBuffer.cc
@@ -128,7 +128,7 @@ QUICIncomingFrameBuffer::_check_and_set_fin_flag(QUICOffset offset, size_t len,
 
     this->_fin_offset = offset + len;
 
-    if (this->_max_offset >= this->_fin_offset) {
+    if (this->_max_offset > this->_fin_offset) {
       return QUICErrorUPtr(new QUICStreamError(this->_stream, QUICTransErrorCode::FINAL_OFFSET_ERROR));
     }
 
diff --git a/iocore/net/quic/test/test_QUICIncomingFrameBuffer.cc b/iocore/net/quic/test/test_QUICIncomingFrameBuffer.cc
index 5652ba3..1f6c337 100644
--- a/iocore/net/quic/test/test_QUICIncomingFrameBuffer.cc
+++ b/iocore/net/quic/test/test_QUICIncomingFrameBuffer.cc
@@ -72,6 +72,18 @@ TEST_CASE("QUICIncomingFrameBuffer_fin_offset", "[quic]")
     CHECK(err->trans_error_code == QUICTransErrorCode::FINAL_OFFSET_ERROR);
   }
 
+  SECTION("Pure FIN")
+  {
+    std::shared_ptr<QUICStreamFrame> stream1_frame_0_r = QUICFrameFactory::create_stream_frame(data, 1024, 1, 0);
+    std::shared_ptr<QUICStreamFrame> stream1_frame_1_r = QUICFrameFactory::create_stream_frame(data, 0, 1, 1024, true);
+
+    err = buffer.insert(stream1_frame_0_r);
+    CHECK(err->cls == QUICErrorClass::NONE);
+
+    err = buffer.insert(stream1_frame_1_r);
+    CHECK(err->cls == QUICErrorClass::NONE);
+  }
+
   delete stream;
 }
 

-- 
To stop receiving notification emails like this one, please contact
masaori@apache.org.