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 8fc244e8e30cb4f9ea27865bd571f6f75dd64175
Author: Masaori Koshiba <[email protected]>
AuthorDate: Fri Jun 22 10:05:23 2018 +0900

    Make pn_protector const reference
---
 iocore/net/P_QUICPacketHandler.h | 10 ++++++----
 iocore/net/QUICPacketHandler.cc  |  7 +++----
 iocore/net/quic/QUICPacket.cc    |  4 ++--
 iocore/net/quic/QUICPacket.h     |  4 ++--
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/iocore/net/P_QUICPacketHandler.h b/iocore/net/P_QUICPacketHandler.h
index b85fc02..3380f6b 100644
--- a/iocore/net/P_QUICPacketHandler.h
+++ b/iocore/net/P_QUICPacketHandler.h
@@ -40,12 +40,12 @@ public:
   QUICPacketHandler();
   ~QUICPacketHandler();
 
-  virtual void send_packet(const QUICPacket &packet, QUICNetVConnection *vc, 
QUICPacketNumberProtector &pn_protector) = 0;
+  virtual void send_packet(const QUICPacket &packet, QUICNetVConnection *vc, 
const QUICPacketNumberProtector &pn_protector) = 0;
   virtual void close_conenction(QUICNetVConnection *conn);
 
 protected:
   static void _send_packet(Continuation *c, const QUICPacket &packet, 
UDPConnection *udp_con, IpEndpoint &addr, uint32_t pmtu,
-                           QUICPacketNumberProtector *pn_protector, int dcil);
+                           const QUICPacketNumberProtector *pn_protector, int 
dcil);
 
   Event *_collector_event                       = nullptr;
   QUICClosedConCollector *_closed_con_collector = nullptr;
@@ -70,7 +70,8 @@ public:
   void init_accept(EThread *t) override;
 
   // QUICPacketHandler
-  virtual void send_packet(const QUICPacket &packet, QUICNetVConnection *vc, 
QUICPacketNumberProtector &pn_protector) override;
+  virtual void send_packet(const QUICPacket &packet, QUICNetVConnection *vc,
+                           const QUICPacketNumberProtector &pn_protector) 
override;
 
 private:
   void _recv_packet(int event, UDPPacket *udp_packet) override;
@@ -92,7 +93,8 @@ public:
   int event_handler(int event, Event *data);
 
   // QUICPacketHandler
-  virtual void send_packet(const QUICPacket &packet, QUICNetVConnection *vc, 
QUICPacketNumberProtector &pn_protector) override;
+  virtual void send_packet(const QUICPacket &packet, QUICNetVConnection *vc,
+                           const QUICPacketNumberProtector &pn_protector) 
override;
 
 private:
   void _recv_packet(int event, UDPPacket *udp_packet) override;
diff --git a/iocore/net/QUICPacketHandler.cc b/iocore/net/QUICPacketHandler.cc
index 1a92cf7..602db26 100644
--- a/iocore/net/QUICPacketHandler.cc
+++ b/iocore/net/QUICPacketHandler.cc
@@ -71,7 +71,7 @@ QUICPacketHandler::close_conenction(QUICNetVConnection *conn)
 
 void
 QUICPacketHandler::_send_packet(Continuation *c, const QUICPacket &packet, 
UDPConnection *udp_con, IpEndpoint &addr, uint32_t pmtu,
-                                QUICPacketNumberProtector *pn_protector, int 
dcil)
+                                const QUICPacketNumberProtector *pn_protector, 
int dcil)
 {
   size_t udp_len;
   Ptr<IOBufferBlock> udp_payload(new_IOBufferBlock());
@@ -302,7 +302,7 @@ QUICPacketHandlerIn::_recv_packet(int event, UDPPacket 
*udp_packet)
 
 // TODO: Should be called via eventProcessor?
 void
-QUICPacketHandlerIn::send_packet(const QUICPacket &packet, QUICNetVConnection 
*vc, QUICPacketNumberProtector &pn_protector)
+QUICPacketHandlerIn::send_packet(const QUICPacket &packet, QUICNetVConnection 
*vc, const QUICPacketNumberProtector &pn_protector)
 {
   this->_send_packet(this, packet, vc->get_udp_con(), vc->con.addr, 
vc->pmtu(), &pn_protector, vc->peer_connection_id().length());
 }
@@ -347,9 +347,8 @@ QUICPacketHandlerOut::event_handler(int event, Event *data)
 }
 
 void
-QUICPacketHandlerOut::send_packet(const QUICPacket &packet, QUICNetVConnection 
*vc, QUICPacketNumberProtector &pn_protector)
+QUICPacketHandlerOut::send_packet(const QUICPacket &packet, QUICNetVConnection 
*vc, const QUICPacketNumberProtector &pn_protector)
 {
-  // TODO Pass QUICPacketNumberProtector
   this->_send_packet(this, packet, vc->get_udp_con(), vc->con.addr, 
vc->pmtu(), &pn_protector, vc->peer_connection_id().length());
 }
 
diff --git a/iocore/net/quic/QUICPacket.cc b/iocore/net/quic/QUICPacket.cc
index 67f9fa3..7a4b076 100644
--- a/iocore/net/quic/QUICPacket.cc
+++ b/iocore/net/quic/QUICPacket.cc
@@ -755,7 +755,7 @@ QUICPacket::decode_packet_number(QUICPacketNumber &dst, 
QUICPacketNumber src, si
 }
 
 bool
-QUICPacket::protect_packet_number(uint8_t *packet, size_t packet_len, 
QUICPacketNumberProtector *pn_protector, int dcil)
+QUICPacket::protect_packet_number(uint8_t *packet, size_t packet_len, const 
QUICPacketNumberProtector *pn_protector, int dcil)
 {
   size_t pn_offset             = 0;
   uint8_t pn_len               = 4;
@@ -794,7 +794,7 @@ QUICPacket::protect_packet_number(uint8_t *packet, size_t 
packet_len, QUICPacket
 }
 
 bool
-QUICPacket::unprotect_packet_number(uint8_t *packet, size_t packet_len, 
QUICPacketNumberProtector *pn_protector)
+QUICPacket::unprotect_packet_number(uint8_t *packet, size_t packet_len, const 
QUICPacketNumberProtector *pn_protector)
 {
   size_t pn_offset             = 0;
   uint8_t pn_len               = 4;
diff --git a/iocore/net/quic/QUICPacket.h b/iocore/net/quic/QUICPacket.h
index 8156a16..fd9f12d 100644
--- a/iocore/net/quic/QUICPacket.h
+++ b/iocore/net/quic/QUICPacket.h
@@ -330,8 +330,8 @@ public:
   static bool encode_packet_number(QUICPacketNumber &dst, QUICPacketNumber 
src, size_t len);
   static bool decode_packet_number(QUICPacketNumber &dst, QUICPacketNumber 
src, size_t len, QUICPacketNumber largest_acked);
 
-  static bool protect_packet_number(uint8_t *packet, size_t packet_len, 
QUICPacketNumberProtector *pn_protector, int dcil);
-  static bool unprotect_packet_number(uint8_t *packet, size_t packet_len, 
QUICPacketNumberProtector *pn_protector);
+  static bool protect_packet_number(uint8_t *packet, size_t packet_len, const 
QUICPacketNumberProtector *pn_protector, int dcil);
+  static bool unprotect_packet_number(uint8_t *packet, size_t packet_len, 
const QUICPacketNumberProtector *pn_protector);
 
   LINK(QUICPacket, link);
 

Reply via email to