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/05/21 00:53:55 UTC

[trafficserver] 02/02: Replace ts::string_view with std::string_view in QUIC

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 b42f7d27467c6e56be9ae8f9664a55e733e7f38d
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Mon May 21 09:53:09 2018 +0900

    Replace ts::string_view with std::string_view in QUIC
---
 iocore/net/P_QUICNetVConnection.h        |  4 ++--
 iocore/net/QUICNetVConnection.cc         |  7 +++----
 iocore/net/quic/QUICHandshakeProtocol.cc |  1 -
 iocore/net/quic/QUICKeyGenerator.cc      | 16 +++++++++-------
 proxy/hq/HQClientSession.cc              |  2 +-
 proxy/hq/HQClientSession.h               |  2 +-
 6 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/iocore/net/P_QUICNetVConnection.h b/iocore/net/P_QUICNetVConnection.h
index c64e072..8ee8358 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -180,8 +180,8 @@ public:
   virtual void net_read_io(NetHandler *nh, EThread *lthread) override;
   virtual int64_t load_buffer_and_write(int64_t towrite, MIOBufferAccessor &buf, int64_t &total_written, int &needs) override;
 
-  int populate_protocol(ts::string_view *results, int n) const override;
-  const char *protocol_contains(ts::string_view tag) const override;
+  int populate_protocol(std::string_view *results, int n) const override;
+  const char *protocol_contains(std::string_view tag) const override;
 
   // QUICNetVConnection
   void registerNextProtocolSet(SSLNextProtocolSet *s);
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 153b701..30d95a6 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -24,7 +24,6 @@
 #include <string>
 
 #include "ts/ink_config.h"
-#include "ts/ink_std_compat.h"
 #include "records/I_RecHttp.h"
 #include "ts/Diags.h"
 
@@ -742,7 +741,7 @@ QUICNetVConnection::load_buffer_and_write(int64_t towrite, MIOBufferAccessor &bu
 }
 
 int
-QUICNetVConnection::populate_protocol(ts::string_view *results, int n) const
+QUICNetVConnection::populate_protocol(std::string_view *results, int n) const
 {
   int retval = 0;
   if (n > retval) {
@@ -755,10 +754,10 @@ QUICNetVConnection::populate_protocol(ts::string_view *results, int n) const
 }
 
 const char *
-QUICNetVConnection::protocol_contains(ts::string_view prefix) const
+QUICNetVConnection::protocol_contains(std::string_view prefix) const
 {
   const char *retval  = nullptr;
-  ts::string_view tag = IP_PROTO_TAG_QUIC;
+  std::string_view tag = IP_PROTO_TAG_QUIC;
   if (prefix.size() <= tag.size() && strncmp(tag.data(), prefix.data(), prefix.size()) == 0) {
     retval = tag.data();
   } else {
diff --git a/iocore/net/quic/QUICHandshakeProtocol.cc b/iocore/net/quic/QUICHandshakeProtocol.cc
index cea5d48..8d46370 100644
--- a/iocore/net/quic/QUICHandshakeProtocol.cc
+++ b/iocore/net/quic/QUICHandshakeProtocol.cc
@@ -24,7 +24,6 @@
 #include "QUICHandshakeProtocol.h"
 
 #include "ts/Diags.h"
-#include "ts/string_view.h"
 #include "QUICTypes.h"
 #include "QUICHKDF.h"
 
diff --git a/iocore/net/quic/QUICKeyGenerator.cc b/iocore/net/quic/QUICKeyGenerator.cc
index 3f30a41..5f97b58 100644
--- a/iocore/net/quic/QUICKeyGenerator.cc
+++ b/iocore/net/quic/QUICKeyGenerator.cc
@@ -26,16 +26,18 @@
 #include "ts/ink_assert.h"
 #include "QUICHKDF.h"
 
+using namespace std::literals;
+
 constexpr static uint8_t QUIC_VERSION_1_SALT[] = {
   0x9c, 0x10, 0x8f, 0x98, 0x52, 0x0a, 0x5c, 0x5c, 0x32, 0x96, 0x8e, 0x95, 0x0e, 0x8a, 0x2c, 0x5f, 0xe0, 0x6d, 0x6c, 0x38,
 };
-constexpr static ts::string_view LABEL_FOR_CLIENT_CLEARTEXT_SECRET("client hs"_sv);
-constexpr static ts::string_view LABEL_FOR_SERVER_CLEARTEXT_SECRET("server hs"_sv);
-constexpr static ts::string_view LABEL_FOR_CLIENT_0RTT_SECRET("EXPORTER-QUIC 0rtt"_sv);
-constexpr static ts::string_view LABEL_FOR_CLIENT_PP_SECRET("EXPORTER-QUIC client 1rtt"_sv);
-constexpr static ts::string_view LABEL_FOR_SERVER_PP_SECRET("EXPORTER-QUIC server 1rtt"_sv);
-constexpr static ts::string_view LABEL_FOR_KEY("key"_sv);
-constexpr static ts::string_view LABEL_FOR_IV("iv"_sv);
+constexpr static std::string_view LABEL_FOR_CLIENT_CLEARTEXT_SECRET("client hs"sv);
+constexpr static std::string_view LABEL_FOR_SERVER_CLEARTEXT_SECRET("server hs"sv);
+constexpr static std::string_view LABEL_FOR_CLIENT_0RTT_SECRET("EXPORTER-QUIC 0rtt"sv);
+constexpr static std::string_view LABEL_FOR_CLIENT_PP_SECRET("EXPORTER-QUIC client 1rtt"sv);
+constexpr static std::string_view LABEL_FOR_SERVER_PP_SECRET("EXPORTER-QUIC server 1rtt"sv);
+constexpr static std::string_view LABEL_FOR_KEY("key"sv);
+constexpr static std::string_view LABEL_FOR_IV("iv"sv);
 
 std::unique_ptr<KeyMaterial>
 QUICKeyGenerator::generate(QUICConnectionId cid)
diff --git a/proxy/hq/HQClientSession.cc b/proxy/hq/HQClientSession.cc
index 332bcb0..f946847 100644
--- a/proxy/hq/HQClientSession.cc
+++ b/proxy/hq/HQClientSession.cc
@@ -123,7 +123,7 @@ HQClientSession::release(ProxyClientTransaction *trans)
 }
 
 int
-HQClientSession::populate_protocol(ts::string_view *result, int size) const
+HQClientSession::populate_protocol(std::string_view *result, int size) const
 {
   int retval = 0;
   if (size > retval) {
diff --git a/proxy/hq/HQClientSession.h b/proxy/hq/HQClientSession.h
index ccbae3d..928503f 100644
--- a/proxy/hq/HQClientSession.h
+++ b/proxy/hq/HQClientSession.h
@@ -50,7 +50,7 @@ public:
   int get_transact_count() const override;
   const char *get_protocol_string() const override;
   void release(ProxyClientTransaction *trans) override;
-  int populate_protocol(ts::string_view *result, int size) const override;
+  int populate_protocol(std::string_view *result, int size) const override;
 
   // HQClientSession specific methods
   void add_transaction(HQClientTransaction *);

-- 
To stop receiving notification emails like this one, please contact
masaori@apache.org.