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 DebugQUIC*() to QUIC*Debug()
Date Tue, 05 Dec 2017 02:51:09 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 67e1eeb  Rename DebugQUIC*() to QUIC*Debug()
67e1eeb is described below

commit 67e1eeb39bdbe177656251cfa3d7492494569bc9
Author: Masakazu Kitajo <maskit@apache.org>
AuthorDate: Tue Dec 5 11:50:10 2017 +0900

    Rename DebugQUIC*() to QUIC*Debug()
---
 iocore/net/QUICNetVConnection.cc    | 48 ++++++++++++++++++-------------------
 iocore/net/quic/QUICHandshake.cc    | 36 ++++++++++++++--------------
 iocore/net/quic/QUICLossDetector.cc | 24 +++++++++----------
 iocore/net/quic/QUICStream.cc       | 30 +++++++++++------------
 4 files changed, 69 insertions(+), 69 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 00d3447..2d5e32d 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -43,7 +43,7 @@
 #define STATE_FROM_VIO(_x) ((NetState *)(((char *)(_x)) - STATE_VIO_OFFSET))
 #define STATE_VIO_OFFSET ((uintptr_t) & ((NetState *)0)->vio)
 
-#define DebugQUICCon(fmt, ...) \
+#define QUICConDebug(fmt, ...) \
   Debug("quic_net", "[%" PRIx64 "] " fmt, static_cast<uint64_t>(this->_quic_connection_id),
##__VA_ARGS__)
 
 #define QUICError(fmt, ...)                                                             
                   \
@@ -126,7 +126,7 @@ QUICNetVConnection::start(SSL_CTX *ssl_ctx)
 void
 QUICNetVConnection::free(EThread *t)
 {
-  DebugQUICCon("Free connection");
+  QUICConDebug("Free connection");
 
   this->_udp_con        = nullptr;
   this->_packet_handler = nullptr;
@@ -221,7 +221,7 @@ QUICNetVConnection::_transmit_packet(QUICPacketUPtr packet)
 {
   SCOPED_MUTEX_LOCK(packet_transmitter_lock, this->_packet_transmitter_mutex, this_ethread());
 
-  DebugQUICCon("Packet Number=%" PRIu64 " Type=%s Size=%hu", packet->packet_number(),
QUICDebugNames::packet_type(packet->type()),
+  QUICConDebug("Packet Number=%" PRIu64 " Type=%s Size=%hu", packet->packet_number(),
QUICDebugNames::packet_type(packet->type()),
                packet->size());
   // TODO Remove const_cast
   this->_packet_send_queue.enqueue(const_cast<QUICPacket *>(packet.release()));
@@ -237,7 +237,7 @@ QUICNetVConnection::transmit_packet(QUICPacketUPtr packet)
 void
 QUICNetVConnection::retransmit_packet(const QUICPacket &packet)
 {
-  DebugQUICCon("Retransmit packet #%" PRIu64 " type %s", packet.packet_number(), QUICDebugNames::packet_type(packet.type()));
+  QUICConDebug("Retransmit packet #%" PRIu64 " type %s", packet.packet_number(), QUICDebugNames::packet_type(packet.type()));
   ink_assert(packet.type() != QUICPacketType::VERSION_NEGOTIATION && packet.type()
!= QUICPacketType::UNINITIALIZED);
 
   // Get payload from a header because packet.payload() is encrypted
@@ -278,7 +278,7 @@ QUICNetVConnection::push_packet(UDPPacket *packet)
 void
 QUICNetVConnection::_transmit_frame(QUICFrameUPtr frame)
 {
-  DebugQUICCon("Frame Type=%s Size=%zu", QUICDebugNames::frame_type(frame->type()), frame->size());
+  QUICConDebug("Frame Type=%s Size=%zu", QUICDebugNames::frame_type(frame->type()), frame->size());
 
   SCOPED_MUTEX_LOCK(frame_transmitter_lock, this->_frame_transmitter_mutex, this_ethread());
 
@@ -340,7 +340,7 @@ QUICNetVConnection::handle_frame(std::shared_ptr<const QUICFrame>
frame)
     this->_switch_to_close_state();
     break;
   default:
-    DebugQUICCon("Unexpected frame type: %02x", static_cast<unsigned int>(frame->type()));
+    QUICConDebug("Unexpected frame type: %02x", static_cast<unsigned int>(frame->type()));
     ink_assert(false);
     break;
   }
@@ -409,7 +409,7 @@ QUICNetVConnection::state_handshake(int event, Event *data)
     this->_handle_idle_timeout();
     break;
   default:
-    DebugQUICCon("Unexpected event: %s", QUICDebugNames::quic_event(event));
+    QUICConDebug("Unexpected event: %s", QUICDebugNames::quic_event(event));
   }
 
   if (error->cls != QUICErrorClass::NONE) {
@@ -440,11 +440,11 @@ QUICNetVConnection::state_connection_established(int event, Event *data)
     break;
   }
   default:
-    DebugQUICCon("Unexpected event: %s", QUICDebugNames::quic_event(event));
+    QUICConDebug("Unexpected event: %s", QUICDebugNames::quic_event(event));
   }
 
   if (error->cls != QUICErrorClass::NONE) {
-    DebugQUICCon("QUICError: cls=%u, code=0x%" PRIu16, static_cast<unsigned int>(error->cls),
error->code());
+    QUICConDebug("QUICError: cls=%u, code=0x%" PRIu16, static_cast<unsigned int>(error->cls),
error->code());
     this->_handle_error(std::move(error));
   }
 
@@ -472,7 +472,7 @@ QUICNetVConnection::state_connection_closing(int event, Event *data)
     break;
   }
   default:
-    DebugQUICCon("Unexpected event: %s", QUICDebugNames::quic_event(event));
+    QUICConDebug("Unexpected event: %s", QUICDebugNames::quic_event(event));
   }
 
   // FIXME Enter closed state if CONNECTION_CLOSE was ACKed and draining period end
@@ -507,7 +507,7 @@ QUICNetVConnection::state_connection_closed(int event, Event *data)
     break;
   }
   default:
