trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From masa...@apache.org
Subject [trafficserver] 02/02: Ran clang-format
Date Fri, 25 Aug 2017 06:07:02 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

commit a281282714390a0367b34786aca2b78b49c52471
Author: Masaori Koshiba <masaori@apache.org>
AuthorDate: Fri Aug 25 15:06:39 2017 +0900

    Ran clang-format
---
 iocore/net/quic/Mock.h               |  6 ++++-
 iocore/net/quic/QUICLossDetector.cc  |  2 +-
 iocore/net/quic/QUICLossDetector.h   |  2 +-
 iocore/net/quic/QUICStream.cc        |  6 ++---
 iocore/net/quic/QUICStream.h         |  6 ++---
 iocore/net/quic/QUICStreamManager.cc | 12 +++++-----
 iocore/net/quic/QUICStreamManager.h  | 12 +++++-----
 iocore/net/quic/QUICTypes.h          |  1 +
 lib/records/RecHttp.cc               | 46 ++++++++++++++++++------------------
 lib/ts/ink_inet.cc                   |  2 +-
 proxy/http/HttpProxyServerMain.cc    |  2 +-
 11 files changed, 51 insertions(+), 46 deletions(-)

diff --git a/iocore/net/quic/Mock.h b/iocore/net/quic/Mock.h
index 4956b55..dad5f63 100644
--- a/iocore/net/quic/Mock.h
+++ b/iocore/net/quic/Mock.h
@@ -95,7 +95,10 @@ public:
 class MockQUICConnection : public QUICConnection
 {
 public:
-  MockQUICConnection(NetVConnectionContext_t context = NET_VCONNECTION_OUT) : QUICConnection(),
_direction(context) { this->_mutex = new_ProxyMutex(); };
+  MockQUICConnection(NetVConnectionContext_t context = NET_VCONNECTION_OUT) : QUICConnection(),
_direction(context)
+  {
+    this->_mutex = new_ProxyMutex();
+  };
   void
   transmit_packet(std::unique_ptr<const QUICPacket> packet) override
   {
@@ -288,6 +291,7 @@ public:
 
   bool is_recv_avail_more_than(uint64_t /* size */) override { return true; }
   void send_frame(std::unique_ptr<QUICFrame, QUICFrameDeleterFunc> /* frame */) override
{ return; }
+
 private:
   int _totalFrameCount = 0;
   int _frameCount[256] = {0};
diff --git a/iocore/net/quic/QUICLossDetector.cc b/iocore/net/quic/QUICLossDetector.cc
index 3687884..bec3c6f 100644
--- a/iocore/net/quic/QUICLossDetector.cc
+++ b/iocore/net/quic/QUICLossDetector.cc
@@ -174,7 +174,7 @@ QUICLossDetector::_on_packet_sent(QUICPacketNumber packet_number, bool
is_retran
 }
 
 void
-QUICLossDetector::_on_ack_received(const std::shared_ptr<const QUICAckFrame>& ack_frame)
+QUICLossDetector::_on_ack_received(const std::shared_ptr<const QUICAckFrame> &ack_frame)
 {
   SCOPED_MUTEX_LOCK(lock, this->mutex, this_ethread());
   // If the largest acked is newly acked, update the RTT.
diff --git a/iocore/net/quic/QUICLossDetector.h b/iocore/net/quic/QUICLossDetector.h
index 49d0333..44e87a5 100644
--- a/iocore/net/quic/QUICLossDetector.h
+++ b/iocore/net/quic/QUICLossDetector.h
@@ -95,7 +95,7 @@ private:
 
   void _on_packet_sent(QUICPacketNumber packet_number, bool is_retransmittable, bool is_handshake,
size_t sent_bytes,
                        std::unique_ptr<const QUICPacket> packet);
-  void _on_ack_received(const std::shared_ptr<const QUICAckFrame>& ack_frame);
+  void _on_ack_received(const std::shared_ptr<const QUICAckFrame> &ack_frame);
   void _on_packet_acked(QUICPacketNumber acked_packet_number);
   void _update_rtt(uint32_t latest_rtt);
   void _detect_lost_packets(QUICPacketNumber largest_acked);
diff --git a/iocore/net/quic/QUICStream.cc b/iocore/net/quic/QUICStream.cc
index c7e4626..509471d 100644
--- a/iocore/net/quic/QUICStream.cc
+++ b/iocore/net/quic/QUICStream.cc
@@ -237,7 +237,7 @@ QUICStream::_signal_write_event(bool direct)
 }
 
 void
-QUICStream::_write_to_read_vio(const std::shared_ptr<const QUICStreamFrame>& frame)
+QUICStream::_write_to_read_vio(const std::shared_ptr<const QUICStreamFrame> &frame)
 {
   SCOPED_MUTEX_LOCK(lock, this->_read_vio.mutex, this_ethread());
 
@@ -297,14 +297,14 @@ QUICStream::recv(std::shared_ptr<const QUICStreamFrame> frame)
 }
 
 QUICError
-QUICStream::recv(const std::shared_ptr<const QUICMaxStreamDataFrame>& frame)
+QUICStream::recv(const std::shared_ptr<const QUICMaxStreamDataFrame> &frame)
 {
   this->_send_max_stream_data += frame->maximum_stream_data();
   return QUICError(QUICErrorClass::NONE);
 }
 
 QUICError
-QUICStream::recv(const std::shared_ptr<const QUICStreamBlockedFrame>& frame)
+QUICStream::recv(const std::shared_ptr<const QUICStreamBlockedFrame> &frame)
 {
   this->_slide_recv_max_stream_data();
   return QUICError(QUICErrorClass::NONE);
diff --git a/iocore/net/quic/QUICStream.h b/iocore/net/quic/QUICStream.h
index 8d54eda..b2110d5 100644
--- a/iocore/net/quic/QUICStream.h
+++ b/iocore/net/quic/QUICStream.h
@@ -60,8 +60,8 @@ public:
   void reenable(VIO *vio) override;
 
   QUICError recv(std::shared_ptr<const QUICStreamFrame> frame);
-  QUICError recv(const std::shared_ptr<const QUICMaxStreamDataFrame>& frame);
-  QUICError recv(const std::shared_ptr<const QUICStreamBlockedFrame>& frame);
+  QUICError recv(const std::shared_ptr<const QUICMaxStreamDataFrame> &frame);
+  QUICError recv(const std::shared_ptr<const QUICStreamBlockedFrame> &frame);
 
   void reset();
 
@@ -74,7 +74,7 @@ private:
 
   void _send();
 
-  void _write_to_read_vio(const std::shared_ptr<const QUICStreamFrame>&);
+  void _write_to_read_vio(const std::shared_ptr<const QUICStreamFrame> &);
   void _reorder_data();
   // NOTE: Those are called update_read_request/update_write_request in Http2Stream
   // void _read_from_net(uint64_t read_len, bool direct);
diff --git a/iocore/net/quic/QUICStreamManager.cc b/iocore/net/quic/QUICStreamManager.cc
index d9a8610..c2aa2a6 100644
--- a/iocore/net/quic/QUICStreamManager.cc
+++ b/iocore/net/quic/QUICStreamManager.cc
@@ -44,8 +44,8 @@ QUICStreamManager::interests()
 }
 
 void
-QUICStreamManager::init_flow_control_params(const std::shared_ptr<const QUICTransportParameters>&
local_tp,
-                                            const std::shared_ptr<const QUICTransportParameters>&
remote_tp)
+QUICStreamManager::init_flow_control_params(const std::shared_ptr<const QUICTransportParameters>
&local_tp,
+                                            const std::shared_ptr<const QUICTransportParameters>
&remote_tp)
 {
   this->_local_tp  = local_tp;
   this->_remote_tp = remote_tp;
@@ -94,7 +94,7 @@ QUICStreamManager::handle_frame(std::shared_ptr<const QUICFrame> frame)
 }
 
 QUICError
-QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICMaxDataFrame>&
frame)
+QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICMaxDataFrame> &frame)
 {
   this->_send_max_data = frame->maximum_data();
   return QUICError(QUICErrorClass::NONE);
@@ -109,7 +109,7 @@ QUICStreamManager::slide_recv_max_data()
 }
 
 QUICError
-QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICMaxStreamDataFrame>&
frame)
+QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICMaxStreamDataFrame>
&frame)
 {
   QUICStream *stream = this->_find_stream(frame->stream_id());
   if (stream) {
@@ -122,7 +122,7 @@ QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICMaxStreamDataFr
 }
 
 QUICError
-QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICStreamBlockedFrame>&
frame)
+QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICStreamBlockedFrame>
&frame)
 {
   QUICStream *stream = this->_find_stream(frame->stream_id());
   if (stream) {
@@ -135,7 +135,7 @@ QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICStreamBlockedFr
 }
 
 QUICError
-QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICStreamFrame>&
frame)
+QUICStreamManager::_handle_frame(const std::shared_ptr<const QUICStreamFrame> &frame)
 {
   QUICStream *stream           = this->_find_or_create_stream(frame->stream_id());
   QUICApplication *application = this->_app_map->get(frame->stream_id());
diff --git a/iocore/net/quic/QUICStreamManager.h b/iocore/net/quic/QUICStreamManager.h
index b01dbdd..88997b5 100644
--- a/iocore/net/quic/QUICStreamManager.h
+++ b/iocore/net/quic/QUICStreamManager.h
@@ -45,8 +45,8 @@ public:
   virtual bool is_recv_avail_more_than(uint64_t size);
   void add_recv_total_offset(uint64_t delta);
   void slide_recv_max_data();
-  void init_flow_control_params(const std::shared_ptr<const QUICTransportParameters>&
local_tp,
-                                const std::shared_ptr<const QUICTransportParameters>&
remote_tp);
+  void init_flow_control_params(const std::shared_ptr<const QUICTransportParameters>
&local_tp,
+                                const std::shared_ptr<const QUICTransportParameters>
&remote_tp);
   uint64_t recv_max_data() const;
   uint64_t send_max_data() const;
   uint64_t recv_total_offset() const;
@@ -57,10 +57,10 @@ public:
 private:
   QUICStream *_find_or_create_stream(QUICStreamId stream_id);
   QUICStream *_find_stream(QUICStreamId id);
-  QUICError _handle_frame(const std::shared_ptr<const QUICMaxDataFrame>&);
-  QUICError _handle_frame(const std::shared_ptr<const QUICStreamFrame>&);
-  QUICError _handle_frame(const std::shared_ptr<const QUICMaxStreamDataFrame>&);
-  QUICError _handle_frame(const std::shared_ptr<const QUICStreamBlockedFrame>&);
+  QUICError _handle_frame(const std::shared_ptr<const QUICMaxDataFrame> &);
+  QUICError _handle_frame(const std::shared_ptr<const QUICStreamFrame> &);
+  QUICError _handle_frame(const std::shared_ptr<const QUICMaxStreamDataFrame> &);
+  QUICError _handle_frame(const std::shared_ptr<const QUICStreamBlockedFrame> &);
 
   QUICFrameTransmitter *_tx                                 = nullptr;
   QUICApplicationMap *_app_map                              = nullptr;
diff --git a/iocore/net/quic/QUICTypes.h b/iocore/net/quic/QUICTypes.h
index e709ddc..5c3f9c2 100644
--- a/iocore/net/quic/QUICTypes.h
+++ b/iocore/net/quic/QUICTypes.h
@@ -217,6 +217,7 @@ public:
   }
 
   operator uint64_t() const { return _data; }
