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/04/05 03:22:02 UTC

[trafficserver] 02/02: Fix QUICHandshake::is_version_negotiated()

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 864da3bde6765bc17943d8654010dd02635bc70c
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Thu Apr 5 12:19:06 2018 +0900

    Fix QUICHandshake::is_version_negotiated()
    
    To do not send ACK frame if VRESION NEGOTIATION packet was sent.
---
 iocore/net/QUICNetVConnection.cc | 7 +++----
 iocore/net/quic/QUICHandshake.cc | 3 ++-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index e55e524..4fcecd3 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -844,13 +844,12 @@ QUICNetVConnection::_state_handshake_process_initial_packet(QUICPacketUPtr packe
 
   // Start handshake
   QUICErrorUPtr error = this->_handshake_handler->start(packet.get(), &this->_packet_factory);
+
+  // If version negotiation was failed and VERSION NEGOTIATION packet was sent, nothing to do.
   if (this->_handshake_handler->is_version_negotiated()) {
     error = this->_recv_and_ack(std::move(packet));
-  } else {
-    // Perhaps response packets for initial packet were lost. Pass packet to _recv_and_ack to send ack to the initial packet.
-    // Stream data will be discarded by offset mismatch.
-    error = this->_recv_and_ack(std::move(packet));
   }
+
   return error;
 }
 
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 94b431e..37ec334 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -186,7 +186,8 @@ QUICHandshake::negotiate_version(const QUICPacket *vn, QUICPacketFactory *packet
 bool
 QUICHandshake::is_version_negotiated() const
 {
-  return (this->_version_negotiator->status() == QUICVersionNegotiationStatus::NEGOTIATED);
+  return (this->_version_negotiator->status() == QUICVersionNegotiationStatus::NEGOTIATED ||
+          this->_version_negotiator->status() == QUICVersionNegotiationStatus::VALIDATED);
 }
 
 bool

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