You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sc...@apache.org on 2018/04/13 01:38:42 UTC

[trafficserver] branch quic-latest updated: QUIC: Adding total offset in Stream Manager

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

scw00 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 fadeb54  QUIC: Adding total offset in Stream Manager
fadeb54 is described below

commit fadeb545dff56497db8cfb7e3a1448ada881698b
Author: scw00 <sc...@apache.org>
AuthorDate: Fri Apr 13 08:31:27 2018 +0800

    QUIC: Adding total offset in Stream Manager
---
 iocore/net/QUICNetVConnection.cc     |  4 +---
 iocore/net/quic/QUICStreamManager.cc | 24 ++++++++++++++----------
 2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 0f33a84..1463056 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -1203,13 +1203,11 @@ QUICNetVConnection::_packetize_frames()
   while (frame) {
     ++frame_count;
     if (frame->type() == QUICFrameType::STREAM) {
-      uint16_t frame_size = frame->size();
-      int ret             = this->_remote_flow_controller->update(this->_stream_manager->total_offset_sent() + frame_size);
+      int ret = this->_remote_flow_controller->update(this->_stream_manager->total_offset_sent());
       Debug("quic_flow_ctrl", "Connection [%" PRIx64 "] [REMOTE] %" PRIu64 "/%" PRIu64,
             static_cast<uint64_t>(this->_quic_connection_id), this->_remote_flow_controller->current_offset(),
             this->_remote_flow_controller->current_limit());
       ink_assert(ret == 0);
-      this->_stream_manager->add_total_offset_sent(frame_size);
     }
     this->_store_frame(buf, len, retransmittable, current_packet_type, std::move(frame));
 
diff --git a/iocore/net/quic/QUICStreamManager.cc b/iocore/net/quic/QUICStreamManager.cc
index 1a04efa..a01ffce 100644
--- a/iocore/net/quic/QUICStreamManager.cc
+++ b/iocore/net/quic/QUICStreamManager.cc
@@ -346,19 +346,23 @@ QUICStreamManager::generate_frame(uint16_t connection_credit, uint16_t maximum_f
   QUICStream *stream = this->_find_stream(STREAM_ID_FOR_HANDSHAKE);
   if (stream) {
     frame = stream->generate_frame(connection_credit, maximum_frame_size);
-    if (frame) {
-      return frame;
-    }
   }
 
-  for (QUICStream *s = this->stream_list.head; s; s = s->link.next) {
-    if (s->id() == STREAM_ID_FOR_HANDSHAKE) {
-      continue;
-    }
-    frame = s->generate_frame(connection_credit, maximum_frame_size);
-    if (frame) {
-      break;
+  if (frame == nullptr) {
+    for (QUICStream *s = this->stream_list.head; s; s = s->link.next) {
+      if (s->id() == STREAM_ID_FOR_HANDSHAKE) {
+        continue;
+      }
+      frame = s->generate_frame(connection_credit, maximum_frame_size);
+      if (frame) {
+        break;
+      }
     }
   }
+
+  if (frame != nullptr && frame->type() == QUICFrameType::STREAM) {
+    this->add_total_offset_sent(frame->size());
+  }
+
   return frame;
 }

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