trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From masa...@apache.org
Subject [trafficserver] branch quic-latest updated: Cleanup frame debug msg
Date Mon, 08 Apr 2019 02:58:39 GMT
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 70397c5  Cleanup frame debug msg
70397c5 is described below

commit 70397c521d33ffcaa52b70f11ee56907d74b22d2
Author: Masaori Koshiba <masaori335@gmail.com>
AuthorDate: Mon Apr 8 11:58:17 2019 +0900

    Cleanup frame debug msg
---
 iocore/net/QUICNetVConnection.cc       |  2 +-
 iocore/net/quic/QUICFrame.cc           | 26 +++++++++++++-------------
 iocore/net/quic/QUICFrameDispatcher.cc |  2 +-
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 548ca36..1e25171 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -1491,7 +1491,7 @@ QUICNetVConnection::_store_frame(Ptr<IOBufferBlock> parent_block,
size_t &size_a
   if (is_debug_tag_set(QUIC_DEBUG_TAG.data())) {
     char msg[1024];
     frame.debug_msg(msg, sizeof(msg));
-    QUICConDebug("[TX] %s", msg);
+    QUICConDebug("[TX] | %s", msg);
   }
 
   frames.emplace_back(frame.id(), frame.generated_by());
diff --git a/iocore/net/quic/QUICFrame.cc b/iocore/net/quic/QUICFrame.cc
index 5b11035..b585460 100644
--- a/iocore/net/quic/QUICFrame.cc
+++ b/iocore/net/quic/QUICFrame.cc
@@ -124,7 +124,7 @@ QUICFrame::to_io_buffer_block(size_t limit) const
 int
 QUICFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| %s size=%zu", QUICDebugNames::frame_type(this->type()),
this->size());
+  return snprintf(msg, msg_len, "%s size=%zu", QUICDebugNames::frame_type(this->type()),
this->size());
 }
 
 bool
@@ -270,7 +270,7 @@ QUICStreamFrame::store(uint8_t *buf, size_t *len, size_t limit) const
 int
 QUICStreamFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| STREAM size=%zu id=%" PRIu64 " offset=%" PRIu64 " data_len=%"
PRIu64 " fin=%d", this->size(),
+  return snprintf(msg, msg_len, "STREAM size=%zu id=%" PRIu64 " offset=%" PRIu64 " data_len=%"
PRIu64 " fin=%d", this->size(),
                   this->stream_id(), this->offset(), this->data_length(), this->has_fin_flag());
 }
 
@@ -461,7 +461,7 @@ QUICCryptoFrame::size() const
 int
 QUICCryptoFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| CRYPTO size=%zu offset=%" PRIu64 " data_len=%" PRIu64,
this->size(), this->offset(),
+  return snprintf(msg, msg_len, "CRYPTO size=%zu offset=%" PRIu64 " data_len=%" PRIu64, this->size(),
this->offset(),
                   this->data_length());
 }
 
@@ -675,7 +675,7 @@ QUICAckFrame::store(uint8_t *buf, size_t *len, size_t limit) const
 int
 QUICAckFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  int len = snprintf(msg, msg_len, "| ACK size=%zu largest_acked=%" PRIu64 " delay=%" PRIu64
" block_count=%" PRIu64, this->size(),
+  int len = snprintf(msg, msg_len, "ACK size=%zu largest_acked=%" PRIu64 " delay=%" PRIu64
" block_count=%" PRIu64, this->size(),
                      this->largest_acknowledged(), this->ack_delay(), this->ack_block_count());
   msg_len -= len;
 
@@ -1043,7 +1043,7 @@ QUICRstStreamFrame::store(uint8_t *buf, size_t *len, size_t limit) const
 int
 QUICRstStreamFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| RESET_STREAM size=%zu stream_id=%" PRIu64 " code=0x%"
PRIx16, this->size(), this->stream_id(),
+  return snprintf(msg, msg_len, "RESET_STREAM size=%zu stream_id=%" PRIu64 " code=0x%" PRIx16,
this->size(), this->stream_id(),
                   this->error_code());
 }
 
