trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mas...@apache.org
Subject [trafficserver] branch quic-latest updated: Remove send_frame from QUICStreamManager
Date Tue, 12 Sep 2017 07:20:39 GMT
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 2786a2c  Remove send_frame from QUICStreamManager
2786a2c is described below

commit 2786a2c23a3250df3be41f16b92ac0fdce4420ac
Author: Masakazu Kitajo <maskit@apache.org>
AuthorDate: Tue Sep 12 16:11:53 2017 +0900

    Remove send_frame from QUICStreamManager
    
    Since QUICStreamManager::send_frame does nothing, QUICStreams pass frames to QUICFrameTransmitter
directly
---
 iocore/net/quic/Mock.h                  |  2 --
 iocore/net/quic/QUICStream.cc           |  6 ++----
 iocore/net/quic/QUICStream.h            |  3 +--
 iocore/net/quic/QUICStreamManager.cc    | 28 ++--------------------------
 iocore/net/quic/QUICStreamManager.h     |  2 --
 iocore/net/quic/test/test_QUICStream.cc |  8 +++-----
 6 files changed, 8 insertions(+), 41 deletions(-)

diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h
index ddf056d..af8b7ff 100644
--- a/iocore/net/quic/Mock.h
+++ b/iocore/net/quic/Mock.h
@@ -306,8 +306,6 @@ public:
     return _totalFrameCount;
   }
 
-  void send_frame(std::unique_ptr<QUICFrame, QUICFrameDeleterFunc> /* frame */) override
{ return; }
-
 private:
   int _totalFrameCount = 0;
   int _frameCount[256] = {0};
diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index b986148..91033fe 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -32,11 +32,9 @@
   Debug("quic_stream", "[%" PRIx32 "] [%s] " fmt, this->_id, QUICDebugNames::stream_state(this->_state),
##__VA_ARGS__)
 
 void
-QUICStream::init(QUICStreamManager *manager, QUICFrameTransmitter *tx, QUICStreamId id, uint64_t
recv_max_stream_data,
-                 uint64_t send_max_stream_data)
+QUICStream::init(QUICFrameTransmitter *tx, QUICStreamId id, uint64_t recv_max_stream_data,
uint64_t send_max_stream_data)
 {
   this->mutex                   = new_ProxyMutex();
-  this->_stream_manager         = manager;
   this->_tx                     = tx;
   this->_id                     = id;
   this->_remote_flow_controller = new QUICRemoteStreamFlowController(send_max_stream_data,
_tx, _id);
@@ -380,7 +378,7 @@ QUICStream::_send()
       break;
     }
     this->_state.update_with_sent_frame(*frame);
-    this->_stream_manager->send_frame(std::move(frame));
+    this->_tx->transmit_frame(std::move(frame));
   }
 
   return error;
diff --git a/iocore/net/quic/QUICStream.h b/iocore/net/quic/QUICStream.h
index ff7bb14..1a1fe71 100644
--- a/iocore/net/quic/QUICStream.h
+++ b/iocore/net/quic/QUICStream.h
@@ -45,8 +45,7 @@ class QUICStream : public VConnection
 public:
   QUICStream() : VConnection(nullptr) {}
   ~QUICStream() {}
-  void init(QUICStreamManager *manager, QUICFrameTransmitter *tx, uint32_t id, uint64_t recv_max_stream_data
= 0,
-            uint64_t send_max_stream_data = 0);
+  void init(QUICFrameTransmitter *tx, uint32_t id, uint64_t recv_max_stream_data = 0, uint64_t
send_max_stream_data = 0);
   void start();
   void init_flow_control_params(uint32_t recv_max_stream_data, uint32_t send_max_stream_data);
   int main_event_handler(int event, void *data);
diff --git a/iocore/net/quic/QUICStreamManager.cc b/iocore/net/quic/QUICStreamManager.cc
index a5daa62..ca789e5 100644
--- a/iocore/net/quic/QUICStreamManager.cc
+++ b/iocore/net/quic/QUICStreamManager.cc
@@ -155,30 +155,6 @@ QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICRstStreamFrame>
   return QUICError(QUICErrorClass::NONE);
 }
 
