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 6d1a8eeb03eb3f4d77d903f2593d1fc4c896cf59 Merge: 57cf415 6932805 Author: Masaori Koshiba <[email protected]> AuthorDate: Mon May 21 09:35:41 2018 +0900 Merge branch 'asf/master' into quic-latest * asf/master: (40 commits) WCCP: Fix issues with gcc8. For TS remap API functions, elaborate on mutual exclusion in the documentation. dump... add -F option Fix linkage of traffic_manager with WCCP due to removal of metric library. Editor: Fix CMakeLists.txt to handle escalate plugin promotion. Doc: Minor tweaks to clear up doc build errors. Promotes cache_promote plugin to stable This adds a new callback to remap APIs: TSRemapConfigReload Restores the expected non-tab indentations Promote the Escalate plugin to stable Uses known port, not rfc6890 loopback ip Fix documentation regarding string_view Replace ts::string_view with std::string_view Fixed memory leak in transform add test, found with clang-analyzer Removes all the metrics.config related stuff Adds a couple of more include dirs to vscode Remove TSHttpSsnConnectionGet which seems redundant. IPv6 for microserver and microDNS Allow better logging by using TSHttpConnectWithPluginId ... Conflicts: .gitignore lib/ts/Makefile.am lib/ts/ink_inet.cc lib/ts/ink_inet.h lib/tsconfig/TsConfigLua.h .editorconfig | 4 + .gitignore | 9 +- .vscode/c_cpp_properties.json | 12 +- CMakeLists.txt | 23 +- build/ax_cxx_compile_stdcxx.m4 | 980 ------------------ ci/jenkins/bin/autest.sh | 63 +- ci/jenkins/bin/build.sh | 18 +- ci/jenkins/bin/clang-analyzer.sh | 22 +- ci/jenkins/bin/clang-format.sh | 0 ci/jenkins/bin/coverity.sh | 3 +- ci/jenkins/bin/docs.sh | 0 ci/jenkins/bin/environment.sh | 83 +- ci/jenkins/bin/extract.sh | 8 + ci/jenkins/bin/gh-mirror.sh | 44 +- ci/jenkins/bin/github.sh | 39 +- ci/jenkins/bin/rat.sh | 2 +- ci/jenkins/git-jenkins-setup.sh | 22 +- ci/jenkins/git-jenkins-update.sh | 18 +- cmd/traffic_cache_tool/CacheDefs.cc | 2 +- cmd/traffic_cache_tool/File.cc | 3 +- cmd/traffic_layout/info.cc | 2 +- cmd/traffic_layout/traffic_layout.cc | 6 +- cmd/traffic_manager/AddConfigFilesHere.cc | 1 - cmd/traffic_manager/Makefile.am | 36 +- cmd/traffic_manager/metrics.cc | 370 ------- cmd/traffic_manager/metrics.h | 36 - cmd/traffic_manager/test_metrics.cc | 115 -- cmd/traffic_manager/traffic_manager.cc | 34 +- cmd/traffic_via/traffic_via.cc | 3 +- configure.ac | 5 +- doc/admin-guide/files/index.en.rst | 4 - doc/admin-guide/files/metrics.config.en.rst | 137 --- .../monitoring/statistics/core-statistics.en.rst | 1 - doc/admin-guide/plugins/compress.en.rst | 108 +- doc/admin-guide/plugins/escalate.en.rst | 9 +- doc/admin-guide/plugins/header_rewrite.en.rst | 8 +- doc/admin-guide/plugins/index.en.rst | 20 +- doc/appendices/command-line/traffic_layout.en.rst | 12 +- doc/appendices/command-line/traffic_server.en.rst | 6 + doc/conf.py | 10 +- .../TSHttpSsnIdGet.en.rst} | 26 +- doc/developer-guide/api/functions/TSRemap.en.rst | 13 +- doc/developer-guide/api/types/CoreTypes.en.rst | 8 + .../api/types/TSOverridableConfigKey.en.rst | 1 + .../internal-libraries/TextView.en.rst | 8 +- .../internal-libraries/buffer-writer.en.rst | 855 ++++++++++++--- .../internal-libraries/index.en.rst | 1 - .../internal-libraries/string_view.en.rst | 69 -- doc/manpages.py | 1 - example/blacklist_1/blacklist_1.c | 2 +- .../DelayTransformationPlugin.cc | 4 +- .../GzipTransformationPlugin.cc | 4 +- .../NullTransformationPlugin.cc | 4 +- example/cppapi/post_buffer/PostBuffer.cc | 4 +- example/ssl_preaccept/ssl_preaccept.cc | 12 +- iocore/eventsystem/IOBuffer.cc | 74 ++ iocore/eventsystem/I_MIOBufferWriter.h | 72 +- iocore/eventsystem/I_ProxyAllocator.h | 25 +- iocore/eventsystem/Makefile.am | 9 +- iocore/eventsystem/ProxyAllocator.cc | 3 +- .../eventsystem/unit-tests/test_MIOBufferWriter.cc | 110 +- iocore/hostdb/HostDB.cc | 2 - iocore/net/I_NetVConnection.h | 12 +- iocore/net/NetVConnection.cc | 4 +- iocore/net/P_SSLNetVConnection.h | 8 +- iocore/net/P_SSLUtils.h | 4 +- iocore/net/P_UnixNetVConnection.h | 4 +- iocore/net/SSLNetVConnection.cc | 14 +- iocore/net/SSLSNIConfig.cc | 4 +- iocore/net/UnixNet.cc | 16 +- iocore/net/UnixNetVConnection.cc | 6 +- lib/bindings/Makefile.am | 2 - lib/bindings/metrics.cc | 259 ----- lib/bindings/metrics.h | 37 - lib/cppapi/GzipDeflateTransformation.cc | 8 +- lib/cppapi/GzipInflateTransformation.cc | 6 +- lib/cppapi/TransformationPlugin.cc | 4 +- .../include/atscppapi/GzipDeflateTransformation.h | 4 +- .../include/atscppapi/GzipInflateTransformation.h | 4 +- .../include/atscppapi/TransformationPlugin.h | 10 +- lib/records/RecHttp.cc | 6 +- lib/records/RecRawStats.cc | 2 +- lib/ts/Allocator.h | 49 +- lib/ts/BufferWriter.h | 259 +++-- lib/ts/BufferWriterFormat.cc | 164 ++- lib/ts/BufferWriterForward.h | 66 +- lib/ts/CryptoHash.h | 4 +- lib/ts/I_Layout.h | 13 +- lib/ts/Layout.cc | 16 +- lib/ts/Makefile.am | 8 +- lib/ts/MemArena.cc | 174 ++-- lib/ts/MemArena.h | 192 +++- lib/ts/MemSpan.h | 86 +- lib/ts/Ptr.h | 33 + lib/ts/TextView.h | 20 +- lib/ts/bwf_std_format.h | 36 + lib/ts/ink_args.cc | 1 + lib/ts/ink_args.h | 1 + lib/ts/ink_inet.cc | 312 +++++- lib/ts/ink_inet.h | 74 +- lib/ts/ink_memory.h | 11 +- lib/ts/ink_queue.cc | 30 +- lib/ts/ink_queue.h | 11 +- lib/ts/ink_res_init.cc | 2 +- lib/ts/ink_std_compat.h | 157 --- lib/ts/ink_string.h | 17 + lib/ts/mkdfa.c | 4 +- lib/ts/signals.cc | 1 + lib/ts/string_view.h | 1093 -------------------- lib/ts/test_freelist.cc | 17 +- lib/ts/unit-tests/test_BufferWriter.cc | 19 +- lib/ts/unit-tests/test_BufferWriterFormat.cc | 70 +- lib/ts/unit-tests/test_MemArena.cc | 234 ++--- lib/ts/unit-tests/test_TextView.cc | 5 +- lib/ts/unit-tests/test_ink_inet.cc | 118 ++- lib/ts/unit-tests/test_layout.cc | 2 +- lib/ts/unit-tests/test_string_view.cc | 552 ---------- lib/tsconfig/TsConfigLua.h | 85 +- lib/wccp/WccpEndPoint.cc | 1 - lib/wccp/WccpLocal.h | 15 +- lib/wccp/WccpMsg.cc | 2 - mgmt/LocalManager.cc | 4 +- plugins/Makefile.am | 4 +- plugins/background_fetch/background_fetch.cc | 2 +- .../escalate => cache_promote}/Makefile.inc | 6 +- plugins/{experimental => }/cache_promote/README | 0 .../cache_promote/cache_promote.cc | 0 plugins/compress/compress.cc | 9 +- .../cache_promote => escalate}/Makefile.inc | 6 +- plugins/{experimental => }/escalate/escalate.cc | 0 plugins/experimental/mysql_remap/lib/dictionary.h | 6 +- plugins/experimental/mysql_remap/lib/iniparser.h | 6 +- .../ssl_cert_loader/ssl-cert-loader.cc | 10 +- plugins/experimental/sslheaders/sslheaders.cc | 10 +- plugins/experimental/tls_bridge/regex.cc | 4 +- plugins/experimental/tls_bridge/regex.h | 6 +- plugins/experimental/url_sig/url_sig.c | 17 +- .../experimental/webp_transform/ImageTransform.cc | 6 +- plugins/healthchecks/healthchecks.c | 2 +- plugins/tcpinfo/tcpinfo.cc | 1 - proxy/InkAPI.cc | 43 +- proxy/InkAPITest.cc | 15 +- proxy/Main.cc | 6 +- proxy/ParentSelection.cc | 4 +- proxy/ProxyClientSession.h | 6 +- proxy/ProxyClientTransaction.h | 6 +- proxy/ReverseProxy.cc | 5 +- proxy/api/ts/remap.h | 8 + proxy/api/ts/ts.h | 10 +- proxy/config/Makefile.am | 1 - proxy/config/metrics.config.default | 71 -- proxy/hdrs/HTTP.cc | 2 +- proxy/hdrs/URL.cc | 4 +- proxy/hdrs/URL.h | 4 +- proxy/http/ForwardedConfig.cc | 4 +- proxy/http/HttpConfig.cc | 4 +- proxy/http/HttpConfig.h | 4 +- proxy/http/HttpDebugNames.h | 41 + proxy/http/HttpProxyServerMain.cc | 22 + proxy/http/HttpSM.cc | 17 +- proxy/http/HttpSM.h | 8 +- proxy/http/HttpServerSession.h | 4 +- proxy/http/HttpTransactHeaders.cc | 31 +- proxy/http/HttpTransactHeaders.h | 2 +- proxy/http/remap/RemapConfig.cc | 21 +- proxy/http/remap/RemapPluginInfo.cc | 17 + proxy/http/remap/RemapPluginInfo.h | 4 + proxy/http/unit-tests/test_ForwardedConfig.cc | 2 +- proxy/http2/Http2ClientSession.h | 6 +- proxy/http2/test_HPACK.cc | 7 +- proxy/logging/LogHost.cc | 4 +- proxy/shared/DiagsConfig.cc | 1 + rc/trafficserver.in | 1 - rc/trafficserver.service.in | 4 +- tests/README.md | 47 +- tests/bootstrap.py | 2 +- tests/gold_tests/autest-site/init.cli.ext | 2 +- tests/gold_tests/autest-site/microDNS.test.ext | 17 +- tests/gold_tests/autest-site/microserver.test.ext | 29 +- .../gold_tests/autest-site/trafficserver.test.ext | 4 - .../headers/general-connection-failure-502.gold | 14 +- .../headers/general-connection-failure-502.test.py | 7 +- .../Makefile.am => tests/tools/lib/IPConstants.py | 48 +- tests/tools/microDNS/uDNS.py | 36 +- tests/tools/microServer/uWServer.py | 16 +- tools/jtest/jtest.cc | 67 +- 186 files changed, 3244 insertions(+), 5486 deletions(-) diff --cc .gitignore index 19ef8bd,9a9f5ec..5514f1c --- a/.gitignore +++ b/.gitignore @@@ -60,6 -58,6 +58,7 @@@ cmd/traffic_layout/traffic_layou cmd/traffic_via/traffic_via cmd/traffic_wccp/traffic_wccp cmd/traffic_cache_tool/traffic_cache_tool ++cmd/traffic_quic/traffic_quic lib/stamp-h1 lib/ink_autoconf.h diff --cc lib/ts/Makefile.am index 4175d8a,fead563..b3d9915 --- a/lib/ts/Makefile.am +++ b/lib/ts/Makefile.am @@@ -212,17 -210,7 +210,18 @@@ libtsutil_la_SOURCES = X509HostnameValidator.cc \ X509HostnameValidator.h +if HAS_HKDF +if OPENSSL_IS_BORINGSSL +HKDF_impl = HKDF_boringssl.cc +else +HKDF_impl = HKDF_openssl.cc +endif +libtsutil_la_SOURCES += \ + HKDF.h \ + $(HKDF_impl) +endif + + BufferWriterFormat.o : AM_CPPFLAGS += -Wno-char-subscripts #test_UNUSED_SOURCES = \ # load_http_hdr.cc \ @@@ -285,14 -273,8 +284,13 @@@ test_tslib_SOURCES = unit-tests/test_MemArena.cc \ unit-tests/test_MT_hashtable.cc \ unit-tests/test_Scalar.cc \ - unit-tests/test_string_view.cc \ unit-tests/test_scoped_resource.cc \ -- unit-tests/test_TextView.cc ++ unit-tests/test_TextView.cc + +if HAS_HKDF +test_tslib_SOURCES += \ + unit-tests/test_HKDF.cc +endif CompileParseRules_SOURCES = CompileParseRules.cc diff --cc lib/ts/ink_inet.cc index a36beff,4b02280..b1b4d92 --- a/lib/ts/ink_inet.cc +++ b/lib/ts/ink_inet.cc @@@ -36,20 -36,20 +36,22 @@@ IpAddr const IpAddr::INVALID; - const ts::string_view IP_PROTO_TAG_IPV4("ipv4"_sv); - const ts::string_view IP_PROTO_TAG_IPV6("ipv6"_sv); - const ts::string_view IP_PROTO_TAG_UDP("udp"_sv); - const ts::string_view IP_PROTO_TAG_TCP("tcp"_sv); - const ts::string_view IP_PROTO_TAG_QUIC("quic"_sv); - const ts::string_view IP_PROTO_TAG_TLS_1_0("tls/1.0"_sv); - const ts::string_view IP_PROTO_TAG_TLS_1_1("tls/1.1"_sv); - const ts::string_view IP_PROTO_TAG_TLS_1_2("tls/1.2"_sv); - const ts::string_view IP_PROTO_TAG_TLS_1_3("tls/1.3"_sv); - const ts::string_view IP_PROTO_TAG_HTTP_0_9("http/0.9"_sv); - const ts::string_view IP_PROTO_TAG_HTTP_1_0("http/1.0"_sv); - const ts::string_view IP_PROTO_TAG_HTTP_1_1("http/1.1"_sv); - const ts::string_view IP_PROTO_TAG_HTTP_2_0("h2"_sv); // HTTP/2 over TLS - const ts::string_view IP_PROTO_TAG_HTTP_QUIC("hq-11"_sv); // HTTP over QUIC + using namespace std::literals; + + const std::string_view IP_PROTO_TAG_IPV4("ipv4"sv); + const std::string_view IP_PROTO_TAG_IPV6("ipv6"sv); + const std::string_view IP_PROTO_TAG_UDP("udp"sv); + const std::string_view IP_PROTO_TAG_TCP("tcp"sv); ++const std::string_view IP_PROTO_TAG_QUIC("quic"sv); + const std::string_view IP_PROTO_TAG_TLS_1_0("tls/1.0"sv); + const std::string_view IP_PROTO_TAG_TLS_1_1("tls/1.1"sv); + const std::string_view IP_PROTO_TAG_TLS_1_2("tls/1.2"sv); + const std::string_view IP_PROTO_TAG_TLS_1_3("tls/1.3"sv); + const std::string_view IP_PROTO_TAG_HTTP_0_9("http/0.9"sv); + const std::string_view IP_PROTO_TAG_HTTP_1_0("http/1.0"sv); + const std::string_view IP_PROTO_TAG_HTTP_1_1("http/1.1"sv); -const std::string_view IP_PROTO_TAG_HTTP_2_0("h2"sv); // HTTP/2 over TLS ++const std::string_view IP_PROTO_TAG_HTTP_2_0("h2"sv); // HTTP/2 over TLS ++const std::string_view IP_PROTO_TAG_HTTP_QUIC("hq-11"sv); // HTTP over QUIC uint32_t ink_inet_addr(const char *s) diff --cc lib/ts/ink_inet.h index c06fb5e,a0e74a6..cf89506 --- a/lib/ts/ink_inet.h +++ b/lib/ts/ink_inet.h @@@ -44,20 -46,18 +46,20 @@@ IN6_IS_ADDR_UNSPECIFIED(in6_addr const #endif // IP protocol stack tags. - extern const ts::string_view IP_PROTO_TAG_IPV4; - extern const ts::string_view IP_PROTO_TAG_IPV6; - extern const ts::string_view IP_PROTO_TAG_UDP; - extern const ts::string_view IP_PROTO_TAG_TCP; - extern const ts::string_view IP_PROTO_TAG_QUIC; - extern const ts::string_view IP_PROTO_TAG_TLS_1_0; - extern const ts::string_view IP_PROTO_TAG_TLS_1_1; - extern const ts::string_view IP_PROTO_TAG_TLS_1_2; - extern const ts::string_view IP_PROTO_TAG_TLS_1_3; - extern const ts::string_view IP_PROTO_TAG_HTTP_0_9; - extern const ts::string_view IP_PROTO_TAG_HTTP_1_0; - extern const ts::string_view IP_PROTO_TAG_HTTP_1_1; - extern const ts::string_view IP_PROTO_TAG_HTTP_2_0; - extern const ts::string_view IP_PROTO_TAG_HTTP_QUIC; + extern const std::string_view IP_PROTO_TAG_IPV4; + extern const std::string_view IP_PROTO_TAG_IPV6; + extern const std::string_view IP_PROTO_TAG_UDP; + extern const std::string_view IP_PROTO_TAG_TCP; ++extern const std::string_view IP_PROTO_TAG_QUIC; + extern const std::string_view IP_PROTO_TAG_TLS_1_0; + extern const std::string_view IP_PROTO_TAG_TLS_1_1; + extern const std::string_view IP_PROTO_TAG_TLS_1_2; + extern const std::string_view IP_PROTO_TAG_TLS_1_3; + extern const std::string_view IP_PROTO_TAG_HTTP_0_9; + extern const std::string_view IP_PROTO_TAG_HTTP_1_0; + extern const std::string_view IP_PROTO_TAG_HTTP_1_1; + extern const std::string_view IP_PROTO_TAG_HTTP_2_0; ++extern const std::string_view IP_PROTO_TAG_HTTP_QUIC; struct IpAddr; // forward declare. diff --cc lib/tsconfig/TsConfigLua.h index a0196a2,8edfcf2..97024de --- a/lib/tsconfig/TsConfigLua.h +++ b/lib/tsconfig/TsConfigLua.h @@@ -89,107 -89,96 +89,96 @@@ class TsConfigBase public: /// Source of the value in the config struct. enum class Source { - NONE, ///< No source, the value is default constructed. + NONE, ///< No source, the value is default constructed. SCHEMA, ///< Value set in schema. - CONFIG ///< Value set in configuration file. + CONFIG ///< Value set in configuration file. }; /// Constructor - need the static descriptor. - TsConfigBase(TsConfigDescriptor const& d) : descriptor(d) {} - TsConfigDescriptor const& descriptor; ///< Static schema data. - Source source = Source::NONE; ///< Where the instance data came from. + TsConfigBase(TsConfigDescriptor const &d) : descriptor(d) {} + TsConfigDescriptor const &descriptor; ///< Static schema data. + Source source = Source::NONE; ///< Where the instance data came from. - virtual ~TsConfigBase() {} + virtual ~TsConfigBase() + {} /// Load the instance data from the Lua stack. - virtual ts::Errata loader(lua_State* s) = 0; + virtual ts::Errata loader(lua_State *s) = 0; }; - class TsConfigInt : public TsConfigBase - { + class TsConfigInt : public TsConfigBase { public: - TsConfigInt(TsConfigDescriptor const& d, int& i):TsConfigBase(d),ref(i){} - ts::Errata loader(lua_State* s) override; + TsConfigInt(TsConfigDescriptor const &d, int &i) : TsConfigBase(d), ref(i) {} + ts::Errata loader(lua_State *s) override; - private: - int & ref; + int &ref; }; - class TsConfigBool : public TsConfigBase - { + class TsConfigBool : public TsConfigBase { public: - TsConfigBool(TsConfigDescriptor const& d, bool& i):TsConfigBase(d), ref(i) {} - ts::Errata loader(lua_State* s) override; -private: - bool &ref; + TsConfigBool(TsConfigDescriptor const &d, bool &i) : TsConfigBase(d), ref(i) {} + ts::Errata loader(lua_State *s) override; +private: + bool &ref; }; - class TsConfigString : public TsConfigBase - { + class TsConfigString : public TsConfigBase { public: - TsConfigString(TsConfigDescriptor const& d, std::string& str) : TsConfigBase(d), ref(str) {} -// TsConfigString& operator= (const TsConfigString& other) -// { -// ref = other.ref; -// return *this; -// } - ts::Errata loader(lua_State* s) override; + TsConfigString(TsConfigDescriptor const &d, std::string &str) : TsConfigBase(d), ref(str) {} + // TsConfigString& operator= (const TsConfigString& other) + // { + // ref = other.ref; + // return *this; + // } + ts::Errata loader(lua_State *s) override; - private: - std::string& ref; + std::string &ref; }; - class TsConfigArrayDescriptor : public TsConfigDescriptor - { + + + class TsConfigArrayDescriptor : public TsConfigDescriptor { public: - TsConfigArrayDescriptor(TsConfigDescriptor const& d) : item(d) {} - const TsConfigDescriptor& item; + TsConfigArrayDescriptor(TsConfigDescriptor const &d) : item(d) {} + const TsConfigDescriptor &item; }; - class TsConfigEnumDescriptor : public TsConfigDescriptor - { + class TsConfigEnumDescriptor : public TsConfigDescriptor { - using self_type = TsConfigEnumDescriptor; + using self_type = TsConfigEnumDescriptor; using super_type = TsConfigDescriptor; - public: - struct Pair { - ts::string_view key; - int value; - }; - TsConfigEnumDescriptor(Type t, ts::string_view t_name, ts::string_view n, ts::string_view d, std::initializer_list<Pair> pairs) + struct Pair { std::string_view key; int value; }; + TsConfigEnumDescriptor(Type t, std::string_view t_name, std::string_view n, std::string_view d, std::initializer_list<Pair> pairs) : super_type{t, t_name, n, d}, values{pairs.size(), &TsLuaConfigSVHash}, keys{pairs.size()} { - for ( auto& p : pairs ) { + for (auto &p : pairs) { values[p.key] = p.value; keys[p.value] = p.key; } } - std::unordered_map<ts::string_view, int, size_t (*)(ts::string_view const &)> values; - std::unordered_map<int, ts::string_view> keys; - int - get(ts::string_view key) + std::unordered_map<std::string_view, int, size_t(*)(std::string_view const&) > values; + std::unordered_map<int, std::string_view> keys; + int get(std::string_view key) { - return values[key]; + return values[key]; } }; - class TsConfigObjectDescriptor : public TsConfigDescriptor - { + class TsConfigObjectDescriptor : public TsConfigDescriptor { - std::unordered_map<std::string, TsConfigDescriptor const*> fields; + std::unordered_map<std::string, TsConfigDescriptor const *> fields; }; - template <typename E> class TsConfigEnum : public TsConfigBase - { -template < typename E > -class TsConfigEnum : public TsConfigBase { ++template <typename E> class TsConfigEnum : public TsConfigBase { public: - TsConfigEnum(TsConfigEnumDescriptor const& d, int& i) : TsConfigBase(d),edescriptor(d), ref(i) {} - TsConfigEnumDescriptor edescriptor; - int& ref; - ts::Errata loader(lua_State* L) override - { + TsConfigEnum(TsConfigEnumDescriptor const &d, int &i) : TsConfigBase(d), edescriptor(d), ref(i) {} + TsConfigEnumDescriptor edescriptor; + int &ref; + ts::Errata + loader(lua_State *L) override + { ts::Errata zret; - std::string key(lua_tostring(L, -1)); - ref = edescriptor.get(ts::string_view(key)); + std::string key(lua_tostring(L,-1)); + ref = edescriptor.get(std::string_view(key)); return zret; - } + } }; #endif /* TSCONFIGLUA_H */ -- To stop receiving notification emails like this one, please contact [email protected].