-    DebugQUICCon("Unexpected event: %s", QUICDebugNames::quic_event(event));
+    QUICConDebug("Unexpected event: %s", QUICDebugNames::quic_event(event));
   }
 
   return EVENT_DONE;
@@ -616,7 +616,7 @@ QUICErrorUPtr
 QUICNetVConnection::_state_handshake_process_initial_client_packet(QUICPacketUPtr packet)
 {
   if (packet->size() < MINIMUM_INITIAL_CLIENT_PACKET_SIZE) {
-    DebugQUICCon("Packet size is smaller than the minimum initial client packet size");
+    QUICConDebug("Packet size is smaller than the minimum initial client packet size");
     // Ignore the packet
     return QUICErrorUPtr(new QUICNoError());
   }
@@ -736,7 +736,7 @@ QUICNetVConnection::_store_frame(ats_unique_buf &buf, size_t &len,
bool &retrans
   }
 
   size_t l = 0;
-  DebugQUICCon("type=%s", QUICDebugNames::frame_type(frame->type()));
+  QUICConDebug("type=%s", QUICDebugNames::frame_type(frame->type()));
   frame->store(buf.get() + len, &l);
   len += l;
 
@@ -775,7 +775,7 @@ QUICNetVConnection::_packetize_frames()
           this->_remote_flow_controller->current_limit());
 
     if (ret != 0) {
-      DebugQUICCon("Flow Controller blocked sending a STREAM frame");
+      QUICConDebug("Flow Controller blocked sending a STREAM frame");
       break;
     }
 