-/**
- * @brief Send stream frame
- */
-void
-QUICStreamManager::send_frame(std::unique_ptr<QUICStreamFrame, QUICFrameDeleterFunc>
frame)
-{
-  if (frame->stream_id() != STREAM_ID_FOR_HANDSHAKE) {
-  }
-  this->_tx->transmit_frame(std::move(frame));
-
-  return;
-}
-
-/**
- * @brief Send frame
- */
-void
-QUICStreamManager::send_frame(std::unique_ptr<QUICFrame, QUICFrameDeleterFunc> frame)
-{
-  this->_tx->transmit_frame(std::move(frame));
-
-  return;
-}
-
 QUICStream *
 QUICStreamManager::_find_stream(QUICStreamId id)
 {
@@ -199,13 +175,13 @@ QUICStreamManager::_find_or_create_stream(QUICStreamId stream_id)
     stream = new (THREAD_ALLOC(quicStreamAllocator, this_ethread())) QUICStream();
     if (stream_id == STREAM_ID_FOR_HANDSHAKE) {
       // XXX rece/send max_stream_data are going to be set by init_flow_control_params()
-      stream->init(this, this->_tx, stream_id, this->_local_tp->initial_max_stream_data());
+      stream->init(this->_tx, stream_id, this->_local_tp->initial_max_stream_data());
     } else {
       const QUICTransportParameters &local_tp  = *this->_local_tp;
       const QUICTransportParameters &remote_tp = *this->_remote_tp;
 
       // TODO: check local_tp and remote_tp is initialized
-      stream->init(this, this->_tx, stream_id, local_tp.initial_max_stream_data(),
remote_tp.initial_max_stream_data());
+      stream->init(this->_tx, stream_id, local_tp.initial_max_stream_data(), remote_tp.initial_max_stream_data());
     }
 
     stream->start();
diff --git a/iocore/net/quic/QUICStreamManager.h b/iocore/net/quic/QUICStreamManager.h
index fd6412a..40753d4 100644
--- a/iocore/net/quic/QUICStreamManager.h
+++ b/iocore/net/quic/QUICStreamManager.h
@@ -38,8 +38,6 @@ public:
   QUICStreamManager(){};
   QUICStreamManager(QUICFrameTransmitter *tx, QUICApplicationMap *app_map);
 
-  virtual void send_frame(std::unique_ptr<QUICFrame, QUICFrameDeleterFunc> frame);
-  virtual void send_frame(std::unique_ptr<QUICStreamFrame, QUICFrameDeleterFunc> frame);
   void init_flow_control_params(const std::shared_ptr<const QUICTransportParameters>
&local_tp,
                                 const std::shared_ptr<const QUICTransportParameters>
&remote_tp);
   uint64_t total_offset_received() const;
diff --git a/iocore/net/quic/test/test_QUICStream.cc b/iocore/net/quic/test/test_QUICStream.cc
index 99563bc..545d353 100644
--- a/iocore/net/quic/test/test_QUICStream.cc
+++ b/iocore/net/quic/test/test_QUICStream.cc
@@ -41,8 +41,6 @@ std::shared_ptr<QUICStreamFrame> frame_6 = std::make_shared<QUICStreamFrame>(pay
 std::shared_ptr<QUICStreamFrame> frame_7 = std::make_shared<QUICStreamFrame>(payload
+ 12, 2, stream_id, 12);
 std::shared_ptr<QUICStreamFrame> frame_8 = std::make_shared<QUICStreamFrame>(payload
+ 14, 2, stream_id, 14);
 
-MockQUICStreamManager *manager = new MockQUICStreamManager();
-
 TEST_CASE("QUICStream_assembling_byte_stream_1", "[quic]")
 {
   MIOBuffer *read_buffer = new_MIOBuffer(BUFFER_SIZE_INDEX_4K);
@@ -50,7 +48,7 @@ TEST_CASE("QUICStream_assembling_byte_stream_1", "[quic]")
   MockQUICFrameTransmitter tx;
 
   std::unique_ptr<QUICStream> stream(new QUICStream());
-  stream->init(manager, &tx, stream_id, 1024, 1024);
+  stream->init(&tx, stream_id, 1024, 1024);
   stream->do_io_read(nullptr, 0, read_buffer);
 
   stream->recv(frame_1);
@@ -77,7 +75,7 @@ TEST_CASE("QUICStream_assembling_byte_stream_2", "[quic]")
   MockQUICFrameTransmitter tx;
 
   std::unique_ptr<QUICStream> stream(new QUICStream());
-  stream->init(manager, &tx, stream_id);
+  stream->init(&tx, stream_id);
   stream->do_io_read(nullptr, 0, read_buffer);
 
   stream->recv(frame_8);
@@ -104,7 +102,7 @@ TEST_CASE("QUICStream_assembling_byte_stream_3", "[quic]")
   MockQUICFrameTransmitter tx;
 
   std::unique_ptr<QUICStream> stream(new QUICStream());
-  stream->init(manager, &tx, stream_id);
+  stream->init(&tx, stream_id);
   stream->do_io_read(nullptr, 0, read_buffer);
 
   stream->recv(frame_8);

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message