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/07 05:57:45 UTC
[trafficserver] branch quic-latest updated: Cleanup: Remove
QUICFrame::_protection
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
The following commit(s) were added to refs/heads/quic-latest by this push:
new 83dfc5a Cleanup: Remove QUICFrame::_protection
83dfc5a is described below
commit 83dfc5a11be6b795b7715ce4189f849cb0893223
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Fri Sep 7 14:57:23 2018 +0900
Cleanup: Remove QUICFrame::_protection
---
iocore/net/quic/QUICAckFrameCreator.cc | 10 ++--
iocore/net/quic/QUICFrame.cc | 94 +++++++++++---------------------
iocore/net/quic/QUICFrame.h | 97 +++++++++++++++-------------------
iocore/net/quic/QUICStream.cc | 4 +-
iocore/net/quic/test/test_QUICFrame.cc | 6 +--
5 files changed, 83 insertions(+), 128 deletions(-)
diff --git a/iocore/net/quic/QUICAckFrameCreator.cc b/iocore/net/quic/QUICAckFrameCreator.cc
index 3b0422a..391934e 100644
--- a/iocore/net/quic/QUICAckFrameCreator.cc
+++ b/iocore/net/quic/QUICAckFrameCreator.cc
@@ -90,8 +90,6 @@ QUICAckFrameCreator::_create_ack_frame(QUICEncryptionLevel level)
size_t i = 0;
uint8_t gap = 0;
uint64_t length = 0;
- // TODO: remove protection
- bool protection = false;
while (i < packet_numbers->size()) {
QUICPacketNumber pn = (*packet_numbers)[i];
@@ -105,10 +103,10 @@ QUICAckFrameCreator::_create_ack_frame(QUICEncryptionLevel level)
ink_assert(length > 0);
if (ack_frame) {
- ack_frame->ack_block_section()->add_ack_block({static_cast<uint8_t>(gap - 1), length - 1}, protection);
+ ack_frame->ack_block_section()->add_ack_block({static_cast<uint8_t>(gap - 1), length - 1});
} else {
uint64_t delay = this->_calculate_delay(level);
- ack_frame = QUICFrameFactory::create_ack_frame(largest_ack_number, delay, length - 1, protection);
+ ack_frame = QUICFrameFactory::create_ack_frame(largest_ack_number, delay, length - 1);
}
gap = last_ack_number - pn;
@@ -117,10 +115,10 @@ QUICAckFrameCreator::_create_ack_frame(QUICEncryptionLevel level)
}
if (ack_frame) {
- ack_frame->ack_block_section()->add_ack_block({static_cast<uint8_t>(gap - 1), length - 1}, protection);
+ ack_frame->ack_block_section()->add_ack_block({static_cast<uint8_t>(gap - 1), length - 1});
} else {
uint64_t delay = this->_calculate_delay(level);
- ack_frame = QUICFrameFactory::create_ack_frame(largest_ack_number, delay, length - 1, protection);
+ ack_frame = QUICFrameFactory::create_ack_frame(largest_ack_number, delay, length - 1);
}
return ack_frame;
diff --git a/iocore/net/quic/QUICFrame.cc b/iocore/net/quic/QUICFrame.cc
index 43459f2..3926961 100644
--- a/iocore/net/quic/QUICFrame.cc
+++ b/iocore/net/quic/QUICFrame.cc
@@ -75,12 +75,6 @@ QUICFrame::reset(const uint8_t *buf, size_t len)
this->_len = len;
}
-bool
-QUICFrame::is_protected() const
-{
- return this->_protection;
-}
-
int
QUICFrame::debug_msg(char *msg, size_t msg_len) const
{
@@ -97,9 +91,7 @@ QUICFrame::split(size_t size)
// STREAM Frame
//
-QUICStreamFrame::QUICStreamFrame(ats_unique_buf data, size_t data_len, QUICStreamId stream_id, QUICOffset offset, bool last,
- bool protection)
- : QUICFrame(protection)
+QUICStreamFrame::QUICStreamFrame(ats_unique_buf data, size_t data_len, QUICStreamId stream_id, QUICOffset offset, bool last)
{
this->_data = std::move(data);
this->_data_len = data_len;
@@ -141,8 +133,8 @@ QUICStreamFrame::split(size_t size)
this->reset(nullptr, 0);
QUICStreamFrame *frame = quicStreamFrameAllocator.alloc();
- new (frame)
- QUICStreamFrame(std::move(buf2), buf2_len, this->stream_id(), this->offset() + this->data_length(), fin, this->is_protected());
+ new (frame) QUICStreamFrame(std::move(buf2), buf2_len, this->stream_id(), this->offset() + this->data_length(), fin);
+
return frame;
}
@@ -150,7 +142,7 @@ QUICFrameUPtr
QUICStreamFrame::clone() const
{
return QUICFrameFactory::create_stream_frame(this->data(), this->data_length(), this->stream_id(), this->offset(),
- this->has_fin_flag(), this->is_protected());
+ this->has_fin_flag());
}
QUICFrameType
@@ -392,7 +384,7 @@ QUICStreamFrame::_get_length_field_len() const
// CRYPTO frame
//
-QUICCryptoFrame::QUICCryptoFrame(ats_unique_buf data, size_t data_len, QUICOffset offset, bool protection) : QUICFrame(protection)
+QUICCryptoFrame::QUICCryptoFrame(ats_unique_buf data, size_t data_len, QUICOffset offset)
{
this->_data = std::move(data);
this->_data_len = data_len;
@@ -423,14 +415,15 @@ QUICCryptoFrame::split(size_t size)
this->reset(nullptr, 0);
QUICCryptoFrame *frame = quicCryptoFrameAllocator.alloc();
- new (frame) QUICCryptoFrame(std::move(buf2), buf2_len, this->offset() + this->data_length(), this->is_protected());
+ new (frame) QUICCryptoFrame(std::move(buf2), buf2_len, this->offset() + this->data_length());
+
return frame;
}
QUICFrameUPtr
QUICCryptoFrame::clone() const
{
- return QUICFrameFactory::create_crypto_frame(this->data(), this->data_length(), this->offset(), this->is_protected());
+ return QUICFrameFactory::create_crypto_frame(this->data(), this->data_length(), this->offset());
}
QUICFrameType
@@ -559,13 +552,12 @@ QUICCryptoFrame::_get_length_field_len() const
// ACK frame
//
-QUICAckFrame::QUICAckFrame(const uint8_t *buf, size_t len, bool protection) : QUICFrame(buf, len, protection)
+QUICAckFrame::QUICAckFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len)
{
this->reset(buf, len);
}
-QUICAckFrame::QUICAckFrame(QUICPacketNumber largest_acknowledged, uint64_t ack_delay, uint64_t first_ack_block, bool protection)
- : QUICFrame(protection)
+QUICAckFrame::QUICAckFrame(QUICPacketNumber largest_acknowledged, uint64_t ack_delay, uint64_t first_ack_block)
{
this->_largest_acknowledged = largest_acknowledged;
this->_ack_delay = ack_delay;
@@ -594,7 +586,7 @@ QUICFrameUPtr
QUICAckFrame::clone() const
{
std::unique_ptr<QUICAckFrame, QUICFrameDeleterFunc> newframe = QUICFrameFactory::create_ack_frame(
- this->largest_acknowledged(), this->ack_delay(), this->ack_block_section()->first_ack_block(), this->is_protected());
+ this->largest_acknowledged(), this->ack_delay(), this->ack_block_section()->first_ack_block());
// TODO Copy ack block section
return newframe;
}
@@ -654,12 +646,6 @@ QUICAckFrame::debug_msg(char *msg, size_t msg_len) const
return len;
}
-bool
-QUICAckFrame::is_protected() const
-{
- return QUICFrame::is_protected() || this->_ack_block_section->has_protected();
-}
-
QUICPacketNumber
QUICAckFrame::largest_acknowledged() const
{
@@ -912,16 +898,9 @@ QUICAckFrame::AckBlockSection::first_ack_block() const
}
void
-QUICAckFrame::AckBlockSection::add_ack_block(AckBlock block, bool protection)
+QUICAckFrame::AckBlockSection::add_ack_block(AckBlock block)
{
this->_ack_blocks.push_back(block);
- this->_protection |= protection;
-}
-
-bool
-QUICAckFrame::AckBlockSection::has_protected() const
-{
- return this->_protection;
}
QUICAckFrame::AckBlockSection::const_iterator
@@ -1016,9 +995,8 @@ QUICAckFrame::AckBlockSection::const_iterator::operator==(const const_iterator &
// RST_STREAM frame
//
-QUICRstStreamFrame::QUICRstStreamFrame(QUICStreamId stream_id, QUICAppErrorCode error_code, QUICOffset final_offset,
- bool protection)
- : QUICFrame(protection), _stream_id(stream_id), _error_code(error_code), _final_offset(final_offset)
+QUICRstStreamFrame::QUICRstStreamFrame(QUICStreamId stream_id, QUICAppErrorCode error_code, QUICOffset final_offset)
+ : _stream_id(stream_id), _error_code(error_code), _final_offset(final_offset)
{
}
@@ -1215,12 +1193,8 @@ QUICPaddingFrame::store(uint8_t *buf, size_t *len, size_t limit) const
// CONNECTION_CLOSE frame
//
QUICConnectionCloseFrame::QUICConnectionCloseFrame(uint16_t error_code, QUICFrameType frame_type, uint64_t reason_phrase_length,
- const char *reason_phrase, bool protection)
- : QUICFrame(protection),
- _error_code(error_code),
- _frame_type(frame_type),
- _reason_phrase_length(reason_phrase_length),
- _reason_phrase(reason_phrase)
+ const char *reason_phrase)
+ : _error_code(error_code), _frame_type(frame_type), _reason_phrase_length(reason_phrase_length), _reason_phrase(reason_phrase)
{
}
@@ -1405,8 +1379,7 @@ QUICConnectionCloseFrame::_get_reason_phrase_field_offset() const
// APPLICATION_CLOSE frame
//
QUICApplicationCloseFrame::QUICApplicationCloseFrame(QUICAppErrorCode error_code, uint64_t reason_phrase_length,
- const char *reason_phrase, bool protection)
- : QUICFrame(protection)
+ const char *reason_phrase)
{
this->_error_code = error_code;
this->_reason_phrase_length = reason_phrase_length;
@@ -1517,7 +1490,7 @@ QUICApplicationCloseFrame::_get_reason_phrase_field_offset() const
//
// MAX_DATA frame
//
-QUICMaxDataFrame::QUICMaxDataFrame(uint64_t maximum_data, bool protection)
+QUICMaxDataFrame::QUICMaxDataFrame(uint64_t maximum_data)
{
this->_maximum_data = maximum_data;
}
@@ -1593,8 +1566,7 @@ QUICMaxDataFrame::_get_max_data_field_length() const
//
// MAX_STREAM_DATA
//
-QUICMaxStreamDataFrame::QUICMaxStreamDataFrame(QUICStreamId stream_id, uint64_t maximum_stream_data, bool protection)
- : QUICFrame(protection)
+QUICMaxStreamDataFrame::QUICMaxStreamDataFrame(QUICStreamId stream_id, uint64_t maximum_stream_data)
{
this->_stream_id = stream_id;
this->_maximum_stream_data = maximum_stream_data;
@@ -1703,7 +1675,7 @@ QUICMaxStreamDataFrame::_get_max_stream_data_field_length() const
//
// MAX_STREAM_ID
//
-QUICMaxStreamIdFrame::QUICMaxStreamIdFrame(QUICStreamId maximum_stream_id, bool protection) : QUICFrame(protection)
+QUICMaxStreamIdFrame::QUICMaxStreamIdFrame(QUICStreamId maximum_stream_id)
{
this->_maximum_stream_id = maximum_stream_id;
}
@@ -2107,8 +2079,8 @@ QUICNewConnectionIdFrame::_get_connection_id_field_offset() const
// STOP_SENDING frame
//
-QUICStopSendingFrame::QUICStopSendingFrame(QUICStreamId stream_id, QUICAppErrorCode error_code, bool protection)
- : QUICFrame(protection), _stream_id(stream_id), _error_code(error_code)
+QUICStopSendingFrame::QUICStopSendingFrame(QUICStreamId stream_id, QUICAppErrorCode error_code)
+ : _stream_id(stream_id), _error_code(error_code)
{
}
@@ -2403,7 +2375,7 @@ QUICNewTokenFrame::_get_token_field_offset() const
// QUICRetransmissionFrame
//
QUICRetransmissionFrame::QUICRetransmissionFrame(QUICFrameUPtr original_frame, const QUICPacket &original_packet)
- : QUICFrame(original_frame->is_protected()), _packet_type(original_packet.type())
+ : _packet_type(original_packet.type())
{
this->_frame = std::move(original_frame);
}
@@ -2582,25 +2554,24 @@ QUICFrameFactory::fast_create(const uint8_t *buf, size_t len)
}
QUICStreamFrameUPtr
-QUICFrameFactory::create_stream_frame(const uint8_t *data, size_t data_len, QUICStreamId stream_id, QUICOffset offset, bool last,
- bool protection)
+QUICFrameFactory::create_stream_frame(const uint8_t *data, size_t data_len, QUICStreamId stream_id, QUICOffset offset, bool last)
{
ats_unique_buf buf = ats_unique_malloc(data_len);
memcpy(buf.get(), data, data_len);
QUICStreamFrame *frame = quicStreamFrameAllocator.alloc();
- new (frame) QUICStreamFrame(std::move(buf), data_len, stream_id, offset, last, protection);
+ new (frame) QUICStreamFrame(std::move(buf), data_len, stream_id, offset, last);
return QUICStreamFrameUPtr(frame, &QUICFrameDeleter::delete_stream_frame);
}
QUICCryptoFrameUPtr
-QUICFrameFactory::create_crypto_frame(const uint8_t *data, uint64_t data_len, QUICOffset offset, bool protection)
+QUICFrameFactory::create_crypto_frame(const uint8_t *data, uint64_t data_len, QUICOffset offset)
{
ats_unique_buf buf = ats_unique_malloc(data_len);
memcpy(buf.get(), data, data_len);
QUICCryptoFrame *frame = quicCryptoFrameAllocator.alloc();
- new (frame) QUICCryptoFrame(std::move(buf), data_len, offset, protection);
+ new (frame) QUICCryptoFrame(std::move(buf), data_len, offset);
return QUICCryptoFrameUPtr(frame, &QUICFrameDeleter::delete_crypto_frame);
}
@@ -2616,11 +2587,10 @@ QUICFrameFactory::split_frame(QUICFrame *frame, size_t size)
}
std::unique_ptr<QUICAckFrame, QUICFrameDeleterFunc>
-QUICFrameFactory::create_ack_frame(QUICPacketNumber largest_acknowledged, uint64_t ack_delay, uint64_t first_ack_block,
- bool protection)
+QUICFrameFactory::create_ack_frame(QUICPacketNumber largest_acknowledged, uint64_t ack_delay, uint64_t first_ack_block)
{
QUICAckFrame *frame = quicAckFrameAllocator.alloc();
- new (frame) QUICAckFrame(largest_acknowledged, ack_delay, first_ack_block, protection);
+ new (frame) QUICAckFrame(largest_acknowledged, ack_delay, first_ack_block);
return std::unique_ptr<QUICAckFrame, QUICFrameDeleterFunc>(frame, &QUICFrameDeleter::delete_ack_frame);
}
@@ -2692,7 +2662,7 @@ std::unique_ptr<QUICPingFrame, QUICFrameDeleterFunc>
QUICFrameFactory::create_ping_frame()
{
QUICPingFrame *frame = quicPingFrameAllocator.alloc();
- new (frame) QUICPingFrame(true);
+ new (frame) QUICPingFrame();
return std::unique_ptr<QUICPingFrame, QUICFrameDeleterFunc>(frame, &QUICFrameDeleter::delete_ping_frame);
}
@@ -2703,7 +2673,7 @@ QUICFrameFactory::create_path_challenge_frame(const uint8_t *data)
memcpy(buf.get(), data, QUICPathChallengeFrame::DATA_LEN);
QUICPathChallengeFrame *frame = quicPathChallengeFrameAllocator.alloc();
- new (frame) QUICPathChallengeFrame(std::move(buf), false);
+ new (frame) QUICPathChallengeFrame(std::move(buf));
return std::unique_ptr<QUICPathChallengeFrame, QUICFrameDeleterFunc>(frame, &QUICFrameDeleter::delete_path_challenge_frame);
}
@@ -2714,7 +2684,7 @@ QUICFrameFactory::create_path_response_frame(const uint8_t *data)
memcpy(buf.get(), data, QUICPathResponseFrame::DATA_LEN);
QUICPathResponseFrame *frame = quicPathResponseFrameAllocator.alloc();
- new (frame) QUICPathResponseFrame(std::move(buf), false);
+ new (frame) QUICPathResponseFrame(std::move(buf));
return std::unique_ptr<QUICPathResponseFrame, QUICFrameDeleterFunc>(frame, &QUICFrameDeleter::delete_path_response_frame);
}
diff --git a/iocore/net/quic/QUICFrame.h b/iocore/net/quic/QUICFrame.h
index 0a9769d..2453ec1 100644
--- a/iocore/net/quic/QUICFrame.h
+++ b/iocore/net/quic/QUICFrame.h
@@ -47,8 +47,7 @@ using QUICCryptoFrameSPtr = std::shared_ptr<const QUICCryptoFrame>;
class QUICFrame
{
public:
- QUICFrame(const uint8_t *buf, size_t len, bool protection) : _buf(buf), _len(len), _protection(protection) {}
- QUICFrame(bool protection) : _protection(protection) {}
+ QUICFrame(const uint8_t *buf, size_t len) : _buf(buf), _len(len) {}
virtual ~QUICFrame() {}
static QUICFrameType type(const uint8_t *buf);
@@ -57,7 +56,6 @@ public:
virtual size_t size() const = 0;
virtual size_t store(uint8_t *buf, size_t *len, size_t limit) const = 0;
virtual void reset(const uint8_t *buf, size_t len);
- virtual bool is_protected() const;
virtual QUICFrame *split(size_t size);
virtual int debug_msg(char *msg, size_t msg_len) const;
LINK(QUICFrame, link);
@@ -66,7 +64,6 @@ protected:
QUICFrame() {}
const uint8_t *_buf = nullptr;
size_t _len = 0;
- bool _protection = true;
};
//
@@ -77,9 +74,8 @@ class QUICStreamFrame : public QUICFrame
{
public:
QUICStreamFrame() : QUICFrame() {}
- QUICStreamFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICStreamFrame(ats_unique_buf buf, size_t len, QUICStreamId streamid, QUICOffset offset, bool last = false,
- bool protection = true);
+ QUICStreamFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICStreamFrame(ats_unique_buf buf, size_t len, QUICStreamId streamid, QUICOffset offset, bool last = false);
QUICFrame *split(size_t size) override;
QUICFrameUPtr clone() const override;
@@ -123,8 +119,8 @@ class QUICCryptoFrame : public QUICFrame
{
public:
QUICCryptoFrame() : QUICFrame() {}
- QUICCryptoFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICCryptoFrame(ats_unique_buf buf, size_t len, QUICOffset offset, bool protection = true);
+ QUICCryptoFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICCryptoFrame(ats_unique_buf buf, size_t len, QUICOffset offset);
QUICFrame *split(size_t size) override;
QUICFrameUPtr clone() const override;
@@ -228,7 +224,7 @@ public:
size_t size() const;
size_t store(uint8_t *buf, size_t *len, size_t limit) const;
uint64_t first_ack_block() const;
- void add_ack_block(const AckBlock block, bool protection = true);
+ void add_ack_block(const AckBlock block);
const_iterator begin() const;
const_iterator end() const;
bool has_protected() const;
@@ -240,12 +236,11 @@ public:
uint64_t _first_ack_block = 0;
uint8_t _ack_block_count = 0;
std::vector<QUICAckFrame::AckBlock> _ack_blocks;
- bool _protection = false;
};
QUICAckFrame() : QUICFrame() {}
- QUICAckFrame(const uint8_t *buf, size_t len, bool protection = true);
- QUICAckFrame(QUICPacketNumber largest_acknowledged, uint64_t ack_delay, uint64_t first_ack_block, bool protection = true);
+ QUICAckFrame(const uint8_t *buf, size_t len);
+ QUICAckFrame(QUICPacketNumber largest_acknowledged, uint64_t ack_delay, uint64_t first_ack_block);
virtual ~QUICAckFrame();
virtual void reset(const uint8_t *buf, size_t len) override;
@@ -254,7 +249,6 @@ public:
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;
- bool is_protected() const override;
QUICPacketNumber largest_acknowledged() const;
uint64_t ack_delay() const;
@@ -284,8 +278,8 @@ class QUICRstStreamFrame : public QUICFrame
{
public:
QUICRstStreamFrame() : QUICFrame() {}
- QUICRstStreamFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICRstStreamFrame(QUICStreamId stream_id, QUICAppErrorCode error_code, QUICOffset final_offset, bool protection = true);
+ QUICRstStreamFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICRstStreamFrame(QUICStreamId stream_id, QUICAppErrorCode error_code, QUICOffset final_offset);
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
@@ -316,8 +310,7 @@ class QUICPingFrame : public QUICFrame
{
public:
QUICPingFrame() : QUICFrame() {}
- QUICPingFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICPingFrame(bool protection) : QUICFrame(protection) {}
+ QUICPingFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -334,7 +327,7 @@ class QUICPaddingFrame : public QUICFrame
{
public:
QUICPaddingFrame() : QUICFrame() {}
- QUICPaddingFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
+ QUICPaddingFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -349,9 +342,8 @@ class QUICConnectionCloseFrame : public QUICFrame
{
public:
QUICConnectionCloseFrame() : QUICFrame() {}
- QUICConnectionCloseFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICConnectionCloseFrame(uint16_t error_code, QUICFrameType frame_type, uint64_t reason_phrase_length, const char *reason_phrase,
- bool protection = true);
+ QUICConnectionCloseFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICConnectionCloseFrame(uint16_t error_code, QUICFrameType frame_type, uint64_t reason_phrase_length, const char *reason_phrase);
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -383,9 +375,8 @@ class QUICApplicationCloseFrame : public QUICFrame
{
public:
QUICApplicationCloseFrame() : QUICFrame() {}
- QUICApplicationCloseFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICApplicationCloseFrame(QUICAppErrorCode error_code, uint64_t reason_phrase_length, const char *reason_phrase,
- bool protection = true);
+ QUICApplicationCloseFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICApplicationCloseFrame(QUICAppErrorCode error_code, uint64_t reason_phrase_length, const char *reason_phrase);
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -412,8 +403,8 @@ class QUICMaxDataFrame : public QUICFrame
{
public:
QUICMaxDataFrame() : QUICFrame() {}
- QUICMaxDataFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICMaxDataFrame(uint64_t maximum_data, bool protection = true);
+ QUICMaxDataFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICMaxDataFrame(uint64_t maximum_data);
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -436,8 +427,8 @@ class QUICMaxStreamDataFrame : public QUICFrame
{
public:
QUICMaxStreamDataFrame() : QUICFrame() {}
- QUICMaxStreamDataFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICMaxStreamDataFrame(QUICStreamId stream_id, uint64_t maximum_stream_data, bool protection = true);
+ QUICMaxStreamDataFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICMaxStreamDataFrame(QUICStreamId stream_id, uint64_t maximum_stream_data);
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -465,8 +456,8 @@ class QUICMaxStreamIdFrame : public QUICFrame
{
public:
QUICMaxStreamIdFrame() : QUICFrame() {}
- QUICMaxStreamIdFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICMaxStreamIdFrame(QUICStreamId maximum_stream_id, bool protection = true);
+ QUICMaxStreamIdFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICMaxStreamIdFrame(QUICStreamId maximum_stream_id);
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -486,8 +477,8 @@ class QUICBlockedFrame : public QUICFrame
{
public:
QUICBlockedFrame() : QUICFrame() {}
- QUICBlockedFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICBlockedFrame(QUICOffset offset, bool protection = true) : QUICFrame(protection), _offset(offset){};
+ QUICBlockedFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICBlockedFrame(QUICOffset offset) : _offset(offset){};
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
@@ -510,8 +501,8 @@ class QUICStreamBlockedFrame : public QUICFrame
{
public:
QUICStreamBlockedFrame() : QUICFrame() {}
- QUICStreamBlockedFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICStreamBlockedFrame(QUICStreamId s, QUICOffset o, bool protection = true) : QUICFrame(protection), _stream_id(s), _offset(o){};
+ QUICStreamBlockedFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICStreamBlockedFrame(QUICStreamId s, QUICOffset o) : _stream_id(s), _offset(o){};
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
@@ -537,8 +528,8 @@ class QUICStreamIdBlockedFrame : public QUICFrame
{
public:
QUICStreamIdBlockedFrame() : QUICFrame() {}
- QUICStreamIdBlockedFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICStreamIdBlockedFrame(QUICStreamId s, bool protection = true) : QUICFrame(protection), _stream_id(s) {}
+ QUICStreamIdBlockedFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICStreamIdBlockedFrame(QUICStreamId s) : _stream_id(s) {}
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -560,9 +551,9 @@ class QUICNewConnectionIdFrame : public QUICFrame
{
public:
QUICNewConnectionIdFrame() : QUICFrame() {}
- QUICNewConnectionIdFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICNewConnectionIdFrame(uint64_t seq, QUICConnectionId id, QUICStatelessResetToken token, bool protection = true)
- : QUICFrame(protection), _sequence(seq), _connection_id(id), _stateless_reset_token(token){};
+ QUICNewConnectionIdFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICNewConnectionIdFrame(uint64_t seq, QUICConnectionId id, QUICStatelessResetToken token)
+ : _sequence(seq), _connection_id(id), _stateless_reset_token(token){};
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
@@ -591,8 +582,8 @@ class QUICStopSendingFrame : public QUICFrame
{
public:
QUICStopSendingFrame() : QUICFrame() {}
- QUICStopSendingFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICStopSendingFrame(QUICStreamId stream_id, QUICAppErrorCode error_code, bool protection = true);
+ QUICStopSendingFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICStopSendingFrame(QUICStreamId stream_id, QUICAppErrorCode error_code);
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
@@ -619,8 +610,8 @@ class QUICPathChallengeFrame : public QUICFrame
public:
static constexpr uint8_t DATA_LEN = 8;
QUICPathChallengeFrame() : QUICFrame() {}
- QUICPathChallengeFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICPathChallengeFrame(ats_unique_buf data, bool protection = true) : QUICFrame(protection), _data(std::move(data)) {}
+ QUICPathChallengeFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICPathChallengeFrame(ats_unique_buf data) : _data(std::move(data)) {}
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -643,8 +634,8 @@ class QUICPathResponseFrame : public QUICFrame
public:
static constexpr uint8_t DATA_LEN = 8;
QUICPathResponseFrame() : QUICFrame() {}
- QUICPathResponseFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICPathResponseFrame(ats_unique_buf data, bool protection = true) : QUICFrame(protection), _data(std::move(data)) {}
+ QUICPathResponseFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICPathResponseFrame(ats_unique_buf data) : _data(std::move(data)) {}
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -666,11 +657,8 @@ class QUICNewTokenFrame : public QUICFrame
{
public:
QUICNewTokenFrame() : QUICFrame() {}
- QUICNewTokenFrame(const uint8_t *buf, size_t len, bool protection = true) : QUICFrame(buf, len, protection) {}
- QUICNewTokenFrame(ats_unique_buf token, size_t token_length, bool protection = true)
- : QUICFrame(protection), _token_length(token_length), _token(std::move(token))
- {
- }
+ QUICNewTokenFrame(const uint8_t *buf, size_t len) : QUICFrame(buf, len) {}
+ QUICNewTokenFrame(ats_unique_buf token, size_t token_length) : _token_length(token_length), _token(std::move(token)) {}
QUICFrameUPtr clone() const override;
virtual QUICFrameType type() const override;
virtual size_t size() const override;
@@ -918,13 +906,13 @@ public:
* You have to make sure that the data size won't exceed the maximum size of QUIC packet.
*/
static QUICStreamFrameUPtr create_stream_frame(const uint8_t *data, size_t data_len, QUICStreamId stream_id, QUICOffset offset,
- bool last = false, bool protection = true);
+ bool last = false);
/*
* Creates a CRYPTO frame.
* You have to make sure that the data size won't exceed the maximum size of QUIC packet.
*/
- static QUICCryptoFrameUPtr create_crypto_frame(const uint8_t *data, uint64_t data_len, QUICOffset offset, bool protection = true);
+ static QUICCryptoFrameUPtr create_crypto_frame(const uint8_t *data, uint64_t data_len, QUICOffset offset);
/*
* Creates a ACK frame.
@@ -932,8 +920,7 @@ public:
* need to ack.
*/
static std::unique_ptr<QUICAckFrame, QUICFrameDeleterFunc> create_ack_frame(QUICPacketNumber largest_acknowledged,
- uint64_t ack_delay, uint64_t first_ack_block,
- bool protection = true);
+ uint64_t ack_delay, uint64_t first_ack_block);
/*
* Creates a CONNECTION_CLOSE frame.
*/
diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index f0a1add..9b69c17 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -452,7 +452,7 @@ QUICStream::generate_frame(QUICEncryptionLevel level, uint64_t connection_credit
// STREAM - Pure FIN or data length is lager than 0
frame = QUICFrameFactory::create_stream_frame(reinterpret_cast<const uint8_t *>(reader->start()), len, this->_id,
- this->_send_offset, fin, true);
+ this->_send_offset, fin);
if (!this->_state.is_allowed_to_send(*frame)) {
QUICStreamDebug("Canceled sending %s frame due to the stream state", QUICDebugNames::frame_type(frame->type()));
return frame;
@@ -699,7 +699,7 @@ QUICCryptoStream::generate_frame(QUICEncryptionLevel level, uint64_t connection_
}
frame = QUICFrameFactory::create_crypto_frame(reinterpret_cast<const uint8_t *>(this->_write_buffer_reader->start()),
- frame_payload_size, this->_send_offset, true);
+ frame_payload_size, this->_send_offset);
this->_send_offset += frame_payload_size;
this->_write_buffer_reader->consume(frame_payload_size);
diff --git a/iocore/net/quic/test/test_QUICFrame.cc b/iocore/net/quic/test/test_QUICFrame.cc
index d488a2a..c7c9b77 100644
--- a/iocore/net/quic/test/test_QUICFrame.cc
+++ b/iocore/net/quic/test/test_QUICFrame.cc
@@ -591,7 +591,7 @@ TEST_CASE("Store Ping Frame", "[quic]")
0x07, // Type
};
- QUICPingFrame frame(true);
+ QUICPingFrame frame;
CHECK(frame.size() == 1);
frame.store(buf, &len, 16);
@@ -1098,7 +1098,7 @@ TEST_CASE("Store PATH_CHALLENGE Frame", "[quic]")
ats_unique_buf data = ats_unique_malloc(raw_len);
memcpy(data.get(), raw, raw_len);
- QUICPathChallengeFrame frame(std::move(data), QUICPathChallengeFrame::DATA_LEN);
+ QUICPathChallengeFrame frame(std::move(data));
CHECK(frame.size() == 9);
frame.store(buf, &len, 16);
@@ -1136,7 +1136,7 @@ TEST_CASE("Store PATH_RESPONSE Frame", "[quic]")
ats_unique_buf data = ats_unique_malloc(raw_len);
memcpy(data.get(), raw, raw_len);
- QUICPathResponseFrame frame(std::move(data), QUICPathResponseFrame::DATA_LEN);
+ QUICPathResponseFrame frame(std::move(data));
CHECK(frame.size() == 9);
frame.store(buf, &len, 16);