@@ -922,17 +922,17 @@ QUICNetVConnection::_dequeue_recv_packet(QUICPacketCreationResult &result)
   }
   quic_packet = this->_packet_factory.create(std::move(pkt), written, this->largest_received_packet_number(),
result);
   if (result == QUICPacketCreationResult::NOT_READY) {
-    DebugQUICCon("Not ready to decrypt the packet");
+    QUICConDebug("Not ready to decrypt the packet");
     // Retry later
     this->_packet_recv_queue.enqueue(udp_packet);
     this_ethread()->schedule_in_local(this, HRTIME_MSECONDS(10), QUIC_EVENT_PACKET_READ_READY);
   } else {
     udp_packet->free();
     if (result == QUICPacketCreationResult::SUCCESS) {
-      DebugQUICCon("type=%s pkt_num=%" PRIu64 " size=%u", QUICDebugNames::packet_type(quic_packet->type()),
+      QUICConDebug("type=%s pkt_num=%" PRIu64 " size=%u", QUICDebugNames::packet_type(quic_packet->type()),
                    quic_packet->packet_number(), quic_packet->size());
     } else {
-      DebugQUICCon("Failed to decrypt the packet");
+      QUICConDebug("Failed to decrypt the packet");
     }
   }
 
@@ -944,7 +944,7 @@ QUICNetVConnection::_schedule_packet_write_ready()
 {
   SCOPED_MUTEX_LOCK(packet_transmitter_lock, this->_packet_transmitter_mutex, this_ethread());
   if (!this->_packet_write_ready) {
-    DebugQUICCon("Schedule %s event", QUICDebugNames::quic_event(QUIC_EVENT_PACKET_WRITE_READY));
+    QUICConDebug("Schedule %s event", QUICDebugNames::quic_event(QUIC_EVENT_PACKET_WRITE_READY));
     this->_packet_write_ready = eventProcessor.schedule_imm(this, ET_CALL, QUIC_EVENT_PACKET_WRITE_READY,
nullptr);
   }
 }
@@ -1002,7 +1002,7 @@ QUICNetVConnection::_complete_handshake_if_possible()
 void
 QUICNetVConnection::_switch_to_handshake_state()
 {
-  DebugQUICCon("Enter state_handshake");
+  QUICConDebug("Enter state_handshake");
   SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_handshake);
 }
 
@@ -1010,7 +1010,7 @@ void
 QUICNetVConnection::_switch_to_established_state()
 {
   if (this->_complete_handshake_if_possible() == 0) {
-    DebugQUICCon("Enter state_connection_established");
+    QUICConDebug("Enter state_connection_established");
     SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_established);
   } else {
     // Illegal state change
@@ -1022,14 +1022,14 @@ void
 QUICNetVConnection::_switch_to_closing_state(QUICConnectionErrorUPtr error)
 {
   if (this->_complete_handshake_if_possible() != 0) {
-    DebugQUICCon("Switching state without handshake completion");
+    QUICConDebug("Switching state without handshake completion");
   }
   if (error->cls == QUICErrorClass::APPLICATION) {
     this->transmit_frame(QUICFrameFactory::create_application_close_frame(std::move(error)));
   } else {
     this->transmit_frame(QUICFrameFactory::create_connection_close_frame(std::move(error)));
   }
-  DebugQUICCon("Enter state_connection_closing");
+  QUICConDebug("Enter state_connection_closing");
   SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_closing);
 }
 
@@ -1037,9 +1037,9 @@ void
 QUICNetVConnection::_switch_to_close_state()
 {
   if (this->_complete_handshake_if_possible() != 0) {
-    DebugQUICCon("Switching state without handshake completion");
+    QUICConDebug("Switching state without handshake completion");
   }
-  DebugQUICCon("Enter state_connection_closed");
+  QUICConDebug("Enter state_connection_closed");
   SET_HANDLER((NetVConnHandler)&QUICNetVConnection::state_connection_closed);
   this_ethread()->schedule_imm(this, QUIC_EVENT_SHUTDOWN, nullptr);
 }
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index 052f0ed..3637feb 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -32,7 +32,7 @@
 
 static constexpr char dump_tag[] = "v_quic_handshake_dump_pkt";
 