@@ -1313,11 +1313,11 @@ QUICConnectionCloseFrame::debug_msg(char *msg, size_t msg_len) const
   int len;
   if (this->_type == 0x1c) {
     len =
-      snprintf(msg, msg_len, "| CONNECTION_CLOSE size=%zu code=%s (0x%" PRIx16 ") frame=%s",
this->size(),
+      snprintf(msg, msg_len, "CONNECTION_CLOSE size=%zu code=%s (0x%" PRIx16 ") frame=%s",
this->size(),
                QUICDebugNames::error_code(this->error_code()), this->error_code(),
QUICDebugNames::frame_type(this->frame_type()));
   } else {
     // Application-specific error. It doesn't have a frame type and we don't know string
representations of error codes.
-    len = snprintf(msg, msg_len, "| CONNECTION_CLOSE size=%zu code=0x%" PRIx16 " ", this->size(),
this->error_code());
+    len = snprintf(msg, msg_len, "CONNECTION_CLOSE size=%zu code=0x%" PRIx16 " ", this->size(),
this->error_code());
   }
 
   if (this->reason_phrase_length() != 0 && this->reason_phrase() != nullptr)
{
@@ -1435,7 +1435,7 @@ QUICMaxDataFrame::store(uint8_t *buf, size_t *len, size_t limit) const
 int
 QUICMaxDataFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| MAX_DATA size=%zu maximum=%" PRIu64, this->size(),
this->maximum_data());
+  return snprintf(msg, msg_len, "MAX_DATA size=%zu maximum=%" PRIu64, this->size(), this->maximum_data());
 }
 
 uint64_t
@@ -1530,7 +1530,7 @@ QUICMaxStreamDataFrame::store(uint8_t *buf, size_t *len, size_t limit)
const
 int
 QUICMaxStreamDataFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| MAX_STREAM_DATA size=%zu id=%" PRIu64 " maximum=%" PRIu64,
this->size(), this->stream_id(),
+  return snprintf(msg, msg_len, "MAX_STREAM_DATA size=%zu id=%" PRIu64 " maximum=%" PRIu64,
this->size(), this->stream_id(),
                   this->maximum_stream_data());
 }
 
@@ -1665,7 +1665,7 @@ QUICDataBlockedFrame::parse(const uint8_t *buf, size_t len)
 int
 QUICDataBlockedFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| DATA_BLOCKED size=%zu offset=%" PRIu64, this->size(),
this->offset());
+  return snprintf(msg, msg_len, "DATA_BLOCKED size=%zu offset=%" PRIu64, this->size(),
this->offset());
 }
 
 QUICFrameType
@@ -1753,7 +1753,7 @@ QUICStreamDataBlockedFrame::parse(const uint8_t *buf, size_t len)
 int
 QUICStreamDataBlockedFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| STREAM_DATA_BLOCKED size=%zu id=%" PRIu64 " offset=%"
PRIu64, this->size(), this->stream_id(),
+  return snprintf(msg, msg_len, "STREAM_DATA_BLOCKED size=%zu id=%" PRIu64 " offset=%" PRIu64,
this->size(), this->stream_id(),
                   this->offset());
 }
 
@@ -1983,7 +1983,7 @@ QUICNewConnectionIdFrame::debug_msg(char *msg, size_t msg_len) const
   char cid_str[QUICConnectionId::MAX_HEX_STR_LENGTH];
   this->connection_id().hex(cid_str, QUICConnectionId::MAX_HEX_STR_LENGTH);
 
-  return snprintf(msg, msg_len, "| NEW_CONNECTION_ID size=%zu seq=%" PRIu64 " cid=0x%s",
this->size(), this->sequence(), cid_str);
+  return snprintf(msg, msg_len, "NEW_CONNECTION_ID size=%zu seq=%" PRIu64 " cid=0x%s", this->size(),
this->sequence(), cid_str);
 }
 
 uint64_t
@@ -2422,7 +2422,7 @@ QUICRetireConnectionIdFrame::store(uint8_t *buf, size_t *len, size_t
limit) cons
 int
 QUICRetireConnectionIdFrame::debug_msg(char *msg, size_t msg_len) const
 {
-  return snprintf(msg, msg_len, "| RETIRE_CONNECTION_ID size=%zu seq_num=%" PRIu64, this->size(),
this->seq_num());
+  return snprintf(msg, msg_len, "RETIRE_CONNECTION_ID size=%zu seq_num=%" PRIu64, this->size(),
this->seq_num());
 }
 
 uint64_t
diff --git a/iocore/net/quic/QUICFrameDispatcher.cc b/iocore/net/quic/QUICFrameDispatcher.cc
index 990cdea..c2f3d1f 100644
--- a/iocore/net/quic/QUICFrameDispatcher.cc
+++ b/iocore/net/quic/QUICFrameDispatcher.cc
@@ -70,7 +70,7 @@ QUICFrameDispatcher::receive_frames(QUICEncryptionLevel level, const uint8_t
*pa
     if (is_debug_tag_set(tag) && type != QUICFrameType::PADDING) {
       char msg[1024];
       frame.debug_msg(msg, sizeof(msg));
-      QUICDebug("[RX] %s", msg);
+      QUICDebug("[RX] | %s", msg);
     }
 
     if (type != QUICFrameType::PADDING && type != QUICFrameType::ACK) {


Mime
View raw message