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 07:06:57 UTC
[trafficserver] branch quic-latest updated: Remove QUICFrame::split
which was used from RetransmisionFrame
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 a62ea1c Remove QUICFrame::split which was used from RetransmisionFrame
a62ea1c is described below
commit a62ea1c0e065815585ba2be5380eaa0c26abfcd0
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Feb 5 16:06:15 2019 +0900
Remove QUICFrame::split which was used from RetransmisionFrame
---
iocore/net/quic/QUICFrame.cc | 83 --------------------------------------------
iocore/net/quic/QUICFrame.h | 9 -----
2 files changed, 92 deletions(-)
diff --git a/iocore/net/quic/QUICFrame.cc b/iocore/net/quic/QUICFrame.cc
index 0bb66ad..3530fe1 100644
--- a/iocore/net/quic/QUICFrame.cc
+++ b/iocore/net/quic/QUICFrame.cc
@@ -125,12 +125,6 @@ QUICFrame::debug_msg(char *msg, size_t msg_len) const
return snprintf(msg, msg_len, "| %s size=%zu", QUICDebugNames::frame_type(this->type()), this->size());
}
-QUICFrame *
-QUICFrame::split(size_t size)
-{
- return nullptr;
-}
-
bool
QUICFrame::valid() const
{
@@ -216,45 +210,6 @@ QUICStreamFrame::_reset()
this->_size = 0;
}
-QUICFrame *
-QUICStreamFrame::split(size_t size)
-{
- size_t header_len = 1 + QUICVariableInt::size(this->_stream_id);
- if (this->_has_offset_field) {
- header_len += QUICVariableInt::size(this->_offset);
- }
- if (this->_has_length_field) {
- header_len += QUICVariableInt::size(this->_block->read_avail());
- }
-
- if (size <= header_len) {
- return nullptr;
- }
- bool fin = this->has_fin_flag();
-
- ink_assert(size < this->size());
- ink_assert(this->_block.get() != nullptr);
-
- size_t data_len = size - header_len;
-
- Ptr<IOBufferBlock> new_block = make_ptr<IOBufferBlock>(this->_block->clone());
- new_block->consume(data_len);
- this->_block->_end = std::min(this->_block->_start + data_len, this->_block->_buf_end);
-
- if (this->has_offset_field()) {
- this->_offset = this->offset();
- }
-
- this->_fin = false;
- this->_stream_id = this->stream_id();
-
- QUICStreamFrame *frame = quicStreamFrameAllocator.alloc();
- new (frame) QUICStreamFrame(new_block, this->stream_id(), this->offset() + this->data_length(), fin, this->_has_offset_field,
- this->_has_length_field, this->_id, this->_owner);
-
- return frame;
-}
-
QUICFrameUPtr
QUICStreamFrame::clone() const
{
@@ -464,33 +419,6 @@ QUICCryptoFrame::_reset()
this->_size = 0;
}
-QUICFrame *
-QUICCryptoFrame::split(size_t size)
-{
- size_t header_len = 1 + QUICVariableInt::size(this->_offset) + QUICVariableInt::size(this->_block->read_avail());
- if (size <= header_len) {
- return nullptr;
- }
-
- ink_assert(size < this->size());
-
- size_t data_len = size - header_len;
-
- ink_assert(size < this->size());
- ink_assert(this->_block.get() != nullptr);
-
- Ptr<IOBufferBlock> new_block = make_ptr<IOBufferBlock>(this->_block->clone());
- new_block->consume(data_len);
- this->_block->_end = std::min(this->_block->_start + data_len, this->_block->_buf_end);
-
- this->_offset = this->offset();
-
- QUICCryptoFrame *frame = quicCryptoFrameAllocator.alloc();
- new (frame) QUICCryptoFrame(this->_block, this->offset() + data_len, this->_id, this->_owner);
-
- return frame;
-}
-
QUICFrameUPtr
QUICCryptoFrame::clone() const
{
@@ -2738,17 +2666,6 @@ QUICFrameFactory::create_crypto_frame(Ptr<IOBufferBlock> &block, QUICOffset offs
return QUICCryptoFrameUPtr(frame, &QUICFrameDeleter::delete_crypto_frame);
}
-QUICFrameUPtr
-QUICFrameFactory::split_frame(QUICFrame *frame, size_t size)
-{
- auto new_frame = frame->split(size);
- if (!new_frame) {
- return QUICFrameFactory::create_null_frame();
- }
-
- return QUICFrameUPtr(new_frame, &QUICFrameDeleter::delete_stream_frame);
-}
-
std::unique_ptr<QUICAckFrame, QUICFrameDeleterFunc>
QUICFrameFactory::create_ack_frame(QUICPacketNumber largest_acknowledged, uint64_t ack_delay, uint64_t first_ack_block,
QUICFrameId id, QUICFrameGenerator *owner)
diff --git a/iocore/net/quic/QUICFrame.h b/iocore/net/quic/QUICFrame.h
index e8dba5b..7b7a1a9 100644
--- a/iocore/net/quic/QUICFrame.h
+++ b/iocore/net/quic/QUICFrame.h
@@ -63,7 +63,6 @@ public:
virtual size_t size() const = 0;
virtual bool is_probing_frame() const;
virtual size_t store(uint8_t *buf, size_t *len, size_t limit) const = 0;
- virtual QUICFrame *split(size_t size);
virtual int debug_msg(char *msg, size_t msg_len) const;
virtual void parse(const uint8_t *buf, size_t len){};
virtual QUICFrameGenerator *generated_by();
@@ -92,7 +91,6 @@ public:
bool has_offset_field = true, bool has_length_field = true, QUICFrameId id = 0,
QUICFrameGenerator *owner = nullptr);
- QUICFrame *split(size_t size) override;
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -133,7 +131,6 @@ public:
QUICCryptoFrame(const uint8_t *buf, size_t len);
QUICCryptoFrame(Ptr<IOBufferBlock> &block, QUICOffset offset, QUICFrameId id = 0, QUICFrameGenerator *owner = nullptr);
- QUICFrame *split(size_t size) override;
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -887,12 +884,6 @@ class QUICFrameFactory
{
public:
/*
- * Split Stream frame into two frame
- * Return the new frame
- */
- static QUICFrameUPtr split_frame(QUICFrame *frame, size_t size);
-
- /*
* This is for an empty QUICFrameUptr.
* Empty frames are used for variable initialization and return value of frame creation failure
*/