-#define DebugQHS(fmt, ...) \
+#define QUICHSDebug(fmt, ...) \
   Debug("quic_handshake", "[%" PRIx64 "] " fmt, static_cast<uint64_t>(this->_client_qc->connection_id()),
##__VA_ARGS__)
 
 #define I_WANNA_DUMP_THIS_BUF(buf, len)                                                 
                                          \
@@ -111,12 +111,12 @@ QUICHandshake::start(const QUICPacket *initial_packet, QUICPacketFactory
*packet
     }
     if (initial_packet->version()) {
       if (this->_version_negotiator->negotiate(initial_packet) == QUICVersionNegotiationStatus::NEGOTIATED)
{
-        DebugQHS("Version negotiation succeeded: %x", initial_packet->version());
+        QUICHSDebug("Version negotiation succeeded: %x", initial_packet->version());
         packet_factory->set_version(this->_version_negotiator->negotiated_version());
       } else {
         this->_client_qc->transmit_packet(
           packet_factory->create_version_negotiation_packet(initial_packet, _client_qc->largest_acked_packet_number()));
-        DebugQHS("Version negotiation failed: %x", initial_packet->version());
+        QUICHSDebug("Version negotiation failed: %x", initial_packet->version());
       }
     } else {
       return QUICErrorUPtr(new QUICConnectionError(QUICTransErrorCode::PROTOCOL_VIOLATION));
@@ -170,11 +170,11 @@ QUICHandshake::set_transport_parameters(std::shared_ptr<QUICTransportParameters>
     // Version revalidation
     if (this->_version_negotiator->revalidate(tp_in_ch) != QUICVersionNegotiationStatus::REVALIDATED)
{
       this->_client_qc->close(QUICConnectionErrorUPtr(new QUICConnectionError(QUICTransErrorCode::VERSION_NEGOTIATION_ERROR)));
-      DebugQHS("Enter state_closed");
+      QUICHSDebug("Enter state_closed");
       SET_HANDLER(&QUICHandshake::state_closed);
       return;
     }
-    DebugQHS("Version negotiation revalidated: %x", tp_in_ch->negotiated_version());
+    QUICHSDebug("Version negotiation revalidated: %x", tp_in_ch->negotiated_version());
     return;
   }
 
@@ -209,7 +209,7 @@ QUICHandshake::state_read_client_hello(int event, Event *data)
     break;
   }
   default:
-    DebugQHS("event: %d", event);
+    QUICHSDebug("event: %d", event);
     break;
   }
 
@@ -219,7 +219,7 @@ QUICHandshake::state_read_client_hello(int event, Event *data)
     } else {
       this->_client_qc->close(QUICConnectionErrorUPtr(new QUICConnectionError(QUICTransErrorCode::PROTOCOL_VIOLATION)));
     }
-    DebugQHS("Enter state_closed");
+    QUICHSDebug("Enter state_closed");
     SET_HANDLER(&QUICHandshake::state_closed);
   }
 
@@ -237,7 +237,7 @@ QUICHandshake::state_read_client_finished(int event, Event *data)
     break;
   }
   default:
-    DebugQHS("event: %d", event);
+    QUICHSDebug("event: %d", event);
     break;
   }
 
@@ -247,7 +247,7 @@ QUICHandshake::state_read_client_finished(int event, Event *data)
     } else {
       this->_client_qc->close(QUICConnectionErrorUPtr(new QUICConnectionError(QUICTransErrorCode::PROTOCOL_VIOLATION)));
     }
-    DebugQHS("Enter state_closed");
+    QUICHSDebug("Enter state_closed");
     SET_HANDLER(&QUICHandshake::state_closed);
   }
 
@@ -264,8 +264,8 @@ QUICHandshake::state_address_validation(int event, void *data)
 int
 QUICHandshake::state_complete(int event, void *data)
 {
-  DebugQHS("event: %d", event);
-  DebugQHS("Got an event on complete state. Ignoring it for now.");
+  QUICHSDebug("event: %d", event);
+  QUICHSDebug("Got an event on complete state. Ignoring it for now.");
 
   return EVENT_CONT;
 }