+
 private:
   uint64_t _data = 0; // in units of 1024 octets
 };
diff --git a/lib/records/RecHttp.cc b/lib/records/RecHttp.cc
index b2b3f3a..225db94 100644
--- a/lib/records/RecHttp.cc
+++ b/lib/records/RecHttp.cc
@@ -36,35 +36,35 @@ SessionProtocolNameRegistry globalSessionProtocolNameRegistry;
    These are also used for NPN setup.
 */
 
-const char *const TS_ALPN_PROTOCOL_HTTP_0_9 = IP_PROTO_TAG_HTTP_0_9.ptr();
-const char *const TS_ALPN_PROTOCOL_HTTP_1_0 = IP_PROTO_TAG_HTTP_1_0.ptr();
-const char *const TS_ALPN_PROTOCOL_HTTP_1_1 = IP_PROTO_TAG_HTTP_1_1.ptr();
-const char *const TS_ALPN_PROTOCOL_HTTP_2_0 = IP_PROTO_TAG_HTTP_2_0.ptr();
+const char *const TS_ALPN_PROTOCOL_HTTP_0_9  = IP_PROTO_TAG_HTTP_0_9.ptr();
+const char *const TS_ALPN_PROTOCOL_HTTP_1_0  = IP_PROTO_TAG_HTTP_1_0.ptr();
+const char *const TS_ALPN_PROTOCOL_HTTP_1_1  = IP_PROTO_TAG_HTTP_1_1.ptr();
+const char *const TS_ALPN_PROTOCOL_HTTP_2_0  = IP_PROTO_TAG_HTTP_2_0.ptr();
 const char *const TS_ALPN_PROTOCOL_HTTP_QUIC = IP_PROTO_TAG_HTTP_QUIC.ptr();
 
 const char *const TS_ALPN_PROTOCOL_GROUP_HTTP  = "http";
 const char *const TS_ALPN_PROTOCOL_GROUP_HTTP2 = "http2";
 
