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

commit 50476f0ccab5bcbfff5efa56ca3a1232cbb7977a
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Mon Mar 5 11:58:56 2018 +0900

    Don't use raw pointer for QUICPacketHeader
---
 iocore/net/QUICNetVConnection.cc | 4 ++--
 iocore/net/quic/QUICPacket.cc    | 4 ++--
 iocore/net/quic/QUICPacket.h     | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index fcf57cf..7a712d7 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -362,8 +362,8 @@ QUICNetVConnection::retransmit_packet(const QUICPacket 
&packet)
   ink_assert(packet.type() != QUICPacketType::VERSION_NEGOTIATION && 
packet.type() != QUICPacketType::UNINITIALIZED);
 
   // Get payload from a header because packet.payload() is encrypted
-  uint16_t size          = packet.header()->payload_size();
-  const uint8_t *payload = packet.header()->payload();
+  uint16_t size          = packet.header().payload_size();
+  const uint8_t *payload = packet.header().payload();
 
   QUICFrameUPtr frame = QUICFrameFactory::create_null_frame();
   uint16_t cursor     = 0;
diff --git a/iocore/net/quic/QUICPacket.cc b/iocore/net/quic/QUICPacket.cc
index 62cfa17..372c24f 100644
--- a/iocore/net/quic/QUICPacket.cc
+++ b/iocore/net/quic/QUICPacket.cc
@@ -521,10 +521,10 @@ QUICPacket::packet_number() const
   return this->_header->packet_number();
 }
 
-const QUICPacketHeader *
+const QUICPacketHeader &
 QUICPacket::header() const
 {
-  return this->_header.get();
+  return *this->_header;
 }
 
 const uint8_t *
diff --git a/iocore/net/quic/QUICPacket.h b/iocore/net/quic/QUICPacket.h
index 6c367c4..6992b79 100644
--- a/iocore/net/quic/QUICPacket.h
+++ b/iocore/net/quic/QUICPacket.h
@@ -254,7 +254,7 @@ public:
   QUICConnectionId connection_id() const;
   QUICPacketNumber packet_number() const;
   QUICVersion version() const;
-  const QUICPacketHeader *header() const;
+  const QUICPacketHeader &header() const;
   const uint8_t *payload() const;
   bool is_retransmittable() const;
 

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

Reply via email to