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/09/04 02:53:04 UTC

[trafficserver] 03/03: Forward limit of local flow controller with the largest reordered stream frame

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 dafca89d479ab5ad411b11ee4338648e34865a55
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Tue Sep 4 11:37:31 2018 +0900

    Forward limit of local flow controller with the largest reordered stream frame
    
    To cover reordering cases. (e.g. QUICStream Unit Test Section "QUICStream_flow_control_local")
---
 iocore/net/quic/QUICStream.cc | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index 3b545db..564e6b5 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -319,21 +319,25 @@ QUICStream::recv(const QUICStreamFrame &frame)
     return error;
   }
 
-  auto new_frame = this->_received_stream_frame_buffer.pop();
+  auto new_frame                   = this->_received_stream_frame_buffer.pop();
+  QUICStreamFrameSPtr stream_frame = nullptr;
 
   while (new_frame != nullptr) {
-    QUICStreamFrameSPtr stream_frame = std::static_pointer_cast<const QUICStreamFrame>(new_frame);
+    stream_frame = std::static_pointer_cast<const QUICStreamFrame>(new_frame);
 
     this->_write_to_read_vio(stream_frame->offset(), stream_frame->data(), stream_frame->data_length(),
                              stream_frame->has_fin_flag());
+    this->_state.update_with_receiving_frame(*new_frame);
+
+    new_frame = this->_received_stream_frame_buffer.pop();
+  }
 
+  // Forward limit of local flow controller with the largest reordered stream frame
+  if (stream_frame) {
     this->_reordered_bytes = stream_frame->offset() + stream_frame->data_length();
     this->_local_flow_controller.forward_limit(this->_reordered_bytes + this->_flow_control_buffer_size);
     QUICStreamFCDebug("[LOCAL] %" PRIu64 "/%" PRIu64, this->_local_flow_controller.current_offset(),
                       this->_local_flow_controller.current_limit());
-    this->_state.update_with_receiving_frame(*new_frame);
-
-    new_frame = this->_received_stream_frame_buffer.pop();
   }
 
   this->_signal_read_event();