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/03/19 14:18:26 UTC

[trafficserver] branch quic-latest updated: Fix Version Negotiation

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

maskit 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 05f30d5  Fix Version Negotiation
05f30d5 is described below

commit 05f30d5785544ca2d3168a8cc65cfaf62d501311
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Mon Mar 19 23:17:36 2018 +0900

    Fix Version Negotiation
    
    Fixes #3305
---
 iocore/net/QUICNet.cc | 51 +++++++++++++++++++--------------------------------
 1 file changed, 19 insertions(+), 32 deletions(-)

diff --git a/iocore/net/QUICNet.cc b/iocore/net/QUICNet.cc
index 14becbe..f73ba26 100644
--- a/iocore/net/QUICNet.cc
+++ b/iocore/net/QUICNet.cc
@@ -56,12 +56,10 @@ QUICPollCont::~QUICPollCont()
 void
 QUICPollCont::_process_long_header_packet(QUICPollEvent *e, NetHandler *nh)
 {
-  uint8_t *buf;
-  QUICPacketType ptype;
   UDPPacketInternal *p = e->packet;
   // FIXME: VC is nullptr ?
   QUICNetVConnection *vc = static_cast<QUICNetVConnection *>(e->con);
-  buf                    = (uint8_t *)p->getIOBlockChain()->buf();
+  uint8_t *buf           = (uint8_t *)p->getIOBlockChain()->buf();
 
   e->free();
   if (!QUICTypeUtil::has_connection_id(reinterpret_cast<const uint8_t *>(buf))) {
@@ -70,38 +68,27 @@ QUICPollCont::_process_long_header_packet(QUICPollEvent *e, NetHandler *nh)
     return;
   }
 
-  ptype = static_cast<QUICPacketType>(buf[0] & 0x7f);
-  switch (ptype) {
-  case QUICPacketType::INITIAL:
-    if (!vc->read.triggered) {
-      vc->read.triggered = 1;
-      vc->handle_received_packet(p);
-      vc->handleEvent(QUIC_EVENT_PACKET_READ_READY, nullptr);
-    } else {
-      p->free();
-    }
+  QUICPacketType ptype = static_cast<QUICPacketType>(buf[0] & 0x7f);
+  if (ptype == QUICPacketType::INITIAL && !vc->read.triggered) {
+    vc->read.triggered = 1;
+    vc->handle_received_packet(p);
+    vc->handleEvent(QUIC_EVENT_PACKET_READ_READY, nullptr);
     return;
-  case QUICPacketType::ZERO_RTT_PROTECTED:
-  // TODO:: do something ?
-  // break;
-  case QUICPacketType::HANDSHAKE:
-  default:
-    // Just Pass Through
-    if (vc) {
-      vc->read.triggered = 1;
-      vc->handle_received_packet(p);
-    } else {
-      this->_longInQueue.push(p);
-    }
+  }
+
+  if (vc) {
+    vc->read.triggered = 1;
+    vc->handle_received_packet(p);
+  } else {
+    this->_longInQueue.push(p);
+  }
 
-    // Push QUICNetVC into nethandler's enabled list
-    if (vc != nullptr) {
-      int isin = ink_atomic_swap(&vc->read.in_enabled_list, 1);
-      if (!isin) {
-        nh->read_enable_list.push(vc);
-      }
+  // Push QUICNetVC into nethandler's enabled list
+  if (vc != nullptr) {
+    int isin = ink_atomic_swap(&vc->read.in_enabled_list, 1);
+    if (!isin) {
+      nh->read_enable_list.push(vc);
     }
-    break;
   }
 }
 

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