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/08/28 07:16:59 UTC

[trafficserver] branch quic-latest updated (fd58225 -> e1f2f3c)

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

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


    from fd58225  Remove QUICTransportParametersInNewSessionTicket
     new 4e8f6b2  Add APIs to check Stream State by QUICFrameType
     new e1f2f3c  Refacoring QUICStream::generate_frame()

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 iocore/net/quic/QUICApplication.cc           |   2 +-
 iocore/net/quic/QUICStream.cc                | 104 ++++++++++++++++-----------
 iocore/net/quic/QUICStreamState.cc           |  40 +++++++++--
 iocore/net/quic/QUICStreamState.h            |   8 +++
 iocore/net/quic/test/test_QUICStream.cc      |  12 ++--
 iocore/net/quic/test/test_QUICStreamState.cc | 101 ++++++++++++++++----------
 6 files changed, 173 insertions(+), 94 deletions(-)


[trafficserver] 01/02: Add APIs to check Stream State by QUICFrameType

Posted by ma...@apache.org.
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

commit 4e8f6b216a17dc24ef231d208b99b03d0cfa3457
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Tue Aug 28 15:34:20 2018 +0900

    Add APIs to check Stream State by QUICFrameType
---
 iocore/net/quic/QUICStreamState.cc           |  40 +++++++++--
 iocore/net/quic/QUICStreamState.h            |   8 +++
 iocore/net/quic/test/test_QUICStreamState.cc | 101 ++++++++++++++++-----------
 3 files changed, 105 insertions(+), 44 deletions(-)

diff --git a/iocore/net/quic/QUICStreamState.cc b/iocore/net/quic/QUICStreamState.cc
index a3605d9..df328b1 100644
--- a/iocore/net/quic/QUICStreamState.cc
+++ b/iocore/net/quic/QUICStreamState.cc
@@ -37,8 +37,12 @@ QUICStreamState::_set_state(State s)
 bool
 QUICReceiveStreamState::is_allowed_to_send(const QUICFrame &frame) const
 {
-  QUICFrameType type = frame.type();
+  return this->is_allowed_to_send(frame.type());
+}
 