@@ -319,7 +319,7 @@ QUICHandshake::_process_client_hello()
   stream_io->read(msg, msg_len);
 
   if (msg_len <= 0) {
-    DebugQHS("No message");
+    QUICHSDebug("No message");
     return QUICErrorUPtr(new QUICNoError());
   }
 
@@ -337,7 +337,7 @@ QUICHandshake::_process_client_hello()
     I_WANNA_DUMP_THIS_BUF(server_hello, static_cast<int64_t>(server_hello_len));
     // <----- DEBUG -----
 
-    DebugQHS("Enter state_read_client_finished");
+    QUICHSDebug("Enter state_read_client_finished");
     SET_HANDLER(&QUICHandshake::state_read_client_finished);
 
     stream_io->write(server_hello, server_hello_len);
@@ -361,7 +361,7 @@ QUICHandshake::_process_client_finished()
   stream_io->read(msg, msg_len);
 
   if (msg_len <= 0) {
-    DebugQHS("No message");
+    QUICHSDebug("No message");
     return QUICErrorUPtr(new QUICNoError());
   }
 
@@ -380,9 +380,9 @@ QUICHandshake::_process_client_finished()
     // <----- DEBUG -----
 
     _process_handshake_complete();
-    DebugQHS("Handshake has been completed");
+    QUICHSDebug("Handshake has been completed");
 
-    DebugQHS("Enter state_complete");
+    QUICHSDebug("Enter state_complete");
     SET_HANDLER(&QUICHandshake::state_complete);
 
     stream_io->write(out, out_len);
@@ -399,9 +399,9 @@ QUICErrorUPtr
 QUICHandshake::_process_handshake_complete()
 {
   if (this->_crypto->update_key_materials()) {
-    DebugQHS("Keying Materials are exported");
+    QUICHSDebug("Keying Materials are exported");
   } else {
-    DebugQHS("Failed to export Keying Materials");
+    QUICHSDebug("Failed to export Keying Materials");
   }
 
   return QUICErrorUPtr(new QUICNoError());
diff --git a/iocore/net/quic/QUICLossDetector.cc b/iocore/net/quic/QUICLossDetector.cc
index 7466d56..672679b 100644
--- a/iocore/net/quic/QUICLossDetector.cc
+++ b/iocore/net/quic/QUICLossDetector.cc
@@ -25,7 +25,7 @@
 #include "QUICEvents.h"
 #include "ts/ink_assert.h"
 
-#define DebugQUICLD(fmt, ...) \
+#define QUICLDDebug(fmt, ...) \
   Debug("quic_loss_detector", "[%" PRIx64 "] " fmt, static_cast<uint64_t>(this->_connection_id),
##__VA_ARGS__)
 
 QUICLossDetector::QUICLossDetector(QUICPacketTransmitter *transmitter) : _transmitter(transmitter)
@@ -55,7 +55,7 @@ QUICLossDetector::event_handler(int event, Event *edata)
   }
   case QUIC_EVENT_LD_SHUTDOWN: {
     SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread());
-    DebugQUICLD("Shutdown");
+    QUICLDDebug("Shutdown");
 
     if (this->_loss_detection_alarm) {
       this->_loss_detection_alarm->cancel();
@@ -84,7 +84,7 @@ QUICLossDetector::handle_frame(std::shared_ptr<const QUICFrame> frame)
     this->_on_ack_received(std::dynamic_pointer_cast<const QUICAckFrame>(frame));
     break;
   default:
-    DebugQUICLD("Unexpected frame type: %02x", static_cast<unsigned int>(frame->type()));
+    QUICLDDebug("Unexpected frame type: %02x", static_cast<unsigned int>(frame->type()));
     ink_assert(false);
     break;
   }
@@ -200,7 +200,7 @@ QUICLossDetector::_on_ack_received(const std::shared_ptr<const QUICAckFrame>
&ac
   }
 
   this->_detect_lost_packets(ack_frame->largest_acknowledged());
-  DebugQUICLD("Unacked handshake pkt %u, retransmittable pkt %u", this->_handshake_outstanding,
this->_retransmittable_outstanding);
+  QUICLDDebug("Unacked handshake pkt %u, retransmittable pkt %u", this->_handshake_outstanding,
this->_retransmittable_outstanding);
   this->_set_loss_detection_alarm();
 }
 
