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/09/11 08:37:31 UTC

[trafficserver] branch quic-latest updated: Add const qualifier to _hs_protocol

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 0095388  Add const qualifier to _hs_protocol
0095388 is described below

commit 00953882b5f29686bdcec69216413bdcd86e177e
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Sep 11 17:36:44 2018 +0900

    Add const qualifier to _hs_protocol
---
 iocore/net/quic/QUICHandshakeProtocol.cc |  2 +-
 iocore/net/quic/QUICHandshakeProtocol.h  |  5 +++--
 iocore/net/quic/QUICPacket.cc            |  2 +-
 iocore/net/quic/QUICPacket.h             | 10 +++++++---
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/iocore/net/quic/QUICHandshakeProtocol.cc b/iocore/net/quic/QUICHandshakeProtocol.cc
index 5f1a347..9aec095 100644
--- a/iocore/net/quic/QUICHandshakeProtocol.cc
+++ b/iocore/net/quic/QUICHandshakeProtocol.cc
@@ -95,7 +95,7 @@ QUICPacketNumberProtector::unprotect(uint8_t *unprotected_pn, uint8_t &unprotect
 }
 
 void
-QUICPacketNumberProtector::set_hs_protocol(QUICHandshakeProtocol *hs_protocol)
+QUICPacketNumberProtector::set_hs_protocol(const QUICHandshakeProtocol *hs_protocol)
 {
   this->_hs_protocol = hs_protocol;
 }
diff --git a/iocore/net/quic/QUICHandshakeProtocol.h b/iocore/net/quic/QUICHandshakeProtocol.h
index cce0eda..3271593 100644
--- a/iocore/net/quic/QUICHandshakeProtocol.h
+++ b/iocore/net/quic/QUICHandshakeProtocol.h
@@ -52,8 +52,9 @@ public:
   bool unprotect(uint8_t *unprotected_pn, uint8_t &unprotected_pn_len, const uint8_t *protected_pn, uint8_t protected_pn_len,
                  const uint8_t *sample, QUICKeyPhase phase) const;
 
-  // FIXME We don't need QUICHandshakeProtocol here, and should pass QUICPacketProtection instead.
-  void set_hs_protocol(QUICHandshakeProtocol *hs_protocol);
+  // FIXME We don't need QUICHandshakeProtocol here, and should pass QUICCryptoInfoProvider or somethign instead.
+  // For now it receives a CONST pointer so PacketNubmerProtector cannot bother handshake.
+  void set_hs_protocol(const QUICHandshakeProtocol *hs_protocol);
 
 private:
   const QUICHandshakeProtocol *_hs_protocol = nullptr;
diff --git a/iocore/net/quic/QUICPacket.cc b/iocore/net/quic/QUICPacket.cc
index bbda5c6..054de41 100644
--- a/iocore/net/quic/QUICPacket.cc
+++ b/iocore/net/quic/QUICPacket.cc
@@ -1229,7 +1229,7 @@ QUICPacketFactory::set_version(QUICVersion negotiated_version)
 }
 
 void
-QUICPacketFactory::set_hs_protocol(QUICHandshakeProtocol *hs_protocol)
+QUICPacketFactory::set_hs_protocol(const QUICHandshakeProtocol *hs_protocol)
 {
   this->_hs_protocol = hs_protocol;
 }
diff --git a/iocore/net/quic/QUICPacket.h b/iocore/net/quic/QUICPacket.h
index d4fb0fc..0d24d82 100644
--- a/iocore/net/quic/QUICPacket.h
+++ b/iocore/net/quic/QUICPacket.h
@@ -401,12 +401,16 @@ public:
   QUICPacketUPtr create_protected_packet(QUICConnectionId connection_id, QUICPacketNumber base_packet_number,
                                          ats_unique_buf payload, size_t len, bool retransmittable);
   void set_version(QUICVersion negotiated_version);
-  void set_hs_protocol(QUICHandshakeProtocol *hs_protocol);
+
+  // FIXME We don't need QUICHandshakeProtocol here, and should pass QUICCryptoInfoProvider or somethign instead.
+  // For now it receives a CONST pointer so PacketFactory cannot bother handshake.
+  void set_hs_protocol(const QUICHandshakeProtocol *hs_protocol);
+
   bool is_ready_to_create_protected_packet();
 
 private:
-  QUICVersion _version                = QUIC_SUPPORTED_VERSIONS[0];
-  QUICHandshakeProtocol *_hs_protocol = nullptr;
+  QUICVersion _version                      = QUIC_SUPPORTED_VERSIONS[0];
+  const QUICHandshakeProtocol *_hs_protocol = nullptr;
   // Initial, 0/1-RTT, and Handshake
   QUICPacketNumberGenerator _packet_number_generator[3];