You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2018/01/09 06:29:38 UTC

[trafficserver] branch quic-latest updated: Replace QUICDebugNames::vc_event(int) with get_vc_event_name(int)

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 666e7d6  Replace QUICDebugNames::vc_event(int) with get_vc_event_name(int)
666e7d6 is described below

commit 666e7d6223a8a225d158b750caeb7abb813834db
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Tue Jan 9 15:29:23 2018 +0900

    Replace QUICDebugNames::vc_event(int) with get_vc_event_name(int)
---
 iocore/net/quic/QUICDebugNames.cc | 27 ---------------------------
 iocore/net/quic/QUICDebugNames.h  |  3 ---
 iocore/net/quic/QUICEchoApp.cc    |  3 ++-
 iocore/net/quic/QUICHandshake.cc  |  6 +++---
 iocore/net/quic/QUICStream.cc     |  9 +++++----
 proxy/hq/QUICSimpleApp.cc         |  3 ++-
 6 files changed, 12 insertions(+), 39 deletions(-)

diff --git a/iocore/net/quic/QUICDebugNames.cc b/iocore/net/quic/QUICDebugNames.cc
index a96bf39..e7e8751 100644
--- a/iocore/net/quic/QUICDebugNames.cc
+++ b/iocore/net/quic/QUICDebugNames.cc
@@ -158,33 +158,6 @@ QUICDebugNames::quic_event(int event)
 }
 
 const char *