@@ -208,7 +208,7 @@ void
 QUICLossDetector::_on_packet_acked(QUICPacketNumber acked_packet_number)
 {
   SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread());
-  DebugQUICLD("Packet number %" PRIu64 " has been acked", acked_packet_number);
+  QUICLDDebug("Packet number %" PRIu64 " has been acked", acked_packet_number);
   // If a packet sent prior to RTO was acked, then the RTO
   // was spurious.  Otherwise, inform congestion control.
   if (this->_rto_count > 0 && acked_packet_number > this->_largest_sent_before_rto)
{
@@ -258,7 +258,7 @@ QUICLossDetector::_on_loss_detection_alarm()
     // eventProcessor.schedule_imm(this->_handler, ET_CALL, QUIC_EVENT_RETRANSMIT_TWO_PACKET);
     this->_rto_count++;
   }
-  DebugQUICLD("Unacked handshake pkt %u, retransmittable pkt %u", this->_handshake_outstanding,
this->_retransmittable_outstanding);
+  QUICLDDebug("Unacked handshake pkt %u, retransmittable pkt %u", this->_handshake_outstanding,
this->_retransmittable_outstanding);
   this->_set_loss_detection_alarm();
 }
 
@@ -283,7 +283,7 @@ QUICLossDetector::_set_loss_detection_alarm()
     this->_loss_detection_alarm_at = 0;
     this->_loss_detection_alarm->cancel();
     this->_loss_detection_alarm = nullptr;
-    DebugQUICLD("Loss detection alarm has been unset");
+    QUICLDDebug("Loss detection alarm has been unset");
     return;
   }
   if (this->_handshake_outstanding) {
@@ -295,11 +295,11 @@ QUICLossDetector::_set_loss_detection_alarm()
     }
     alarm_duration = std::max(alarm_duration, this->_MIN_TLP_TIMEOUT);
     alarm_duration = alarm_duration * (1 << this->_handshake_count);
-    DebugQUICLD("Handshake retransmission alarm will be set");
+    QUICLDDebug("Handshake retransmission alarm will be set");
   } else if (this->_loss_time != 0) {
     // Early retransmit timer or time loss detection.
     alarm_duration = this->_loss_time - Thread::get_hrtime();
-    DebugQUICLD("Early retransmit timer or time loss detection will be set");
+    QUICLDDebug("Early retransmit timer or time loss detection will be set");
   } else if (this->_tlp_count < this->_MAX_TLPS) {
     // Tail Loss Probe
     if (this->_retransmittable_outstanding) {
@@ -308,17 +308,17 @@ QUICLossDetector::_set_loss_detection_alarm()
       alarm_duration = this->_MIN_TLP_TIMEOUT;
     }
     alarm_duration = std::max(alarm_duration, 2 * this->_smoothed_rtt);
-    DebugQUICLD("TLP alarm will be set");
+    QUICLDDebug("TLP alarm will be set");
   } else {
     // RTO alarm
     alarm_duration = this->_smoothed_rtt + 4 * this->_rttvar;
     alarm_duration = std::max(alarm_duration, this->_MIN_RTO_TIMEOUT);
     alarm_duration = alarm_duration * (1 << this->_rto_count);
-    DebugQUICLD("RTO alarm will be set");
+    QUICLDDebug("RTO alarm will be set");
   }
 
   this->_loss_detection_alarm_at = Thread::get_hrtime() + alarm_duration;
