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/08/23 06:20:57 UTC

[trafficserver] branch quic-latest updated: Cleanup: Remove QUICPacketTransmitter::transmit_packet()

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 0a2fd36  Cleanup: Remove QUICPacketTransmitter::transmit_packet()
0a2fd36 is described below

commit 0a2fd364d8e3826fa5530760a8eaf03e1008e478
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Thu Aug 23 14:58:09 2018 +0900

    Cleanup: Remove QUICPacketTransmitter::transmit_packet()
---
 iocore/net/P_QUICNetVConnection.h       |  3 ---
 iocore/net/QUICNetVConnection.cc        | 22 ----------------------
 iocore/net/quic/Mock.h                  | 16 ----------------
 iocore/net/quic/QUICLossDetector.cc     | 11 ++++-------
 iocore/net/quic/QUICPacketTransmitter.h |  9 ---------
 5 files changed, 4 insertions(+), 57 deletions(-)

diff --git a/iocore/net/P_QUICNetVConnection.h b/iocore/net/P_QUICNetVConnection.h
index 27a3410..5e6e0d3 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -209,7 +209,6 @@ public:
   bool is_closed() const override;
 
   // QUICConnection (QUICPacketTransmitter)
-  virtual uint32_t transmit_packet(QUICPacketUPtr packet) override;
   virtual void retransmit_packet(const QUICPacket &packet) override;
   virtual Ptr<ProxyMutex> get_packet_transmitter_mutex() override;
 
@@ -269,7 +268,6 @@ private:
   QUICPathValidator *_path_validator                = nullptr;
 
   QUICPacketReceiveQueue _packet_recv_queue = {this->_packet_factory, this->_pn_protector};
-  CountQueue<QUICPacket> _packet_send_queue;
 
   QUICConnectionErrorUPtr _connection_error  = nullptr;
   uint32_t _state_closing_recv_packet_count  = 0;
@@ -296,7 +294,6 @@ private:
   Event *_path_validation_timeout = nullptr;
 
   uint64_t _maximum_stream_frame_data_size();
-  uint32_t _transmit_packet(QUICPacketUPtr packet);
   void _store_frame(ats_unique_buf &buf, size_t &offset, uint64_t &max_frame_size, QUICFrameUPtr frame);
   QUICPacketUPtr _packetize_frames(QUICEncryptionLevel level, uint64_t max_packet_size);
   void _packetize_closing_frame();
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 750fa09..03fde79 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -411,28 +411,6 @@ QUICNetVConnection::stream_manager()
   return this->_stream_manager;
 }
 
-uint32_t
-QUICNetVConnection::_transmit_packet(QUICPacketUPtr packet)
-{
-  SCOPED_MUTEX_LOCK(packet_transmitter_lock, this->_packet_transmitter_mutex, this_ethread());
-
-  if (packet) {
-    QUICConDebug("Enqueue %s packet #%" PRIu64 " size=%hu %s", QUICDebugNames::packet_type(packet->type()), packet->packet_number(),
-                 packet->size(), (!packet->is_retransmittable()) ? "ack_only" : "");
-    // TODO Remove const_cast
-    this->_packet_send_queue.enqueue(const_cast<QUICPacket *>(packet.release()));
-  }
-  return this->_packet_send_queue.size;
-}
-
-uint32_t
-QUICNetVConnection::transmit_packet(QUICPacketUPtr packet)
-{
-  uint32_t npackets = this->_transmit_packet(std::move(packet));
-  this->_schedule_packet_write_ready();
-  return npackets;
-}
-
 void
 QUICNetVConnection::retransmit_packet(const QUICPacket &packet)
 {
diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h
index 1bc08a4..df68c42 100644
--- a/iocore/net/quic/Mock.h
+++ b/iocore/net/quic/Mock.h
@@ -179,13 +179,6 @@ public:
     return std::string_view("00000000-00000000"sv);
   }
 
-  uint32_t
-  transmit_packet(QUICPacketUPtr packet) override
-  {
-    ++_transmit_count;
-    return 1;
-  }
-
   void
   retransmit_packet(const QUICPacket &packet) override
   {
@@ -368,15 +361,6 @@ class MockQUICPacketTransmitter : public QUICPacketTransmitter
 {
 public:
   MockQUICPacketTransmitter() : QUICPacketTransmitter() { this->_mutex = new_ProxyMutex(); };
-  uint32_t
-  transmit_packet(QUICPacketUPtr packet) override
-  {
-    if (packet) {
-      this->transmitted.insert(packet->packet_number());
-      return 1;
-    }
-    return 0;
-  }
 
   void
   retransmit_packet(const QUICPacket &packet) override
diff --git a/iocore/net/quic/QUICLossDetector.cc b/iocore/net/quic/QUICLossDetector.cc
index 2773d80..de3c864 100644
--- a/iocore/net/quic/QUICLossDetector.cc
+++ b/iocore/net/quic/QUICLossDetector.cc
@@ -507,11 +507,10 @@ QUICLossDetector::_send_one_packet()
 {
   SCOPED_MUTEX_LOCK(transmitter_lock, this->_transmitter->get_packet_transmitter_mutex().get(), this_ethread());
   SCOPED_MUTEX_LOCK(lock, this->_loss_detection_mutex, this_ethread());
-  if (this->_transmitter->transmit_packet() < 1) {
-    auto ite = this->_sent_packets.rbegin();
-    if (ite != this->_sent_packets.rend()) {
-      this->_transmitter->retransmit_packet(*ite->second->packet);
-    }
+
+  auto ite = this->_sent_packets.rbegin();
+  if (ite != this->_sent_packets.rend()) {
+    this->_transmitter->retransmit_packet(*ite->second->packet);
   }
 }
 
@@ -527,8 +526,6 @@ QUICLossDetector::_send_two_packets()
     if (ite != this->_sent_packets.rend()) {
       this->_transmitter->retransmit_packet(*ite->second->packet);
     }
-  } else {
-    this->_transmitter->transmit_packet();
   }
 }
 
diff --git a/iocore/net/quic/QUICPacketTransmitter.h b/iocore/net/quic/QUICPacketTransmitter.h
index d562257..c60e55c 100644
--- a/iocore/net/quic/QUICPacketTransmitter.h
+++ b/iocore/net/quic/QUICPacketTransmitter.h
@@ -30,15 +30,6 @@ class QUICPacketTransmitter
 {
 public:
   /*
-   * Enqueue a packet for transmission
-   *
-   * If packet parameter is not passed, it just sends an event without queuing a new packet.
-   * This sends QUIC_PACKET_WRITE_READY event.
-   * This return number of packets currently in queue
-   */
-  virtual uint32_t transmit_packet(QUICPacketUPtr packet = QUICPacketUPtr(nullptr, &QUICPacketDeleter::delete_packet)) = 0;
-
-  /*
    * Enqueue a packet for retransmission
    * All frames except ACK and PADDING frames in the original packet will be retransmitted on a new packet.
    * This sends QUIC_PACKET_WRITE_READY event.