trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mas...@apache.org
Subject [trafficserver] 04/05: Fix trivial things
Date Fri, 01 Sep 2017 07:49:13 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

commit 05de7b0180622c53527e5656a601ee3c1bd4e4d5
Author: Masakazu Kitajo <maskit@apache.org>
AuthorDate: Wed Aug 30 14:16:15 2017 +0900

    Fix trivial things
---
 iocore/net/quic/QUICStream.cc | 43 ++++++++++++++++++++++---------------------
 iocore/net/quic/QUICStream.h  | 12 ++++++------
 2 files changed, 28 insertions(+), 27 deletions(-)

diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index 42db203..c7f4615 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -28,8 +28,9 @@
 #include "QUICDebugNames.h"
 #include "QUICConfig.h"
 
-#define DebugQUICStream(fmt, ...) \
-  Debug("quic_stream", "[%" PRIx64 "] [%s] " fmt, static_cast<uint64_t>(this->_id),
QUICDebugNames::stream_state(this->_state), ##__VA_ARGS__)
+#define DebugQUICStream(fmt, ...)                                                       
                                       \
+  Debug("quic_stream", "[%" PRIx64 "] [%s] " fmt, static_cast<uint64_t>(this->_id),
QUICDebugNames::stream_state(this->_state), \
+        ##__VA_ARGS__)
 
 static constexpr uint64_t MAX_DATA_HEADSPACE        = 10240; // in uints of octets
 static constexpr uint64_t MAX_STREAM_DATA_HEADSPACE = 1024;
@@ -38,9 +39,9 @@ void
 QUICStream::init(QUICStreamManager *manager, QUICFrameTransmitter *tx, QUICStreamId id, uint64_t
recv_max_stream_data,
                  uint64_t send_max_stream_data)
 {
-  this->_streamManager = manager;
-  this->_tx            = tx;
-  this->_id            = id;
+  this->_stream_manager = manager;
+  this->_tx             = tx;
+  this->_id             = id;
   init_flow_control_params(recv_max_stream_data, send_max_stream_data);
 
   this->mutex = new_ProxyMutex();
@@ -56,12 +57,12 @@ QUICStream::start()
 void
 QUICStream::init_flow_control_params(uint32_t recv_max_stream_data, uint32_t send_max_stream_data)
 {
-  this->_recv_max_stream_data        = recv_max_stream_data;
-  this->_recv_max_stream_data_deleta = recv_max_stream_data;
-  this->_send_max_stream_data        = send_max_stream_data;
+  this->_recv_max_stream_data       = recv_max_stream_data;
+  this->_recv_max_stream_data_delta = recv_max_stream_data;
+  this->_send_max_stream_data       = send_max_stream_data;
 }
 
-uint32_t
+QUICStreamId
 QUICStream::id()
 {
   return this->_id;
@@ -316,8 +317,8 @@ void
 QUICStream::_slide_recv_max_stream_data()
 {
   // TODO: How much should this be increased?
-  this->_recv_max_stream_data += this->_recv_max_stream_data_deleta;
-  this->_streamManager->send_frame(QUICFrameFactory::create_max_stream_data_frame(this->_id,
this->_recv_max_stream_data));
+  this->_recv_max_stream_data += this->_recv_max_stream_data_delta;
+  this->_stream_manager->send_frame(QUICFrameFactory::create_max_stream_data_frame(this->_id,
this->_recv_max_stream_data));
 }
 
 QUICError
@@ -330,20 +331,20 @@ QUICStream::_recv_flow_control(uint64_t new_offset)
   uint64_t delta = new_offset - this->_recv_largest_offset;
 
   Debug("quic_flow_ctrl", "Con: %" PRIu64 "/%" PRIu64 " Stream: %" PRIu64 "/%" PRIu64,
-        (this->_streamManager->recv_total_offset() + delta) / 1024, this->_streamManager->recv_max_data(),
new_offset,
+        (this->_stream_manager->recv_total_offset() + delta) / 1024, this->_stream_manager->recv_max_data(),
new_offset,
         this->_recv_max_stream_data);
 
   // Connection Level Flow Control
   if (this->_id != STREAM_ID_FOR_HANDSHAKE) {
-    if (!this->_streamManager->is_recv_avail_more_than(delta)) {
+    if (!this->_stream_manager->is_recv_avail_more_than(delta)) {
       return QUICError(QUICErrorClass::QUIC_TRANSPORT, QUICErrorCode::QUIC_FLOW_CONTROL_RECEIVED_TOO_MUCH_DATA);
     }
 
-    if (!this->_streamManager->is_recv_avail_more_than(delta + MAX_DATA_HEADSPACE))
{
-      this->_streamManager->slide_recv_max_data();
+    if (!this->_stream_manager->is_recv_avail_more_than(delta + MAX_DATA_HEADSPACE))
{
+      this->_stream_manager->slide_recv_max_data();
     }
 
-    this->_streamManager->add_recv_total_offset(delta);
+    this->_stream_manager->add_recv_total_offset(delta);
   }
 
   // Stream Level Flow Control
@@ -402,7 +403,7 @@ QUICStream::_send()
       break;
     }
     this->_state.update_with_sent_frame(*frame);
-    this->_streamManager->send_frame(std::move(frame));
+    this->_stream_manager->send_frame(std::move(frame));
   }
 
   return;
@@ -412,21 +413,21 @@ bool
 QUICStream::_send_flow_control(uint64_t len)
 {
   Debug("quic_flow_ctrl", "Con: %" PRIu64 "/%" PRIu64 " Stream: %" PRIu64 "/%" PRIu64,
-        (this->_streamManager->send_total_offset() + len) / 1024, this->_streamManager->send_max_data(),
this->_send_offset + len,
+        (this->_stream_manager->send_total_offset() + len) / 1024, this->_stream_manager->send_max_data(),
this->_send_offset + len,
         this->_send_max_stream_data);
 
   // Stream Level Flow Control
   // TODO: remove check of _send_max_stream_data when moved to Second Implementation completely
   if (this->_send_max_stream_data > 0 && len > this->_send_max_stream_data)
{
-    this->_streamManager->send_frame(QUICFrameFactory::create_stream_blocked_frame(this->_id));
+    this->_stream_manager->send_frame(QUICFrameFactory::create_stream_blocked_frame(this->_id));
 
     return false;
   }
 
   // Connection Level Flow Control
   if (this->_id != STREAM_ID_FOR_HANDSHAKE) {
-    if (!this->_streamManager->is_send_avail_more_than(len)) {
-      this->_streamManager->send_frame(QUICFrameFactory::create_blocked_frame());
+    if (!this->_stream_manager->is_send_avail_more_than(len)) {
+      this->_stream_manager->send_frame(QUICFrameFactory::create_blocked_frame());
 
       return false;
     }
diff --git a/iocore/net/quic/QUICStream.h b/iocore/net/quic/QUICStream.h
index b2110d5..e3c6d9c 100644
--- a/iocore/net/quic/QUICStream.h
+++ b/iocore/net/quic/QUICStream.h
@@ -50,7 +50,7 @@ public:
   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);
 
-  uint32_t id();
+  QUICStreamId id();
 
   // Implement VConnection interface.
   VIO *do_io_read(Continuation *c, int64_t nbytes = INT64_MAX, MIOBuffer *buf = nullptr)
override;
@@ -94,9 +94,9 @@ private:
   QUICOffset _recv_largest_offset = 0;
   QUICOffset _send_offset         = 0;
 
-  uint64_t _recv_max_stream_data        = 0;
-  uint64_t _recv_max_stream_data_deleta = 0;
-  uint64_t _send_max_stream_data        = 0;
+  uint64_t _recv_max_stream_data       = 0;
+  uint64_t _recv_max_stream_data_delta = 0;
+  uint64_t _send_max_stream_data       = 0;
 
   VIO _read_vio;
   VIO _write_vio;
@@ -108,6 +108,6 @@ private:
   // TODO: Consider to replace with ts/RbTree.h or other data structure
   std::map<QUICOffset, std::shared_ptr<const QUICStreamFrame>> _request_stream_frame_buffer;
 
-  QUICStreamManager *_streamManager = nullptr;
-  QUICFrameTransmitter *_tx         = nullptr;
+  QUICStreamManager *_stream_manager = nullptr;
+  QUICFrameTransmitter *_tx          = nullptr;
 };

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

Mime
View raw message