-  DebugQUICLD("Loss detection alarm has been set to %" PRId64, alarm_duration);
+  QUICLDDebug("Loss detection alarm has been set to %" PRId64, alarm_duration);
 
   if (!this->_loss_detection_alarm) {
     this->_loss_detection_alarm = eventProcessor.schedule_every(this, HRTIME_MSECONDS(100));
diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index 1f6a6c4..8c9822d 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -28,10 +28,10 @@
 #include "QUICDebugNames.h"
 #include "QUICConfig.h"
 
-#define DebugQUICStream(fmt, ...)                                                       
                               \
+#define QUICStreamDebug(fmt, ...)                                                       
                               \
   Debug("quic_stream", "[%" PRIx64 "] [%" PRIx32 "] [%s] " fmt, static_cast<uint64_t>(this->_connection_id),
this->_id, \
         QUICDebugNames::stream_state(this->_state), ##__VA_ARGS__)
-#define DebugQUICStreamFC(fmt, ...)                                                     
                                  \
+#define QUICStreamFCDebug(fmt, ...)                                                     
                                  \
   Debug("quic_flow_ctrl", "[%" PRIx64 "] [%" PRIx32 "] [%s] " fmt, static_cast<uint64_t>(this->_connection_id),
this->_id, \
         QUICDebugNames::stream_state(this->_state), ##__VA_ARGS__)
 
@@ -47,7 +47,7 @@ QUICStream::init(QUICFrameTransmitter *tx, QUICConnectionId cid, QUICStreamId
si
   this->_local_flow_controller  = new QUICLocalStreamFlowController(recv_max_stream_data,
_tx, _id);
   this->init_flow_control_params(recv_max_stream_data, send_max_stream_data);
 
-  DebugQUICStream("Initialized");
+  QUICStreamDebug("Initialized");
 }
 
 void
@@ -62,9 +62,9 @@ QUICStream::init_flow_control_params(uint32_t recv_max_stream_data, uint32_t
sen
   this->_flow_control_buffer_size = recv_max_stream_data;
   this->_local_flow_controller->forward_limit(recv_max_stream_data);
   this->_remote_flow_controller->forward_limit(send_max_stream_data);
-  DebugQUICStreamFC("[LOCAL] %" PRIu64 "/%" PRIu64, this->_local_flow_controller->current_offset(),
+  QUICStreamFCDebug("[LOCAL] %" PRIu64 "/%" PRIu64, this->_local_flow_controller->current_offset(),
                     this->_local_flow_controller->current_limit());
-  DebugQUICStreamFC("[REMOTE] %" PRIu64 "/%" PRIu64, this->_remote_flow_controller->current_offset(),
+  QUICStreamFCDebug("[REMOTE] %" PRIu64 "/%" PRIu64, this->_remote_flow_controller->current_offset(),
                     this->_remote_flow_controller->current_limit());
 }
 
@@ -84,7 +84,7 @@ QUICStream::final_offset()
 int
 QUICStream::main_event_handler(int event, void *data)
 {
-  DebugQUICStream("%s", QUICDebugNames::vc_event(event));
+  QUICStreamDebug("%s", QUICDebugNames::vc_event(event));
   QUICErrorUPtr error = std::unique_ptr<QUICError>(new QUICNoError());
 
   switch (event) {
@@ -111,17 +111,17 @@ QUICStream::main_event_handler(int event, void *data)
     break;
   }
   default:
-    DebugQUICStream("unknown event");
+    QUICStreamDebug("unknown event");
     ink_assert(false);
   }
 
   if (error->cls != QUICErrorClass::NONE) {
     if (error->cls == QUICErrorClass::TRANSPORT) {
-      DebugQUICStream("QUICError: %s (%u), %s (0x%x)", QUICDebugNames::error_class(error->cls),
+      QUICStreamDebug("QUICError: %s (%u), %s (0x%x)", QUICDebugNames::error_class(error->cls),
                       static_cast<unsigned int>(error->cls), QUICDebugNames::error_code(error->trans_error_code),
                       static_cast<unsigned int>(error->trans_error_code));
     } else {
-      DebugQUICStream("QUICError: %s (%u), APPLICATION ERROR (0x%x)", QUICDebugNames::error_class(error->cls),
+      QUICStreamDebug("QUICError: %s (%u), APPLICATION ERROR (0x%x)", QUICDebugNames::error_class(error->cls),
                       static_cast<unsigned int>(error->cls), static_cast<unsigned
int>(error->app_error_code));
     }
     if (dynamic_cast<QUICStreamError *>(error.get()) != nullptr) {
@@ -281,7 +281,7 @@ QUICStream::_write_to_read_vio(const std::shared_ptr<const QUICStreamFrame>
&fra
   this->_read_vio.nbytes += bytes_added;
   // frame->offset() + frame->data_length() == this->_recv_offset
   this->_local_flow_controller->forward_limit(frame->offset() + frame->data_length()
+ this->_flow_control_buffer_size);
-  DebugQUICStreamFC("[LOCAL] %" PRIu64 "/%" PRIu64, this->_local_flow_controller->current_offset(),
+  QUICStreamFCDebug("[LOCAL] %" PRIu64 "/%" PRIu64, this->_local_flow_controller->current_offset(),
                     this->_local_flow_controller->current_limit());
 
   this->_state.update_with_received_frame(*frame);
@@ -306,7 +306,7 @@ QUICStream::recv(const std::shared_ptr<const QUICStreamFrame> frame)
 
   // Flow Control - Even if it's allowed to receive on the state, it may exceed the limit
   int ret = this->_local_flow_controller->update(frame->offset() + frame->data_length());
-  DebugQUICStreamFC("[LOCAL] %" PRIu64 "/%" PRIu64, this->_local_flow_controller->current_offset(),
+  QUICStreamFCDebug("[LOCAL] %" PRIu64 "/%" PRIu64, this->_local_flow_controller->current_offset(),
                     this->_local_flow_controller->current_limit());
   if (ret != 0) {
     return QUICErrorUPtr(new QUICConnectionError(QUICTransErrorCode::FLOW_CONTROL_ERROR));
@@ -331,7 +331,7 @@ QUICErrorUPtr
 QUICStream::recv(const std::shared_ptr<const QUICMaxStreamDataFrame> frame)
 {
   this->_remote_flow_controller->forward_limit(frame->maximum_stream_data());
-  DebugQUICStreamFC("[REMOTE] %" PRIu64 "/%" PRIu64, this->_remote_flow_controller->current_offset(),
+  QUICStreamFCDebug("[REMOTE] %" PRIu64 "/%" PRIu64, this->_remote_flow_controller->current_offset(),
                     this->_remote_flow_controller->current_limit());
 
   this->reenable(&this->_write_vio);
@@ -382,15 +382,15 @@ QUICStream::_send()
     QUICStreamFrameUPtr frame = QUICFrameFactory::create_stream_frame(reinterpret_cast<const
uint8_t *>(reader->start()), len,
                                                                       this->_id, this->_send_offset,
fin);
     if (!this->_state.is_allowed_to_send(*frame)) {
-      DebugQUICStream("Canceled sending %s frame due to the stream state", QUICDebugNames::frame_type(frame->type()));
+      QUICStreamDebug("Canceled sending %s frame due to the stream state", QUICDebugNames::frame_type(frame->type()));
       break;
     }
 
     int ret = this->_remote_flow_controller->update(this->_send_offset + len);
-    DebugQUICStreamFC("[REMOTE] %" PRIu64 "/%" PRIu64, this->_remote_flow_controller->current_offset(),
+    QUICStreamFCDebug("[REMOTE] %" PRIu64 "/%" PRIu64, this->_remote_flow_controller->current_offset(),
                       this->_remote_flow_controller->current_limit());
     if (ret != 0) {
-      DebugQUICStream("Flow Controller blocked sending a STREAM frame");
+      QUICStreamDebug("Flow Controller blocked sending a STREAM frame");
       break;
     }
     // We cannot cancel sending the frame after updating the flow controller

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

Mime
View raw message