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 666ee79 Remove QUICPacketRetransmitter 666ee79 is described below commit 666ee793da1c177bc5d4ee785422896888fb51fc Author: Masakazu Kitajo <mas...@apache.org> AuthorDate: Tue Feb 5 14:49:30 2019 +0900 Remove QUICPacketRetransmitter --- iocore/net/P_QUICNetVConnection.h | 2 - iocore/net/QUICNetVConnection.cc | 16 +---- iocore/net/quic/Makefile.am | 1 - iocore/net/quic/QUICPacketRetransmitter.cc | 109 ----------------------------- iocore/net/quic/QUICPacketRetransmitter.h | 43 ------------ 5 files changed, 1 insertion(+), 170 deletions(-) diff --git a/iocore/net/P_QUICNetVConnection.h b/iocore/net/P_QUICNetVConnection.h index 8890ca9..7d7b8d7 100644 --- a/iocore/net/P_QUICNetVConnection.h +++ b/iocore/net/P_QUICNetVConnection.h @@ -52,7 +52,6 @@ #include "quic/QUICHandshakeProtocol.h" #include "quic/QUICAckFrameCreator.h" #include "quic/QUICPinger.h" -#include "quic/QUICPacketRetransmitter.h" #include "quic/QUICLossDetector.h" #include "quic/QUICStreamManager.h" #include "quic/QUICAltConnectionManager.h" @@ -254,7 +253,6 @@ private: QUICFrameFactory _frame_factory; QUICAckFrameManager _ack_frame_manager; QUICPinger _pinger; - QUICPacketRetransmitter _packet_retransmitter; QUICPacketHeaderProtector _ph_protector; QUICRTTMeasure _rtt_measure; QUICApplicationMap *_application_map = nullptr; diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc index 453002f..e68d5ea 100644 --- a/iocore/net/QUICNetVConnection.cc +++ b/iocore/net/QUICNetVConnection.cc @@ -472,9 +472,7 @@ QUICNetVConnection::stream_manager() void QUICNetVConnection::retransmit_packet(const QUICPacket &packet) { - QUICConDebug("Retransmit %s packet #%" PRIu64, QUICDebugNames::packet_type(packet.type()), packet.packet_number()); - - this->_packet_retransmitter.retransmit_packet(packet); + QUICConDebug("[NOP] Retransmit %s packet #%" PRIu64, QUICDebugNames::packet_type(packet.type()), packet.packet_number()); } Ptr<ProxyMutex> @@ -955,7 +953,6 @@ QUICNetVConnection::_state_handshake_process_version_negotiation_packet(QUICPack } this->_congestion_controller->reset(); SCOPED_MUTEX_LOCK(packet_transmitter_lock, this->_packet_transmitter_mutex, this_ethread()); - this->_packet_retransmitter.reset(); // start handshake over this->_handshake_handler->reset(); @@ -1031,7 +1028,6 @@ QUICNetVConnection::_state_handshake_process_retry_packet(QUICPacketUPtr packet) } this->_congestion_controller->reset(); SCOPED_MUTEX_LOCK(packet_transmitter_lock, this->_packet_transmitter_mutex, this_ethread()); - this->_packet_retransmitter.reset(); this->_packet_recv_queue.reset(); // Initialize Key Materials with peer CID. Because peer CID is DCID of (second) INITIAL packet from client which reply to RETRY @@ -1381,16 +1377,6 @@ QUICNetVConnection::_packetize_frames(QUICEncryptionLevel level, uint64_t max_pa } } - // Lost frames - frame = this->_packet_retransmitter.generate_frame(level, UINT16_MAX, max_frame_size); - while (frame) { - ++frame_count; - probing |= frame->is_probing_frame(); - this->_store_frame(buf, len, max_frame_size, frame, frames); - - frame = this->_packet_retransmitter.generate_frame(level, UINT16_MAX, max_frame_size); - } - // MAX_DATA frame = this->_local_flow_controller->generate_frame(level, UINT16_MAX, max_frame_size); if (frame) { diff --git a/iocore/net/quic/Makefile.am b/iocore/net/quic/Makefile.am index 2b12239..9e55520 100644 --- a/iocore/net/quic/Makefile.am +++ b/iocore/net/quic/Makefile.am @@ -77,7 +77,6 @@ libquic_a_SOURCES = \ QUICApplicationMap.cc \ QUICIncomingFrameBuffer.cc \ QUICPacketReceiveQueue.cc \ - QUICPacketRetransmitter.cc \ QUICPathValidator.cc \ QUICPinger.cc \ QUICFrameGenerator.cc \ diff --git a/iocore/net/quic/QUICPacketRetransmitter.cc b/iocore/net/quic/QUICPacketRetransmitter.cc deleted file mode 100644 index b200781..0000000 --- a/iocore/net/quic/QUICPacketRetransmitter.cc +++ /dev/null @@ -1,109 +0,0 @@ -/** @file - * - * A brief file description - * - * @section license License - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "QUICPacketRetransmitter.h" -#include "QUICDebugNames.h" - -void -QUICPacketRetransmitter::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(); - - QUICFrameUPtr frame = QUICFrameFactory::create_null_frame(); - uint16_t cursor = 0; - - while (cursor < size) { - frame = QUICFrameFactory::create(payload + cursor, size - cursor); - cursor += frame->size(); - - switch (frame->type()) { - case QUICFrameType::PADDING: - case QUICFrameType::ACK: - case QUICFrameType::PATH_CHALLENGE: - case QUICFrameType::PATH_RESPONSE: - case QUICFrameType::RESET_STREAM: - case QUICFrameType::DATA_BLOCKED: - case QUICFrameType::STREAM_DATA_BLOCKED: - case QUICFrameType::MAX_DATA: - case QUICFrameType::MAX_STREAM_DATA: - case QUICFrameType::NEW_TOKEN: - case QUICFrameType::PING: - case QUICFrameType::STOP_SENDING: - case QUICFrameType::CONNECTION_CLOSE: - case QUICFrameType::STREAM: - case QUICFrameType::CRYPTO: - case QUICFrameType::NEW_CONNECTION_ID: - case QUICFrameType::RETIRE_CONNECTION_ID: - break; - default: - frame = QUICFrameFactory::create_retransmission_frame(frame->clone(), packet); - int index = static_cast<int>(QUICTypeUtil::encryption_level(packet.type())); - this->_retransmission_frames[index].push(std::move(frame)); - break; - } - } -} - -void -QUICPacketRetransmitter::reset() -{ - for (auto level : QUIC_ENCRYPTION_LEVELS) { - int index = static_cast<int>(level); - while (!this->_retransmission_frames[index].empty()) { - this->_retransmission_frames[index].pop(); - } - } -} - -bool -QUICPacketRetransmitter::will_generate_frame(QUICEncryptionLevel level) -{ - return !this->_retransmission_frames[static_cast<int>(level)].empty(); -} - -QUICFrameUPtr -QUICPacketRetransmitter::generate_frame(QUICEncryptionLevel level, uint64_t connection_credit, uint16_t maximum_frame_size) -{ - QUICFrameUPtr frame = QUICFrameFactory::create_null_frame(); - int index = static_cast<int>(level); - if (!this->_retransmission_frames[index].empty()) { - frame = std::move(this->_retransmission_frames[index].front()); - this->_retransmission_frames[index].pop(); - - if (frame->size() > maximum_frame_size) { - auto new_frame = QUICFrameFactory::split_frame(frame.get(), maximum_frame_size); - if (new_frame) { - this->_retransmission_frames[index].push(std::move(new_frame)); - } else { - // failed to split frame return nullptr - this->_retransmission_frames[index].push(std::move(frame)); - frame = QUICFrameFactory::create_null_frame(); - } - } - } - return frame; -} diff --git a/iocore/net/quic/QUICPacketRetransmitter.h b/iocore/net/quic/QUICPacketRetransmitter.h deleted file mode 100644 index 93de7cf..0000000 --- a/iocore/net/quic/QUICPacketRetransmitter.h +++ /dev/null @@ -1,43 +0,0 @@ -/** @file - * - * A brief file description - * - * @section license License - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include "QUICPacket.h" -#include "QUICFrame.h" -#include "QUICFrameGenerator.h" -#include <queue> - -class QUICPacketRetransmitter : public QUICFrameGenerator -{ -public: - void retransmit_packet(const QUICPacket &packet); - void reset(); - - // QUICFrameGenerator - bool will_generate_frame(QUICEncryptionLevel level) override; - QUICFrameUPtr generate_frame(QUICEncryptionLevel level, uint64_t connection_credit, uint16_t maximum_frame_size) override; - -private: - std::queue<QUICFrameUPtr> _retransmission_frames[4]; -};