-QUICDebugNames::vc_event(int event)
-{
-  switch (event) {
-  case VC_EVENT_READ_READY:
-    return "VC_EVENT_READ_READY";
-  case VC_EVENT_READ_COMPLETE:
-    return "VC_EVENT_READ_COMPLETE";
-  case VC_EVENT_WRITE_READY:
-    return "VC_EVENT_WRITE_READY";
-  case VC_EVENT_WRITE_COMPLETE:
-    return "VC_EVENT_WRITE_COMPLETE";
-  case VC_EVENT_EOS:
-    return "VC_EVENT_EOS";
-  case VC_EVENT_ERROR:
-    return "VC_EVENT_ERROR";
-  case VC_EVENT_INACTIVITY_TIMEOUT:
-    return "VC_EVENT_INACTIVITY_TIMEOUT";
-  case VC_EVENT_ACTIVE_TIMEOUT:
-    return "VC_EVENT_ACTIVE_TIMEOUT";
-  case VC_EVENT_OOB_COMPLETE:
-    return "VC_EVENT_OOB_COMPLETE";
-  default:
-    return "UNKNOWN";
-  }
-}
-
-const char *
 QUICDebugNames::transport_parameter_id(QUICTransportParameterId id)
 {
   switch (id) {
diff --git a/iocore/net/quic/QUICDebugNames.h b/iocore/net/quic/QUICDebugNames.h
index 8ccac29..093e81d 100644
--- a/iocore/net/quic/QUICDebugNames.h
+++ b/iocore/net/quic/QUICDebugNames.h
@@ -38,7 +38,4 @@ public:
   static const char *transport_parameter_id(QUICTransportParameterId id);
   static const char *stream_state(QUICStreamState state);
   static const char *quic_event(int event);
-
-  // TODO: move to somewhere
-  static const char *vc_event(int event);
 };
diff --git a/iocore/net/quic/QUICEchoApp.cc b/iocore/net/quic/QUICEchoApp.cc
index 6451dc7..35ea791 100644
--- a/iocore/net/quic/QUICEchoApp.cc
+++ b/iocore/net/quic/QUICEchoApp.cc
@@ -24,6 +24,7 @@
 #include "QUICEchoApp.h"
 
 #include "P_Net.h"
+#include "P_VConnection.h"
 #include "QUICDebugNames.h"
 
 static constexpr char tag[] = "quic_echo_app";
@@ -36,7 +37,7 @@ QUICEchoApp::QUICEchoApp(QUICConnection *qc) : QUICApplication(qc)
 int
 QUICEchoApp::main_event_handler(int event, Event *data)
 {
-  Debug(tag, "%s", QUICDebugNames::vc_event(event));
+  Debug(tag, "%s", get_vc_event_name(event));
 
   QUICStream *stream      = reinterpret_cast<QUICStream *>(data->cookie);
   QUICStreamIO *stream_io = this->_find_stream_io(stream->id());
diff --git a/iocore/net/quic/QUICHandshake.cc b/iocore/net/quic/QUICHandshake.cc
index cd70206..b2ff6e6 100644
--- a/iocore/net/quic/QUICHandshake.cc
+++ b/iocore/net/quic/QUICHandshake.cc
@@ -225,7 +225,7 @@ QUICHandshake::remote_transport_parameters()
 int
 QUICHandshake::state_initial(int event, Event *data)
 {
-  QUICHSDebug("event: %d", event);
+  QUICHSDebug("%s", get_vc_event_name(event));
 
   QUICErrorUPtr error = QUICErrorUPtr(new QUICNoError());
   switch (event) {
@@ -263,7 +263,7 @@ QUICHandshake::state_initial(int event, Event *data)
 int
 QUICHandshake::state_key_exchange(int event, Event *data)
 {
-  QUICHSDebug("event: %d", event);
+  QUICHSDebug("%s", get_vc_event_name(event));
 
   QUICErrorUPtr error = QUICErrorUPtr(new QUICNoError());
   switch (event) {
@@ -295,7 +295,7 @@ QUICHandshake::state_key_exchange(int event, Event *data)
 int
 QUICHandshake::state_auth(int event, Event *data)
 {
-  QUICHSDebug("event: %d", event);
+  QUICHSDebug("%s", get_vc_event_name(event));
 
   QUICErrorUPtr error = QUICErrorUPtr(new QUICNoError());
   switch (event) {
diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index 4dafbf1..c2370d1 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -24,6 +24,7 @@
 #include "QUICStream.h"
 
 #include "I_Event.h"
+#include "P_VConnection.h"
 #include "QUICStreamManager.h"
 #include "QUICDebugNames.h"
 #include "QUICConfig.h"
@@ -93,7 +94,7 @@ QUICStream::final_offset()
 int
 QUICStream::state_stream_open(int event, void *data)
 {
-  QUICStreamDebug("%s", QUICDebugNames::vc_event(event));
+  QUICStreamDebug("%s", get_vc_event_name(event));
   QUICErrorUPtr error = std::unique_ptr<QUICError>(new QUICNoError());
 
   switch (event) {
@@ -153,7 +154,7 @@ QUICStream::state_stream_open(int event, void *data)
 int
 QUICStream::state_stream_closed(int event, void *data)
 {
-  QUICStreamDebug("%s", QUICDebugNames::vc_event(event));
+  QUICStreamDebug("%s", get_vc_event_name(event));
 
   switch (event) {
   case VC_EVENT_READ_READY:
@@ -399,7 +400,7 @@ QUICStream::_signal_read_event()
     this_ethread()->schedule_imm(this->_read_vio._cont, event, &this->_read_vio);
   }
 
-  QUICStreamDebug("%s", QUICDebugNames::vc_event(event));
+  QUICStreamDebug("%s", get_vc_event_name(event));
 }
 
 /**
@@ -421,7 +422,7 @@ QUICStream::_signal_write_event()
     this_ethread()->schedule_imm(this->_write_vio._cont, event, &this->_write_vio);
   }
 
-  QUICStreamDebug("%s", QUICDebugNames::vc_event(event));
+  QUICStreamDebug("%s", get_vc_event_name(event));
 }
 
 int64_t
diff --git a/proxy/hq/QUICSimpleApp.cc b/proxy/hq/QUICSimpleApp.cc
index 310a5a0..502a1d0 100644
--- a/proxy/hq/QUICSimpleApp.cc
+++ b/proxy/hq/QUICSimpleApp.cc
@@ -24,6 +24,7 @@
 #include "QUICSimpleApp.h"
 
 #include "P_Net.h"
+#include "P_VConnection.h"
 #include "QUICDebugNames.h"
 
 #include "HQClientSession.h"
@@ -54,7 +55,7 @@ QUICSimpleApp::~QUICSimpleApp()
 int
 QUICSimpleApp::main_event_handler(int event, Event *data)
 {
-  Debug(tag, "%s", QUICDebugNames::vc_event(event));
+  Debug(tag, "%s", get_vc_event_name(event));
 
   VIO *vio                = reinterpret_cast<VIO *>(data);
   QUICStreamIO *stream_io = this->_find_stream_io(vio);

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