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/02/27 07:58:06 UTC

[trafficserver] branch quic-latest updated: QUIC: Ensure only first initial packet could enter QVC::acceptEvent

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 4f68ac7  QUIC: Ensure only first initial packet could enter QVC::acceptEvent
4f68ac7 is described below

commit 4f68ac7e5f293e2bd1afa9af3bad79b22028e817
Author: scw00 <sc...@apache.org>
AuthorDate: Tue Feb 27 13:53:01 2018 +0800

    QUIC: Ensure only first initial packet could enter QVC::acceptEvent
---
 iocore/net/QUICNet.cc           | 10 ++++++----
 iocore/net/QUICPacketHandler.cc |  1 -
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/iocore/net/QUICNet.cc b/iocore/net/QUICNet.cc
index 68bcc9e..e153c35 100644
--- a/iocore/net/QUICNet.cc
+++ b/iocore/net/QUICNet.cc
@@ -73,10 +73,12 @@ QUICPollCont::_process_long_header_packet(QUICPollEvent *e, NetHandler *nh)
   ptype = static_cast<QUICPacketType>(buf[0] & 0x7f);
   switch (ptype) {
   case QUICPacketType::INITIAL:
-    vc->read.triggered = 1;
-    vc->handle_received_packet(p);
-    this->mutex->thread_holding->schedule_imm(vc, QUIC_EVENT_PACKET_READ_READY);
-    return;
+    if (!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;
diff --git a/iocore/net/QUICPacketHandler.cc b/iocore/net/QUICPacketHandler.cc
index 0526a9c..49ae711 100644
--- a/iocore/net/QUICPacketHandler.cc
+++ b/iocore/net/QUICPacketHandler.cc
@@ -213,7 +213,6 @@ QUICPacketHandlerIn::_recv_packet(int event, UDPPacket *udp_packet)
     vc->action_     = *this->action_;
     vc->set_is_transparent(this->opt.f_inbound_transparent);
     vc->set_context(NET_VCONNECTION_IN);
-    vc->read.triggered = 1;
     vc->start(this->_ssl_ctx);
     vc->options.ip_proto  = NetVCOptions::USE_UDP;
     vc->options.ip_family = udp_packet->from.sa.sa_family;

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