-const char *const TS_PROTO_TAG_HTTP_1_0 = TS_ALPN_PROTOCOL_HTTP_1_0;
-const char *const TS_PROTO_TAG_HTTP_1_1 = TS_ALPN_PROTOCOL_HTTP_1_1;
-const char *const TS_PROTO_TAG_HTTP_2_0 = TS_ALPN_PROTOCOL_HTTP_2_0;
+const char *const TS_PROTO_TAG_HTTP_1_0  = TS_ALPN_PROTOCOL_HTTP_1_0;
+const char *const TS_PROTO_TAG_HTTP_1_1  = TS_ALPN_PROTOCOL_HTTP_1_1;
+const char *const TS_PROTO_TAG_HTTP_2_0  = TS_ALPN_PROTOCOL_HTTP_2_0;
 const char *const TS_PROTO_TAG_HTTP_QUIC = TS_ALPN_PROTOCOL_HTTP_QUIC;
-const char *const TS_PROTO_TAG_TLS_1_3  = IP_PROTO_TAG_TLS_1_3.ptr();
-const char *const TS_PROTO_TAG_TLS_1_2  = IP_PROTO_TAG_TLS_1_2.ptr();
-const char *const TS_PROTO_TAG_TLS_1_1  = IP_PROTO_TAG_TLS_1_1.ptr();
-const char *const TS_PROTO_TAG_TLS_1_0  = IP_PROTO_TAG_TLS_1_0.ptr();
-const char *const TS_PROTO_TAG_TCP      = IP_PROTO_TAG_TCP.ptr();
-const char *const TS_PROTO_TAG_UDP      = IP_PROTO_TAG_UDP.ptr();
-const char *const TS_PROTO_TAG_IPV4     = IP_PROTO_TAG_IPV4.ptr();
-const char *const TS_PROTO_TAG_IPV6     = IP_PROTO_TAG_IPV6.ptr();
+const char *const TS_PROTO_TAG_TLS_1_3   = IP_PROTO_TAG_TLS_1_3.ptr();
+const char *const TS_PROTO_TAG_TLS_1_2   = IP_PROTO_TAG_TLS_1_2.ptr();
+const char *const TS_PROTO_TAG_TLS_1_1   = IP_PROTO_TAG_TLS_1_1.ptr();
+const char *const TS_PROTO_TAG_TLS_1_0   = IP_PROTO_TAG_TLS_1_0.ptr();
+const char *const TS_PROTO_TAG_TCP       = IP_PROTO_TAG_TCP.ptr();
+const char *const TS_PROTO_TAG_UDP       = IP_PROTO_TAG_UDP.ptr();
+const char *const TS_PROTO_TAG_IPV4      = IP_PROTO_TAG_IPV4.ptr();
+const char *const TS_PROTO_TAG_IPV6      = IP_PROTO_TAG_IPV6.ptr();
 
 InkHashTable *TSProtoTags;
 
 // Precomputed indices for ease of use.
