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: Rename BLOCKED frame to DATA_BLOCKED frame
Date Fri, 01 Feb 2019 07:18:08 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 e0df825  Rename BLOCKED frame to DATA_BLOCKED frame
e0df825 is described below

commit e0df8254057543ddbe0cb3904e9b9aa7a7cb9160
Author: Masakazu Kitajo <maskit@apache.org>
AuthorDate: Fri Feb 1 16:17:14 2019 +0900

    Rename BLOCKED frame to DATA_BLOCKED frame
---
 iocore/net/quic/QUICFlowController.cc           |  2 +-
 iocore/net/quic/QUICFrame.cc                    | 34 ++++++++++++-------------
 iocore/net/quic/QUICFrame.h                     | 17 +++++++------
 iocore/net/quic/test/test_QUICFlowController.cc |  6 ++---
 iocore/net/quic/test/test_QUICFrame.cc          |  5 ++--
 src/tscore/Diags.cc                             |  9 +------
 6 files changed, 34 insertions(+), 39 deletions(-)

diff --git a/iocore/net/quic/QUICFlowController.cc b/iocore/net/quic/QUICFlowController.cc
index a973543..078f09b 100644
--- a/iocore/net/quic/QUICFlowController.cc
+++ b/iocore/net/quic/QUICFlowController.cc
@@ -217,7 +217,7 @@ QUICLocalFlowController::_need_to_forward_limit()
 QUICFrameUPtr
 QUICRemoteConnectionFlowController::_create_frame()
 {
-  auto frame                    = QUICFrameFactory::create_blocked_frame(this->_offset,
this->_issue_frame_id(), this);
+  auto frame                    = QUICFrameFactory::create_data_blocked_frame(this->_offset,
this->_issue_frame_id(), this);
   QUICFrameInformationUPtr info = QUICFrameInformationUPtr(quicFrameInformationAllocator.alloc());
   info->type                    = frame->type();
   info->level                   = QUICEncryptionLevel::NONE;
diff --git a/iocore/net/quic/QUICFrame.cc b/iocore/net/quic/QUICFrame.cc
index f9d4e09..4c78b67 100644
--- a/iocore/net/quic/QUICFrame.cc
+++ b/iocore/net/quic/QUICFrame.cc
@@ -40,7 +40,7 @@ ClassAllocator<QUICMaxDataFrame> quicMaxDataFrameAllocator("quicMaxDataFrameAllo
 ClassAllocator<QUICMaxStreamDataFrame> quicMaxStreamDataFrameAllocator("quicMaxStreamDataFrameAllocator");
 ClassAllocator<QUICMaxStreamsFrame> quicMaxStreamIdFrameAllocator("quicMaxStreamDataIdAllocator");
 ClassAllocator<QUICPingFrame> quicPingFrameAllocator("quicPingFrameAllocator");
-ClassAllocator<QUICBlockedFrame> quicBlockedFrameAllocator("quicBlockedFrameAllocator");
+ClassAllocator<QUICDataBlockedFrame> quicBlockedFrameAllocator("quicBlockedFrameAllocator");
 ClassAllocator<QUICStreamDataBlockedFrame> quicStreamBlockedFrameAllocator("quicStreamBlockedFrameAllocator");
 ClassAllocator<QUICStreamIdBlockedFrame> quicStreamIdBlockedFrameAllocator("quicStreamIdBlockedFrameAllocator");
 ClassAllocator<QUICNewConnectionIdFrame> quicNewConnectionIdFrameAllocator("quicNewConnectionIdFrameAllocator");
@@ -1737,13 +1737,13 @@ QUICMaxStreamsFrame::maximum_streams() const
 //
 // BLOCKED frame
 //
-QUICBlockedFrame::QUICBlockedFrame(const uint8_t *buf, size_t len)
+QUICDataBlockedFrame::QUICDataBlockedFrame(const uint8_t *buf, size_t len)
 {
   this->parse(buf, len);
 }
 
 void
-QUICBlockedFrame::_reset()
+QUICDataBlockedFrame::_reset()
 {
   this->_offset = 0;
 
@@ -1754,7 +1754,7 @@ QUICBlockedFrame::_reset()
 }
 
 void
-QUICBlockedFrame::parse(const uint8_t *buf, size_t len)
+QUICDataBlockedFrame::parse(const uint8_t *buf, size_t len)
 {
   ink_assert(len >= 1);
   this->_reset();
@@ -1770,25 +1770,25 @@ QUICBlockedFrame::parse(const uint8_t *buf, size_t len)
 }
 
 int
-QUICBlockedFrame::debug_msg(char *msg, size_t msg_len) const
+QUICDataBlockedFrame::debug_msg(char *msg, size_t msg_len) const
 {
   return snprintf(msg, msg_len, "| BLOCKED size=%zu offset=%" PRIu64, this->size(), this->offset());
 }
 
 QUICFrameUPtr
-QUICBlockedFrame::clone() const
+QUICDataBlockedFrame::clone() const
 {
-  return QUICFrameFactory::create_blocked_frame(this->offset(), this->_id, this->_owner);
+  return QUICFrameFactory::create_data_blocked_frame(this->offset(), this->_id, this->_owner);
 }
 
 QUICFrameType
-QUICBlockedFrame::type() const
+QUICDataBlockedFrame::type() const
 {
   return QUICFrameType::DATA_BLOCKED;
 }
 
 size_t
-QUICBlockedFrame::size() const
+QUICDataBlockedFrame::size() const
 {
   if (this->_size) {
     return this->_size;
@@ -1798,7 +1798,7 @@ QUICBlockedFrame::size() const
 }
 
 size_t
-QUICBlockedFrame::store(uint8_t *buf, size_t *len, size_t limit) const
+QUICDataBlockedFrame::store(uint8_t *buf, size_t *len, size_t limit) const
 {
   if (limit < this->size()) {
     return 0;
@@ -1818,7 +1818,7 @@ QUICBlockedFrame::store(uint8_t *buf, size_t *len, size_t limit) const
 }
 
 QUICOffset
-QUICBlockedFrame::offset() const
+QUICDataBlockedFrame::offset() const
 {
   return this->_offset;
 }
@@ -2714,7 +2714,7 @@ QUICFrameFactory::create(const uint8_t *buf, size_t len)
     return QUICFrameUPtr(frame, &QUICFrameDeleter::delete_ping_frame);
   case QUICFrameType::DATA_BLOCKED:
     frame = quicBlockedFrameAllocator.alloc();
-    new (frame) QUICBlockedFrame(buf, len);
+    new (frame) QUICDataBlockedFrame(buf, len);
     return QUICFrameUPtr(frame, &QUICFrameDeleter::delete_blocked_frame);
   case QUICFrameType::STREAM_DATA_BLOCKED:
     frame = quicStreamBlockedFrameAllocator.alloc();
@@ -2890,12 +2890,12 @@ QUICFrameFactory::create_path_response_frame(const uint8_t *data,
QUICFrameId id
   return std::unique_ptr<QUICPathResponseFrame, QUICFrameDeleterFunc>(frame, &QUICFrameDeleter::delete_path_response_frame);
 }
 
-std::unique_ptr<QUICBlockedFrame, QUICFrameDeleterFunc>
-QUICFrameFactory::create_blocked_frame(QUICOffset offset, QUICFrameId id, QUICFrameGenerator
*owner)
+std::unique_ptr<QUICDataBlockedFrame, QUICFrameDeleterFunc>
+QUICFrameFactory::create_data_blocked_frame(QUICOffset offset, QUICFrameId id, QUICFrameGenerator
*owner)
 {
-  QUICBlockedFrame *frame = quicBlockedFrameAllocator.alloc();
-  new (frame) QUICBlockedFrame(offset, id, owner);
-  return std::unique_ptr<QUICBlockedFrame, QUICFrameDeleterFunc>(frame, &QUICFrameDeleter::delete_blocked_frame);
+  QUICDataBlockedFrame *frame = quicBlockedFrameAllocator.alloc();
+  new (frame) QUICDataBlockedFrame(offset, id, owner);
+  return std::unique_ptr<QUICDataBlockedFrame, QUICFrameDeleterFunc>(frame, &QUICFrameDeleter::delete_blocked_frame);
 }
 
 std::unique_ptr<QUICStreamDataBlockedFrame, QUICFrameDeleterFunc>
diff --git a/iocore/net/quic/QUICFrame.h b/iocore/net/quic/QUICFrame.h
index 10d79bb..db97e06 100644
--- a/iocore/net/quic/QUICFrame.h
+++ b/iocore/net/quic/QUICFrame.h
@@ -463,12 +463,12 @@ private:
 //
 // BLOCKED
 //
-class QUICBlockedFrame : public QUICFrame
+class QUICDataBlockedFrame : public QUICFrame
 {
 public:
-  QUICBlockedFrame(QUICFrameId id = 0, QUICFrameGenerator *owner = nullptr) : QUICFrame(id,
owner) {}
-  QUICBlockedFrame(const uint8_t *buf, size_t len);
-  QUICBlockedFrame(QUICOffset offset, QUICFrameId id = 0, QUICFrameGenerator *owner = nullptr)
+  QUICDataBlockedFrame(QUICFrameId id = 0, QUICFrameGenerator *owner = nullptr) : QUICFrame(id,
owner) {}
+  QUICDataBlockedFrame(const uint8_t *buf, size_t len);
+  QUICDataBlockedFrame(QUICOffset offset, QUICFrameId id = 0, QUICFrameGenerator *owner =
nullptr)
     : QUICFrame(id, owner), _offset(offset){};
 
   QUICFrameUPtr clone() const override;
@@ -749,7 +749,7 @@ extern ClassAllocator<QUICMaxDataFrame> quicMaxDataFrameAllocator;
 extern ClassAllocator<QUICMaxStreamDataFrame> quicMaxStreamDataFrameAllocator;
 extern ClassAllocator<QUICMaxStreamsFrame> quicMaxStreamIdFrameAllocator;
 extern ClassAllocator<QUICPingFrame> quicPingFrameAllocator;
-extern ClassAllocator<QUICBlockedFrame> quicBlockedFrameAllocator;
+extern ClassAllocator<QUICDataBlockedFrame> quicBlockedFrameAllocator;
 extern ClassAllocator<QUICStreamDataBlockedFrame> quicStreamBlockedFrameAllocator;
 extern ClassAllocator<QUICStreamIdBlockedFrame> quicStreamIdBlockedFrameAllocator;
 extern ClassAllocator<QUICNewConnectionIdFrame> quicNewConnectionIdFrameAllocator;
@@ -844,7 +844,7 @@ public:
   delete_blocked_frame(QUICFrame *frame)
   {
     frame->~QUICFrame();
-    quicBlockedFrameAllocator.free(static_cast<QUICBlockedFrame *>(frame));
+    quicBlockedFrameAllocator.free(static_cast<QUICDataBlockedFrame *>(frame));
   }
 
   static void
@@ -1014,8 +1014,9 @@ public:
   /*
    * Creates a BLOCKED frame.
    */
-  static std::unique_ptr<QUICBlockedFrame, QUICFrameDeleterFunc> create_blocked_frame(QUICOffset
offset, QUICFrameId id = 0,
-                                                                                      QUICFrameGenerator
*owner = nullptr);
+  static std::unique_ptr<QUICDataBlockedFrame, QUICFrameDeleterFunc> create_data_blocked_frame(QUICOffset
offset,
+                                                                                        
      QUICFrameId id            = 0,
+                                                                                        
      QUICFrameGenerator *owner = nullptr);
 
   /*
    * Creates a STREAM_DATA_BLOCKED frame.
diff --git a/iocore/net/quic/test/test_QUICFlowController.cc b/iocore/net/quic/test/test_QUICFlowController.cc
index 975d9a5..b5cca32 100644
--- a/iocore/net/quic/test/test_QUICFlowController.cc
+++ b/iocore/net/quic/test/test_QUICFlowController.cc
@@ -326,7 +326,7 @@ TEST_CASE("Frame retransmission", "[quic]")
     CHECK(ret == 0);
     frame = fc.generate_frame(level, 1024, 1024);
     REQUIRE(frame);
-    CHECK(static_cast<QUICBlockedFrame *>(frame.get())->offset() == 1024);
+    CHECK(static_cast<QUICDataBlockedFrame *>(frame.get())->offset() == 1024);
     QUICFrameId id = frame->id();
 
     // Don't retransmit unless the frame is lost
@@ -337,7 +337,7 @@ TEST_CASE("Frame retransmission", "[quic]")
     fc.on_frame_lost(id);
     frame = fc.generate_frame(level, 1024, 1024);
     REQUIRE(frame);
-    CHECK(static_cast<QUICBlockedFrame *>(frame.get())->offset() == 1024);
+    CHECK(static_cast<QUICDataBlockedFrame *>(frame.get())->offset() == 1024);
 
     // Don't send if it was not blocked
     fc.on_frame_lost(frame->id());
@@ -350,7 +350,7 @@ TEST_CASE("Frame retransmission", "[quic]")
     ret   = fc.update(2048);
     frame = fc.generate_frame(level, 1024, 1024);
     REQUIRE(frame);
-    CHECK(static_cast<QUICBlockedFrame *>(frame.get())->offset() == 2048);
+    CHECK(static_cast<QUICDataBlockedFrame *>(frame.get())->offset() == 2048);
   }
 
   SECTION("STREAM_DATA_BLOCKED frame")
diff --git a/iocore/net/quic/test/test_QUICFrame.cc b/iocore/net/quic/test/test_QUICFrame.cc
index 0e4a160..2751afd 100644
--- a/iocore/net/quic/test/test_QUICFrame.cc
+++ b/iocore/net/quic/test/test_QUICFrame.cc
@@ -1058,7 +1058,8 @@ TEST_CASE("Load Blocked Frame", "[quic]")
     std::shared_ptr<const QUICFrame> frame1 = QUICFrameFactory::create(buf1, sizeof(buf1));
     CHECK(frame1->type() == QUICFrameType::DATA_BLOCKED);
     CHECK(frame1->size() == 2);
-    std::shared_ptr<const QUICBlockedFrame> blocked_stream_frame = std::dynamic_pointer_cast<const
QUICBlockedFrame>(frame1);
+    std::shared_ptr<const QUICDataBlockedFrame> blocked_stream_frame =
+      std::dynamic_pointer_cast<const QUICDataBlockedFrame>(frame1);
     CHECK(blocked_stream_frame != nullptr);
     CHECK(blocked_stream_frame->offset() == 0x07);
   }
@@ -1083,7 +1084,7 @@ TEST_CASE("Store Blocked Frame", "[quic]")
     0x08, // Type
     0x07, // Offset
   };
-  QUICBlockedFrame blocked_stream_frame(0x07, 0, nullptr);
+  QUICDataBlockedFrame blocked_stream_frame(0x07, 0, nullptr);
   CHECK(blocked_stream_frame.size() == 2);
 
   blocked_stream_frame.store(buf, &len, 65535);
diff --git a/src/tscore/Diags.cc b/src/tscore/Diags.cc
index b34db02..815d6d8 100644
--- a/src/tscore/Diags.cc
+++ b/src/tscore/Diags.cc
@@ -225,15 +225,8 @@ Diags::print_va(const char *debug_tag, DiagsLevel diags_level, const
SourceLocat
   format_writer.print("[{timestamp}] ");
   auto timestamp_offset = format_writer.size();
 
-  format_writer.print("{thread-name}");
-  format_writer.print(" {}: ", level_name(diags_level));
-
   if (location(loc, show_location, diags_level)) {
-    format_writer.print("<{}> ", *loc);
-  }
-
-  if (debug_tag) {
-    format_writer.print("({}) ", debug_tag);
+    format_writer.print("<{:50,50}> ", *loc);
   }
 
   format_writer.print("{}", format_string);


Mime
View raw message