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 2019/02/05 06:44:34 UTC

[trafficserver] branch quic-latest updated: Remove QUICRetransmissionFrame

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 8c4f40f  Remove QUICRetransmissionFrame
8c4f40f is described below

commit 8c4f40f845d659f7f757754fef9e2cd4d0604818
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Feb 5 15:43:51 2019 +0900

    Remove QUICRetransmissionFrame
---
 iocore/net/quic/QUICFrame.cc | 65 --------------------------------------------
 iocore/net/quic/QUICFrame.h  | 38 --------------------------
 2 files changed, 103 deletions(-)

diff --git a/iocore/net/quic/QUICFrame.cc b/iocore/net/quic/QUICFrame.cc
index 2ae36a0..0bb66ad 100644
--- a/iocore/net/quic/QUICFrame.cc
+++ b/iocore/net/quic/QUICFrame.cc
@@ -49,7 +49,6 @@ ClassAllocator<QUICPathChallengeFrame> quicPathChallengeFrameAllocator("quicPath
 ClassAllocator<QUICPathResponseFrame> quicPathResponseFrameAllocator("quicPathResponseFrameAllocator");
 ClassAllocator<QUICNewTokenFrame> quicNewTokenFrameAllocator("quicNewTokenFrameAllocator");
 ClassAllocator<QUICRetireConnectionIdFrame> quicRetireConnectionIdFrameAllocator("quicRetireConnectionIdFrameAllocator");
-ClassAllocator<QUICRetransmissionFrame> quicRetransmissionFrameAllocator("quicRetransmissionFrameAllocator");
 
 #define LEFT_SPACE(pos) ((size_t)(buf + len - pos))
 #define FRAME_SIZE(pos) (pos - buf)
@@ -2595,62 +2594,6 @@ QUICRetireConnectionIdFrame::seq_num() const
 }
 
 //
-// QUICRetransmissionFrame
-//
-QUICRetransmissionFrame::QUICRetransmissionFrame(QUICFrameUPtr original_frame, const QUICPacket &original_packet)
-  : QUICFrame(original_frame->id(), original_frame->generated_by()), _packet_type(original_packet.type())
-{
-  this->_frame = std::move(original_frame);
-}
-
-QUICFrameUPtr
-QUICRetransmissionFrame::clone() const
-{
-  ink_assert(!"Retransmission frames shouldn't be cloned");
-  return QUICFrameFactory::create_null_frame();
-}
-
-QUICFrameType
-QUICRetransmissionFrame::type() const
-{
-  return this->_frame->type();
-}
-
-size_t
-QUICRetransmissionFrame::size() const
-{
-  return this->_frame->size();
-}
-
-size_t
-QUICRetransmissionFrame::store(uint8_t *buf, size_t *len, size_t limit) const
-{
-  return this->_frame->store(buf, len, limit);
-}
-
-int
-QUICRetransmissionFrame::debug_msg(char *msg, size_t msg_len) const
-{
-  return snprintf(msg, msg_len, "| %s size=%zu (retransmission)", QUICDebugNames::frame_type(this->type()), this->size());
-}
-
-QUICPacketType
-QUICRetransmissionFrame::packet_type() const
-{
-  return this->_packet_type;
-}
-
-QUICFrame *
-QUICRetransmissionFrame::split(size_t size)
-{
-  if (this->_frame->type() != QUICFrameType::STREAM) {
-    return nullptr;
-  }
-
-  return this->_frame->split(size);
-}
-
-//
 // QUICFrameFactory
 //
 
@@ -2970,14 +2913,6 @@ QUICFrameFactory::create_retire_connection_id_frame(uint64_t seq_num, QUICFrameI
                                                                             &QUICFrameDeleter::delete_retire_connection_id_frame);
 }
 