-int TS_ALPN_PROTOCOL_INDEX_HTTP_0_9 = SessionProtocolNameRegistry::INVALID;
-int TS_ALPN_PROTOCOL_INDEX_HTTP_1_0 = SessionProtocolNameRegistry::INVALID;
-int TS_ALPN_PROTOCOL_INDEX_HTTP_1_1 = SessionProtocolNameRegistry::INVALID;
-int TS_ALPN_PROTOCOL_INDEX_HTTP_2_0 = SessionProtocolNameRegistry::INVALID;
+int TS_ALPN_PROTOCOL_INDEX_HTTP_0_9  = SessionProtocolNameRegistry::INVALID;
+int TS_ALPN_PROTOCOL_INDEX_HTTP_1_0  = SessionProtocolNameRegistry::INVALID;
+int TS_ALPN_PROTOCOL_INDEX_HTTP_1_1  = SessionProtocolNameRegistry::INVALID;
+int TS_ALPN_PROTOCOL_INDEX_HTTP_2_0  = SessionProtocolNameRegistry::INVALID;
 int TS_ALPN_PROTOCOL_INDEX_HTTP_QUIC = SessionProtocolNameRegistry::INVALID;
 
 // Predefined protocol sets for ease of use.
@@ -652,10 +652,10 @@ void
 ts_session_protocol_well_known_name_indices_init()
 {
   // register all the well known protocols and get the indices set.
-  TS_ALPN_PROTOCOL_INDEX_HTTP_0_9 = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_0_9);
-  TS_ALPN_PROTOCOL_INDEX_HTTP_1_0 = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_1_0);
-  TS_ALPN_PROTOCOL_INDEX_HTTP_1_1 = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_1_1);
-  TS_ALPN_PROTOCOL_INDEX_HTTP_2_0 = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_2_0);
+  TS_ALPN_PROTOCOL_INDEX_HTTP_0_9  = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_0_9);
+  TS_ALPN_PROTOCOL_INDEX_HTTP_1_0  = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_1_0);
+  TS_ALPN_PROTOCOL_INDEX_HTTP_1_1  = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_1_1);
+  TS_ALPN_PROTOCOL_INDEX_HTTP_2_0  = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_2_0);
   TS_ALPN_PROTOCOL_INDEX_HTTP_QUIC = globalSessionProtocolNameRegistry.toIndexConst(TS_ALPN_PROTOCOL_HTTP_QUIC);
 
   // Now do the predefined protocol sets.
diff --git a/lib/ts/ink_inet.cc b/lib/ts/ink_inet.cc
index 8247cb4..39b66c7 100644
--- a/lib/ts/ink_inet.cc
+++ b/lib/ts/ink_inet.cc
@@ -43,7 +43,7 @@ const ts::StringView IP_PROTO_TAG_TLS_1_3("tls/1.3", ts::StringView::literal);
 const ts::StringView IP_PROTO_TAG_HTTP_0_9("http/0.9", ts::StringView::literal);
 const ts::StringView IP_PROTO_TAG_HTTP_1_0("http/1.0", ts::StringView::literal);
 const ts::StringView IP_PROTO_TAG_HTTP_1_1("http/1.1", ts::StringView::literal);
-const ts::StringView IP_PROTO_TAG_HTTP_2_0("h2", ts::StringView::literal); // HTTP/2 over
TLS
+const ts::StringView IP_PROTO_TAG_HTTP_2_0("h2", ts::StringView::literal);     // HTTP/2
over TLS
 const ts::StringView IP_PROTO_TAG_HTTP_QUIC("hq-05", ts::StringView::literal); // HTTP over
QUIC
 
 uint32_t
diff --git a/proxy/http/HttpProxyServerMain.cc b/proxy/http/HttpProxyServerMain.cc
index 1ee1b0f..acde339 100644
--- a/proxy/http/HttpProxyServerMain.cc
+++ b/proxy/http/HttpProxyServerMain.cc
@@ -227,7 +227,7 @@ MakeHttpProxyAcceptor(HttpProxyAcceptor &acceptor, HttpProxyPort &port,
unsigned
     if (port.m_session_protocol_preference.contains(TS_ALPN_PROTOCOL_INDEX_HTTP_QUIC)) {
       HQSessionAccept *hq = new HQSessionAccept(accept_opt);
       // FIXME hq should be registered to QUICNextProtocolAccept like SSL
-      acceptor._accept    = hq;
+      acceptor._accept = hq;
     }
 #endif
   } else {

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

Mime
View raw message