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 108c33a  Minor cleanup: rename "Client Initial" to "Initial"
108c33a is described below

commit 108c33a2919cc0a010df11ccbd8cbd60b3750eaf
Author: Masaori Koshiba <[email protected]>
AuthorDate: Mon Apr 2 11:57:09 2018 +0900

    Minor cleanup: rename "Client Initial" to "Initial"
---
 iocore/net/P_QUICNetVConnection.h              |  8 ++++----
 iocore/net/QUICNetVConnection.cc               | 24 ++++++++++++------------
 iocore/net/quic/test/test_QUICPacketFactory.cc | 17 ++++++++---------
 3 files changed, 24 insertions(+), 25 deletions(-)

diff --git a/iocore/net/P_QUICNetVConnection.h 
b/iocore/net/P_QUICNetVConnection.h
index 6b34210..4c08f86 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -109,9 +109,9 @@ class SSLNextProtocolSet;
  * state_handshake()
  *  | READ:
  *  |   _state_handshake_process_packet()
- *  |   _state_handshake_process_initial_client_packet()
+ *  |   _state_handshake_process_initial_packet()
  *  |   _state_handshake_process_retry_packet()
- *  |   _state_handshake_process_client_cleartext_packet()
+ *  |   _state_handshake_process_handshake_packet()
  *  |   _state_handshake_process_zero_rtt_protected_packet()
  *  | WRITE:
  *  |   _state_common_send_packet()
@@ -284,9 +284,9 @@ private:
   QUICErrorUPtr _recv_and_ack(QUICPacketUPtr packet);
 
   QUICErrorUPtr _state_handshake_process_packet(QUICPacketUPtr packet);
-  QUICErrorUPtr _state_handshake_process_initial_client_packet(QUICPacketUPtr 
packet);
+  QUICErrorUPtr _state_handshake_process_initial_packet(QUICPacketUPtr packet);
   QUICErrorUPtr _state_handshake_process_retry_packet(QUICPacketUPtr packet);
-  QUICErrorUPtr 
_state_handshake_process_client_cleartext_packet(QUICPacketUPtr packet);
+  QUICErrorUPtr _state_handshake_process_handshake_packet(QUICPacketUPtr 
packet);
   QUICErrorUPtr 
