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


The following commit(s) were added to refs/heads/quic-latest by this push:
     new 375fe44  Randomize Connection ID only if needed
375fe44 is described below

commit 375fe44b33f207e1ae6c24df8fe4656ee3c53cb6
Author: Masaori Koshiba <masa...@apache.org>
AuthorDate: Thu Apr 5 14:45:32 2018 +0900

    Randomize Connection ID only if needed
    
    Connection id was rondomized every time when state_handshake reveiced
    QUIC_EVENT_PACKET_WRITE_READY event.
---
 iocore/net/QUICNetVConnection.cc | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 4fcecd3..c57ec91 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -544,15 +544,6 @@ QUICNetVConnection::state_handshake(int event, Event *data)
         this->_switch_to_close_state();
       }
     } else {
-      if (this->get_context() == NET_VCONNECTION_OUT && 
(this->_last_received_packet_type == QUICPacketType::RETRY)) {
-        QUICConnectionId tmp = this->_original_quic_connection_id;
-        this->_original_quic_connection_id.randomize();
-        QUICConDebug("Connection ID %" PRIx64 " has been changed to %" PRIx64, 
static_cast<uint64_t>(tmp),
-                     
static_cast<uint64_t>(this->_original_quic_connection_id));
-
-        
this->_hs_protocol->initialize_key_materials(this->_original_quic_connection_id);
-      }
-
       error = this->_state_common_send_packet();
     }
     // Reschedule WRITE_READY
@@ -1255,6 +1246,16 @@ QUICNetVConnection::_build_packet(ats_unique_buf buf, 
size_t len, bool retransmi
   switch (type) {
   case QUICPacketType::INITIAL:
     ink_assert(this->get_context() == NET_VCONNECTION_OUT);
+
+    if (this->_last_received_packet_type == QUICPacketType::RETRY) {
+      QUICConnectionId tmp = this->_original_quic_connection_id;
+      this->_original_quic_connection_id.randomize();
+      QUICConDebug("Connection ID %" PRIx64 " has been changed to %" PRIx64, 
static_cast<uint64_t>(tmp),
+                   static_cast<uint64_t>(this->_original_quic_connection_id));
+
+      
this->_hs_protocol->initialize_key_materials(this->_original_quic_connection_id);
+    }
+
     packet = 
this->_packet_factory.create_initial_packet(this->_original_quic_connection_id, 
this->largest_acked_packet_number(),
                                                          std::move(buf), len);
     
this->_handshake_handler->handleEvent(QUIC_EVENT_HANDSHAKE_PACKET_WRITE_COMPLETE,
 nullptr);

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

Reply via email to