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/22 01:37:47 UTC

[trafficserver] 01/03: Add sageguard on sending packet

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 90e21a372a1a1620b1e53f82be3719662a56916a
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Mon Aug 20 14:32:19 2018 +0900

    Add sageguard on sending packet
---
 iocore/net/QUICNetVConnection.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 6b92aed..87b5ed1 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -63,6 +63,7 @@ static constexpr uint32_t MAX_STREAM_FRAME_OVERHEAD = 24;
 // static constexpr uint32_t MAX_CRYPTO_FRAME_OVERHEAD   = 16;
 static constexpr uint32_t MINIMUM_INITIAL_PACKET_SIZE = 1200;
 static constexpr ink_hrtime WRITE_READY_INTERVAL      = HRTIME_MSECONDS(20);
+static constexpr uint32_t PACKET_PRE_EVENT            = 32;
 
 static constexpr uint32_t MAX_PACKETS_WITHOUT_SRC_ADDR_VARIDATION = 3;
 
@@ -1082,8 +1083,7 @@ QUICNetVConnection::_state_common_send_packet()
 {
   uint32_t packet_count = 0;
   uint32_t error        = 0;
-  while (error == 0) {
-    // TODO: add safeguard like FRAME_PER_EVENT
+  while (error == 0 && packet_count < PACKET_PRE_EVENT) {
     uint32_t window = this->_congestion_controller->open_window();
 
     if (window == 0) {