_state_handshake_process_zero_rtt_protected_packet(QUICPacketUPtr packet);
   QUICErrorUPtr _state_connection_established_process_packet(QUICPacketUPtr 
packet);
   QUICErrorUPtr _state_common_receive_packet();
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 3f6d80d..21bbcc1 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -53,11 +53,11 @@
   Debug("quic_net", "[%" PRIx64 "] " fmt, 
static_cast<uint64_t>(this->_quic_connection_id), ##__VA_ARGS__); \
   Error("quic_net [%" PRIx64 "] " fmt, 
static_cast<uint64_t>(this->_quic_connection_id), ##__VA_ARGS__)
 
-static constexpr uint32_t MAX_PACKET_OVERHEAD                = 17; // Max long 
header len(17)
-static constexpr uint32_t MAX_STREAM_FRAME_OVERHEAD          = 15;
-static constexpr uint32_t MINIMUM_INITIAL_CLIENT_PACKET_SIZE = 1200;
-static constexpr ink_hrtime WRITE_READY_INTERVAL             = 
HRTIME_MSECONDS(20);
-static constexpr int FRAME_PER_EVENT                         = 64;
+static constexpr uint32_t MAX_PACKET_OVERHEAD         = 17; // Max long header 
len(17)
+static constexpr uint32_t MAX_STREAM_FRAME_OVERHEAD   = 15;
+static constexpr uint32_t MINIMUM_INITIAL_PACKET_SIZE = 1200;
+static constexpr ink_hrtime WRITE_READY_INTERVAL      = HRTIME_MSECONDS(20);
+static constexpr int FRAME_PER_EVENT                  = 64;
 
 ClassAllocator<QUICNetVConnection> quicNetVCAllocator("quicNetVCAllocator");
 
@@ -335,7 +335,7 @@ QUICNetVConnection::minimum_quic_packet_size()
 {
   if (netvc_context == NET_VCONNECTION_OUT) {
     // FIXME Only the first packet need to be 1200 bytes at least
-    return MINIMUM_INITIAL_CLIENT_PACKET_SIZE;
+    return MINIMUM_INITIAL_PACKET_SIZE;
   } else {
     // FIXME This size should be configurable and should have some randomness
     // This is just for providing protection against packet analysis for 
protected packets
@@ -775,13 +775,13 @@ 
QUICNetVConnection::_state_handshake_process_packet(QUICPacketUPtr packet)
   QUICErrorUPtr error = QUICErrorUPtr(new QUICNoError());
   switch (packet->type()) {
   case QUICPacketType::INITIAL:
-    error = 
this->_state_handshake_process_initial_client_packet(std::move(packet));
+    error = this->_state_handshake_process_initial_packet(std::move(packet));
     break;
   case QUICPacketType::RETRY:
     error = this->_state_handshake_process_retry_packet(std::move(packet));
     break;
   case QUICPacketType::HANDSHAKE:
-    error = 
this->_state_handshake_process_client_cleartext_packet(std::move(packet));
+    error = this->_state_handshake_process_handshake_packet(std::move(packet));
     break;
   case QUICPacketType::ZERO_RTT_PROTECTED:
     error = 
this->_state_handshake_process_zero_rtt_protected_packet(std::move(packet));
@@ -797,10 +797,10 @@ 
QUICNetVConnection::_state_handshake_process_packet(QUICPacketUPtr packet)
 }
 
 QUICErrorUPtr
-QUICNetVConnection::_state_handshake_process_initial_client_packet(QUICPacketUPtr
 packet)
+QUICNetVConnection::_state_handshake_process_initial_packet(QUICPacketUPtr 
packet)
 {
-  if (packet->size() < MINIMUM_INITIAL_CLIENT_PACKET_SIZE) {
-    QUICConDebug("Packet size is smaller than the minimum initial client 
packet size");
+  if (packet->size() < MINIMUM_INITIAL_PACKET_SIZE) {
+    QUICConDebug("Packet size is smaller than the minimum initial packet 
size");
     // Ignore the packet
     return QUICErrorUPtr(new QUICNoError());
   }
@@ -834,7 +834,7 @@ 
QUICNetVConnection::_state_handshake_process_retry_packet(QUICPacketUPtr packet)
 }
 
 QUICErrorUPtr
-QUICNetVConnection::_state_handshake_process_client_cleartext_packet(QUICPacketUPtr
 packet)
+QUICNetVConnection::_state_handshake_process_handshake_packet(QUICPacketUPtr 
packet)
 {
   return this->_recv_and_ack(std::move(packet));
 }
diff --git a/iocore/net/quic/test/test_QUICPacketFactory.cc 
b/iocore/net/quic/test/test_QUICPacketFactory.cc
index e260563..78e3820 100644
--- a/iocore/net/quic/test/test_QUICPacketFactory.cc
+++ b/iocore/net/quic/test/test_QUICPacketFactory.cc
@@ -32,25 +32,24 @@ 
TEST_CASE("QUICPacketFactory_Create_VersionNegotiationPacket", "[quic]")
   MockQUICHandshakeProtocol hs_protocol;
   factory.set_hs_protocol(&hs_protocol);
 
-  uint8_t client_initial_packet_header[] = {
+  uint8_t initial_packet_header[] = {
     0x82,                                           // Type
     0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, // Connection id
     0xaa, 0xbb, 0xcc, 0xdd,                         // Version
     0x00, 0x00, 0x00, 0x00,                         // Packet number
   };
-  uint8_t client_initial_packet_payload[] = {
+  uint8_t initial_packet_payload[] = {
     0x00 // Payload
   };
 
-  QUICPacketHeaderUPtr header =
-    QUICPacketHeader::load({client_initial_packet_header, [](void *) {}}, 
sizeof(client_initial_packet_header), 0);
-  QUICPacket client_initial_packet(std::move(header), 
ats_unique_buf(client_initial_packet_payload, [](void *) {}),
-                                   sizeof(client_initial_packet_payload), 0);
+  QUICPacketHeaderUPtr header = QUICPacketHeader::load({initial_packet_header, 
[](void *) {}}, sizeof(initial_packet_header), 0);
+  QUICPacket initial_packet(std::move(header), 
ats_unique_buf(initial_packet_payload, [](void *) {}),
+                            sizeof(initial_packet_payload), 0);
 
-  QUICPacketUPtr packet = 
factory.create_version_negotiation_packet(&client_initial_packet, 0);
+  QUICPacketUPtr packet = 
factory.create_version_negotiation_packet(&initial_packet, 0);
   CHECK(packet->type() == QUICPacketType::VERSION_NEGOTIATION);
-  CHECK(packet->connection_id() == client_initial_packet.connection_id());
-  CHECK(packet->packet_number() == client_initial_packet.packet_number());
+  CHECK(packet->connection_id() == initial_packet.connection_id());
+  CHECK(packet->packet_number() == initial_packet.packet_number());
   CHECK(packet->version() == 0x00);
   CHECK(memcmp(packet->payload(), "\xff\x00\x00\x09", 4) == 0);
 }

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to