-std::unique_ptr<QUICRetransmissionFrame, QUICFrameDeleterFunc>
-QUICFrameFactory::create_retransmission_frame(QUICFrameUPtr original_frame, const QUICPacket &original_packet)
-{
-  QUICRetransmissionFrame *frame = quicRetransmissionFrameAllocator.alloc();
-  new (frame) QUICRetransmissionFrame(std::move(original_frame), original_packet);
-  return std::unique_ptr<QUICRetransmissionFrame, QUICFrameDeleterFunc>(frame, &QUICFrameDeleter::delete_retransmission_frame);
-}
-
 QUICFrameId
 QUICFrameInfo::id()
 {
diff --git a/iocore/net/quic/QUICFrame.h b/iocore/net/quic/QUICFrame.h
index ddb94bd..e8dba5b 100644
--- a/iocore/net/quic/QUICFrame.h
+++ b/iocore/net/quic/QUICFrame.h
@@ -716,29 +716,6 @@ private:
   uint64_t _seq_num = 0;
 };
 
-//
-// Retransmission Frame - Not on the spec
-//
-
-class QUICRetransmissionFrame : public QUICFrame
-{
-public:
-  QUICRetransmissionFrame() {}
-  QUICRetransmissionFrame(QUICFrameUPtr original_frame, const QUICPacket &original_packet);
-  QUICFrameUPtr clone() const override;
-  QUICFrameType type() const override;
-  virtual size_t size() const override;
-  virtual size_t store(uint8_t *buf, size_t *len, size_t limit) const override;
-  virtual int debug_msg(char *msg, size_t msg_len) const override;
-  QUICPacketType packet_type() const;
-  QUICFrame *split(size_t size) override;
-
-private:
-  QUICFrameUPtr _frame = QUICFrameUPtr(nullptr, nullptr);
-  ats_unique_buf _data = ats_unique_buf(nullptr);
-  QUICPacketType _packet_type;
-};
-
 extern ClassAllocator<QUICStreamFrame> quicStreamFrameAllocator;
 extern ClassAllocator<QUICCryptoFrame> quicCryptoFrameAllocator;
 extern ClassAllocator<QUICAckFrame> quicAckFrameAllocator;
@@ -758,7 +735,6 @@ extern ClassAllocator<QUICPathChallengeFrame> quicPathChallengeFrameAllocator;
 extern ClassAllocator<QUICPathResponseFrame> quicPathResponseFrameAllocator;
 extern ClassAllocator<QUICNewTokenFrame> quicNewTokenFrameAllocator;
 extern ClassAllocator<QUICRetireConnectionIdFrame> quicRetireConnectionIdFrameAllocator;
-extern ClassAllocator<QUICRetransmissionFrame> quicRetransmissionFrameAllocator;
 
 class QUICFrameDeleter
 {
@@ -902,13 +878,6 @@ public:
     frame->~QUICFrame();
     quicRetireConnectionIdFrameAllocator.free(static_cast<QUICRetireConnectionIdFrame *>(frame));
   }
-
-  static void
-  delete_retransmission_frame(QUICFrame *frame)
-  {
-    frame->~QUICFrame();
-    quicRetransmissionFrameAllocator.free(static_cast<QUICRetransmissionFrame *>(frame));
-  }
 };
 
 //
@@ -1070,13 +1039,6 @@ public:
   static std::unique_ptr<QUICRetireConnectionIdFrame, QUICFrameDeleterFunc> create_retire_connection_id_frame(
     uint64_t seq_num, QUICFrameId id = 0, QUICFrameGenerator *owner = nullptr);
 
-  /*
-   * Creates a retransmission frame, which is very special.
-   * This retransmission frame will be used only for retransmission and it's not a standard frame type.
-   */
-  static std::unique_ptr<QUICRetransmissionFrame, QUICFrameDeleterFunc> create_retransmission_frame(
-    QUICFrameUPtr original_frame, const QUICPacket &original_packet);
-
 private:
   // FIXME Actual number of frame types is several but some of the values are not sequential.
   std::shared_ptr<QUICFrame> _reusable_frames[256] = {nullptr};