+bool
+QUICReceiveStreamState::is_allowed_to_send(QUICFrameType type) const
+{
   // Return true or break out the switch to return false
   switch (this->get()) {
   case State::_Init:
@@ -96,8 +100,12 @@ QUICReceiveStreamState::is_allowed_to_send(const QUICFrame &frame) const
 bool
 QUICReceiveStreamState::is_allowed_to_receive(const QUICFrame &frame) const
 {
-  QUICFrameType type = frame.type();
+  return this->is_allowed_to_receive(frame.type());
+}
 
+bool
+QUICReceiveStreamState::is_allowed_to_receive(QUICFrameType type) const
+{
   // Return true or break out the switch to return false
   switch (this->get()) {
   case State::_Init:
@@ -216,8 +224,12 @@ QUICReceiveStreamState::update(const QUICStreamState &opposite_side)
 bool
 QUICSendStreamState::is_allowed_to_send(const QUICFrame &frame) const
 {
-  QUICFrameType type = frame.type();
+  return this->is_allowed_to_send(frame.type());
+}
 
+bool
+QUICSendStreamState::is_allowed_to_send(QUICFrameType type) const
+{
   switch (this->get()) {
   case State::_Init:
     break;
@@ -255,6 +267,12 @@ QUICSendStreamState::is_allowed_to_send(const QUICFrame &frame) const
 bool
 QUICSendStreamState::is_allowed_to_receive(const QUICFrame &frame) const
 {
+  return this->is_allowed_to_receive(frame.type());
+}
+
+bool
+QUICSendStreamState::is_allowed_to_receive(QUICFrameType type) const
+{
   return false;
 }
 
@@ -393,11 +411,23 @@ QUICBidirectionalStreamState::update_with_receiving_frame(const QUICFrame &frame
 bool
 QUICBidirectionalStreamState::is_allowed_to_send(const QUICFrame &frame) const
 {
-  return this->_send_stream_state.is_allowed_to_send(frame) || this->_recv_stream_state.is_allowed_to_send(frame);
+  return this->is_allowed_to_send(frame.type());
+}
+
+bool
+QUICBidirectionalStreamState::is_allowed_to_send(QUICFrameType type) const
+{
+  return this->_send_stream_state.is_allowed_to_send(type) || this->_recv_stream_state.is_allowed_to_send(type);
 }
 
 bool
 QUICBidirectionalStreamState::is_allowed_to_receive(const QUICFrame &frame) const
 {
-  return this->_send_stream_state.is_allowed_to_receive(frame) || this->_recv_stream_state.is_allowed_to_receive(frame);
+  return this->is_allowed_to_receive(frame.type());
+}
+
+bool
+QUICBidirectionalStreamState::is_allowed_to_receive(QUICFrameType type) const
+{
+  return this->_send_stream_state.is_allowed_to_receive(type) || this->_recv_stream_state.is_allowed_to_receive(type);
 }
diff --git a/iocore/net/quic/QUICStreamState.h b/iocore/net/quic/QUICStreamState.h
index 7d3bcfc..1179a48 100644
--- a/iocore/net/quic/QUICStreamState.h
+++ b/iocore/net/quic/QUICStreamState.h
@@ -65,7 +65,9 @@ public:
   virtual void update_with_sending_frame(const QUICFrame &frame)   = 0;
   virtual void update_with_receiving_frame(const QUICFrame &frame) = 0;
 
+  virtual bool is_allowed_to_send(QUICFrameType type) const        = 0;
   virtual bool is_allowed_to_send(const QUICFrame &frame) const    = 0;
+  virtual bool is_allowed_to_receive(QUICFrameType type) const     = 0;
   virtual bool is_allowed_to_receive(const QUICFrame &frame) const = 0;
 
 protected:
@@ -101,7 +103,9 @@ public:
   void update_with_receiving_frame(const QUICFrame &frame) override;
   void update(const QUICStreamState &opposite_side) override;
 
+  bool is_allowed_to_send(QUICFrameType type) const override;
   bool is_allowed_to_send(const QUICFrame &frame) const override;
+  bool is_allowed_to_receive(QUICFrameType type) const override;
   bool is_allowed_to_receive(const QUICFrame &frame) const override;
 };
 
@@ -117,7 +121,9 @@ public:
   void update_with_receiving_frame(const QUICFrame &frame) override;
   void update(const QUICStreamState &opposite_side) override;
 
+  bool is_allowed_to_send(QUICFrameType type) const override;
   bool is_allowed_to_send(const QUICFrame &frame) const override;
+  bool is_allowed_to_receive(QUICFrameType type) const override;
   bool is_allowed_to_receive(const QUICFrame &frame) const override;
 };
 
@@ -135,7 +141,9 @@ public:
   void update_with_sending_frame(const QUICFrame &frame) override;
   void update_with_receiving_frame(const QUICFrame &frame) override;
 
+  bool is_allowed_to_send(QUICFrameType type) const override;
   bool is_allowed_to_send(const QUICFrame &frame) const override;
+  bool is_allowed_to_receive(QUICFrameType type) const override;
   bool is_allowed_to_receive(const QUICFrame &frame) const override;
 
 private:
diff --git a/iocore/net/quic/test/test_QUICStreamState.cc b/iocore/net/quic/test/test_QUICStreamState.cc
index 875072a..7c4d1d6 100644
--- a/iocore/net/quic/test/test_QUICStreamState.cc
+++ b/iocore/net/quic/test/test_QUICStreamState.cc
@@ -29,6 +29,7 @@
 #include "quic/QUICStreamState.h"
 #include "quic/Mock.h"
 
+// Unidirectional (sending)
 TEST_CASE("QUICSendStreamState", "[quic]")
 {
   auto stream_frame          = QUICFrameFactory::create_stream_frame(reinterpret_cast<const uint8_t *>("foo"), 4, 1, 0);
@@ -36,64 +37,86 @@ TEST_CASE("QUICSendStreamState", "[quic]")
   auto rst_stream_frame      = QUICFrameFactory::create_rst_stream_frame(0, static_cast<QUICAppErrorCode>(0x01), 0);
   auto stream_blocked_frame  = QUICFrameFactory::create_stream_blocked_frame(0, 0);
 
-  SECTION("_Init")
+  SECTION("Ready -> Send -> Data Sent")
   {
     // Case1. Create Stream (Sending)
-    QUICSendStreamState ss1(nullptr, nullptr);
-    CHECK(ss1.get() == QUICStreamState::State::Ready);
+    QUICSendStreamState ss(nullptr, nullptr);
+    CHECK(ss.get() == QUICStreamState::State::Ready);
 
     // Case2. Send STREAM
-    QUICSendStreamState ss2(nullptr, nullptr);
-    ss2.update_with_sending_frame(*stream_frame);
-    CHECK(ss2.get() == QUICStreamState::State::Send);
-
-    // Case3. Send RST_STREAM
-    QUICSendStreamState ss3(nullptr, nullptr);
-    ss3.update_with_sending_frame(*rst_stream_frame);
-    CHECK(ss3.get() == QUICStreamState::State::ResetSent);
-
-    // Case4. Send FIN in a STREAM
-    QUICSendStreamState ss4(nullptr, nullptr);
-    ss4.update_with_sending_frame(*stream_frame_with_fin);
-    CHECK(ss4.get() == QUICStreamState::State::DataSent);
+    CHECK(ss.is_allowed_to_send(QUICFrameType::STREAM));
+    ss.update_with_sending_frame(*stream_frame);
+    CHECK(ss.get() == QUICStreamState::State::Send);
+
+    // Case3. Send STREAM_BLOCKED
+    CHECK(ss.is_allowed_to_send(QUICFrameType::STREAM_BLOCKED));
+    ss.update_with_sending_frame(*stream_blocked_frame);
+    CHECK(ss.get() == QUICStreamState::State::Send);
+
+    // Case3. Send FIN in a STREAM
+    CHECK(ss.is_allowed_to_send(QUICFrameType::STREAM));
+    ss.update_with_sending_frame(*stream_frame_with_fin);
+    CHECK(ss.get() == QUICStreamState::State::DataSent);
+
+    // Case4. STREAM is not allowed to send
+    CHECK(!ss.is_allowed_to_send(QUICFrameType::STREAM));
+  }
+
+  SECTION("Ready -> Reset Sent")
+  {
+    // Case1. Create Stream (Sending)
+    QUICSendStreamState ss(nullptr, nullptr);
+    CHECK(ss.get() == QUICStreamState::State::Ready);
+
+    // Case2. Send RST_STREAM
+    CHECK(ss.is_allowed_to_send(QUICFrameType::RST_STREAM));
+    ss.update_with_sending_frame(*rst_stream_frame);
+    CHECK(ss.get() == QUICStreamState::State::ResetSent);
   }
 }
 
+// Unidirectional (receiving)
 TEST_CASE("QUICReceiveStreamState", "[quic]")
 {
   auto stream_frame          = QUICFrameFactory::create_stream_frame(reinterpret_cast<const uint8_t *>("foo"), 4, 1, 0);
   auto stream_frame_with_fin = QUICFrameFactory::create_stream_frame(reinterpret_cast<const uint8_t *>("bar"), 4, 1, 0, true);
   auto rst_stream_frame      = QUICFrameFactory::create_rst_stream_frame(0, static_cast<QUICAppErrorCode>(0x01), 0);
-  auto max_stream_data_frame = QUICFrameFactory::create_max_stream_data_frame(0, 0);
   auto stream_blocked_frame  = QUICFrameFactory::create_stream_blocked_frame(0, 0);
 
-  SECTION("_Init")
+  SECTION("Recv -> Size Known -> Data Recvd")
   {
     MockQUICTransferProgressProvider in_progress;
 
     // Case1. Recv STREAM
-    QUICReceiveStreamState ss1(&in_progress, nullptr);
-    ss1.update_with_receiving_frame(*stream_frame);
-    CHECK(ss1.get() == QUICStreamState::State::Recv);
+    QUICReceiveStreamState ss(&in_progress, nullptr);
+    CHECK(ss.is_allowed_to_receive(QUICFrameType::STREAM));
+    ss.update_with_receiving_frame(*stream_frame);
+    CHECK(ss.get() == QUICStreamState::State::Recv);
 
     // Case2. Recv STREAM_BLOCKED
-    QUICReceiveStreamState ss2(&in_progress, nullptr);
-    ss2.update_with_receiving_frame(*stream_blocked_frame);
-    CHECK(ss2.get() == QUICStreamState::State::Recv);
-
-    // Case3. Recv RST_STREAM
-    QUICReceiveStreamState ss3(&in_progress, nullptr);
-    ss3.update_with_receiving_frame(*rst_stream_frame);
-    CHECK(ss3.get() == QUICStreamState::State::ResetRecvd);
-
-    // Case4. Recv MAX_STREAM_DATA
-    QUICReceiveStreamState ss4(&in_progress, nullptr);
-    ss4.update_with_receiving_frame(*max_stream_data_frame);
-    CHECK(ss4.get() == QUICStreamState::State::Recv);
-
-    // Case5. Recv FIN in a STREAM
-    QUICReceiveStreamState ss5(&in_progress, nullptr);
-    ss5.update_with_receiving_frame(*stream_frame_with_fin);
-    CHECK(ss5.get() == QUICStreamState::State::SizeKnown);
+    CHECK(ss.is_allowed_to_receive(QUICFrameType::STREAM_BLOCKED));
+    ss.update_with_receiving_frame(*stream_blocked_frame);
+    CHECK(ss.get() == QUICStreamState::State::Recv);
+
+    // Case3. Recv FIN in a STREAM
+    CHECK(ss.is_allowed_to_receive(QUICFrameType::STREAM));
+    ss.update_with_receiving_frame(*stream_frame_with_fin);
+    CHECK(ss.get() == QUICStreamState::State::SizeKnown);
+  }
+
+  SECTION("Recv -> Reset Recvd")
+  {
+    MockQUICTransferProgressProvider in_progress;
+
+    // Case1. Recv STREAM
+    QUICReceiveStreamState ss(&in_progress, nullptr);
+    CHECK(ss.is_allowed_to_receive(QUICFrameType::STREAM));
+    ss.update_with_receiving_frame(*stream_frame);
+    CHECK(ss.get() == QUICStreamState::State::Recv);
+
+    // Case2. Recv RST_STREAM
+    CHECK(ss.is_allowed_to_receive(QUICFrameType::RST_STREAM));
+    ss.update_with_receiving_frame(*rst_stream_frame);
+    CHECK(ss.get() == QUICStreamState::State::ResetRecvd);
   }
 }


[trafficserver] 02/02: Refacoring QUICStream::generate_frame()

Posted by ma...@apache.org.
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

commit e1f2f3c79e9619d666a9b7305cfac0e071ab4b97
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Tue Aug 28 16:14:23 2018 +0900

    Refacoring QUICStream::generate_frame()
---
 iocore/net/quic/QUICApplication.cc      |   2 +-
 iocore/net/quic/QUICStream.cc           | 104 +++++++++++++++++++-------------
 iocore/net/quic/test/test_QUICStream.cc |  12 ++--
 3 files changed, 68 insertions(+), 50 deletions(-)

diff --git a/iocore/net/quic/QUICApplication.cc b/iocore/net/quic/QUICApplication.cc
index 1d77135..f4d09a4 100644
--- a/iocore/net/quic/QUICApplication.cc
+++ b/iocore/net/quic/QUICApplication.cc
@@ -63,7 +63,7 @@ QUICStreamIO::read(uint8_t *buf, int64_t len)
 {
   if (is_debug_tag_set(tag_stream_io)) {
     if (this->_read_vio->nbytes == INT64_MAX) {
-      QUICStreamIODebug("nbytes=-" PRId64 " ndone=%" PRId64 " read_avail=%" PRId64 " read_len=%" PRId64, this->_read_vio->ndone,
+      QUICStreamIODebug("nbytes=- ndone=%" PRId64 " read_avail=%" PRId64 " read_len=%" PRId64, this->_read_vio->ndone,
                         this->_read_buffer_reader->read_avail(), len);
     } else {
       QUICStreamIODebug("nbytes=%" PRId64 " ndone=%" PRId64 " read_avail=%" PRId64 " read_len=%" PRId64, this->_read_vio->nbytes,
diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index 37f1130..18f3f73 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -391,80 +391,98 @@ QUICStream::generate_frame(QUICEncryptionLevel level, uint64_t connection_credit
 {
   SCOPED_MUTEX_LOCK(lock, this->_write_vio.mutex, this_ethread());
 
-  QUICErrorUPtr error = std::unique_ptr<QUICError>(new QUICNoError());
-
+  // RST_STREAM
   if (this->_reset_reason) {
     return QUICFrameFactory::create_rst_stream_frame(std::move(this->_reset_reason));
   }
 
   QUICFrameUPtr frame = QUICFrameFactory::create_null_frame();
-  frame               = this->_local_flow_controller.generate_frame(level, connection_credit, maximum_frame_size);
+
+  // MAX_STREAM_DATA
+  frame = this->_local_flow_controller.generate_frame(level, UINT16_MAX, maximum_frame_size);
   if (frame) {
     return frame;
   }
 
-  if (connection_credit == 0) {
+  if (!this->_state.is_allowed_to_send(QUICFrameType::STREAM)) {
     return frame;
   }
 
+  uint64_t maximum_data_size = 0;
   if (maximum_frame_size <= MAX_STREAM_FRAME_OVERHEAD) {
     return frame;
   }
+  maximum_data_size = maximum_frame_size - MAX_STREAM_FRAME_OVERHEAD;
 
-  IOBufferReader *reader = this->_write_vio.get_reader();
-  int64_t bytes_avail    = reader->read_avail();
-  if (bytes_avail == 0) {
-    return frame;
+  bool pure_fin = false;
+  bool fin      = false;
+  if ((this->_write_vio.nbytes != 0 || this->_write_vio.nbytes != INT64_MAX) &&
+      this->_write_vio.nbytes == static_cast<int64_t>(this->_send_offset)) {
+    // Pure FIN stream should be sent regardless status of remote flow controller, because the length is zero.
+    pure_fin = true;
+    fin      = true;
   }
 
-  // STREAM_BLOCKED
-  uint64_t stream_credit = this->_remote_flow_controller.credit();
-  // The `bytes_avail` should be also checked before calling QUICRemoteFlowController::generate_frame(), but we don't need it.
-  // Because it's already checked in above.
-  if (stream_credit == 0) {
-    frame = this->_remote_flow_controller.generate_frame(level, connection_credit, maximum_frame_size);
-    if (frame) {
+  uint64_t len           = 0;
+  IOBufferReader *reader = this->_write_vio.get_reader();
+  if (!pure_fin) {
+    uint64_t data_len = reader->block_read_avail();
+    if (data_len == 0) {
       return frame;
     }
-  }
 
-  int64_t data_len = reader->block_read_avail();
-  int64_t len      = 0;
-  bool fin         = false;
+    // Check Connection/Stream level credit only if the generating STREAM frame is not pure fin
+    uint64_t stream_credit = this->_remote_flow_controller.credit();
+    if (stream_credit == 0) {
+      // STREAM_BLOCKED
+      frame = this->_remote_flow_controller.generate_frame(level, UINT16_MAX, maximum_frame_size);
+      return frame;
+    }
 
-  len = std::min(data_len, static_cast<int64_t>(std::min(static_cast<uint64_t>(maximum_frame_size - MAX_STREAM_FRAME_OVERHEAD),
-                                                         std::min(stream_credit, static_cast<uint64_t>(connection_credit)))));
+    if (connection_credit == 0) {
+      // BLOCKED - BLOCKED frame will be sent by connection level remote flow controller
+      return frame;
+    }
 
-  if (this->_write_vio.nbytes == static_cast<int64_t>(this->_send_offset + len)) {
-    fin = true;
-  }
+    len = std::min(data_len, std::min(maximum_data_size, std::min(stream_credit, connection_credit)));
 
-  if (len > 0) {
-    frame = QUICFrameFactory::create_stream_frame(reinterpret_cast<const uint8_t *>(reader->start()), len, this->_id,
-                                                  this->_send_offset, fin, true);
-    if (!this->_state.is_allowed_to_send(*frame)) {
-      QUICStreamDebug("Canceled sending %s frame due to the stream state", QUICDebugNames::frame_type(frame->type()));
-      return frame;
+    // data_len, maximum_data_size, stream_credit and connection_credit are already checked they're larger than 0
+    ink_assert(len != 0);
+
+    if (this->_write_vio.nbytes == static_cast<int64_t>(this->_send_offset + len)) {
+      fin = true;
     }
-  } else {
-    len = bytes_avail;
   }
 
-  int ret = this->_remote_flow_controller.update(this->_send_offset + len);
-  // We cannot cancel sending the frame after updating the flow controller
+  // STREAM - Pure FIN or data length is lager than 0
+  frame = QUICFrameFactory::create_stream_frame(reinterpret_cast<const uint8_t *>(reader->start()), len, this->_id,
+                                                this->_send_offset, fin, true);
+  if (!this->_state.is_allowed_to_send(*frame)) {
+    QUICStreamDebug("Canceled sending %s frame due to the stream state", QUICDebugNames::frame_type(frame->type()));
+    return frame;
+  }
+
+  if (!pure_fin) {
+    int ret = this->_remote_flow_controller.update(this->_send_offset + len);
+    // We cannot cancel sending the frame after updating the flow controller
+
+    // Calling update always success, because len is always less than stream_credit
+    ink_assert(ret == 0);
+
+    QUICStreamFCDebug("[REMOTE] %" PRIu64 "/%" PRIu64, this->_remote_flow_controller.current_offset(),
+                      this->_remote_flow_controller.current_limit());
+    if (this->_remote_flow_controller.current_offset() == this->_remote_flow_controller.current_limit()) {
+      QUICStreamDebug("Flow Controller will block sending a STREAM frame");
+    }
 
-  QUICStreamFCDebug("[REMOTE] %" PRIu64 "/%" PRIu64, this->_remote_flow_controller.current_offset(),
-                    this->_remote_flow_controller.current_limit());
-  if (frame && ret == 0) {
-    this->_send_offset += len;
     reader->consume(len);
+    this->_send_offset += len;
     this->_write_vio.ndone += len;
-    this->_signal_write_event();
-    this->_state.update_with_sending_frame(*frame);
-  } else if (ret != 0) {
-    QUICStreamDebug("Flow Controller blocked sending a STREAM frame");
-    frame = this->_remote_flow_controller.generate_frame(level, connection_credit, maximum_frame_size);
   }
+
+  this->_signal_write_event();
+  this->_state.update_with_sending_frame(*frame);
+
   return frame;
 }
 
diff --git a/iocore/net/quic/test/test_QUICStream.cc b/iocore/net/quic/test/test_QUICStream.cc
index a5a0eec..535b89b 100644
--- a/iocore/net/quic/test/test_QUICStream.cc
+++ b/iocore/net/quic/test/test_QUICStream.cc
@@ -71,7 +71,7 @@ TEST_CASE("QUICStream", "[quic]")
 
     std::unique_ptr<QUICStream> stream(
       new QUICStream(new MockQUICRTTProvider(), new MockQUICConnectionInfoProvider(), stream_id, 1024, 1024));
-    stream->do_io_read(nullptr, 0, read_buffer);
+    stream->do_io_read(nullptr, INT64_MAX, read_buffer);
 
     stream->recv(*frame_1);
     stream->recv(*frame_2);
@@ -97,7 +97,7 @@ TEST_CASE("QUICStream", "[quic]")
 
     std::unique_ptr<QUICStream> stream(
       new QUICStream(new MockQUICRTTProvider(), new MockQUICConnectionInfoProvider(), stream_id, UINT64_MAX, UINT64_MAX));
-    stream->do_io_read(nullptr, 0, read_buffer);
+    stream->do_io_read(nullptr, INT64_MAX, read_buffer);
 
     stream->recv(*frame_8);
     stream->recv(*frame_7);
@@ -123,7 +123,7 @@ TEST_CASE("QUICStream", "[quic]")
 
     std::unique_ptr<QUICStream> stream(
       new QUICStream(new MockQUICRTTProvider(), new MockQUICConnectionInfoProvider(), stream_id, UINT64_MAX, UINT64_MAX));
-    stream->do_io_read(nullptr, 0, read_buffer);
+    stream->do_io_read(nullptr, INT64_MAX, read_buffer);
 
     stream->recv(*frame_8);
     stream->recv(*frame_7);
@@ -153,7 +153,7 @@ TEST_CASE("QUICStream", "[quic]")
 
     std::unique_ptr<QUICStream> stream(new QUICStream(new MockQUICRTTProvider(), new MockQUICConnectionInfoProvider(), stream_id));
     stream->init_flow_control_params(4096, 4096);
-    stream->do_io_read(nullptr, 0, read_buffer);
+    stream->do_io_read(nullptr, INT64_MAX, read_buffer);
 
     // Start with 1024 but not 0 so received frames won't be processed
     error = stream->recv(*std::make_shared<QUICStreamFrame>(ats_unique_malloc(1024), 1024, stream_id, 1024));
@@ -190,8 +190,8 @@ TEST_CASE("QUICStream", "[quic]")
     std::unique_ptr<QUICStream> stream(new QUICStream(new MockQUICRTTProvider(), new MockQUICConnectionInfoProvider(), stream_id));
     stream->init_flow_control_params(4096, 4096);
     MockContinuation mock_cont(stream->mutex);
-    stream->do_io_read(nullptr, 0, read_buffer);
-    stream->do_io_write(&mock_cont, 0, write_buffer_reader);
+    stream->do_io_read(nullptr, INT64_MAX, read_buffer);
+    stream->do_io_write(&mock_cont, INT64_MAX, write_buffer_reader);
 
     QUICEncryptionLevel level = QUICEncryptionLevel::ONE_RTT;