(trafficserver) branch master updated: KIWF: Remove useless declaration in IpAllow (#10946)

2023-12-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 18b0895126 KIWF: Remove useless declaration in IpAllow (#10946)
18b0895126 is described below

commit 18b089512614ee29231d5ab6c8977ee9120b0874
Author: Alan M. Carroll 
AuthorDate: Mon Dec 18 16:50:05 2023 -0600

KIWF: Remove useless declaration in IpAllow (#10946)
---
 include/proxy/IPAllow.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/include/proxy/IPAllow.h b/include/proxy/IPAllow.h
index 85352e48ad..3c332e2ce8 100644
--- a/include/proxy/IPAllow.h
+++ b/include/proxy/IPAllow.h
@@ -52,8 +52,6 @@ class Node;
  */
 class IpAllow : public ConfigInfo
 {
-  friend struct IpAllowUpdate;
-
   using MethodNames = swoc::MemSpan;
 
   static constexpr uint32_t ALL_METHOD_MASK = ~0; // Mask for all methods.



(trafficserver) branch master updated: Arena: Avoid use of temporary. (#10941)

2023-12-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new a34df6e214 Arena: Avoid use of temporary. (#10941)
a34df6e214 is described below

commit a34df6e21408780d2abf9b6bdfdd7bce4a67f4f6
Author: Alan M. Carroll 
AuthorDate: Mon Dec 18 12:33:18 2023 -0600

Arena: Avoid use of temporary. (#10941)
---
 src/proxy/http/HttpTransact.cc | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/proxy/http/HttpTransact.cc b/src/proxy/http/HttpTransact.cc
index cb5816ace9..f472313487 100644
--- a/src/proxy/http/HttpTransact.cc
+++ b/src/proxy/http/HttpTransact.cc
@@ -930,14 +930,13 @@ HttpTransact::OriginDown(State *s)
   bootstrap_state_variables_from_request(s, >hdr_info.client_request);
   build_error_response(s, HTTP_STATUS_BAD_GATEWAY, "Origin Server Marked 
Down", "connect#failed_connect");
   Metrics::Counter::increment(http_rsb.down_server_no_requests);
-  char *url_str = s->hdr_info.client_request.url_string_get(>arena);
+  char *url_str = s->hdr_info.client_request.url_string_get_ref(nullptr);
   int host_len;
   const char *host_name_ptr = s->unmapped_url.host_get(_len);
   std::string_view host_name{host_name_ptr, size_t(host_len)};
   swoc::bwprint(error_bw_buffer, "CONNECT: down server no request to {} for 
host='{}' url='{}'", s->current.server->dst_addr,
 host_name, swoc::bwf::FirstOf(url_str, ""));
   Log::error("%s", error_bw_buffer.c_str());
-  s->arena.str_free(url_str);
 
   TRANSACT_RETURN(SM_ACTION_SEND_ERROR_CACHE_NOOP, nullptr);
 }



(trafficserver) branch master updated (db7e10542a -> 5f1d865942)

2023-12-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from db7e10542a Use slice req method type in Data obj (#10925)
 add 5f1d865942 Arena; avoid use of temporary. (#10940)

No new revisions were added by this update.

Summary of changes:
 src/proxy/http/HttpSM.cc | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)



(trafficserver) branch master updated (df36c4c896 -> 986ebe95e0)

2023-12-13 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from df36c4c896 IP: Adjust ats_force_order_by_family parameters for less 
type dependence. (#10933)
 add 986ebe95e0 KIWF: remove ink_res_getservers (#10932)

No new revisions were added by this update.

Summary of changes:
 src/tscore/ink_res_init.cc | 15 ---
 1 file changed, 15 deletions(-)



(trafficserver) branch master updated: IP: Adjust ats_force_order_by_family parameters for less type dependence. (#10933)

2023-12-13 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new df36c4c896 IP: Adjust ats_force_order_by_family parameters for less 
type dependence. (#10933)
df36c4c896 is described below

commit df36c4c8966365e82d0124a9121dfb929b06c7c7
Author: Alan M. Carroll 
AuthorDate: Wed Dec 13 12:08:21 2023 -0600

IP: Adjust ats_force_order_by_family parameters for less type dependence. 
(#10933)
---
 include/tscore/ink_resolver.h  | 2 +-
 src/proxy/http/HttpTransact.cc | 2 +-
 src/tscore/ink_res_mkquery.cc  | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/tscore/ink_resolver.h b/include/tscore/ink_resolver.h
index 8430a9c81b..6a268b4ee8 100644
--- a/include/tscore/ink_resolver.h
+++ b/include/tscore/ink_resolver.h
@@ -195,7 +195,7 @@ extern void parse_host_res_preference(const char *value,
///< [in] Co
 /// Configure the preference order to hold only what's from the client address.
 /// @addr[in] client's address.
 /// @order[out] Order to update
-extern void ats_force_order_by_family(sockaddr const *addr, 
HostResPreferenceOrder order);
+extern void ats_force_order_by_family(sa_family_t family, 
HostResPreferenceOrder order);
 
 // Domain resolution priority for origin.
 struct HostResData {
diff --git a/src/proxy/http/HttpTransact.cc b/src/proxy/http/HttpTransact.cc
index b14b5e528e..0829ebcaeb 100644
--- a/src/proxy/http/HttpTransact.cc
+++ b/src/proxy/http/HttpTransact.cc
@@ -3748,7 +3748,7 @@ HttpTransact::handle_response_from_server(State *s)
 // Force host resolution to have the same family as the client.
 // Because this is a transparent connection, we can't switch address
 // families - that is locked in by the client source address.
-ats_force_order_by_family(>current.server->dst_addr.sa, 
s->my_txn_conf().host_res_data.order);
+ats_force_order_by_family(s->current.server->dst_addr.family(), 
s->my_txn_conf().host_res_data.order);
 return CallOSDNSLookup(s);
   } else {
 if ((s->txn_conf->connect_attempts_rr_retries > 0) &&
diff --git a/src/tscore/ink_res_mkquery.cc b/src/tscore/ink_res_mkquery.cc
index 401117533b..fc5b6064c9 100644
--- a/src/tscore/ink_res_mkquery.cc
+++ b/src/tscore/ink_res_mkquery.cc
@@ -550,12 +550,12 @@ ats_host_res_from(int family, HostResPreferenceOrder 
const )
 }
 
 void
-ats_force_order_by_family(sockaddr const *addr, HostResPreferenceOrder order)
+ats_force_order_by_family(sa_family_t family, HostResPreferenceOrder order)
 {
   HostResPreferenceOrder::size_type pos{0};
-  if (ats_is_ip6(addr)) {
+  if (AF_INET6 == family) {
 order[pos++] = HOST_RES_PREFER_IPV6;
-  } else if (ats_is_ip4(addr)) {
+  } else if (AF_INET == family) {
 order[pos++] = HOST_RES_PREFER_IPV4;
   }
   for (; pos < order.size(); pos++) {



(trafficserver) branch master updated (3c8e4cad63 -> 3e52401991)

2023-11-28 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 3c8e4cad63 For vscode users, automatically use ms-vscode.cmake-tools 
(#10810)
 add 3e52401991 Update to libswoc 1.5.8 (#10849)

No new revisions were added by this update.

Summary of changes:
 lib/swoc/include/swoc/BufferWriter.h |  25 +-
 lib/swoc/include/swoc/DiscreteRange.h|  74 ++---
 lib/swoc/include/swoc/Errata.h   | 199 +-
 lib/swoc/include/swoc/IPAddr.h   | 146 ++
 lib/swoc/include/swoc/IPEndpoint.h   |  54 ++--
 lib/swoc/include/swoc/IPRange.h  | 437 +++--
 lib/swoc/include/swoc/IPSrv.h| 454 +--
 lib/swoc/include/swoc/IntrusiveDList.h   | 100 +++
 lib/swoc/include/swoc/IntrusiveHashMap.h |   9 +-
 lib/swoc/include/swoc/Lexicon.h  |   5 +-
 lib/swoc/include/swoc/MemArena.h |  31 ++-
 lib/swoc/include/swoc/MemSpan.h  | 339 ---
 lib/swoc/include/swoc/Scalar.h   |  10 +-
 lib/swoc/include/swoc/TextView.h | 228 +++-
 lib/swoc/include/swoc/Vectray.h  | 315 ++---
 lib/swoc/include/swoc/bwf_base.h |  74 ++---
 lib/swoc/include/swoc/bwf_ex.h   |  10 +-
 lib/swoc/include/swoc/bwf_fwd.h  |   8 +-
 lib/swoc/include/swoc/bwf_ip.h   |  10 +-
 lib/swoc/include/swoc/bwf_std.h  |  10 +-
 lib/swoc/include/swoc/swoc_file.h|  78 +-
 lib/swoc/include/swoc/swoc_meta.h|  58 +++-
 lib/swoc/include/swoc/swoc_version.h |   4 +-
 lib/swoc/src/Errata.cc   |  32 +--
 lib/swoc/src/MemArena.cc |  29 +-
 lib/swoc/src/RBTree.cc   |   5 +-
 lib/swoc/src/TextView.cc |   8 +-
 lib/swoc/src/bw_format.cc| 262 +++---
 lib/swoc/src/bw_ip_format.cc |  30 +-
 lib/swoc/src/swoc_file.cc| 117 
 lib/swoc/src/swoc_ip.cc  |  90 +++---
 31 files changed, 1936 insertions(+), 1315 deletions(-)



(trafficserver) branch master updated (1947a3f3df -> 0b203bf928)

2023-11-27 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 1947a3f3df Remove code for old openssl (#10792)
 add 0b203bf928 Add Errata support to YAML configuration support (promoted 
from IPAllow) (#10809)

No new revisions were added by this update.

Summary of changes:
 include/tscpp/util/YamlCfg.h |  7 +++
 src/proxy/IPAllow.cc |  9 +
 src/tscpp/util/YamlCfg.cc| 12 
 3 files changed, 20 insertions(+), 8 deletions(-)



(trafficserver) branch master updated: Cleanup: remove some autotools files from .gitignore. (#10843)

2023-11-27 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 564e064d34 Cleanup: remove some autotools files from .gitignore. 
(#10843)
564e064d34 is described below

commit 564e064d3435b438fc1deff6f89e7cbfd58d4376
Author: Alan M. Carroll 
AuthorDate: Mon Nov 27 10:32:33 2023 -0600

Cleanup: remove some autotools files from .gitignore. (#10843)
---
 .gitignore | 13 -
 1 file changed, 13 deletions(-)

diff --git a/.gitignore b/.gitignore
index 3454b032b1..5c26e9a34f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -32,10 +32,7 @@ CMakeUserPresets.json
 
 .diags.log.meta
 
-/aclocal.m4
-/autom4te.cache
 /build-aux
-/configure
 /tags
 /_build
 
@@ -49,12 +46,6 @@ m4/lt~obsolete.m4
 # common directory name for out-of-tree CMake builds
 build*
 
-Makefile
-Makefile-pl
-config.cache
-config.status
-config.nice
-
 configs/records.yaml.default
 configs/storage.config.default
 
@@ -81,11 +72,7 @@ src/traffic_top/traffic_top
 src/traffic_via/traffic_via
 
 include/stamp-h1
-include/ink_autoconf.h
-include/ink_autoconf.h.in
 src/tscore/stamp-h1
-src/tscore/ink_autoconf.h
-src/tscore/ink_autoconf.h.in
 include/tscore/ink_config.h
 include/ts/apidefs.h
 src/tscore/CompileParseRules



(trafficserver) branch master updated (d04ef9f149 -> 46d1f0cc2d)

2023-11-17 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from d04ef9f149 Remove HAVE_FLOAT_H build var (#10803)
 add 46d1f0cc2d Fix CID-15233643 - use move instead of assign. (#10787)

No new revisions were added by this update.

Summary of changes:
 src/iocore/cache/unit_tests/main.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(trafficserver) branch master updated: Export Regex support to plugins. (#10722)

2023-11-13 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 6e00344df4 Export Regex support to plugins. (#10722)
6e00344df4 is described below

commit 6e00344df420db067e2b3cddbe8a7a48b7559700
Author: Alan M. Carroll 
AuthorDate: Mon Nov 13 17:20:13 2023 -0600

Export Regex support to plugins. (#10722)

Export Regex wrapper so it is available to plugins.
---
 include/iocore/net/SSLSNIConfig.h  |  8 
 include/proxy/ControlMatcher.h | 10 -
 include/proxy/hdrs/HdrToken.h  |  2 +-
 include/proxy/http/HttpConfig.h|  2 +-
 include/proxy/http/remap/UrlMapping.h  | 10 -
 include/proxy/http/remap/UrlRewrite.h  |  2 +-
 include/tscore/DiagsTypes.h|  2 +-
 include/tscore/Regression.h|  2 +-
 include/{tscore => tscpp/util}/Regex.h | 30 +
 plugins/experimental/tls_bridge/tls_bridge.cc  |  2 +-
 src/iocore/cache/CachePages.cc |  9 
 src/iocore/net/SSLCertLookup.cc|  2 +-
 src/mgmt/rpc/CMakeLists.txt|  2 +-
 src/mgmt/rpc/handlers/common/RecordsUtils.cc   |  9 
 src/proxy/CacheControl.cc  |  2 +-
 src/proxy/hdrs/CMakeLists.txt  |  2 +-
 src/proxy/hdrs/HdrToken.cc |  2 +-
 src/proxy/hdrs/test_urlhash.cc |  2 +-
 src/proxy/hdrs/unit_tests/test_Hdrs.cc |  2 +-
 src/traffic_cache_tool/CMakeLists.txt  |  2 +-
 src/traffic_cache_tool/CacheDefs.h |  2 +-
 src/traffic_layout/info.cc |  8 
 src/traffic_via/traffic_via.cc |  2 +-
 src/tscore/CMakeLists.txt  |  2 -
 src/tscpp/util/CMakeLists.txt  | 15 +--
 src/{tscore => tscpp/util}/Regex.cc| 50 +-
 .../util}/unit_tests/test_Regex.cc |  2 +-
 27 files changed, 140 insertions(+), 45 deletions(-)

diff --git a/include/iocore/net/SSLSNIConfig.h 
b/include/iocore/net/SSLSNIConfig.h
index 856c1b9f30..af78eeaf20 100644
--- a/include/iocore/net/SSLSNIConfig.h
+++ b/include/iocore/net/SSLSNIConfig.h
@@ -37,6 +37,14 @@
 #include 
 #include 
 
+#if __has_include("pcre/pcre.h")
+#include 
+#elif __has_include("pcre.h")
+#include 
+#else
+#error "Unable to locate PCRE heeader"
+#endif
+
 #include "tscpp/util/ts_ip.h"
 
 #include "iocore/eventsystem/ConfigProcessor.h"
diff --git a/include/proxy/ControlMatcher.h b/include/proxy/ControlMatcher.h
index f3536bc01c..2ccf3461f1 100644
--- a/include/proxy/ControlMatcher.h
+++ b/include/proxy/ControlMatcher.h
@@ -94,9 +94,17 @@
 #include "tscore/ink_apidefs.h"
 #include "tscore/ink_defs.h"
 #include "proxy/hdrs/HTTP.h"
-#include "tscore/Regex.h"
+#include "tscpp/util/Regex.h"
 #include "proxy/hdrs/URL.h"
 
+#if __has_include("pcre/pcre.h")
+#include 
+#elif __has_include("pcre.h")
+#include 
+#else
+#error "Unable to locate PCRE heeader"
+#endif
+
 #include 
 
 #ifdef HAVE_CTYPE_H
diff --git a/include/proxy/hdrs/HdrToken.h b/include/proxy/hdrs/HdrToken.h
index 0c2ef0ee33..23f3ce03f8 100644
--- a/include/proxy/hdrs/HdrToken.h
+++ b/include/proxy/hdrs/HdrToken.h
@@ -30,7 +30,7 @@
 #include "tscore/ink_defs.h"
 #include "tscore/ink_string.h"
 #include "tscore/Allocator.h"
-#include "tscore/Regex.h"
+#include "tscpp/util/Regex.h"
 #include "tscore/ink_apidefs.h"
 
 
diff --git a/include/proxy/http/HttpConfig.h b/include/proxy/http/HttpConfig.h
index 2abc899c93..3532d16689 100644
--- a/include/proxy/http/HttpConfig.h
+++ b/include/proxy/http/HttpConfig.h
@@ -46,7 +46,7 @@
 #include "tscore/ink_platform.h"
 #include "tscore/ink_inet.h"
 #include "tscore/ink_resolver.h"
-#include "tscore/Regex.h"
+#include "tscpp/util/Regex.h"
 #include "tscpp/util/ts_bw.h"
 #include "iocore/eventsystem/ConfigProcessor.h"
 #include "iocore/net/ConnectionTracker.h"
diff --git a/include/proxy/http/remap/UrlMapping.h 
b/include/proxy/http/remap/UrlMapping.h
index 2de926286b..d51e909843 100644
--- a/include/proxy/http/remap/UrlMapping.h
+++ b/include/proxy/http/remap/UrlMapping.h
@@ -26,13 +26,21 @@
 
 #include 
 
+#if __has_include("pcre/pcre.h")
+#include 
+#elif __has_include("pcre.h")
+#include 
+#else
+#error "Unable to locate PCRE heeader"
+#endif
+
 #includ

(trafficserver) branch master updated (bce7b05c86 -> 57fe3de979)

2023-11-13 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from bce7b05c86 Support upstream MPTCP (#10701)
 add 57fe3de979 Fix: CID 1497247 - unitialized variable. (#10156)

No new revisions were added by this update.

Summary of changes:
 src/traffic_cache_tool/CacheDefs.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)



(trafficserver) branch master updated (27a35efe99 -> dbea08b06a)

2023-11-08 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 27a35efe99 Fix sni.yaml's ip_allow (#10749)
 add dbea08b06a Fix script error in clang-format.sh. (#10753)

No new revisions were added by this update.

Summary of changes:
 tools/clang-format.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[trafficserver] branch master updated (1f99445892 -> e2a88784c0)

2023-09-27 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 1f99445892 CID-1508880: Re-work function to avoid dead-code. (#10475)
 add e2a88784c0 libswoc: Update to 1.5.5 (#10523)

No new revisions were added by this update.

Summary of changes:
 lib/swoc/include/swoc/IPEndpoint.h |  62 ---
 lib/swoc/include/swoc/IPRange.h|   2 +-
 lib/swoc/include/swoc/IntrusiveDList.h | 288 -
 lib/swoc/include/swoc/bwf_ip.h |   3 +
 lib/swoc/src/bw_ip_format.cc   |   6 +
 lib/swoc/src/swoc_ip.cc|   4 -
 6 files changed, 336 insertions(+), 29 deletions(-)



[trafficserver] branch master updated (67f020a365 -> 135ba6e163)

2023-08-28 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 67f020a365 tools/jtest: use @SWOC_LIBS@ (#10292)
 add 135ba6e163 Fix missing virtual destructor. (#10293)

No new revisions were added by this update.

Summary of changes:
 include/records/I_RecDefs.h | 1 +
 1 file changed, 1 insertion(+)



[trafficserver] branch master updated: libswoc - remove legacy RbTree. (#10109)

2023-07-28 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 283e00ada8 libswoc - remove legacy RbTree. (#10109)
283e00ada8 is described below

commit 283e00ada8983bc71120517dd4b2a68cecd6975c
Author: Alan M. Carroll 
AuthorDate: Fri Jul 28 09:34:34 2023 -0500

libswoc - remove legacy RbTree. (#10109)
---
 include/tscore/RbTree.h   | 219 ---
 src/tscore/CMakeLists.txt |   1 -
 src/tscore/Makefile.am|   1 -
 src/tscore/RbTree.cc  | 370 --
 4 files changed, 591 deletions(-)

diff --git a/include/tscore/RbTree.h b/include/tscore/RbTree.h
deleted file mode 100644
index 2f7dc2ecae..00
--- a/include/tscore/RbTree.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/** @file
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#pragma once
-
-namespace ts
-{
-namespace detail
-{
-  /** A node in a red/black tree.
-
-  This class provides only the basic tree operations. The client
-  must provide the search and decision logic. This enables this
-  class to be a base class for templated nodes with much less code
-  duplication.
-  */
-  struct RBNode {
-using self = RBNode; ///< self reference type
-
-/// Node colors
-using Color = enum {
-  RED,
-  BLACK,
-};
-
-/// Directional constants
-using Direction = enum {
-  NONE,
-  LEFT,
-  RIGHT,
-};
-
-/// Get a child by direction.
-/// @return The child in the direction @a d if it exists,
-/// @c NULL if not.
-self *getChild(Direction d //!< The direction of the desired child
-) const;
-
-/** Determine which child a node is
-@return @c LEFT if @a n is the left child,
-@c RIGHT if @a n is the right child,
-@c NONE if @a n is not a child
-*/
-Direction
-getChildDirection(self *const  //!< The presumed child node
-) const
-{
-  return (n == _left) ? LEFT : (n == _right) ? RIGHT : NONE;
-}
-
-/** Get the parent node.
-@return A Node* to the parent node or a @c nil Node* if no parent.
-*/
-self *
-getParent() const
-{
-  return const_cast(_parent);
-}
-
-/// @return The color of the node.
-Color
-getColor() const
-{
-  return _color;
-}
-
-self *
-leftmostDescendant() const
-{
-  const self *n = this;
-  while (n->_left)
-n = n->_left;
-
-  return const_cast(n);
-}
-
-/** Reverse a direction
-@return @c LEFT if @a d is @c RIGHT, @c RIGHT if @a d is @c LEFT,
-@c NONE otherwise.
-*/
-Direction
-flip(Direction d)
-{
-  return LEFT == d ? RIGHT : RIGHT == d ? LEFT : NONE;
-}
-
-/** Perform internal validation checks.
-@return 0 on failure, black height of the tree on success.
-*/
-int validate();
-
-/// Default constructor.
-RBNode() {}
-/// Destructor (force virtual).
-virtual ~RBNode() {}
-/** Rotate the subtree rooted at this node.
-The node is rotated in to the position of one of its children.
-Which child is determined by the direction parameter @a d. The
-child in the other direction becomes the new root of the subtree.
-
-If the parent pointer is set, then the child pointer of the original
-parent is updated so that the tree is left in a consistent state.
-
-@note If there is no child in the other direction, the rotation
-fails and the original node is returned. It is @b not required
-that a child exist in the direction specified by @a d.
-
-@return The new root node for the subtree.
-*/
-self *rotate(Direction d //!< The direction to rotate
-);
-
-/** Set the child node in direction @a d to @a n.
-The @a d child is set to the node @a n. The pointers in this
-node and @a n are set correctly. This can only be called if
-there is no child node already present.
-
-@return @a 

[trafficserver] branch master updated (c042875841 -> 5d0a549233)

2023-07-27 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from c042875841 Fix ports.py type hint for sets on older Python (#10107)
 add 5d0a549233 libswoc: Remove legacy IntrusiveDList. (#10106)

No new revisions were added by this update.

Summary of changes:
 .../internal-libraries/MemArena.en.rst |   4 +-
 .../internal-libraries/index.en.rst|   1 -
 .../internal-libraries/intrusive-list.en.rst   | 234 --
 include/tscpp/util/IntrusiveDList.h| 890 -
 include/tscpp/util/Makefile.am |   1 -
 proxy/http/remap/PluginDso.h   |   7 +-
 proxy/http/remap/PluginFactory.h   |   7 +-
 proxy/http3/QPACK.h|   5 +-
 src/tscpp/util/CMakeLists.txt  |   1 -
 src/tscpp/util/unit_tests/test_IntrusiveDList.cc   | 295 ---
 10 files changed, 13 insertions(+), 1432 deletions(-)
 delete mode 100644 doc/developer-guide/internal-libraries/intrusive-list.en.rst
 delete mode 100644 include/tscpp/util/IntrusiveDList.h
 delete mode 100644 src/tscpp/util/unit_tests/test_IntrusiveDList.cc



[trafficserver] branch master updated: libswoc: Remove legacy IntrusiveHashMap (#10104)

2023-07-27 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 5706e3ba67 libswoc: Remove legacy IntrusiveHashMap (#10104)
5706e3ba67 is described below

commit 5706e3ba675844c5b6df5b51b93e478b87d591b0
Author: Alan M. Carroll 
AuthorDate: Thu Jul 27 14:18:31 2023 -0500

libswoc: Remove legacy IntrusiveHashMap (#10104)
---
 .../internal-libraries/index.en.rst|   1 -
 .../internal-libraries/intrusive-hash-map.en.rst   | 213 --
 include/tscore/IntrusiveHashMap.h  | 724 -
 src/tscore/CMakeLists.txt  |   1 -
 src/tscore/Makefile.am |   1 -
 src/tscore/unit_tests/test_IntrusiveHashMap.cc | 240 ---
 6 files changed, 1180 deletions(-)

diff --git a/doc/developer-guide/internal-libraries/index.en.rst 
b/doc/developer-guide/internal-libraries/index.en.rst
index 32dfb332b6..73ec59e528 100644
--- a/doc/developer-guide/internal-libraries/index.en.rst
+++ b/doc/developer-guide/internal-libraries/index.en.rst
@@ -35,6 +35,5 @@ development team.
MemSpan.en
TextView.en
buffer-writer.en
-   intrusive-hash-map.en
intrusive-list.en
scalar.en
diff --git a/doc/developer-guide/internal-libraries/intrusive-hash-map.en.rst 
b/doc/developer-guide/internal-libraries/intrusive-hash-map.en.rst
deleted file mode 100644
index 150e9a3594..00
--- a/doc/developer-guide/internal-libraries/intrusive-hash-map.en.rst
+++ /dev/null
@@ -1,213 +0,0 @@
-.. Licensed to the Apache Software Foundation (ASF) under one
-   or more contributor license agreements. See the NOTICE file distributed 
with this work for
-   additional information regarding copyright ownership. The ASF licenses this 
file to you under the
-   Apache License, Version 2.0 (the "License"); you may not use this file 
except in compliance with
-   the License. You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software 
distributed under the License
-   is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
-   or implied. See the License for the specific language governing permissions 
and limitations under
-   the License.
-
-.. include:: ../../common.defs
-
-.. _lib-intrusive-hash-map:
-.. highlight:: cpp
-.. default-domain:: cpp
-
-IntrusiveHashMap
-
-
-:class:`IntrusiveHashMap` provides a "hashed" or "unordered" set, using 
intrusive links. It provides a
-container for elements, each of which has a :arg:`key`. A hash function is 
applied to a key to
-generate a :arg:`hash id` which is used to group the elements in to buckets 
for fast lookup. This
-container is a mix of :code:`std::unordered_set` and 
:code:`std::unordered_map`. There is no
-separation between elements and keys, but each element can contain non-key 
data.
-
-Iteration over elements is provided and is constant time.
-
-In order to optimize lookup, the container can increase the number of buckets 
used. This is called
-"expansion" and when it occurs is control by the "expansion policy" of the 
container. The policy can
-be to be automatic or only done explicitly.
-
-Usage
-=
-
-To use an :class:`IntrusiveHashMap` the element must provide support for the 
container. This is done
-through an associated descriptor class which provides the operations needed to 
manipulate the elements
-in the container.
-
-
-Details
-===
-
-.. class:: template < typename H > IntrusiveHashMap
-
-   :tparam H: Element operations.
-
-   An unordered map using a hash function. The properties of the map are 
determined by types and
-   operations provided by the descriptor type :arg:`H`. The following types 
are derived from :arg:`H`
-   and defined in the container type.
-
-   .. type:: value_type
-
-  The type of elements in the container, deduced from the return types of 
the link accessor methods
-  in :arg:`H`.
-
-   .. type:: key_type
-
-  The type of the key used for hash computations. Deduced from the return 
type of the key
-  accessor. An instance of this type is never default constructed nor 
modified, therefore it can
-  be a reference if the key type is expensive to copy.
-
-   .. type:: hash_id
-
-  The type of the hash of a :type:`key_type`. Deduced from the return type 
of the hash function.
-  This must be a numeric type.
-
-   :arg:`H`
-  This describes the hash map, primarily via the operations required for 
the map. The related types are deduced
-  from the function return types. This is designed to be compatible with 
:class:`IntrusiveDList`.
-
-  .. function:: static key_type key_of(value_type * v

[trafficserver] branch master updated: Update to libswoc 1.5.3 (#10094)

2023-07-26 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 3adcde5484 Update to libswoc 1.5.3 (#10094)
3adcde5484 is described below

commit 3adcde54840d80bff6d362540cdb263d6bb4669c
Author: Alan M. Carroll 
AuthorDate: Wed Jul 26 10:50:53 2023 -0500

Update to libswoc 1.5.3 (#10094)
---
 lib/swoc/CMakeLists.txt  |   2 +-
 lib/swoc/Makefile.am |   2 +-
 lib/swoc/include/swoc/BufferWriter.h |  27 +++--
 lib/swoc/include/swoc/MemSpan.h  | 184 ++-
 lib/swoc/include/swoc/TextView.h |   4 +-
 lib/swoc/include/swoc/Vectray.h  |  26 ++---
 lib/swoc/include/swoc/bwf_base.h |  15 ++-
 lib/swoc/include/swoc/bwf_fwd.h  |   2 +
 lib/swoc/include/swoc/bwf_ip.h   |  16 ++-
 lib/swoc/include/swoc/swoc_version.h |   4 +-
 lib/swoc/src/Errata.cc   |   4 +-
 lib/swoc/src/bw_format.cc|   8 +-
 lib/swoc/src/bw_ip_format.cc |   2 +-
 lib/swoc/src/swoc_file.cc|   4 +
 14 files changed, 256 insertions(+), 44 deletions(-)

diff --git a/lib/swoc/CMakeLists.txt b/lib/swoc/CMakeLists.txt
index 5f0696bafb..33a0ce7f57 100644
--- a/lib/swoc/CMakeLists.txt
+++ b/lib/swoc/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.11)
 
 project(Lib-SWOC CXX)
-set(LIBSWOC_VERSION "1.5.2")
+set(LIBSWOC_VERSION "1.5.3")
 set(CMAKE_CXX_STANDARD 17)
 cmake_policy(SET CMP0087 NEW)
 # override "lib64" to be "lib" unless the user explicitly sets it.
diff --git a/lib/swoc/Makefile.am b/lib/swoc/Makefile.am
index deb1de366e..ad56edd792 100644
--- a/lib/swoc/Makefile.am
+++ b/lib/swoc/Makefile.am
@@ -22,7 +22,7 @@ library_includedir=$(includedir)/swoc
 
 AM_CPPFLAGS += @SWOC_INCLUDES@
 
-libtsswoc_la_LDFLAGS = @AM_LDFLAGS@ -no-undefined -release 1.5.2
+libtsswoc_la_LDFLAGS = @AM_LDFLAGS@ -no-undefined -release 1.5.3
 libtsswoc_la_SOURCES = \
src/ArenaWriter.cc  src/bw_format.cc  src/bw_ip_format.cc  
src/Errata.cc  src/MemArena.cc  src/RBTree.cc  src/swoc_file.cc  src/swoc_ip.cc 
 src/TextView.cc src/string_view_util.cc
 
diff --git a/lib/swoc/include/swoc/BufferWriter.h 
b/lib/swoc/include/swoc/BufferWriter.h
index 5ea465f5ea..4de2d97074 100644
--- a/lib/swoc/include/swoc/BufferWriter.h
+++ b/lib/swoc/include/swoc/BufferWriter.h
@@ -53,17 +53,19 @@ public:
*/
   virtual BufferWriter (void const *data, size_t length);
 
-  /** Add the contents of @a sv to the buffer, up to the size of the view.
-
-  Data is added only up to the remaining room in the buffer. If the 
remaining capacity is
-  exceeded (i.e. data is not written to the output), the instance is put 
in to an error
-  state. In either case the value for @c extent is incremented by the size 
of @a sv.
-
-  @return @c *this
-  */
-  BufferWriter (const std::string_view );
+  /** Write data to the buffer.
+   *
+   * @param span Data source.
+   * @return @a this
+   *
+   * Data from @a span is written directly to the buffer, and clipped to the 
size of the buffer.
+   *
+   * @internal The char poointer overloads protect this method in order to 
protect against including
+   * the terminal nul in the destination buffer.
+   */
+  BufferWriter & write(MemSpan span);
 
-  /// Address of the first byte in the output buffer.
+  /// @return Pointer to first byte in buffer.
   virtual const char *data() const = 0;
 
   /// Get the error state.
@@ -440,10 +442,15 @@ BufferWriter::write(const void *data, size_t length) {
   return *this;
 }
 
+# if 0
 inline BufferWriter &
 BufferWriter::write(const std::string_view ) {
   return this->write(sv.data(), sv.size());
 }
+# endif
+
+inline BufferWriter &
+BufferWriter::write(MemSpan span) { return 
this->write(span.data(), span.size()); }
 
 inline char *
 BufferWriter::aux_data() {
diff --git a/lib/swoc/include/swoc/MemSpan.h b/lib/swoc/include/swoc/MemSpan.h
index bb097ede59..53d7a3f539 100644
--- a/lib/swoc/include/swoc/MemSpan.h
+++ b/lib/swoc/include/swoc/MemSpan.h
@@ -138,7 +138,7 @@ public:
*
* @internal A non-const variant of this is needed because passing by CR 
means imposing constness
* on the container which can then undesirably propagate that to the element 
type. Best example -
-   * consstructing from @c std::string. Without this variant it's not possible 
to construct a @c char
+   * constructing from @c std::string. Without this variant it's not possible 
to construct a @c char
* span vs. a @c char @c const.
*/
   template < typename C
@@ -264,8 +264,11 @@ public:
*
* @tparam U Type for the created span.
* @return A @c MemSpan which contains the same memory as instances of @a U.
+   *
+   * if no type is specified, the default is @c void or @c void @c const 
according to whether
+   * 

[trafficserver] branch master updated: libswoc: Update WCCP use of Errata. (#9875)

2023-07-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new ad17bbd612 libswoc: Update WCCP use of Errata. (#9875)
ad17bbd612 is described below

commit ad17bbd612f280f519b4e1f2cfab314c2e830785
Author: Alan M. Carroll 
AuthorDate: Tue Jul 18 17:20:04 2023 -0500

libswoc: Update WCCP use of Errata. (#9875)
---
 include/tscpp/util/ts_errata.h  |  26 +++
 include/wccp/Wccp.h |  18 +-
 src/traffic_wccp/Makefile.inc   |   8 +-
 src/traffic_wccp/wccp_client.cc |  23 +-
 src/wccp/WccpConfig.cc  | 503 +---
 src/wccp/WccpEndPoint.cc| 196 
 src/wccp/WccpLocal.h|  50 ++--
 src/wccp/WccpMsg.cc |  29 +--
 src/wccp/WccpStatic.cc  |  48 +++-
 src/wccp/WccpUtil.h |  79 ---
 10 files changed, 491 insertions(+), 489 deletions(-)

diff --git a/include/tscpp/util/ts_errata.h b/include/tscpp/util/ts_errata.h
index e9b6d7d2ae..8ac508e5ae 100644
--- a/include/tscpp/util/ts_errata.h
+++ b/include/tscpp/util/ts_errata.h
@@ -21,6 +21,8 @@ limitations under the License.
 
 #pragma once
 
+#include 
+
 #include "tscpp/util/ts_diag_levels.h"
 #include "swoc/TextView.h"
 #include "swoc/Errata.h"
@@ -35,6 +37,23 @@ static constexpr swoc::Errata::Severity 
ERRATA_FATAL{DL_Fatal};
 static constexpr swoc::Errata::Severity ERRATA_ALERT{DL_Alert};
 static constexpr swoc::Errata::Severity ERRATA_EMERGENCY{DL_Emergency};
 
+inline DiagsLevel
+diags_level_of(swoc::Errata::Severity s)
+{
+  return static_cast(static_cast(s));
+}
+
+inline std::error_code
+ec_for()
+{
+  return std::error_code(errno, std::system_category());
+}
+inline std::error_code
+ec_for(int e)
+{
+  return std::error_code(e, std::system_category());
+}
+
 // This is treated as an array so must numerically match with @c DiagsLevel
 static constexpr std::array Severity_Names{
   {"Diag", "Debug", "Status", "Note", "Warn", "Error", "Fatal", "Alert", 
"Emergency"}
@@ -53,3 +72,10 @@ make_errno_code(int err)
 
 // Temporary string for formatting.
 inline thread_local std::string bw_dbg;
+
+template 
+void
+bw_log(DiagsLevel lvl, swoc::TextView fmt, Args &&...args)
+{
+  swoc::bwprint_v(bw_dbg, fmt, std::forward_as_tuple(args...));
+}
diff --git a/include/wccp/Wccp.h b/include/wccp/Wccp.h
index ffba07bad8..aa156c09d7 100644
--- a/include/wccp/Wccp.h
+++ b/include/wccp/Wccp.h
@@ -24,14 +24,14 @@
 
 #include 
 #include 
-
 // INADDR_ANY
 #include 
 
+#include "tscpp/util/ts_errata.h"
+
 #include "tscore/ink_defs.h"
 #include "tscore/ink_memory.h"
 #include "tscore/IntrusivePtr.h"
-#include "tscore/Errata.h"
 
 // Nasty, defining this with no prefix. The value is still available
 // in TS_VERSION_STRING.
@@ -88,6 +88,9 @@ struct ServiceConstants {
   };
 };
 
+swoc::BufferWriter (swoc::BufferWriter , swoc::bwf::Spec const 
, ServiceConstants::PacketStyle);
+swoc::BufferWriter (swoc::BufferWriter , swoc::bwf::Spec const 
, ServiceConstants::CacheAssignmentStyle);
+
 /** Service group definition.
 
 Also used as serialized layout internally by ServiceGroupElt. This is kept
@@ -121,7 +124,7 @@ public:
   static uint8_t const RESERVED = 50;
 
   /// Number of ports in component (defined by protocol).
-  static size_t const N_PORTS = 8;
+  static constexpr size_t const N_PORTS = 8;
 
   /// @name Flag mask values.
   //@{
@@ -240,8 +243,7 @@ public:
   @return 0 on success, -ERRNO on failure.
   @see setAddr
   */
-  int open(uint32_t addr = INADDR_ANY ///< Local IP address for socket.
-  );
+  swoc::Errata open(uint32_t addr = INADDR_ANY);
 
   /// Get the internal socket.
   /// Useful primarily for socket options and using
@@ -257,7 +259,7 @@ public:
 
   /// Receive and process a message on the socket.
   /// @return 0 for success, -ERRNO on system error.
-  ts::Rv handleMessage();
+  swoc::Errata handleMessage();
 
 protected:
   /// Default constructor.
@@ -295,8 +297,8 @@ public:
   ~Cache() override;
 
   /// Define services from a configuration file.
-  ts::Errata loadServicesFromFile(char const *path ///< Path to file.
-  );
+  /// @param path Path to configuration file.
+  swoc::Errata loadServicesFromFile(char const *path);
 
   /** Define a service group.
 
diff --git a/src/traffic_wccp/Makefile.inc b/src/traffic_wccp/Makefile.inc
index 1e2150c478..5298ca77b7 100644
--- a/src/traffic_wccp/Makefile.inc
+++ b/src/traffic_wccp/Makefile.inc
@@ -25,11 +25,13 @@ traffic_wccp_traffic_wccp_CPPFLAGS = \
-I$(abs_top_srcdir)/include \
-I$(abs_top_srcdir)/lib \
$(TS_INCLUDES) \
-   @OPENSSL_INCLUDES@
+   @SWOC_INCLUDES@ \
+@OPENSSL_I

[trafficserver] branch master updated: libswoc: Update Errata use in cache tool. (#9878)

2023-07-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 73cbbfba86 libswoc: Update Errata use in cache tool. (#9878)
73cbbfba86 is described below

commit 73cbbfba8655f6b3247418e6b4ab66bcfb8de1da
Author: Alan M. Carroll 
AuthorDate: Tue Jul 18 17:19:52 2023 -0500

libswoc: Update Errata use in cache tool. (#9878)
---
 include/tscpp/util/ts_errata.h  | 11 +
 src/traffic_cache_tool/CacheDefs.cc | 23 ++-
 src/traffic_cache_tool/CacheDefs.h  | 13 +++---
 src/traffic_cache_tool/CacheScan.cc | 12 +++---
 src/traffic_cache_tool/CacheTool.cc | 80 ++---
 5 files changed, 77 insertions(+), 62 deletions(-)

diff --git a/include/tscpp/util/ts_errata.h b/include/tscpp/util/ts_errata.h
index 42bdf11b74..e9b6d7d2ae 100644
--- a/include/tscpp/util/ts_errata.h
+++ b/include/tscpp/util/ts_errata.h
@@ -40,5 +40,16 @@ static constexpr std::array 
Severity_Names{
   {"Diag", "Debug", "Status", "Note", "Warn", "Error", "Fatal", "Alert", 
"Emergency"}
 };
 
+inline std::error_code
+make_errno_code()
+{
+  return {errno, std::system_category()};
+}
+inline std::error_code
+make_errno_code(int err)
+{
+  return {err, std::system_category()};
+}
+
 // Temporary string for formatting.
 inline thread_local std::string bw_dbg;
diff --git a/src/traffic_cache_tool/CacheDefs.cc 
b/src/traffic_cache_tool/CacheDefs.cc
index ff63dd9d24..b6a62a50e5 100644
--- a/src/traffic_cache_tool/CacheDefs.cc
+++ b/src/traffic_cache_tool/CacheDefs.cc
@@ -28,9 +28,12 @@
 using namespace std;
 using namespace ts;
 
-using ts::Errata;
 namespace ts
 {
+
+using swoc::Errata;
+using swoc::Rv;
+
 std::ostream &
 operator<<(std::ostream , Bytes const )
 {
@@ -305,7 +308,7 @@ Stripe::updateHeaderFooter()
   InitializeMeta();
 
   if (!OPEN_RW_FLAG) {
-zret.push(0, 1, "Writing Not Enabled.. Please use --write to enable 
writing to disk");
+zret.note("Writing Not Enabled.. Please use --write to enable writing to 
disk");
 return zret;
   }
 
@@ -319,9 +322,9 @@ Stripe::updateHeaderFooter()
 
 ssize_t n = pwrite(_span->_fd, meta_t, hdr_size, _meta_pos[i][HEAD]);
 if (n < hdr_size) {
+  zret = swoc::Errata(make_errno_code(), "Failed to write stripe header ");
   std::cout << "problem writing header to disk: " << strerror(errno) << ":"
 << " " << n << "<" << hdr_size << std::endl;
-  zret = Errata::Message(0, errno, "Failed to write stripe header ");
   ats_free(meta_t);
   return zret;
 }
@@ -330,9 +333,9 @@ Stripe::updateHeaderFooter()
 memcpy(meta_t, (char *)dir, dir_size);
 n = pwrite(_span->_fd, meta_t, dir_size, _meta_pos[i][HEAD] + hdr_size); //
 if (n < dir_size) {
+  zret = Errata(make_errno_code(), "Failed to write stripe header ");
   std::cout << "problem writing dir to disk: " << strerror(errno) << ":"
 << " " << n << "<" << dir_size << std::endl;
-  zret = Errata::Message(0, errno, "Failed to write stripe header ");
   ats_free(meta_t);
   return zret;
 }
@@ -343,9 +346,9 @@ Stripe::updateHeaderFooter()
 int64_t footer_size = ROUND_TO_STORE_BLOCK(sizeof(StripeMeta));
 n   = pwrite(_span->_fd, meta_t, footer_size, 
_meta_pos[i][FOOT]);
 if (n < footer_size) {
+  zret = Errata(make_errno_code(), "Failed to write stripe header ");
   std::cout << "problem writing footer to disk: " << strerror(errno) << ":"
 << " " << n << "<" << footer_size << std::endl;
-  zret = Errata::Message(0, errno, "Failed to write stripe header ");
   ats_free(meta_t);
   return zret;
 }
@@ -897,8 +900,8 @@ Stripe::loadMeta()
   alignas(SBSIZE) char stripe_buff[SBSIZE]; // Use when reading a 
single stripe block.
   alignas(SBSIZE) char stripe_buff2[SBSIZE];// use to save the 
stripe freelist
   if (io_align > SBSIZE) {
-return Errata::Message(0, 1, "Cannot load stripe ", _idx, " on span ", 
_span->_path.string(),
-   " because the I/O block alignment ", io_align, " is 
larger than the buffer alignment ", SBSIZE);
+return Errata("Cannot load stripe {} on span [} because the I/O block 
alignment {} is larger than the buffer alignment {}",
+  _idx, _span->_path.stri

[trafficserver] branch master updated (9d241b2372 -> 40eb3336a4)

2023-07-17 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 9d241b2372 RPC client: Increase message buffer size. (#9970)
 add 40eb3336a4 libswoc: Update to 1.5.2

No new revisions were added by this update.

Summary of changes:
 lib/swoc/CMakeLists.txt  |  2 +-
 lib/swoc/Makefile.am |  2 +-
 lib/swoc/include/swoc/MemSpan.h  |  6 +++
 lib/swoc/include/swoc/TextView.h | 78 +---
 lib/swoc/include/swoc/bwf_base.h | 33 ++-
 lib/swoc/include/swoc/swoc_version.h |  4 +-
 lib/swoc/src/bw_format.cc|  4 +-
 7 files changed, 116 insertions(+), 13 deletions(-)



[trafficserver] branch master updated (efb9756e45 -> e40e0acd61)

2023-06-26 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from efb9756e45 libswoc: Update IntrusiveHashMap in log rolling (#9871)
 add e40e0acd61 libswoc: Update IntrusvieHashMap in Http connection 
tracking. (#9873)

No new revisions were added by this update.

Summary of changes:
 proxy/http/HttpConnectionCount.h | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)



[trafficserver] branch master updated: libswoc: Update IntrusiveHashMap in HostDB. (#9874)

2023-06-26 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new cf771e3ee7 libswoc: Update IntrusiveHashMap in HostDB. (#9874)
cf771e3ee7 is described below

commit cf771e3ee781a1e872e05229b01fefea3012827e
Author: Alan M. Carroll 
AuthorDate: Mon Jun 26 15:40:11 2023 -0700

libswoc: Update IntrusiveHashMap in HostDB. (#9874)
---
 iocore/hostdb/HostDB.cc | 2 +-
 iocore/hostdb/P_RefCountCache.h | 7 ---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index 159005df0e..e510c65562 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -1274,7 +1274,7 @@ HostDBContinuation::iterateEvent(int event, Event *e)
 ts::shared_mutex _lock = 
hostDB.refcountcache->get_partition(current_iterate_pos).lock;
 std::shared_lock lock{bucket_lock};
 
-IntrusiveHashMap  = 
hostDB.refcountcache->get_partition(current_iterate_pos).get_map();
+auto  = 
hostDB.refcountcache->get_partition(current_iterate_pos).get_map();
 for (const auto  : partMap) {
   auto *r = static_cast(it.item.get());
   if (r && !r->is_failed()) {
diff --git a/iocore/hostdb/P_RefCountCache.h b/iocore/hostdb/P_RefCountCache.h
index fba8e1156a..c227eb8068 100644
--- a/iocore/hostdb/P_RefCountCache.h
+++ b/iocore/hostdb/P_RefCountCache.h
@@ -25,7 +25,8 @@
 #include 
 #include  // TODO: less? just need ET_TASK
 
-#include "tscore/IntrusiveHashMap.h"
+#include "swoc/IntrusiveHashMap.h"
+
 #include "tscore/PriorityQueue.h"
 
 #include "tscore/List.h"
@@ -159,7 +160,7 @@ protected:
 template  class RefCountCachePartition : private RefCountCacheBase
 {
 public:
-  using hash_type = IntrusiveHashMap;
+  using hash_type = swoc::IntrusiveHashMap;
 
   RefCountCachePartition(unsigned int part_num, uint64_t max_size, unsigned 
int max_items, RecRawStatBlock *rsb = nullptr);
   Ptr get(uint64_t key);
@@ -365,7 +366,7 @@ RefCountCachePartition::metric_inc(RefCountCache_Stats 
metric_enum, int64_t d
 }
 
 template 
-IntrusiveHashMap &
+swoc::IntrusiveHashMap &
 RefCountCachePartition::get_map()
 {
   return this->item_map;



[trafficserver] branch master updated (ca4f8cd634 -> efb9756e45)

2023-06-26 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from ca4f8cd634 libswoc: Update IntrusiveHashMap in HTTP session manager. 
(#9872)
 add efb9756e45 libswoc: Update IntrusiveHashMap in log rolling (#9871)

No new revisions were added by this update.

Summary of changes:
 proxy/logging/RolledLogDeleter.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[trafficserver] branch master updated: libswoc: Update IntrusiveHashMap in HTTP session manager. (#9872)

2023-06-26 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new ca4f8cd634 libswoc: Update IntrusiveHashMap in HTTP session manager. 
(#9872)
ca4f8cd634 is described below

commit ca4f8cd634beb808bbadf03cb646ab6760cabbe4
Author: Alan M. Carroll 
AuthorDate: Mon Jun 26 15:38:48 2023 -0700

libswoc: Update IntrusiveHashMap in HTTP session manager. (#9872)
---
 proxy/http/HttpSessionManager.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/proxy/http/HttpSessionManager.h b/proxy/http/HttpSessionManager.h
index 9d7266e191..af5ee99707 100644
--- a/proxy/http/HttpSessionManager.h
+++ b/proxy/http/HttpSessionManager.h
@@ -34,7 +34,7 @@
 
 #include "I_EventSystem.h"
 #include "PoolableSession.h"
-#include "tscore/IntrusiveHashMap.h"
+#include "swoc/IntrusiveHashMap.h"
 
 class ProxyTransaction;
 class HttpSM;
@@ -76,8 +76,8 @@ public:
   }
 
 private:
-  using IPTable   = IntrusiveHashMap;
-  using FQDNTable = IntrusiveHashMap;
+  using IPTable   = swoc::IntrusiveHashMap;
+  using FQDNTable = swoc::IntrusiveHashMap;
 
 public:
   /** Check if a session matches address and host name.



[trafficserver] branch master updated: WCCP: remove ts::Buffer (#9824)

2023-06-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new fc92d96a44 WCCP: remove ts::Buffer (#9824)
fc92d96a44 is described below

commit fc92d96a448337d81e0e24e3aa4cc6a8197a6261
Author: Alan M. Carroll 
AuthorDate: Thu Jun 15 15:35:38 2023 -0500

WCCP: remove ts::Buffer (#9824)
---
 include/wccp/Wccp.h  | 10 +++---
 src/wccp/Makefile.am |  2 +-
 src/wccp/WccpEndPoint.cc | 22 ++--
 src/wccp/WccpLocal.h | 90 ++--
 src/wccp/WccpMsg.cc  |  8 ++---
 5 files changed, 63 insertions(+), 69 deletions(-)

diff --git a/include/wccp/Wccp.h b/include/wccp/Wccp.h
index 17a7e8eeb6..ffba07bad8 100644
--- a/include/wccp/Wccp.h
+++ b/include/wccp/Wccp.h
@@ -25,18 +25,18 @@
 #include 
 #include 
 
-#include "tscore/TsBuffer.h"
-#include "tscore/Errata.h"
+// INADDR_ANY
+#include 
+
 #include "tscore/ink_defs.h"
 #include "tscore/ink_memory.h"
+#include "tscore/IntrusivePtr.h"
+#include "tscore/Errata.h"
 
 // Nasty, defining this with no prefix. The value is still available
 // in TS_VERSION_STRING.
 #undef VERSION
 
-// INADDR_ANY
-#include 
-
 /// WCCP Support.
 namespace wccp
 {
diff --git a/src/wccp/Makefile.am b/src/wccp/Makefile.am
index 704e76aa91..25151ae160 100644
--- a/src/wccp/Makefile.am
+++ b/src/wccp/Makefile.am
@@ -24,7 +24,7 @@ AM_CPPFLAGS += \
-I$(abs_top_srcdir)/lib \
-I$(abs_top_srcdir)/proxy \
$(TS_INCLUDES) \
-   @YAMLCPP_INCLUDES@
+   @SWOC_INCLUDES@ @YAMLCPP_INCLUDES@
 
 noinst_LIBRARIES = libwccp.a
 
diff --git a/src/wccp/WccpEndPoint.cc b/src/wccp/WccpEndPoint.cc
index e56bb45761..4bf3b6da85 100644
--- a/src/wccp/WccpEndPoint.cc
+++ b/src/wccp/WccpEndPoint.cc
@@ -228,10 +228,10 @@ Impl::handleMessage()
 
   // Check to see if there is a valid header.
   MsgHeaderComp header;
-  MsgBuffer msg_buffer(buffer, n);
+  MsgBuffer msg_buffer(buffer_type(buffer, n));
   if (PARSE_SUCCESS == header.parse(msg_buffer)) {
 message_type_t msg_type = header.getType();
-ts::Buffer chunk(buffer, n);
+buffer_type chunk(buffer, n);
 
 switch (msg_type) {
 case HERE_I_AM:
@@ -257,22 +257,22 @@ Impl::handleMessage()
 }
 
 ts::Errata
-Impl::handleHereIAm(IpHeader const &, ts::Buffer const &)
+Impl::handleHereIAm(IpHeader const &, buffer_type const &)
 {
   return log(LVL_INFO, "Unanticipated WCCP2_HERE_I_AM message ignored");
 }
 ts::Errata
-Impl::handleISeeYou(IpHeader const &, ts::Buffer const & /* data ATS_UNUSED */)
+Impl::handleISeeYou(IpHeader const &, buffer_type const & /* data ATS_UNUSED 
*/)
 {
   return log(LVL_INFO, "Unanticipated WCCP2_I_SEE_YOU message ignored.");
 }
 ts::Errata
-Impl::handleRedirectAssign(IpHeader const &, ts::Buffer const & /* data 
ATS_UNUSED */)
+Impl::handleRedirectAssign(IpHeader const &, buffer_type const & /* data 
ATS_UNUSED */)
 {
   return log(LVL_INFO, "Unanticipated WCCP2_REDIRECT_ASSIGN message ignored.");
 }
 ts::Errata
-Impl::handleRemovalQuery(IpHeader const &, ts::Buffer const & /* data 
ATS_UNUSED */)
+Impl::handleRemovalQuery(IpHeader const &, buffer_type const & /* data 
ATS_UNUSED */)
 {
   return log(LVL_INFO, "Unanticipated WCCP2_REMOVAL_QUERY message ignored.");
 }
@@ -604,7 +604,7 @@ CacheImpl::housekeeping()
   static size_t const BUFFER_SIZE = 4096;
   MsgBuffer msg_buffer;
   char msg_data[BUFFER_SIZE];
-  msg_buffer.set(msg_data, BUFFER_SIZE);
+  msg_buffer.assign({msg_data, BUFFER_SIZE});
 
   // Set up everything except the IP address.
   memset(_addr, 0, sizeof(dst_addr));
@@ -690,7 +690,7 @@ CacheImpl::housekeeping()
 }
 
 ts::Errata
-CacheImpl::handleISeeYou(IpHeader const & /* ip_hdr ATS_UNUSED */, ts::Buffer 
const )
+CacheImpl::handleISeeYou(IpHeader const & /* ip_hdr ATS_UNUSED */, buffer_type 
const )
 {
   ts::Errata zret;
   ISeeYouMsg msg;
@@ -849,7 +849,7 @@ CacheImpl::handleISeeYou(IpHeader const & /* ip_hdr 
ATS_UNUSED */, ts::Buffer co
 }
 
 ts::Errata
-CacheImpl::handleRemovalQuery(IpHeader const & /* ip_hdr ATS_UNUSED */, 
ts::Buffer const )
+CacheImpl::handleRemovalQuery(IpHeader const & /* ip_hdr ATS_UNUSED */, 
buffer_type const )
 {
   ts::Errata zret;
   RemovalQueryMsg msg;
@@ -937,7 +937,7 @@ RouterImpl::GroupData::resizeRouterSources()
 }
 
 ts::Errata
-RouterImpl::handleHereIAm(IpHeader const _hdr, ts::Buffer const )
+RouterImpl::handleHereIAm(IpHeader const _hdr, buffer_type const )
 {
   ts::Errata zret;
   HereIAmMsg msg;
@@ -1058,7 +1058,7 @@ RouterImpl::xmitISeeYou()
   memset(_addr, 0, sizeof(dst_addr));
   dst_addr.sin_family = AF_INET;
   dst_addr.sin_port   = htons(DEFAULT_PORT);
-  buffer.set(data, BUFFER_SIZE);
+  buffer.a

[trafficserver] branch master updated (a29574d2fd -> b6f61e7d84)

2023-06-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from a29574d2fd Set SIZEOF_VOIDP in CMake build (#9850)
 add b6f61e7d84 libswoc - update to 1.5.1 (#9858)

No new revisions were added by this update.

Summary of changes:
 lib/swoc/CMakeLists.txt  |  2 +-
 lib/swoc/Makefile.am |  2 +-
 lib/swoc/include/swoc/IPAddr.h   | 67 +++-
 lib/swoc/include/swoc/IPRange.h  |  9 +
 lib/swoc/include/swoc/swoc_version.h |  4 +--
 5 files changed, 49 insertions(+), 35 deletions(-)



[trafficserver] branch master updated: Update to libswoc 1.5.0 (#9830)

2023-06-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 61b27c3403 Update to libswoc 1.5.0 (#9830)
61b27c3403 is described below

commit 61b27c340368e51e4879f82c1b7775b5000fd79e
Author: Alan M. Carroll 
AuthorDate: Thu Jun 15 08:59:01 2023 -0500

Update to libswoc 1.5.0 (#9830)
---
 lib/swoc/CMakeLists.txt   |   2 +-
 lib/swoc/Makefile.am  |   2 +-
 lib/swoc/include/swoc/DiscreteRange.h | 234 
 lib/swoc/include/swoc/IPRange.h   | 700 ++
 lib/swoc/include/swoc/Lexicon.h   |   2 +-
 lib/swoc/include/swoc/MemSpan.h   |  23 +-
 lib/swoc/include/swoc/bwf_base.h  |  28 +-
 lib/swoc/include/swoc/swoc_version.h  |   6 +-
 lib/swoc/src/swoc_file.cc |   2 +
 lib/swoc/src/swoc_ip.cc   |  96 +++--
 proxy/ControlMatcher.cc   |   2 +-
 11 files changed, 798 insertions(+), 299 deletions(-)

diff --git a/lib/swoc/CMakeLists.txt b/lib/swoc/CMakeLists.txt
index 88a549ebe8..c49f8a67fc 100644
--- a/lib/swoc/CMakeLists.txt
+++ b/lib/swoc/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.11)
 
 project(Lib-SWOC CXX)
-set(LIBSWOC_VERSION "1.4.10")
+set(LIBSWOC_VERSION "1.5.0")
 set(CMAKE_CXX_STANDARD 17)
 cmake_policy(SET CMP0087 NEW)
 # override "lib64" to be "lib" unless the user explicitly sets it.
diff --git a/lib/swoc/Makefile.am b/lib/swoc/Makefile.am
index 98d72ca31d..d5d9b9261b 100644
--- a/lib/swoc/Makefile.am
+++ b/lib/swoc/Makefile.am
@@ -22,7 +22,7 @@ library_includedir=$(includedir)/swoc
 
 AM_CPPFLAGS += @SWOC_INCLUDES@
 
-libtsswoc_la_LDFLAGS = @AM_LDFLAGS@ -no-undefined -release 1.4.10
+libtsswoc_la_LDFLAGS = @AM_LDFLAGS@ -no-undefined -release 1.5.0
 libtsswoc_la_SOURCES = \
src/ArenaWriter.cc  src/bw_format.cc  src/bw_ip_format.cc  
src/Errata.cc  src/MemArena.cc  src/RBTree.cc  src/swoc_file.cc  src/swoc_ip.cc 
 src/TextView.cc src/string_view_util.cc
 
diff --git a/lib/swoc/include/swoc/DiscreteRange.h 
b/lib/swoc/include/swoc/DiscreteRange.h
index a04a3e7d27..ff681f2484 100644
--- a/lib/swoc/include/swoc/DiscreteRange.h
+++ b/lib/swoc/include/swoc/DiscreteRange.h
@@ -127,7 +127,7 @@ enum class DiscreteRangeEdgeRelation : uint8_t {
- have value semantics
- have minimum and maximum values either
  - members @c MIN and @c MAX that define static instances
- - support @c std::numeric_limits
+ - @c std::numeric_limits support.
 
The interval is always an inclusive (closed) contiguous interval,
defined by the minimum and maximum values contained in the interval.
@@ -147,7 +147,7 @@ public:
   using EdgeRelation = DiscreteRangeEdgeRelation; ///< Import type for 
convenience.
 
   /** Default constructor.
-  An invalid (empty) range is constructed.
+   * An invalid (empty) range is constructed.
*/
   constexpr DiscreteRange() : _min(detail::maximum()), 
_max(detail::minimum()) {}
 
@@ -174,109 +174,139 @@ public:
*/
   bool empty() const;
 
+  /** Update the range.
+   *
+   * @param min New minimum value.
+   * @param max New maximum value.
+   * @return @a this.
+   */
   self_type (metric_type const , metric_type const );
 
-  /// Set the interval to be a singleton.
-  self_type (metric_type const );
+  /** Update the range.
+   *
+   * @param value The new minimum and maximum value.
+   * @return @a this.
+   *
+   * The range will contain the single value @a value.
+   */
+  self_type (metric_type const );
 
+  /** Update the minimum value.
+   *
+   * @param min The new minimum value.
+   * @return @a this.
+   *
+   * @note No checks are done - this can result in an empty range.
+   */
   self_type _min(metric_type const );
 
+  /** Update the maximum value.
+   *
+   * @param max The new maximum value.
+   * @return @a this.
+   *
+   * @note No checks are done - this can result in an empty range.
+   */
   self_type _max(metric_type const );
 
   /** Decrement the maximum value.
*
* @return @a this.
+   *
+   * @note No checks are done, the caller must ensure it is valid to 
decremented the current maximum.
*/
-  self_type &
-  clip_max() {
---_max;
-return *this;
-  }
+  self_type & clip_max();
 
-  /** Get the minimum value in the interval.
-  @note The return value is unspecified if the interval is empty.
+  /** Minimum value.
+   * @return the minimum value in the range.
+   * @note The return value is unspecified if the interval is empty.
*/
   metric_type const () const;
 
-  /** Get the maximum value in the interval.
-  @note The return value is unspecified if the interval is empty.
+  /** Maximum value.
+   * @return The maximum value in the range.
+   * @note The return value is unspecified if the interval is empty.
*/
   met

[trafficserver] branch master updated (d6c6d628c9 -> 78a2933348)

2023-06-09 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from d6c6d628c9 Move Catch from tests/include to lib/catch2 (#9815)
 add 78a2933348 WCCP pre-fix cleanup (#9801)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt |   1 +
 include/wccp/Wccp.h|  88 +--
 .../wccp}/CMakeLists.txt   |   9 +-
 src/wccp/WccpEndPoint.cc   |  12 +-
 src/wccp/WccpLocal.h   | 652 ++---
 src/wccp/WccpMsg.cc|  36 +-
 6 files changed, 402 insertions(+), 396 deletions(-)
 copy {plugins/cache_range_requests => src/wccp}/CMakeLists.txt (84%)



[trafficserver] branch master updated (d0c2f142e -> fc76b2904)

2023-05-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from d0c2f142e Cleanup: remove ts::Buffer from URL.cc (#9663)
 add fc76b2904 Cleanup: remove ts::Buffer from LogField. (#9665)

No new revisions were added by this update.

Summary of changes:
 proxy/logging/LogField.cc | 16 +---
 proxy/logging/LogField.h  |  1 -
 2 files changed, 9 insertions(+), 8 deletions(-)



[trafficserver] branch master updated (644658e09 -> d0c2f142e)

2023-05-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 644658e09 Check the calling thread of Ethread::schedule_local (#9691)
 add d0c2f142e Cleanup: remove ts::Buffer from URL.cc (#9663)

No new revisions were added by this update.

Summary of changes:
 proxy/hdrs/URL.cc | 31 +++
 1 file changed, 15 insertions(+), 16 deletions(-)



[trafficserver] branch master updated (a4ae0d16f -> f6356f63e)

2023-05-11 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from a4ae0d16f Reload hosting.config on TASK thread (#9699)
 add f6356f63e libswoc: Update to 1.4.10 (#9700)

No new revisions were added by this update.

Summary of changes:
 iocore/eventsystem/IOBuffer.cc   |  33 +++---
 lib/swoc/CMakeLists.txt  |   2 +-
 lib/swoc/Makefile.am |   2 +-
 lib/swoc/include/swoc/BufferWriter.h |  10 +-
 lib/swoc/include/swoc/IPAddr.h   |  26 +++--
 lib/swoc/include/swoc/IPRange.h  |  72 +
 lib/swoc/include/swoc/Lexicon.h  | 192 +++
 lib/swoc/include/swoc/MemArena.h |  14 +--
 lib/swoc/include/swoc/MemSpan.h  |   6 +-
 lib/swoc/include/swoc/TextView.h |  45 ++--
 lib/swoc/include/swoc/bwf_base.h |  17 +++-
 lib/swoc/include/swoc/bwf_fwd.h  |  13 ++-
 lib/swoc/include/swoc/bwf_std.h  |  30 --
 lib/swoc/include/swoc/swoc_version.h |   4 +-
 lib/swoc/src/MemArena.cc |  10 +-
 lib/swoc/src/bw_format.cc|  33 --
 lib/swoc/src/bw_ip_format.cc |   4 +-
 lib/swoc/src/swoc_ip.cc  |   4 +-
 18 files changed, 349 insertions(+), 168 deletions(-)



[trafficserver] branch master updated (0a5df0e7b2 -> 88afa42232)

2023-05-03 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 0a5df0e7b2 Fix leak in MultiTextMod in ControlBase. (#9675)
 add 88afa42232 Cleanup: remove ts::buffer from HostDB. (#9677)

No new revisions were added by this update.

Summary of changes:
 iocore/hostdb/P_HostDBProcessor.h | 1 -
 1 file changed, 1 deletion(-)



[trafficserver] branch master updated (0a7cc0bcdd -> 0a5df0e7b2)

2023-05-02 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 0a7cc0bcdd Cleanup: remove TsBuffer.h from MIME.cc (#9661)
 add 0a5df0e7b2 Fix leak in MultiTextMod in ControlBase. (#9675)

No new revisions were added by this update.

Summary of changes:
 proxy/ControlBase.cc | 23 +--
 1 file changed, 9 insertions(+), 14 deletions(-)



[trafficserver] branch master updated (157237365c -> 0a7cc0bcdd)

2023-05-02 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 157237365c Cleanup: remove ts::Buffer from ControlBase. (#9664)
 add 0a7cc0bcdd Cleanup: remove TsBuffer.h from MIME.cc (#9661)

No new revisions were added by this update.

Summary of changes:
 proxy/hdrs/MIME.cc | 1 -
 1 file changed, 1 deletion(-)



[trafficserver] branch master updated (2df27d7cf3 -> 157237365c)

2023-05-02 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 2df27d7cf3 setup pre-commit hook at cmake generation time (#9669)
 add 157237365c Cleanup: remove ts::Buffer from ControlBase. (#9664)

No new revisions were added by this update.

Summary of changes:
 proxy/ControlBase.cc | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)



[trafficserver] branch master updated (7e699e234a -> 138b506c17)

2023-05-01 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 7e699e234a Add support for CONNECT method on HTTP/2 connection (#9616)
 add 138b506c17 OCSP: Fix unitialized variable error. (#9662)

No new revisions were added by this update.

Summary of changes:
 iocore/net/OCSPStapling.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[trafficserver] branch master updated (28e883dbec -> 1461d6dd78)

2023-04-19 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 28e883dbec Cleanup: Rename d with vol (#9619)
 add 1461d6dd78 Doc: document IP allow filter for remap. (#9626)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/files/ip_allow.yaml.en.rst |  2 ++
 doc/admin-guide/files/remap.config.en.rst  | 15 +++
 2 files changed, 17 insertions(+)



[trafficserver] branch master updated: Plugin: change system_stats to use std::chrono instead of ink_hrtime. (#9612)

2023-04-16 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new af352c551d Plugin: change system_stats to use std::chrono instead of 
ink_hrtime. (#9612)
af352c551d is described below

commit af352c551d8b1fccfdfeff56e9ed710fdf5ddd85
Author: Alan M. Carroll 
AuthorDate: Sun Apr 16 01:19:09 2023 -0500

Plugin: change system_stats to use std::chrono instead of ink_hrtime. 
(#9612)
---
 plugins/experimental/system_stats/system_stats.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/plugins/experimental/system_stats/system_stats.cc 
b/plugins/experimental/system_stats/system_stats.cc
index cc77628154..8f5ea9ff74 100644
--- a/plugins/experimental/system_stats/system_stats.cc
+++ b/plugins/experimental/system_stats/system_stats.cc
@@ -43,6 +43,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include "ink_autoconf.h"
 
@@ -51,7 +52,6 @@
 #endif
 
 #include 
-#include "tscore/ink_hrtime.h"
 
 #define PLUGIN_NAME "system_stats"
 #define DEBUG_TAG   PLUGIN_NAME
@@ -276,7 +276,9 @@ getStats(TSMutex stat_creation_mutex)
 
   sysinfo();
 
-  statSet(TIMESTAMP, ink_hrtime_to_msec(ink_get_hrtime_internal()), 
stat_creation_mutex);
+  statSet(TIMESTAMP,
+  
std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count(),
+  stat_creation_mutex);
   statSet(LOAD_AVG_ONE_MIN, info.loads[0], stat_creation_mutex);
   statSet(LOAD_AVG_FIVE_MIN, info.loads[1], stat_creation_mutex);
   statSet(LOAD_AVG_FIFTEEN_MIN, info.loads[2], stat_creation_mutex);



[trafficserver] branch master updated: Standardization: Use chrono instead of core for stats_over_http (#9614)

2023-04-16 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 4a688fe785 Standardization: Use chrono instead of core for 
stats_over_http (#9614)
4a688fe785 is described below

commit 4a688fe785eef33b7bb036cd2103e298b599c870
Author: Alan M. Carroll 
AuthorDate: Sun Apr 16 01:18:59 2023 -0500

Standardization: Use chrono instead of core for stats_over_http (#9614)
---
 plugins/stats_over_http/stats_over_http.cc | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/plugins/stats_over_http/stats_over_http.cc 
b/plugins/stats_over_http/stats_over_http.cc
index 7a86a32423..7836581c33 100644
--- a/plugins/stats_over_http/stats_over_http.cc
+++ b/plugins/stats_over_http/stats_over_http.cc
@@ -40,6 +40,8 @@
 #include 
 #include 
 #include 
+#include 
+
 #include 
 
 #include "swoc/swoc_ip.h"
@@ -51,8 +53,6 @@
 #include 
 #endif
 
-#include "tscore/ink_hrtime.h"
-
 #define PLUGIN_NAME "stats_over_http"
 #define FREE_TMOUT  30
 #define STR_BUFFER_SIZE 1024
@@ -180,6 +180,15 @@ init_br(stats_state *my_state)
 }
 #endif
 
+namespace
+{
+inline uint64_t
+ms_since_epoch()
+{
+  return 
std::chrono::duration_cast(std::chrono::system_clock::now().time_since_epoch()).count();
+}
+} // namespace
+
 encoding_format
 init_gzip(stats_state *my_state, int mode)
 {
@@ -415,7 +424,7 @@ json_out_stats(stats_state *my_state)
   APPEND("{ \"global\": {\n");
   TSRecordDump((TSRecordType)(TS_RECORDTYPE_PLUGIN | TS_RECORDTYPE_NODE | 
TS_RECORDTYPE_PROCESS), json_out_stat, my_state);
   version = TSTrafficServerVersionGet();
-  APPEND_STAT_JSON_NUMERIC("current_time_epoch_ms", "%" PRIu64, 
ink_hrtime_to_msec(ink_get_hrtime_internal()));
+  APPEND_STAT_JSON_NUMERIC("current_time_epoch_ms", "%" PRIu64, 
ms_since_epoch());
   APPEND("\"server\": \"");
   APPEND(version);
   APPEND("\"\n");
@@ -494,7 +503,7 @@ csv_out_stats(stats_state *my_state)
 {
   TSRecordDump((TSRecordType)(TS_RECORDTYPE_PLUGIN | TS_RECORDTYPE_NODE | 
TS_RECORDTYPE_PROCESS), csv_out_stat, my_state);
   const char *version = TSTrafficServerVersionGet();
-  APPEND_STAT_CSV_NUMERIC("current_time_epoch_ms", "%" PRIu64, 
ink_hrtime_to_msec(ink_get_hrtime_internal()));
+  APPEND_STAT_CSV_NUMERIC("current_time_epoch_ms", "%" PRIu64, 
ms_since_epoch());
   APPEND_STAT_CSV("version", "%s", version);
 }
 



[trafficserver] branch master updated: libswoc: Replace ts::file with swoc::file. (#9581)

2023-04-14 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 6065340f88 libswoc: Replace ts::file with swoc::file. (#9581)
6065340f88 is described below

commit 6065340f880a0b00cefdc3c221249e945aeff674
Author: Alan M. Carroll 
AuthorDate: Fri Apr 14 11:47:05 2023 -0500

libswoc: Replace ts::file with swoc::file. (#9581)
---
 include/tscore/ts_file.h   | 340 
 iocore/cache/CacheHosting.cc   |   7 +-
 iocore/cache/test/main.cc  |   7 +-
 iocore/hostdb/HostDB.cc|  20 +-
 iocore/hostdb/HostFile.cc  |   8 +-
 iocore/hostdb/HostFile.h   |   5 +-
 iocore/hostdb/Makefile.am  |   2 +-
 iocore/hostdb/P_HostDBProcessor.h  |   2 +-
 iocore/hostdb/test_HostFile.cc |  12 +-
 iocore/io_uring/unit_tests/test_diskIO.cc  |  15 +-
 iocore/net/SSLSecret.cc|   5 +-
 iocore/net/SSLUtils.cc |   4 +-
 mgmt/rpc/config/JsonRPCConfig.cc   |   5 +-
 mgmt/rpc/server/unit_tests/test_rpcserver.cc   |   7 +-
 plugins/experimental/tls_bridge/tls_bridge.cc  |  18 +-
 plugins/experimental/traffic_dump/session_data.cc  |  14 +-
 plugins/experimental/traffic_dump/session_data.h   |   7 +-
 plugins/experimental/traffic_dump/traffic_dump.cc  |   6 +-
 proxy/ControlMatcher.cc|   4 +-
 proxy/http/remap/PluginDso.cc  |  18 +-
 proxy/http/remap/PluginDso.h   |  14 +-
 proxy/http/remap/PluginFactory.cc  |   6 +-
 proxy/http/remap/RemapConfig.cc|   8 +-
 proxy/http/remap/unit-tests/test_PluginDso.cc  |  34 +-
 proxy/http/remap/unit-tests/test_PluginFactory.cc  |  14 +-
 proxy/http/remap/unit-tests/test_RemapPlugin.cc|   2 +-
 proxy/logging/RolledLogDeleter.cc  |   7 +-
 proxy/logging/unit-tests/test_RolledLogDeleter.cc  |   8 +-
 src/records/RecCore.cc |   7 +-
 src/traffic_cache_tool/CacheDefs.h |  14 +-
 src/traffic_cache_tool/CacheScan.h |   2 +-
 src/traffic_cache_tool/CacheTool.cc|  66 ++--
 src/traffic_cache_tool/Makefile.inc|   1 -
 src/traffic_server/traffic_server.cc   |   5 +-
 src/tscore/CMakeLists.txt  |   2 -
 src/tscore/Makefile.am |   2 -
 src/tscore/ts_file.cc  | 344 -
 src/tscore/unit_tests/test_ts_file.cc  | 278 -
 .../jsonrpc/plugins/jsonrpc_plugin_handler_test.cc |   9 +-
 39 files changed, 194 insertions(+), 1135 deletions(-)

diff --git a/include/tscore/ts_file.h b/include/tscore/ts_file.h
deleted file mode 100644
index 8a9eff2bef..00
--- a/include/tscore/ts_file.h
+++ /dev/null
@@ -1,340 +0,0 @@
-/** @file
-
-  Simple path and file utilities.
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-#pragma once
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include "tscore/ink_memory.h"
-#include "tscpp/util/TextView.h"
-#include "tscore/BufferWriter.h"
-
-namespace ts
-{
-namespace file
-{
-  /** Utility class for file system paths.
-   */
-  class path
-  {
-using self_type = path;
-
-  public:
-using value_type  = char;
-using string_type = std::string;
-static constexpr char preferred_separator = value_type{'/'};
-
-/// Default construct empty path.
-path() = default;
-
-/// Copy constructor - copies the path.
-path(const self_type ) = default;
-
-/// Move constructor.
-path(self_type &) = default;
-
-/// Construct from a null terminated string.
-explicit path(const char *src);
-
-/// Construct from a string view.
-path(std::s

[trafficserver] branch master updated: Always load initial SSL configuration. (#9580)

2023-04-08 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 7651796f64 Always load initial SSL configuration. (#9580)
7651796f64 is described below

commit 7651796f643ae17e70c23115d46063e145d97289
Author: Alan M. Carroll 
AuthorDate: Sat Apr 8 19:28:57 2023 -0500

Always load initial SSL configuration. (#9580)

Issue 9533 - bad certificate disables all TLS on startup.
Closes #9553
---
 include/tscpp/util/ts_errata.h|  3 +++
 iocore/net/P_SSLUtils.h   |  4 +++-
 iocore/net/SSLConfig.cc   | 26 +++---
 iocore/net/SSLUtils.cc| 22 --
 src/traffic_server/CMakeLists.txt |  3 ++-
 5 files changed, 35 insertions(+), 23 deletions(-)

diff --git a/include/tscpp/util/ts_errata.h b/include/tscpp/util/ts_errata.h
index 1f50079522..42bdf11b74 100644
--- a/include/tscpp/util/ts_errata.h
+++ b/include/tscpp/util/ts_errata.h
@@ -39,3 +39,6 @@ static constexpr swoc::Errata::Severity 
ERRATA_EMERGENCY{DL_Emergency};
 static constexpr std::array Severity_Names{
   {"Diag", "Debug", "Status", "Note", "Warn", "Error", "Fatal", "Alert", 
"Emergency"}
 };
+
+// Temporary string for formatting.
+inline thread_local std::string bw_dbg;
diff --git a/iocore/net/P_SSLUtils.h b/iocore/net/P_SSLUtils.h
index 5fc1a6f3e3..934a0c30bc 100644
--- a/iocore/net/P_SSLUtils.h
+++ b/iocore/net/P_SSLUtils.h
@@ -29,6 +29,8 @@
 #endif
 #include 
 
+#include "tscpp/util/ts_errata.h"
+
 #include "tscore/ink_config.h"
 #include "tscore/Diags.h"
 #include "records/I_RecCore.h"
@@ -77,7 +79,7 @@ public:
   SSLMultiCertConfigLoader(const SSLConfigParams *p) : _params(p) {}
   virtual ~SSLMultiCertConfigLoader(){};
 
-  bool load(SSLCertLookup *lookup);
+  swoc::Errata load(SSLCertLookup *lookup);
 
   virtual SSL_CTX *default_server_ssl_ctx();
 
diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index 8154ecd448..3de6cf6f9a 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -610,27 +610,31 @@ SSLCertificateConfig::reconfigure()
 ink_hrtime_sleep(HRTIME_SECONDS(secs));
   }
 
-  SSLMultiCertConfigLoader loader(params);
-  if (!loader.load(lookup)) {
+  auto errata = SSLMultiCertConfigLoader(params).load(lookup);
+  if (!lookup->is_valid || (errata.has_severity() && errata.severity() >= 
ERRATA_ERROR)) {
 retStatus = false;
   }
 
-  if (!lookup->is_valid) {
-retStatus = false;
-  }
-
-  // If there are errors in the certificate configs and we had wanted to exit 
on error
-  // we won't want to reset the config
-  if (retStatus) {
+  // If the load succeeded, load it. If there is no current configuration, 
load even a broken
+  // config so that a bad initial load doesn't completely disable TLS.
+  if (retStatus || configid == 0) {
 configid = configProcessor.set(configid, lookup);
   } else {
 delete lookup;
   }
 
+  if (!errata.empty()) {
+errata.assign_annotation_glue_text("\n  ");
+errata.assign_severity_glue_text(" -> \n  ");
+bwprint(bw_dbg, "\n{}", errata);
+  } else {
+bw_dbg = "";
+  }
+
   if (retStatus) {
-Note("%s finished loading", params->configFilePath);
+Note("%s finished loading%s", params->configFilePath, bw_dbg.c_str());
   } else {
-Error("%s failed to load", params->configFilePath);
+Error("%s failed to load%s", params->configFilePath, bw_dbg.c_str());
   }
 
   return retStatus;
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index aa4e561b59..c92d5d3252 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -19,6 +19,9 @@
   limitations under the License.
  */
 
+#include "swoc/Errata.h"
+#include "swoc/bwf_std.h"
+
 #include "P_SSLUtils.h"
 
 #include "tscpp/util/TextView.h"
@@ -1955,7 +1958,7 @@ ssl_extract_certificate(const matcher_line *line_info, 
SSLMultiCertConfigParams
   return true;
 }
 
-bool
+swoc::Errata
 SSLMultiCertConfigLoader::load(SSLCertLookup *lookup)
 {
   const SSLConfigParams *params = this->_params;
@@ -1975,11 +1978,10 @@ SSLMultiCertConfigLoader::load(SSLCertLookup *lookup)
 switch (ec.value()) {
 case ENOENT:
   // missing config file is an acceptable runtime state
-  Warning("Cannot open SSL certificate configuration from %s - %s", 
params->configFilePath, strerror(ec.value()));
-  return true;
+  return swoc::Errata(ERRATA_WARN, "Cannot open SSL certificate 
configuration \"{}\" - {}", params->configFilePath, ec);
 default:
-  Error("Failed to read SSL certificate c

[trafficserver] branch master updated (d03d0dcbe7 -> d41a067bac)

2023-04-08 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from d03d0dcbe7 Make Http3App class responsible for H3 transaction 
creation/deletion (#9346)
 add d41a067bac libswoc: Update to 1.4.9. (#9592)

No new revisions were added by this update.

Summary of changes:
 lib/swoc/CMakeLists.txt  |   2 +-
 lib/swoc/Makefile.am |   2 +-
 lib/swoc/include/swoc/Errata.h   |  68 +--
 lib/swoc/include/swoc/IPEndpoint.h   |  10 +-
 lib/swoc/include/swoc/IPRange.h  |  24 ++-
 lib/swoc/include/swoc/MemSpan.h  |  61 +-
 lib/swoc/include/swoc/TextView.h |   1 +
 lib/swoc/include/swoc/bwf_base.h |   3 +-
 lib/swoc/include/swoc/string_view_util.h |   1 +
 lib/swoc/include/swoc/swoc_file.h| 220 +++--
 lib/swoc/include/swoc/swoc_meta.h|  32 
 lib/swoc/include/swoc/swoc_version.h |   4 +-
 lib/swoc/src/swoc_file.cc| 315 ---
 lib/swoc/src/swoc_ip.cc  |  54 --
 14 files changed, 710 insertions(+), 87 deletions(-)



[trafficserver] branch master updated (9082b9219 -> 59f1d05a1)

2023-03-22 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 9082b9219 libswoc: Final elimination of obsolete IpMap. (#9548)
 add 59f1d05a1 libswoc: Remove ts::MemArena. (#9549)

No new revisions were added by this update.

Summary of changes:
 include/records/I_RecHttp.h|   4 +-
 include/tscore/MemArena.h  | 317 -
 src/tscore/CMakeLists.txt  |   2 -
 src/tscore/Makefile.am |   2 -
 src/tscore/MemArena.cc | 158 
 src/tscore/unit_tests/test_MemArena.cc | 255 --
 6 files changed, 2 insertions(+), 736 deletions(-)
 delete mode 100644 include/tscore/MemArena.h
 delete mode 100644 src/tscore/MemArena.cc
 delete mode 100644 src/tscore/unit_tests/test_MemArena.cc



[trafficserver] branch master updated: libswoc: Final elimination of obsolete IpMap. (#9548)

2023-03-22 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 9082b9219 libswoc: Final elimination of obsolete IpMap. (#9548)
9082b9219 is described below

commit 9082b92190ef37862b56ef8c549e1e32f104dc75
Author: Alan M. Carroll 
AuthorDate: Wed Mar 22 10:01:42 2023 -0500

libswoc: Final elimination of obsolete IpMap. (#9548)
---
 include/tscore/IpMap.h  |  504 -
 src/tscore/CMakeLists.txt   |1 -
 src/tscore/IpMap.cc | 1342 ---
 src/tscore/Makefile.am  |2 -
 src/tscore/unit_tests/test_IpMap.cc |  633 -
 5 files changed, 2482 deletions(-)

diff --git a/include/tscore/IpMap.h b/include/tscore/IpMap.h
deleted file mode 100644
index 72c54482e..0
--- a/include/tscore/IpMap.h
+++ /dev/null
@@ -1,504 +0,0 @@
-/** @file
-
-Map of IP addresses to client data.
-
-@section license License
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements.  See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership.  The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-*/
-
-#pragma once
-
-#include 
-#include 
-
-#include "tscore/ink_platform.h"
-#include "tscore/ink_defs.h"
-#include "tscore/RbTree.h"
-#include "tscore/ink_inet.h"
-#include "tscpp/util/IntrusiveDList.h"
-#include "tscore/ink_assert.h"
-#include "tscore/BufferWriterForward.h"
-
-namespace ts
-{
-namespace detail
-{
-  /** Interval class.
-  This holds an interval based on a metric @a T along with
-  client data.
-  */
-  template 
-  struct Interval {
-using Metric  = T; ///< Metric (storage) type.
-using ArgType = A; ///< Type used to pass instances of @c Metric.
-
-Interval() {} ///< Default constructor.
-/// Construct with values.
-Interval(ArgType min, ///< Minimum value in span.
- ArgType max  ///< Maximum value in span.
- )
-  : _min(min), _max(max)
-{
-}
-Metric _min; ///< Minimum value in span.
-Metric _max; ///< Maximum value in span.
-  };
-
-  class Ip4Map; // Forward declare.
-  class Ip6Map; // Forward declare.
-} // namespace detail
-} // namespace ts
-
-/** Map from IP addresses to client data.
-
-Conceptually this class maps the entire space of IP addresses to
-client data. Client data is stored as a @c (void*). Memory
-management of the data is left to the client. The interface
-supports marking ranges of addresses with a specific client
-data. Marking takes a painter's algorithm approach -- any marking
-overwrites any previous marking on an address. Details of marking
-calls are discarded and only the final results are kept. That is,
-a client cannot unmark explicitly any previous marking. Only a
-specific range of addresses can be unmarked.
-
-Both IPv4 and IPv6 are supported in the same map. Mixed ranges are
-not supported (any particular range of addresses must be a single
-protocol but ranges of both types can be in the map).
-
-Use @c mark to mark / set / add addresses to the map.
-Use @c unmark to unset addresses (setting the client data to 0 does
-@b not remove the address -- this is for the convenience of clients
-that do not need data, only membership). @c contains tests for
-membership and retrieves the client data.
-
-Ranges can be marked and unmarked arbitrarily. The internal
-representation keeps a minimal set of ranges to describe the
-current addresses. Search time is O(log n) where n is the number
-of disjoint ranges. Marking and unmarking can take O(log n) and
-may require memory allocation / deallocation although this is
-minimized.
-*/
-
-class IpMap
-{
-public:
-  using self_type = IpMap; ///< Self reference type.
-
-  class iterator; // forward declare.
-
-  static constexpr in_addr_t RAW_IP4_MIN_ADDR = 0;
-  static constexpr IpAddr IP4_MIN_ADDR{RAW_IP4_MIN_ADDR};
-  static constexpr in_addr_t RAW_IP4_MAX_ADDR = ~0;
-  static constexpr IpAddr IP4_MAX_ADDR{RAW_IP4_MAX_ADDR};
-
-  stati

[trafficserver] branch master updated: Remove IpMap dependency from NetVConnection infrastructure. (#9541)

2023-03-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 96066eec2 Remove IpMap dependency from NetVConnection infrastructure. 
(#9541)
96066eec2 is described below

commit 96066eec2d4e4cc29c1665d8a9e484160932c0f3
Author: Alan M. Carroll 
AuthorDate: Tue Mar 21 13:22:30 2023 -0500

Remove IpMap dependency from NetVConnection infrastructure. (#9541)

* Remove IpMap from NetVConnection infrastructure.
---
 include/records/I_RecHttp.h | 13 +
 iocore/net/I_NetProcessor.h |  1 -
 iocore/net/P_SNIActionPerformer.h   |  7 ---
 iocore/net/P_SSLConfig.h|  7 ---
 iocore/net/SNIActionPerformer.cc| 33 -
 iocore/net/SSLConfig.cc |  6 +++---
 iocore/net/SSLNetVConnection.cc |  7 +++
 proxy/ProtocolProbeSessionAccept.cc |  6 +++---
 proxy/ProtocolProbeSessionAccept.h  |  4 +++-
 proxy/http/HttpConfig.cc|  6 +++---
 proxy/http/HttpConfig.h |  3 +--
 proxy/http/HttpProxyServerMain.cc   |  2 +-
 src/records/RecHttp.cc  | 25 +++--
 13 files changed, 61 insertions(+), 59 deletions(-)

diff --git a/include/records/I_RecHttp.h b/include/records/I_RecHttp.h
index c87be14c5..cd720378e 100644
--- a/include/records/I_RecHttp.h
+++ b/include/records/I_RecHttp.h
@@ -23,13 +23,14 @@
 
 #pragma once
 
+#include "swoc/swoc_ip.h"
+
 #include "tscore/ink_inet.h"
 #include "tscpp/util/ts_ip.h"
 #include "tscore/ink_resolver.h"
 #include "ts/apidefs.h"
 #include "ts/apidefs.h"
 #include "tscore/ink_assert.h"
-#include "tscore/IpMap.h"
 #include "tscore/MemArena.h"
 #include 
 #include 
@@ -42,9 +43,13 @@
 ts::IPAddrPair RecHttpLoadIp(char const *name);
 
 /// Load up an IpMap with IP addresses from the configuration file.
-void RecHttpLoadIpMap(const char *name, ///< Name of value in configuration 
file.
-  IpMap   ///< [out] IpMap.
-);
+
+/** Load a set of IP address from a configuration variable.
+ *
+ * @param name Variable name
+ * @param addrs Destination address set.
+ */
+void RecHttpLoadIpAddrsFromConfVar(const char *name, swoc::IPRangeSet );
 
 /** A set of session protocols.
 This depends on using @c SessionProtocolNameRegistry to get the indices.
diff --git a/iocore/net/I_NetProcessor.h b/iocore/net/I_NetProcessor.h
index d4f5d29fd..9cffa72e1 100644
--- a/iocore/net/I_NetProcessor.h
+++ b/iocore/net/I_NetProcessor.h
@@ -24,7 +24,6 @@
 
 #pragma once
 
-#include "tscore/IpMap.h"
 #include "I_EventSystem.h"
 #include "I_Socks.h"
 #include "I_NetVConnection.h"
diff --git a/iocore/net/P_SNIActionPerformer.h 
b/iocore/net/P_SNIActionPerformer.h
index d35fd9994..3ef1cd3f1 100644
--- a/iocore/net/P_SNIActionPerformer.h
+++ b/iocore/net/P_SNIActionPerformer.h
@@ -30,15 +30,16 @@
  /
 #pragma once
 
+#include "swoc/TextView.h"
+#include "swoc/swoc_ip.h"
+
 #include "I_EventSystem.h"
 #include "P_SSLNextProtocolAccept.h"
 #include "P_SSLNetVConnection.h"
 #include "SNIActionPerformer.h"
 #include "SSLTypes.h"
-#include "swoc/TextView.h"
 
 #include "tscore/ink_inet.h"
-#include "swoc/TextView.h"
 
 #include 
 
@@ -337,7 +338,7 @@ public:
 
 class SNI_IpAllow : public ActionItem
 {
-  IpMap ip_map;
+  swoc::IPRangeSet ip_addrs;
 
 public:
   SNI_IpAllow(std::string _allow_list, const std::string );
diff --git a/iocore/net/P_SSLConfig.h b/iocore/net/P_SSLConfig.h
index acabd4582..6a25f7ce8 100644
--- a/iocore/net/P_SSLConfig.h
+++ b/iocore/net/P_SSLConfig.h
@@ -34,8 +34,9 @@
 
 #include 
 
+#include "swoc/swoc_ip.h"
+
 #include "tscore/ink_inet.h"
-#include "tscore/IpMap.h"
 
 #include "ConfigProcessor.h"
 
@@ -137,7 +138,7 @@ struct SSLConfigParams : public ConfigInfo {
   static size_t session_cache_max_bucket_size;
   static bool session_cache_skip_on_lock_contention;
 
-  static IpMap *proxy_protocol_ipmap;
+  static swoc::IPRangeSet *proxy_protocol_ip_addrs;
 
   static init_ssl_ctx_func init_ssl_ctx_cb;
   static load_ssl_file_func load_ssl_file_cb;
@@ -171,7 +172,7 @@ struct SSLConfigParams : public ConfigInfo {
   void initialize();
   void cleanup();
   void reset();
-  void SSLConfigInit(IpMap *global);
+  void SSLConfigInit(swoc::IPRangeSet *global);
 
 private:
   // c_str() of string passed to in-progess call to updateCTX().
diff --git a/iocore/net/SNIActionPerformer.cc b/iocore/net/SNIActionPerformer.cc
index 3d9fec028..9856511ba 100644
--- a/iocore/net/SNIActionPerformer.cc
+++ b/io

[trafficserver] branch master updated (e3c5a9410 -> b1de61053)

2023-03-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from e3c5a9410 Docs: format typos in header_rewrite doc (#9544)
 add b1de61053 swoc: Remove IpMap from logfilter. (#9531)

No new revisions were added by this update.

Summary of changes:
 include/tscore/ink_inet.h  |  13 
 proxy/logging/LogFilter.cc | 123 -
 proxy/logging/LogFilter.h  |  10 ++-
 src/tscore/unit_tests/test_ink_inet.cc |   2 +
 4 files changed, 63 insertions(+), 85 deletions(-)



[trafficserver] branch master updated (fc8a42da7 -> d6c55bdf8)

2023-03-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from fc8a42da7 Change RecHttpLoadIp to use ts::AddrPair (#9514)
 add d6c55bdf8 swoc: Change IpMap to IPSpace for IP address based redirect 
actions. (#9539)

No new revisions were added by this update.

Summary of changes:
 proxy/http/HttpConfig.cc   | 72 +++---
 proxy/http/HttpConfig.h|  9 --
 proxy/http/HttpTransact.cc |  8 +++---
 3 files changed, 27 insertions(+), 62 deletions(-)



[trafficserver] branch master updated: Change RecHttpLoadIp to use ts::AddrPair (#9514)

2023-03-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new fc8a42da7 Change RecHttpLoadIp to use ts::AddrPair (#9514)
fc8a42da7 is described below

commit fc8a42da7e68f9ad3433418bbb0543cf74a3167e
Author: Alan M. Carroll 
AuthorDate: Tue Mar 21 10:26:57 2023 -0500

Change RecHttpLoadIp to use ts::AddrPair (#9514)

* Change RecHttpLoadIp to use ts::AddrPair
---
 include/records/I_RecHttp.h| 35 ++--
 include/tscpp/util/ts_ip.h | 25 ++---
 proxy/ProxyTransaction.cc  | 24 -
 proxy/ProxyTransaction.h   |  2 +-
 proxy/http/HttpConfig.cc   | 10 +++
 proxy/http/HttpConfig.h|  6 +++--
 proxy/http/HttpProxyServerMain.cc  | 21 +--
 proxy/http/HttpSessionAccept.h | 14 +++---
 proxy/http/Makefile.am |  4 +--
 src/records/RecHttp.cc | 49 +++---
 src/records/unit_tests/test_RecHttp.cc |  4 +--
 src/traffic_server/InkAPI.cc   |  2 +-
 src/traffic_server/traffic_server.cc   | 18 ++---
 src/tscpp/util/ts_ip.cc| 12 +
 14 files changed, 113 insertions(+), 113 deletions(-)

diff --git a/include/records/I_RecHttp.h b/include/records/I_RecHttp.h
index bafa0fd4f..c87be14c5 100644
--- a/include/records/I_RecHttp.h
+++ b/include/records/I_RecHttp.h
@@ -24,6 +24,7 @@
 #pragma once
 
 #include "tscore/ink_inet.h"
+#include "tscpp/util/ts_ip.h"
 #include "tscore/ink_resolver.h"
 #include "ts/apidefs.h"
 #include "ts/apidefs.h"
@@ -33,11 +34,12 @@
 #include 
 #include 
 
-/// Load default inbound IP addresses from the configuration file.
-void RecHttpLoadIp(const char *name, ///< Name of value in configuration file.
-   IpAddr ,  ///< [out] IPv4 address.
-   IpAddr///< [out] Ipv6 address.
-);
+/** Load IP addresses from a configuration value.
+ *
+ * @param name Configuration variable name.
+ * @return The results of parsing the value.
+ */
+ts::IPAddrPair RecHttpLoadIp(char const *name);
 
 /// Load up an IpMap with IP addresses from the configuration file.
 void RecHttpLoadIpMap(const char *name, ///< Name of value in configuration 
file.
@@ -269,9 +271,7 @@ public:
   /// Local address for inbound connections (listen address).
   IpAddr m_inbound_ip;
   /// Local address for outbound connections (to origin server).
-  IpAddr m_outbound_ip4;
-  /// Local address for outbound connections (to origin server).
-  IpAddr m_outbound_ip6;
+  ts::IPAddrPair m_outbound;
   /// Ordered preference for DNS resolution family ( @c FamilyPrefence )
   /// A value of @c PREFER_NONE indicates that entry and subsequent ones
   /// are invalid.
@@ -284,13 +284,6 @@ public:
   /// Default constructor.
   HttpProxyPort();
 
-  /** Select the local outbound address object.
-
-  @return The IP address for @a family
-  */
-  IpAddr (uint16_t family ///< IP address family.
-  );
-
   /// Check for SSL port.
   bool isSSL() const;
 
@@ -468,18 +461,6 @@ HttpProxyPort::isPlugin() const
   return TRANSPORT_PLUGIN == m_type;
 }
 
-inline IpAddr &
-HttpProxyPort::outboundIp(uint16_t family)
-{
-  static IpAddr invalid; // dummy to make compiler happy about return.
-  if (AF_INET == family)
-return m_outbound_ip4;
-  else if (AF_INET6 == family)
-return m_outbound_ip6;
-  ink_release_assert(!"Invalid family for outbound address on proxy port.");
-  return invalid; // never happens but compiler insists.
-}
-
 inline bool
 HttpProxyPort::loadValue(const char *value)
 {
diff --git a/include/tscpp/util/ts_ip.h b/include/tscpp/util/ts_ip.h
index 58a34ad11..9d2c276f0 100644
--- a/include/tscpp/util/ts_ip.h
+++ b/include/tscpp/util/ts_ip.h
@@ -41,13 +41,20 @@ public:
*
* @param a4 Address.
*/
-  IPAddrPair(swoc::IP4Addr a4);
+  IPAddrPair(swoc::IP4Addr const );
 
   /** Construct with IPv6 address.
*
* @param a6 Address.
*/
-  IPAddrPair(swoc::IP6Addr a6);
+  IPAddrPair(swoc::IP6Addr const );
+
+  /** Construct from two addresses.
+   *
+   * @param addr4 IPv4 address.
+   * @param addr6 IPv6 address.
+   */
+  IPAddrPair(swoc::IP4Addr const , swoc::IP6Addr const );
 
   /// @return @c true if either address is present.
   bool has_value() const;
@@ -89,13 +96,23 @@ public:
*/
   self_type =(swoc::IPAddr const );
 
+  /** Additive / union.
+   *
+   * @param that Source value.
+   * @return @a this
+   *
+   * Missing values in @a that are not copied, the original value remains.
+   */
+  self_type +=(self_type const );
+
 protected:
   std::optional _ip4;
   std::optional _ip6;
 };
 
-inline IPAddrPair::IPAddrPair(swoc::IP4Addr a4) : _ip4(a4) {}
-i

[trafficserver] branch master updated (3bf5bbd54 -> 9462f6307)

2023-03-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 3bf5bbd54 Improve comment on Au test extension function 
MakeATSProcess(). (#9535)
 add 9462f6307 Doc: fix typo in SNI YAML. (#9542)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/files/sni.yaml.en.rst | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)



[trafficserver] branch master updated: Add files generated by "make check" to ignore list. (#9540)

2023-03-20 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 8676ef8e5 Add files generated by "make check" to ignore list. (#9540)
8676ef8e5 is described below

commit 8676ef8e5935b4264321571a06e42c038e5f7d22
Author: Alan M. Carroll 
AuthorDate: Mon Mar 20 09:29:40 2023 -0500

Add files generated by "make check" to ignore list. (#9540)
---
 .gitignore | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/.gitignore b/.gitignore
index f676c43dc..30a42adcc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -112,7 +112,10 @@ iocore/aio/test_AIO
 iocore/eventsystem/test_IOBuffer
 iocore/eventsystem/test_EventSystem
 iocore/eventsystem/test_MIOBufferWriter
+iocore/eventsystem/benchmark_ProxyAllocator
+
 iocore/hostdb/test_RefCountCache
+iocore/hostdb/test_HostFile
 
 proxy/hdrs/test_mime
 proxy/hdrs/test_Huffmancode
@@ -146,6 +149,8 @@ plugins/experimental/slice/test_*
 plugins/experimental/sslheaders/test_sslheaders
 plugins/s3_auth/test_s3auth
 plugins/experimental/traffic_dump/test_*
+plugins/authproxy/authproxy_test
+plugins/prefetch/test_*
 
 plugins/esi/docnode_test
 plugins/esi/gzip_test
@@ -157,6 +162,8 @@ plugins/esi/vars_test
 plugins/experimental/uri_signing/test_uri_signing
 
 mgmt/rpc/overridable_txn_vars.cc
+mgmt/rpc/test_jsonrpc
+mgmt/rpc/test_jsonrpcserver
 mgmt/api/traffic_api_cli_remote
 mgmt/tools/traffic_mcast_snoop
 mgmt/tools/traffic_net_config



[trafficserver] branch master updated: CMake: clean up dead references to IpMapConf (#9538)

2023-03-20 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new a8c5898c3 CMake: clean up dead references to IpMapConf (#9538)
a8c5898c3 is described below

commit a8c5898c3d4df4665f8b4d11200c3cec1451169f
Author: Alan M. Carroll 
AuthorDate: Mon Mar 20 09:29:09 2023 -0500

CMake: clean up dead references to IpMapConf (#9538)
---
 src/tscore/CMakeLists.txt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index 8ab2f393f..ff7acdfbe 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -30,6 +30,7 @@ add_custom_command(
 add_custom_target(ParseRules ALL DEPENDS ParseRulesCType 
ParseRulesCTypeToUpper ParseRulesCTypeToLower)
 
 add_library(tscore SHARED
+AcidPtr.cc
 AcidPtr.cc
 Arena.cc
 ArgParser.cc
@@ -49,8 +50,6 @@ add_library(tscore SHARED
 HashSip.cc
 HostLookup.cc
 InkErrno.cc
-IpMap.cc
-IpMapConf.cc
 JeMiAllocator.cc
 Layout.cc
 LogMessage.cc



[trafficserver] branch master updated: Remove unused IpMap include. (#9532)

2023-03-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 5e482e70d Remove unused IpMap include. (#9532)
5e482e70d is described below

commit 5e482e70dc2159e562b75b5f882b6de50e0b77c7
Author: Alan M. Carroll 
AuthorDate: Sat Mar 18 09:28:26 2023 -0500

Remove unused IpMap include. (#9532)
---
 iocore/net/I_NetVConnection.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/iocore/net/I_NetVConnection.h b/iocore/net/I_NetVConnection.h
index 9eafde48c..6935099ed 100644
--- a/iocore/net/I_NetVConnection.h
+++ b/iocore/net/I_NetVConnection.h
@@ -39,7 +39,6 @@
 #include "ts/apidefs.h"
 #include "YamlSNIConfig.h"
 #include "tscpp/util/TextView.h"
-#include "tscore/IpMap.h"
 
 #define CONNECT_SUCCESS 1
 #define CONNECT_FAILURE 0



[trafficserver] branch master updated: libswoc: Update to 1.4.6 (#9530)

2023-03-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 7433988c8 libswoc: Update to 1.4.6 (#9530)
7433988c8 is described below

commit 7433988c86a100093535bb913fb223cb689c9d72
Author: Alan M. Carroll 
AuthorDate: Sat Mar 18 09:23:31 2023 -0500

libswoc: Update to 1.4.6 (#9530)
---
 lib/swoc/CMakeLists.txt   |   2 +-
 lib/swoc/Makefile.am  |   2 +-
 lib/swoc/include/swoc/DiscreteRange.h |   9 ++
 lib/swoc/include/swoc/Errata.h| 128 ++--
 lib/swoc/include/swoc/IPAddr.h|   2 +
 lib/swoc/include/swoc/IPRange.h   | 273 +++---
 lib/swoc/include/swoc/swoc_version.h  |   4 +-
 lib/swoc/src/Errata.cc|  32 +++-
 lib/swoc/src/bw_format.cc |  12 +-
 lib/swoc/src/swoc_ip.cc   |   6 +-
 10 files changed, 414 insertions(+), 56 deletions(-)

diff --git a/lib/swoc/CMakeLists.txt b/lib/swoc/CMakeLists.txt
index 420da122e..f0a7755f5 100644
--- a/lib/swoc/CMakeLists.txt
+++ b/lib/swoc/CMakeLists.txt
@@ -1,7 +1,7 @@
 cmake_minimum_required(VERSION 3.11)
 
 project(Lib-SWOC CXX)
-set(LIBSWOC_VERSION "1.4.5")
+set(LIBSWOC_VERSION "1.4.6")
 set(CMAKE_CXX_STANDARD 17)
 cmake_policy(SET CMP0087 NEW)
 # override "lib64" to be "lib" unless the user explicitly sets it.
diff --git a/lib/swoc/Makefile.am b/lib/swoc/Makefile.am
index bd1c51dea..210d7c6b4 100644
--- a/lib/swoc/Makefile.am
+++ b/lib/swoc/Makefile.am
@@ -22,7 +22,7 @@ library_includedir=$(includedir)/swoc
 
 AM_CPPFLAGS += @SWOC_INCLUDES@
 
-libtsswoc_la_LDFLAGS = @AM_LDFLAGS@ -no-undefined -release 1.4.5
+libtsswoc_la_LDFLAGS = @AM_LDFLAGS@ -no-undefined -release 1.4.6
 libtsswoc_la_SOURCES = \
src/ArenaWriter.cc  src/bw_format.cc  src/bw_ip_format.cc  
src/Errata.cc  src/MemArena.cc  src/RBTree.cc  src/swoc_file.cc  src/swoc_ip.cc 
 src/TextView.cc src/string_view_util.cc
 
diff --git a/lib/swoc/include/swoc/DiscreteRange.h 
b/lib/swoc/include/swoc/DiscreteRange.h
index cfefbf510..a04a3e7d2 100644
--- a/lib/swoc/include/swoc/DiscreteRange.h
+++ b/lib/swoc/include/swoc/DiscreteRange.h
@@ -850,6 +850,9 @@ public:
   /// @return The number of distinct ranges.
   size_t count() const;
 
+  /// @return @c true if there are no ranges in the container, @c false 
otherwise.
+  bool empty() const;
+
   /// @return Iterator for the first range.
   iterator begin() { return _list.begin(); }
   /// @return Iterator past the last node.
@@ -977,6 +980,12 @@ DiscreteSpace::count() const {
   return _list.count();
 }
 
+template 
+bool
+DiscreteSpace::empty() const {
+  return _list.empty();
+}
+
 template 
 auto
 DiscreteSpace::head() -> Node * {
diff --git a/lib/swoc/include/swoc/Errata.h b/lib/swoc/include/swoc/Errata.h
index 94c9b9a2c..3995e279c 100644
--- a/lib/swoc/include/swoc/Errata.h
+++ b/lib/swoc/include/swoc/Errata.h
@@ -76,7 +76,7 @@ public:
 
   /// Code used if not specified.
   static inline const code_type DEFAULT_CODE;
-  /// Severity used if not specified.
+  /// Severity reported if severity not set.
   static Severity DEFAULT_SEVERITY;
   /// Severity level at which the instance is a failure of some sort.
   static Severity FAILURE_SEVERITY;
@@ -189,7 +189,13 @@ protected:
 /// Allocate from the arena.
 swoc::MemSpan alloc(size_t n);
 
-Severity _severity{Errata::DEFAULT_SEVERITY}; ///< Severity.
+TextView _annotation_glue_text = DEFAULT_ANNOTATION_GLUE_TEXT;
+TextView _annotation_severity_glue_text = DEFAULT_SEVERITY_GLUE_TEXT;
+TextView _severity_glue_text = DEFAULT_SEVERITY_GLUE_TEXT;
+TextView _indent_text = DEFAULT_INDENT_TEXT;
+bool _glue_final_p = true; ///< Add glue after the last annotation?
+
+std::optional _severity; ///< Severity.
 code_type _code{Errata::DEFAULT_CODE};///< Message code / ID
 Container _notes; ///< The message stack.
 swoc::MemArena _arena;///< Annotation text storage.
@@ -360,7 +366,11 @@ public:
   friend std::ostream <<(std::ostream &, self_type const &);
 
   /// Default glue value (a newline) for text rendering.
-  static std::string_view DEFAULT_GLUE;
+  static inline TextView DEFAULT_ANNOTATION_GLUE_TEXT = "\n";
+  /// Default glue text for use after the severity name.
+  static inline TextView DEFAULT_SEVERITY_GLUE_TEXT = ": ";
+  // Text used for each level of indent.
+  static inline TextView DEFAULT_INDENT_TEXT = "  ";
 
   /** Test status.
 
@@ -391,6 +401,8 @@ public:
*/
   bool is_ok() const;
 
+  bool has_severity() const { return _data && _data->_severity.has_value(); }
+
   /** Get the maximum severity of the messages in the erratum.
*
* @re

[trafficserver] branch master updated: Refresh SOCKs logic, remove IpMapConf (#9523)

2023-03-16 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 61c56b19c Refresh SOCKs logic, remove IpMapConf (#9523)
61c56b19c is described below

commit 61c56b19c3bbfeb0e67de0fc64e172636de9c5d3
Author: Alan M. Carroll 
AuthorDate: Thu Mar 16 23:31:57 2023 -0500

Refresh SOCKs logic, remove IpMapConf (#9523)

* SOCKS: Update for libswoc, remove IpMap dependency.

* swoc: Remove IpMapConf
---
 include/tscore/IpMapConf.h |  35 
 iocore/net/P_Socks.h   |  15 ++--
 iocore/net/Socks.cc| 115 +
 iocore/net/UnixNetProcessor.cc |   2 +-
 src/tscore/IpMapConf.cc| 187 -
 src/tscore/Makefile.am |   1 -
 6 files changed, 71 insertions(+), 284 deletions(-)

diff --git a/include/tscore/IpMapConf.h b/include/tscore/IpMapConf.h
deleted file mode 100644
index 7d229adf1..0
--- a/include/tscore/IpMapConf.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
-
-  Loading @c IpMap from a configuration file.
-
-  @section license License
-
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
- */
-
-// Copied from IPRange.cc for backwards compatibility.
-
-#pragma once
-
-class IpMap; // declare in name only.
-
-// Returns 0 if successful, error string otherwise
-int read_addr(char *line, int n, int *i, sockaddr *addr, char *err);
-// Returns 0 if successful, error string otherwise
-char *Load_IpMap_From_File(IpMap *map, int fd, char const *key_str);
-// Returns 0 if successful, error string otherwise
-char *Load_IpMap_From_File(IpMap *map, FILE *f, char const *key_str);
diff --git a/iocore/net/P_Socks.h b/iocore/net/P_Socks.h
index 2f875c1e4..d924796af 100644
--- a/iocore/net/P_Socks.h
+++ b/iocore/net/P_Socks.h
@@ -22,12 +22,16 @@
  */
 
 #pragma once
+
+#include "swoc/TextView.h"
+#include "swoc/swoc_ip.h"
+
 #include "P_EventSystem.h"
 #include "I_Socks.h"
+#include "tscpp/util/ts_errata.h"
 
 #ifdef SOCKS_WITH_TS
 #include "ParentSelection.h"
-#include "tscore/IpMap.h"
 #endif
 
 enum {
@@ -43,8 +47,7 @@ struct socks_conf_struct {
   int server_connect_timeout= 0;
   int socks_timeout = 100;
   unsigned char default_version = 5;
-  char *user_name_n_passwd  = nullptr;
-  int user_name_n_passwd_len= 0;
+  std::string user_name_n_passwd;
 
   int per_server_connection_attempts = 1;
   int connection_attempts= 0;
@@ -55,7 +58,7 @@ struct socks_conf_struct {
   unsigned short http_port = 1080;
 
 #ifdef SOCKS_WITH_TS
-  IpMap ip_map;
+  swoc::IPRangeSet ip_addrs;
 #endif
 
 #ifndef SOCKS_WITH_TS
@@ -75,7 +78,9 @@ extern struct socks_conf_struct *g_socks_conf_stuff;
 
 void start_SocksProxy(int port);
 
-int loadSocksAuthInfo(int fd, socks_conf_struct *socks_stuff);
+int loadSocksAuthInfo(swoc::TextView content, socks_conf_struct *socks_stuff);
+
+swoc::Errata loadSocksIPAddrs(swoc::TextView content, socks_conf_struct 
*socks_stuff);
 
 // umm.. the following typedef should take _its own_ type as one of the args
 // not possible with C
diff --git a/iocore/net/Socks.cc b/iocore/net/Socks.cc
index aceddf700..ecb282d57 100644
--- a/iocore/net/Socks.cc
+++ b/iocore/net/Socks.cc
@@ -30,11 +30,16 @@
   duplicated in UnixNet.cc and NTNetProcessor.cc
 */
 
+#include "swoc/swoc_file.h"
+#include "swoc/bwf_std.h"
+#include "swoc/bwf_ex.h"
+
 #include "P_Net.h"
 #include "tscore/I_Layout.h"
 #include "tscore/ink_sock.h"
 #include "tscore/InkErrno.h"
-#include "tscore/IpMapConf.h"
+
+using namespace swoc::literals;
 
 socks_conf_struct *g_socks_conf_stuff = nullptr;
 
@@ -460,8 +465,10 @@ loadSocksConfiguration(socks_conf_struct *socks_conf_stuff)
   int socks_config_fd = -1;
   ats_scoped_str config_pathname;
 #ifdef SOCKS_WITH_TS
-  char *tmp;
+  swoc::Errata errata;
 #endif
+  std::error_code ec;
+  std::string config_text;
 
   socks_conf_stuff->accept_enabled = 0; // initialize 

[trafficserver] branch master updated (dac7b2551 -> 9b3e3c2b0)

2023-03-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from dac7b2551 CryptoContext: Clean up to avoid compiler problem. (#9521)
 add 9b3e3c2b0 libswoc: Update to 1.4.5 (#9522)

No new revisions were added by this update.

Summary of changes:
 lib/swoc/include/swoc/IPAddr.h | 113 +++--
 lib/swoc/include/swoc/IPEndpoint.h | 102 ++---
 lib/swoc/include/swoc/IPRange.h|   3 +
 lib/swoc/include/swoc/bwf_base.h   |  42 --
 lib/swoc/src/swoc_ip.cc| 100 ++--
 5 files changed, 298 insertions(+), 62 deletions(-)



[trafficserver] branch master updated: CryptoContext: Clean up to avoid compiler problem. (#9521)

2023-03-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new dac7b2551 CryptoContext: Clean up to avoid compiler problem. (#9521)
dac7b2551 is described below

commit dac7b2551c7c4d406059963dc5521663367456bf
Author: Alan M. Carroll 
AuthorDate: Wed Mar 15 11:09:07 2023 -0500

CryptoContext: Clean up to avoid compiler problem. (#9521)
---
 include/tscore/CryptoHash.h | 86 -
 include/tscore/MD5.h|  4 +--
 include/tscore/MMH.h|  2 +-
 include/tscore/SHA256.h |  2 +-
 4 files changed, 50 insertions(+), 44 deletions(-)

diff --git a/include/tscore/CryptoHash.h b/include/tscore/CryptoHash.h
index 02c1f9d71..c486bacc4 100644
--- a/include/tscore/CryptoHash.h
+++ b/include/tscore/CryptoHash.h
@@ -111,53 +111,42 @@ union CryptoHash {
 
 extern CryptoHash const CRYPTO_HASH_ZERO;
 
-/** Protocol class for a crypto hash context.
-
-A hash of this type is used for strong hashing, such as for URLs.
-*/
-class CryptoContextBase
+class CryptoContext
 {
-  typedef CryptoContextBase self; ///< Self reference type.
 public:
-  /// Destructor (force virtual)
-  virtual ~CryptoContextBase() {}
-  /// Update the hash with @a data of @a length bytes.
-  virtual bool update(void const *data, int length) = 0;
-  /// Finalize and extract the @a hash.
-  virtual bool finalize(CryptoHash ) = 0;
+  /** Protocol class for a crypto hash context.
 
-  /// Convenience overload.
-  bool finalize(CryptoHash *hash);
+ A hash of this type is used for strong hashing, such as for URLs.
+   */
+  class Hasher
+  {
+using self_type = Hasher; ///< Self reference type.
+  public:
+/// Destructor (force virtual)
+virtual ~Hasher() {}
+/// Update the hash with @a data of @a length bytes.
+virtual bool update(void const *data, int length) = 0;
+/// Finalize and extract the @a hash.
+virtual bool finalize(CryptoHash ) = 0;
+
+/// Convenience overload.
+bool finalize(CryptoHash *hash);
+
+  protected:
+EVP_MD_CTX *_ctx = nullptr;
+  };
+
+  CryptoContext();
+  /// Update the hash with @a data of @a length bytes.
+  bool update(void const *data, int length);
 
   /// Convenience - compute final @a hash for @a data.
   /// @note This is just as fast as the previous style, as a new context must 
be initialized
   /// every time this is done.
   bool hash_immediate(CryptoHash , void const *data, int length);
 
-protected:
-  EVP_MD_CTX *_ctx = nullptr;
-};
-
-inline bool
-CryptoContextBase::hash_immediate(CryptoHash , void const *data, int 
length)
-{
-  return this->update(data, length) && this->finalize(hash);
-}
-
-inline bool
-CryptoContextBase::finalize(CryptoHash *hash)
-{
-  return this->finalize(*hash);
-}
-
-class CryptoContext : public CryptoContextBase
-{
-public:
-  CryptoContext();
-  /// Update the hash with @a data of @a length bytes.
-  bool update(void const *data, int length) override;
   /// Finalize and extract the @a hash.
-  bool finalize(CryptoHash ) override;
+  bool finalize(CryptoHash );
 
   enum HashType {
 UNSPECIFIED,
@@ -168,23 +157,40 @@ public:
   }; ///< What type of hash we really are.
   static HashType Setting;
 
-  ~CryptoContext() { reinterpret_cast(_base)->~CryptoContextBase(); }
+  ~CryptoContext();
 
 private:
   static size_t constexpr OBJ_SIZE = 256;
   char _base[OBJ_SIZE];
 };
 
+inline bool
+CryptoContext::Hasher::finalize(CryptoHash *hash)
+{
+  return this->finalize(*hash);
+}
+
 inline bool
 CryptoContext::update(void const *data, int length)
 {
-  return reinterpret_cast(_base)->update(data, length);
+  return reinterpret_cast(_base)->update(data, length);
 }
 
 inline bool
 CryptoContext::finalize(CryptoHash )
 {
-  return reinterpret_cast(_base)->finalize(hash);
+  return reinterpret_cast(_base)->finalize(hash);
+}
+
+inline bool
+CryptoContext::hash_immediate(CryptoHash , void const *data, int length)
+{
+  return this->update(data, length) && this->finalize(hash);
+}
+
+inline CryptoContext::~CryptoContext()
+{
+  std::destroy_at(reinterpret_cast(_base));
 }
 
 ts::BufferWriter (ts::BufferWriter , ts::BWFSpec const , 
ats::CryptoHash const );
diff --git a/include/tscore/MD5.h b/include/tscore/MD5.h
index b26a2e1ca..67171f7dd 100644
--- a/include/tscore/MD5.h
+++ b/include/tscore/MD5.h
@@ -31,7 +31,7 @@
 #include 
 #endif
 
-class MD5Context : public ats::CryptoContextBase
+class MD5Context : public ats::CryptoContext::Hasher
 {
 public:
   MD5Context()
@@ -90,4 +90,4 @@ private:
 #endif
 };
 
-typedef CryptoHash INK_MD5;
+using INK_MD5 = CryptoHash;
diff --git a/include/tscore/MMH.h b/include/tscore/MMH.h
index 15d74b642..efa52094b 100644
--- a/include/tscore/MMH.h
+++ b/include/tscore/MMH.h
@@ -50,7 +50,7 @@ int ink_code_MMH(unsign

[trafficserver] branch master updated (269082da1 -> d0a756940)

2023-03-13 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 269082da1 autest - Minor fix on the verifier_client test ext to allow 
setting only the http3 ports. (#9517)
 add d0a756940 UnitParser: add unit parser support. (#9485)

No new revisions were added by this update.

Summary of changes:
 include/tscpp/util/Makefile.am |   2 +
 .../tscpp/util/ts_time_parser.h|  41 
 include/tscpp/util/ts_unit_parser.h| 103 +
 src/tscpp/util/CMakeLists.txt  |   3 +-
 src/tscpp/util/Makefile.am |   6 +-
 src/tscpp/util/ts_unit_parser.cc   |  91 ++
 .../{test_Strerror.cc => test_time_parser.cc}  |  24 +++--
 7 files changed, 242 insertions(+), 28 deletions(-)
 copy src/records/unit_tests/test_Diags.h => 
include/tscpp/util/ts_time_parser.h (60%)
 create mode 100644 include/tscpp/util/ts_unit_parser.h
 create mode 100644 src/tscpp/util/ts_unit_parser.cc
 copy src/tscpp/util/unit_tests/{test_Strerror.cc => test_time_parser.cc} (67%)



[trafficserver] branch master updated: Remove inactive include of IpMapConf.h (#9512)

2023-03-09 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 455cf6522 Remove inactive include of IpMapConf.h (#9512)
455cf6522 is described below

commit 455cf6522c8cd0660172ae8a6dd7c04642a09189
Author: Alan M. Carroll 
AuthorDate: Thu Mar 9 12:16:16 2023 -0600

Remove inactive include of IpMapConf.h (#9512)
---
 src/records/RecHttp.cc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/records/RecHttp.cc b/src/records/RecHttp.cc
index bc283a022..cba63d8ac 100644
--- a/src/records/RecHttp.cc
+++ b/src/records/RecHttp.cc
@@ -31,7 +31,6 @@
 #include "tscore/ink_inet.h"
 #include 
 #include 
-#include 
 
 using ts::TextView;
 



[trafficserver] branch master updated (abdf1748c -> 1a8ed22d4)

2023-03-08 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from abdf1748c records.yaml - Fix record name comparison logic. (#9504)
 add 1a8ed22d4 CMake: Update src/tscpp/util. (#9510)

No new revisions were added by this update.

Summary of changes:
 src/tscpp/util/CMakeLists.txt | 3 +++
 1 file changed, 3 insertions(+)



[trafficserver] branch master updated (622055c60 -> 2aa635d26)

2023-03-07 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 622055c60 Replace exclusive locks with rwlocks in hostdb (#9442)
 add 2aa635d26 libswoc: Replace ts::IpAddrSet with swoc::IPRangeSet (#9507)

No new revisions were added by this update.

Summary of changes:
 include/tscpp/util/ts_ip.h | 102 -
 plugins/experimental/maxmind_acl/mmdb.h|   6 +-
 plugins/stats_over_http/stats_over_http.cc |   4 +-
 3 files changed, 6 insertions(+), 106 deletions(-)



[trafficserver] branch master updated (12c869585 -> 56f4bf897)

2023-03-07 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 12c869585 libswoc: Replace IpMap in ControlMatcher. (#9499)
 add 56f4bf897 libswoc: remove IpMap from header_rewrite (#9506)

No new revisions were added by this update.

Summary of changes:
 plugins/header_rewrite/Makefile.inc   |  2 --
 plugins/header_rewrite/ipranges_helper.cc | 43 -
 plugins/header_rewrite/ipranges_helper.h  | 46 ---
 plugins/header_rewrite/matcher.h  | 27 +++---
 4 files changed, 23 insertions(+), 95 deletions(-)
 delete mode 100644 plugins/header_rewrite/ipranges_helper.cc
 delete mode 100644 plugins/header_rewrite/ipranges_helper.h



[trafficserver] branch master updated (d4e937779 -> 12c869585)

2023-03-07 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from d4e937779 Minor cleanup, prioritize HTTP/1.1 (#9490)
 add 12c869585 libswoc: Replace IpMap in ControlMatcher. (#9499)

No new revisions were added by this update.

Summary of changes:
 proxy/ControlMatcher.cc | 30 ++
 proxy/ControlMatcher.h  |  8 +---
 2 files changed, 19 insertions(+), 19 deletions(-)



[trafficserver] branch master updated (62ca563d1 -> 6f6d238ea)

2023-03-06 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 62ca563d1 libswoc: update to 1.4.4 (#9495)
 add 6f6d238ea Fix SNI destination parsing. (#9493)

No new revisions were added by this update.

Summary of changes:
 iocore/net/TLSTunnelSupport.cc | 16 +++-
 iocore/net/TLSTunnelSupport.h  |  8 
 proxy/http/HttpSM.cc   |  8 
 3 files changed, 15 insertions(+), 17 deletions(-)



[trafficserver] branch master updated (9659434b4 -> 62ca563d1)

2023-03-06 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 9659434b4 traffic_ctl: config set/get --cold tidy. (#9498)
 add 62ca563d1 libswoc: update to 1.4.4 (#9495)

No new revisions were added by this update.

Summary of changes:
 lib/swoc/CMakeLists.txt   | 136 +++---
 lib/swoc/Makefile.am  |   2 +-
 lib/swoc/include/swoc/DiscreteRange.h | 170 +++-
 lib/swoc/include/swoc/Errata.h|  10 +-
 lib/swoc/include/swoc/IPAddr.h|  19 +-
 lib/swoc/include/swoc/IPEndpoint.h|  22 +-
 lib/swoc/include/swoc/IPRange.h   | 186 -
 lib/swoc/include/swoc/Lexicon.h   |   6 +-
 lib/swoc/include/swoc/MemArena.h  |  19 +
 lib/swoc/include/swoc/MemSpan.h   | 752 +++---
 lib/swoc/include/swoc/TextView.h  |  30 +-
 lib/swoc/include/swoc/bwf_base.h  |   9 +-
 lib/swoc/include/swoc/bwf_ip.h|   6 +
 lib/swoc/include/swoc/swoc_meta.h |   2 +-
 lib/swoc/include/swoc/swoc_version.h  |   4 +-
 lib/swoc/src/Errata.cc|   6 +-
 lib/swoc/src/bw_format.cc |   4 +-
 lib/swoc/src/bw_ip_format.cc  |  29 ++
 src/records/RecHttp.cc|   6 +-
 19 files changed, 1109 insertions(+), 309 deletions(-)



[trafficserver] branch master updated (c7fbc9efd -> 65dd1cadc)

2023-03-04 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from c7fbc9efd Human readable timestamp for traffic_ctl config status 
(#9440)
 add 65dd1cadc Fix pre-warm std::string. (#9492)

No new revisions were added by this update.

Summary of changes:
 proxy/http/PreWarmManager.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[trafficserver] branch master updated (a3ec43b32 -> 217c5a8e2)

2023-03-02 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from a3ec43b32 records.yaml: Make sure when a string field is set to NULL 
then this (#9472)
 add 217c5a8e2 libswoc: replace TextView in src/tscore/HostLookup.cc (#9437)

No new revisions were added by this update.

Summary of changes:
 src/tscore/HostLookup.cc | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)



[trafficserver] branch master updated (3f6282128 -> 06d214840)

2023-02-27 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 3f6282128 Fix SSLSessionDup for old OpenSSL and BoringSSL (#9444)
 add 06d214840 Build: remove configure check for sys/mount.h, use C++17 
builtin. (#9463)

No new revisions were added by this update.

Summary of changes:
 configure.ac  | 2 +-
 include/tscore/ink_file.h | 2 +-
 src/tscore/ink_file.cc| 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)



[trafficserver] branch master updated: libswoc: Remove TextView from inet.cc (#9438)

2023-02-24 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 396c49762 libswoc: Remove TextView from inet.cc (#9438)
396c49762 is described below

commit 396c49762f93e52072aabef779d9798632c354c0
Author: Alan M. Carroll 
AuthorDate: Fri Feb 24 11:16:50 2023 -0600

libswoc: Remove TextView from inet.cc (#9438)
---
 iocore/net/SSLCertLookup.cc| 11 ++--
 src/tscore/ink_inet.cc | 25 -
 src/tscore/unit_tests/test_ink_inet.cc | 94 +-
 3 files changed, 64 insertions(+), 66 deletions(-)

diff --git a/iocore/net/SSLCertLookup.cc b/iocore/net/SSLCertLookup.cc
index e2fd207a2..f736f84db 100644
--- a/iocore/net/SSLCertLookup.cc
+++ b/iocore/net/SSLCertLookup.cc
@@ -29,8 +29,10 @@
 #include "tscore/Regex.h"
 #include "tscore/Trie.h"
 #include "tscore/ink_config.h"
-#include "tscore/BufferWriter.h"
-#include "tscore/bwf_std_format.h"
+
+#include "swoc/BufferWriter.h"
+#include "swoc/bwf_base.h"
+
 #include "tscore/TestBox.h"
 
 #include "I_EventSystem.h"
@@ -51,8 +53,9 @@ struct SSLAddressLookupKey {
 // lookup insensitive to address formatting and also allow the longest 
match semantic to produce
 // different matches if there is a certificate on the port.
 
-ts::FixedBufferWriter w{key, sizeof(key)};
-w.print("{}", ts::bwf::Hex_Dump(ip)); // dump as raw hex bytes, don't 
format as IP address.
+swoc::FixedBufferWriter w{key, sizeof(key)};
+w.print("{}", ip.isIp6() ? swoc::bwf::As_Hex(ip.sin6.sin6_addr) :
+   swoc::bwf::As_Hex(ip.sin.sin_addr)); // dump as 
raw hex bytes, don't format as IP address.
 if (in_port_t port = ip.host_order_port(); port) {
   sep = static_cast(w.size());
   w.print(".{:x}", port);
diff --git a/src/tscore/ink_inet.cc b/src/tscore/ink_inet.cc
index 09e0fe06a..d8ef8d8b8 100644
--- a/src/tscore/ink_inet.cc
+++ b/src/tscore/ink_inet.cc
@@ -33,6 +33,8 @@
 #include "tscpp/util/TextView.h"
 #include "tscore/ink_inet.h"
 
+#include "swoc/TextView.h"
+
 IpAddr const IpAddr::INVALID;
 
 using namespace std::literals;
@@ -178,7 +180,7 @@ ats_ip_nptop(sockaddr const *addr, char *dst, size_t size)
 int
 ats_ip_parse(std::string_view str, std::string_view *addr, std::string_view 
*port, std::string_view *rest)
 {
-  ts::TextView src(str); /// Easier to work with for parsing.
+  swoc::TextView src(str); /// Easier to work with for parsing.
   // In case the incoming arguments are null, set them here and only check for 
null once.
   // it doesn't matter if it's all the same, the results will be thrown away.
   std::string_view local;
@@ -223,10 +225,10 @@ ats_ip_parse(std::string_view str, std::string_view 
*addr, std::string_view *por
 ++src;
   }
 } else {
-  ts::TextView::size_type last = src.rfind(':');
-  if (last != ts::TextView::npos && last == src.find(':')) {
+  swoc::TextView::size_type last = src.rfind(':');
+  if (last != swoc::TextView::npos && last == src.find(':')) {
 // Exactly one colon - leave post colon stuff in @a src.
-*addr   = src.take_prefix_at(last);
+*addr   = src.take_prefix(last);
 colon_p = true;
   } else { // presume no port, use everything.
 *addr = src;
@@ -234,7 +236,7 @@ ats_ip_parse(std::string_view str, std::string_view *addr, 
std::string_view *por
   }
 }
 if (colon_p) {
-  ts::TextView tmp{src};
+  swoc::TextView tmp{src};
   src.ltrim_if(::is_digit);
 
   if (tmp.data() == src.data()) {   // no digits at all
@@ -304,9 +306,9 @@ ats_ip_range_parse(std::string_view src, IpAddr , 
IpAddr )
   zret = TS_ERROR;
 } else if ('/' == src[idx]) {
   if (TS_SUCCESS == addr.load(src.substr(0, idx))) { // load the address
-ts::TextView parsed;
+swoc::TextView parsed;
 src.remove_prefix(idx + 1); // drop address and separator.
-int cidr = ts::svtoi(src, );
+int cidr = swoc::svtoi(src, );
 if (parsed.size() && 0 <= cidr) { // a cidr that's a positive integer.
   // Special case the cidr sizes for 0, maximum, and for IPv6 64 bit 
boundaries.
   if (addr.isIp4()) {
@@ -966,13 +968,4 @@ bwformat(BufferWriter , BWFSpec const , sockaddr 
const *addr)
   return w;
 }
 
-namespace bwf
-{
-  detail::MemDump
-  Hex_Dump(IpEndpoint const )
-  {
-return detail::MemDump(ats_ip_addr8_cast(), ats_ip_addr_size());
-  }
-} // namespace bwf
-
 } // namespace ts
diff --git a/src/tscore/unit_tests/test_ink_inet.cc 
b/src/tscore/unit_tests/test_ink_inet.cc
index 6fed519ea..b022b133d 100644
--- a/src/tscore/u

[trafficserver] branch master updated: tscore: Remove unneeded and mispelled libswoc reference. (#9429)

2023-02-16 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new ebfc242b2a tscore: Remove unneeded and mispelled libswoc reference. 
(#9429)
ebfc242b2a is described below

commit ebfc242b2ac416445d520e0ea2729635cf40250e
Author: Alan M. Carroll 
AuthorDate: Thu Feb 16 14:46:04 2023 -0600

tscore: Remove unneeded and mispelled libswoc reference. (#9429)
---
 src/tscore/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tscore/Makefile.am b/src/tscore/Makefile.am
index 96174d0d56..941a3625d9 100644
--- a/src/tscore/Makefile.am
+++ b/src/tscore/Makefile.am
@@ -152,7 +152,7 @@ ParseRulesCType: CompileParseRules
LSAN_OPTIONS='detect_leaks=0' ./CompileParseRules
 
 test_atomic_SOURCES = test_atomic.cc
-test_atomic_LDADD = libtscore.la 
$(top_builddir)/src/tscpp/util/libtscpputil.la @SWOC_LIBSS@ @LIBPCRE@
+test_atomic_LDADD = libtscore.la 
$(top_builddir)/src/tscpp/util/libtscpputil.la @LIBPCRE@
 
 test_freelist_SOURCES = test_freelist.cc
 test_freelist_LDADD = libtscore.la 
$(top_builddir)/src/tscpp/util/libtscpputil.la @SWOC_LIBS@ @LIBPCRE@



[trafficserver] branch master updated: Histogram: rename members because Zwoop. (#9417)

2023-02-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 23ce1a0977 Histogram: rename members because Zwoop. (#9417)
23ce1a0977 is described below

commit 23ce1a09771bc1fff98525eb755a981a234db726
Author: Alan M. Carroll 
AuthorDate: Wed Feb 15 16:58:22 2023 -0600

Histogram: rename members because Zwoop. (#9417)
---
 include/tscpp/util/Histogram.h   | 32 
 iocore/eventsystem/UnixEventProcessor.cc |  4 ++--
 src/tscore/unit_tests/test_Histogram.cc  | 20 ++--
 3 files changed, 28 insertions(+), 28 deletions(-)

diff --git a/include/tscpp/util/Histogram.h b/include/tscpp/util/Histogram.h
index 1587ff9e5e..8828625442 100644
--- a/include/tscpp/util/Histogram.h
+++ b/include/tscpp/util/Histogram.h
@@ -23,7 +23,7 @@
 
 #pragma once
 
-#include 
+#include 
 #include 
 
 namespace ts
@@ -65,17 +65,17 @@ public:
   /// Number of bits to split each base range in to span buckets.
   static constexpr raw_type N_SPAN_BITS = S;
   /// Number of buckets per span.
-  static constexpr raw_type N_SPAN_BUCKETS = 1 << N_SPAN_BITS;
+  static constexpr raw_type N_SPAN_BUCKETS = raw_type(1) << N_SPAN_BITS;
   /// Mask to extract the local bucket index from a sample.
-  static constexpr raw_type SPAN_MASK = (1 << N_SPAN_BITS) - 1;
+  static constexpr raw_type SPAN_MASK = (raw_type(1) << N_SPAN_BITS) - 1;
   /// Initial mask to find the MSB in the sample.
-  static constexpr raw_type MSB_MASK = 1 << (N_RANGE_BITS + N_SPAN_BITS - 1);
-  /// Total number of buckets - 1 for overflow and an extra range for less 
than @c LOWER_BOUND
+  static constexpr raw_type MSB_MASK = raw_type(1) << (N_RANGE_BITS + 
N_SPAN_BITS - 1);
+  /// Total number of buckets - 1 for overflow and an extra range for less 
than @c UNDERFLOW_BOUND
   static constexpr raw_type N_BUCKETS = ((N_RANGE_BITS + 1) * N_SPAN_BUCKETS) 
+ 1;
   /// Samples less than this go in the underflow range.
-  static constexpr raw_type LOWER_BOUND = 1 << N_SPAN_BITS;
+  static constexpr raw_type UNDERFLOW_BOUND = raw_type(1) << N_SPAN_BITS;
   /// Sample equal or greater than this  go in the overflow bucket.
-  static constexpr raw_type UPPER_BOUND = 1 << (N_RANGE_BITS + N_SPAN_BITS + 
1);
+  static constexpr raw_type OVERFLOW_BOUND = raw_type(1) << (N_RANGE_BITS + 
N_SPAN_BITS + 1);
 
   /** Add @sample to the histogram.
*
@@ -97,12 +97,12 @@ public:
*/
   raw_type operator[](unsigned idx);
 
-  /** Lower bound for samples in bucket.
+  /** Minimum value for samples in bucket.
*
* @param idx Index of the bucket.
* @return The smallest sample value that will increment the bucket.
*/
-  static raw_type lower_bound(unsigned idx);
+  static raw_type min_for_bucket(unsigned idx);
 
   /** Add counts from another histogram.
*
@@ -143,15 +143,15 @@ auto
 Histogram::operator()(raw_type sample) -> self_type &
 {
   int idx = N_BUCKETS - 1; // index of overflow bucket
-  if (sample < LOWER_BOUND) {
-idx = sample;// sample -> bucket is identity in the 
underflow range.
-  } else if (sample < UPPER_BOUND) { // not overflow bucket.
-idx   -= N_SPAN_BUCKETS; // bottom bucket in the range.
-auto mask = MSB_MASK;// Mask to probe for bit set.
+  if (sample < UNDERFLOW_BOUND) {
+idx = sample;   // sample -> bucket is identity in the 
underflow range.
+  } else if (sample < OVERFLOW_BOUND) { // not overflow bucket.
+idx   -= N_SPAN_BUCKETS;// bottom bucket in the range.
+auto mask = MSB_MASK;   // Mask to probe for bit set.
 // Shift needed after finding the MSB to put the span bits in the LSBs.
 unsigned normalize_shift_count = N_RANGE_BITS - 1;
 // Walk the mask bit down until the MSB is found. Each span bumps down the 
bucket index
-// and the shift for the span bits. An MSB will be found because @a sample 
>= @c LOWER_BOUND
+// and the shift for the span bits. An MSB will be found because @a sample 
>= @c UNDERFLOW_BOUND
 // The MSB is not before @c MSB_MASK because @a sample < @c UPPER_BOUND
 while (0 == (sample & mask)) {
   mask >>= 1;
@@ -166,7 +166,7 @@ Histogram::operator()(raw_type sample) -> self_type &
 
 template 
 auto
-Histogram::lower_bound(unsigned idx) -> raw_type
+Histogram::min_for_bucket(unsigned idx) -> raw_type
 {
   auto range = idx / N_SPAN_BUCKETS;
   raw_type base  = 0; // minimum value for the range (not span!).
diff --git a/iocore/eventsystem/UnixEventProcessor.cc 
b/iocore/eventsystem/UnixEventProcessor.cc
index a2e7ce2f99..e9dcb659cd 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProc

[trafficserver] branch master updated: libswoc: update build support to fix issues with 10-Dev merge. (#9397)

2023-02-15 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new a3b1a7d453 libswoc: update build support to fix issues with 10-Dev 
merge. (#9397)
a3b1a7d453 is described below

commit a3b1a7d45393e3e0cc75b3a4ebd793398146b7fd
Author: Alan M. Carroll 
AuthorDate: Wed Feb 15 11:25:31 2023 -0600

libswoc: update build support to fix issues with 10-Dev merge. (#9397)

Add pkg-config support.
---
 build/libswoc.m4  | 123 +-
 configure.ac  |   4 +-
 proxy/logging/Makefile.am |   4 +-
 src/records/Makefile.am   |   1 -
 4 files changed, 72 insertions(+), 60 deletions(-)

diff --git a/build/libswoc.m4 b/build/libswoc.m4
index 65c1d61e47..5ecb9f6037 100644
--- a/build/libswoc.m4
+++ b/build/libswoc.m4
@@ -20,68 +20,77 @@ dnl
 
 dnl
 dnl TS_CHECK_LIBSWOC: look for libswoc libraries and headers
+dnl value
+dnl   "yes" libswoc is presumed available already and nothing needs to be done.
+dnl   "no" Not allowed, generates an error.
+dnl   * Presumed to be a directory containing libswoc.
 dnl
 AC_DEFUN([TS_CHECK_LIBSWOC], [
-has_libswoc=no
-AC_ARG_WITH(libswoc, [AS_HELP_STRING([--with-libswoc=DIR],[use a specific 
libswoc library])],
-[
-  if test "x$withval" != "xyes" && test "x$withval" != "x"; then
-libswoc_base_dir="$withval"
-if test "$withval" != "no"; then
-  has_libswoc=yes
-  case "$withval" in
-  *":"*)
-swoc_include="`echo $withval |sed -e 's/:.*$//'`"
-swoc_ldflags="`echo $withval |sed -e 's/^.*://'`"
-AC_MSG_CHECKING(checking for libswoc includes in $swoc_include libs in 
$swoc_ldflags )
-;;
-  *)
-swoc_include="$withval/include"
-swoc_ldflags="$withval/lib"
-libswoc_base_dir="$withval"
-AC_MSG_CHECKING(libswoc includes in $withval libs in $swoc_ldflags)
-;;
-  esac
-fi
-  fi
+  # internal defaults.
+  has_libswoc=no
+  SWOC_INCLUDES=-I\${abs_top_srcdir}/lib/swoc/include
+  SWOC_LIBS=-ltsswoc
+  SWOC_LDFLAGS=-L\${abs_top_builddir}/lib/swoc
+  AC_ARG_WITH(libswoc, [AS_HELP_STRING([--with-libswoc=DIR],[use a specific 
libswoc library])],
+[
+AC_MSG_CHECKING(checking libswoc)
+# Check for override.
+if test "x$withval" != "x"; then
+  has_libswoc=yes # inhibit internal build of libswoc
+  if test "$withval" = "no" ; then
+AC_MSG_ERROR([libswoc is required internally, it cannot be disabled])
+  elif test "$withval" = "yes" ; then # assume libswoc is installed in a 
standard place
+SWOC_INCLUDES=
+SWOC_LIBS=-lswoc
+SWOC_LDFLAGS=
+AC_MSG_RESULT([ok])
+  else
+swoc_pkg_cfg=""
+# Defaults if pkg config not found.
+SWOC_INCLUDES="-I${withval}/include"
+SWOC_LIBS="-lswoc"
+SWOC_LDFLAGS="-L${withval}/lib"
+if test -n "$PKG_CONFIG" ; then # pkg-config binary was found
+  for pk in "lib/pkgconfig" "lib" "." ; do
+if PKG_CONFIG_LIBDIR=${withval}/${pk} $PKG_CONFIG --exists libswoc 
; then
+  swoc_pkg_cfg=" [pkg-config: ${pk}]"
+  SWOC_INCLUDES=$(PKG_CONFIG_LIBDIR=${withval}/${pk} $PKG_CONFIG 
--cflags libswoc)
+  SWOC_LIBS=$(PKG_CONFIG_LIBDIR=${withval}/${pk} $PKG_CONFIG 
--libs-only-l libswoc)
+  SWOC_LDFLAGS=$(PKG_CONFIG_LIBDIR=${withval}/${pk} $PKG_CONFIG 
--libs-only-L libswoc)
+  break
+fi
+  done
+fi
 
-  if test -d $swoc_include && test -d $swoc_ldflags && test -f 
$swoc_include/libswoc/swoc_version.h; then
-AC_MSG_RESULT([ok])
-  else
-AC_MSG_RESULT([not found])
-  fi
+# time to see if things work
 
-if test "$has_libswoc" != "no"; then
-  saved_ldflags=$LDFLAGS
-  saved_cppflags=$CPPFLAGS
+swoc_CXXFLAGS="$CXXFLAGS"
+swoc_LIBS="${LIBS}"
+CXXFLAGS="$CXXFLAGS ${SWOC_INCLUDES}"
+LIBS="${SWOC_LDFLAGS} ${SWOC_LIBS}"
 
-  SWOC_LIBS=-ltsswoc
-  if test "$libswoc_base_dir" != "/usr"; then
-SWOC_INCLUDES=-I${swoc_include}
-SWOC_LDFLAGS=-L${swoc_ldflags}
+AC_LANG_PUSH(C++)
+AC_LINK_IFELSE(
+  [AC_LANG_PROGRAM([#include ], [swoc::TextView 
tv{"Evil Dave Rulz"};])],
+  [AC_MSG_RESULT([ok${swoc_pkg_cfg}])],
+  [
+AC_MSG_RESULT([failed${swoc_pkg_cfg}])
+AC_MSG_ERROR([${withval} does not contain a val

[trafficserver] branch master updated: CMake: Update for post 10-Dev merge. (#9398)

2023-02-10 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 3ac223022b CMake: Update for post 10-Dev merge. (#9398)
3ac223022b is described below

commit 3ac223022bc5833bbbe7ed2572103c9dfbed6379
Author: Alan M. Carroll 
AuthorDate: Fri Feb 10 16:28:04 2023 -0600

CMake: Update for post 10-Dev merge. (#9398)
---
 CMakeLists.txt|  4 ++--
 mgmt/CMakeLists.txt   | 44 ---
 mgmt/utils/CMakeLists.txt |  4 
 src/records/CMakeLists.txt|  1 -
 src/tscore/CMakeLists.txt |  3 +--
 src/tscpp/util/CMakeLists.txt |  8 
 6 files changed, 7 insertions(+), 57 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8b909aac8..86abec54b2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@
 #
 ###
 
-cmake_minimum_required(VERSION 3.23)
+cmake_minimum_required(VERSION 3.20)
 project(ats)
 
 enable_testing()
@@ -130,5 +130,5 @@ add_subdirectory(src/tscore)
 add_subdirectory(src/records)
 add_subdirectory(iocore)
 add_subdirectory(proxy)
-add_subdirectory(mgmt)
+add_subdirectory(mgmt/utils)
 add_subdirectory(src/traffic_server)
diff --git a/mgmt/CMakeLists.txt b/mgmt/CMakeLists.txt
deleted file mode 100644
index 2091ed24aa..00
--- a/mgmt/CMakeLists.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-###
-#
-#  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
-#  agreements.  See the NOTICE file distributed with this work for additional 
information regarding
-#  copyright ownership.  The ASF licenses this file to you under the Apache 
License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with the 
License.  You may obtain
-#  a copy of the License at
-#
-#  http://www.apache.org/licenses/LICENSE-2.0
-#
-#  Unless required by applicable law or agreed to in writing, software 
distributed under the License
-#  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
-#  or implied. See the License for the specific language governing permissions 
and limitations under
-#  the License.
-#
-###
-
-
-
-add_library(mgmt_c STATIC RecordsConfig.cc)
-add_library(mgmt_p STATIC
-BaseManager.cc
-RecordsConfigUtils.cc
-RecordsConfig.cc
-ProcessManager.cc
-ProxyConfig.cc
-YamlCfg.cc
-)
-add_library(mgmt_lm STATIC
-BaseManager.cc
-RecordsConfigUtils.cc
-Alarms.cc
-DerivativeMetrics.cc
-FileManager.cc
-LocalManager.cc
-ConfigManager.cc
-WebMgmtUtils.cc
-)
-include_directories(${IOCORE_INCLUDE_DIRS} ${PROXY_INCLUDE_DIRS} 
${YAML_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/utils 
${CMAKE_CURRENT_SOURCE_DIR})
-
-#target_link_libraries(mgmt_lm yaml-cpp proxy logging tscore records_lm mgmt_c 
inkevent utils_lm proxy)
-#target_link_libraries(mgmt_p yaml-cpp proxy logging tscore records_p mgmt_c 
inkevent utils_p )
-
-add_subdirectory(utils)
\ No newline at end of file
diff --git a/mgmt/utils/CMakeLists.txt b/mgmt/utils/CMakeLists.txt
index 97f4ac59b8..122c202535 100644
--- a/mgmt/utils/CMakeLists.txt
+++ b/mgmt/utils/CMakeLists.txt
@@ -17,17 +17,13 @@
 
 
 add_library(utils_lm STATIC
-MgmtMarshall.cc
 MgmtSocket.cc
 MgmtUtils.cc
 ExpandingArray.cc
-MgmtLocalCleanup.cc
 )
 add_library(utils_p STATIC
-MgmtMarshall.cc
 MgmtSocket.cc
 MgmtUtils.cc
-MgmtProcessCleanup.cc
 )
 include_directories(
 ${IOCORE_INCLUDE_DIRS}
diff --git a/src/records/CMakeLists.txt b/src/records/CMakeLists.txt
index 71a6b85276..f084d5783c 100644
--- a/src/records/CMakeLists.txt
+++ b/src/records/CMakeLists.txt
@@ -27,7 +27,6 @@ add_library(records_lm STATIC
 RecMutex.cc
 RecRawStats.cc
 RecUtils.cc
-RecLocal.cc
 )
 target_include_directories(records_lm PRIVATE
 ${CMAKE_SOURCE_DIR}/mgmt
diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index 04d14f03ca..36bd63c5d8 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -135,7 +135,6 @@ add_executable(test_tscore
 unit_tests/test_Ptr.cc
 unit_tests/test_Random.cc
 unit_tests/test_Regex.cc
-unit_tests/test_Scalar.cc
 unit_tests/test_Throttler.cc
 unit_tests/test_Tokenizer.cc
 unit_tests/test_Version.cc
@@ -148,4 +147,4 @@ add_executable(test_tscore
 unit_tests/unit_test_main.cc
 )
 target_link_libraries(test_tscore PRIVATE tscore inkevent)
-target_include_directories(test_tscore PRIVATE ${CMAKE_SOURCE_DIR}/include 
${CMAKE_SOURCE_DIR}/iocore/eventsystem ${CATCH_INCLUDE_DIR})
\ No newline at end of file
+target

[trafficserver] branch 10-Dev updated: std::atomic - replace use of core atomics in tsmemcache plugin. (#9269)

2022-12-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new c8c6e7311 std::atomic - replace use of core atomics in tsmemcache 
plugin. (#9269)
c8c6e7311 is described below

commit c8c6e731101f9aa06c0ec0dfd292bc574a92d086
Author: Alan M. Carroll 
AuthorDate: Wed Dec 21 13:09:45 2022 -0600

std::atomic - replace use of core atomics in tsmemcache plugin. (#9269)
---
 plugins/experimental/memcache/tsmemcache.cc | 7 +++
 plugins/experimental/memcache/tsmemcache.h  | 8 +++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/plugins/experimental/memcache/tsmemcache.cc 
b/plugins/experimental/memcache/tsmemcache.cc
index daabb181b..cb1b32f66 100644
--- a/plugins/experimental/memcache/tsmemcache.cc
+++ b/plugins/experimental/memcache/tsmemcache.cc
@@ -44,7 +44,6 @@ static time_t base_day_time;
 // These should be persistent.
 int32_t MC::verbosity = 0;
 ink_hrtime MC::last_flush = 0;
-int64_t MC::next_cas  = 1;
 
 static void
 tsmemcache_constants()
@@ -788,7 +787,7 @@ MC::ascii_set_event(int event, void *data)
 return ASCII_RESPONSE("EXISTS");
   }
 }
-header.cas = ink_atomic_increment(_cas, 1);
+header.cas = next_cas++;
 if (f.set_append || f.set_prepend) {
   header.nbytes = nbytes + rcache_header->nbytes;
 } else {
@@ -935,7 +934,7 @@ MC::ascii_incr_decr_event(int event, void *data)
 header.exptime = UINT32_MAX; // 136 years
   }
 }
-header.cas = ink_atomic_increment(_cas, 1);
+header.cas = next_cas++;
 {
   char *localdata = nullptr;
   int len = 0;
@@ -1366,7 +1365,7 @@ MC::read_ascii_from_client_event(int event, void *data)
 #if __WORDSIZE == 64
 last_flush = new_last_flush; // this will be atomic for native word size
 #else
-ink_atomic_swap(_flush, new_last_flush);
+last_flush.exchange(new_last_flush);
 #endif
 if (!is_end_of_cmd(s, e)) {
   break;
diff --git a/plugins/experimental/memcache/tsmemcache.h 
b/plugins/experimental/memcache/tsmemcache.h
index 7b0d5c341..69a78819b 100644
--- a/plugins/experimental/memcache/tsmemcache.h
+++ b/plugins/experimental/memcache/tsmemcache.h
@@ -21,6 +21,8 @@
   limitations under the License.
  */
 
+#include 
+
 #include "I_EventSystem.h"
 #include "I_Net.h"
 #include "I_Cache.h"
@@ -154,8 +156,12 @@ struct MC : Continuation {
   uint64_t delta;
 
   static int32_t verbosity;
+#if __WORDSIZE == 64
   static ink_hrtime last_flush;
-  static int64_t next_cas;
+#else
+  static std::atomic last_flush;
+#endif
+  static inline std::atomic next_cas = 1;
 
   int write_to_client(int64_t ntowrite = -1);
   int write_then_read_from_client(int64_t ntowrite = -1);



[trafficserver] branch 10-Dev updated: RefCountObj - further improvements wrt copy construction. (#9235)

2022-12-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new f77fd958e RefCountObj - further improvements wrt copy construction. 
(#9235)
f77fd958e is described below

commit f77fd958e79b54cf6a0c13168660d708762b5ad5
Author: Alan M. Carroll 
AuthorDate: Wed Dec 21 13:09:24 2022 -0600

RefCountObj - further improvements wrt copy construction. (#9235)
---
 include/tscore/Ptr.h  | 24 +++
 iocore/eventsystem/P_UnixEThread.h|  1 +
 iocore/eventsystem/unit_tests/test_EventSystem.cc |  1 +
 iocore/net/P_UDPConnection.h  |  1 +
 plugins/experimental/memcache/tsmemcache.cc   |  1 +
 proxy/logging/LogBuffer.h |  1 +
 proxy/logging/LogFile.cc  | 21 
 proxy/logging/LogFile.h   |  2 +-
 proxy/logging/LogFormat.cc|  2 +-
 9 files changed, 14 insertions(+), 40 deletions(-)

diff --git a/include/tscore/Ptr.h b/include/tscore/Ptr.h
index 0f221c831..27a0221db 100644
--- a/include/tscore/Ptr.h
+++ b/include/tscore/Ptr.h
@@ -23,8 +23,7 @@
 
 #pragma once
 
-#include "tscore/ink_atomic.h"
-
+#include 
 #include 
 
 
@@ -47,32 +46,23 @@ class RefCountObj : public ForceVFPTToTop
 {
 public:
   RefCountObj() {}
-  RefCountObj(const RefCountObj )
-  {
-(void)s;
-return;
-  }
-
+  RefCountObj(const RefCountObj &) = delete;
   ~RefCountObj() override {}
-  RefCountObj &
-  operator=(const RefCountObj )
-  {
-(void)s;
-return (*this);
-  }
+
+  RefCountObj =(const RefCountObj &) = delete;
 
   // Increment the reference count, returning the new count.
   int
   refcount_inc()
   {
-return ink_atomic_increment((int *)_refcount, 1) + 1;
+return ++m_refcount;
   }
 
   // Decrement the reference count, returning the new count.
   int
   refcount_dec()
   {
-return ink_atomic_increment((int *)_refcount, -1) - 1;
+return --m_refcount;
   }
 
   int
@@ -88,7 +78,7 @@ public:
   }
 
 private:
-  int m_refcount = 0;
+  std::atomic m_refcount = 0;
 };
 
 
diff --git a/iocore/eventsystem/P_UnixEThread.h 
b/iocore/eventsystem/P_UnixEThread.h
index 21ca05240..b1824630c 100644
--- a/iocore/eventsystem/P_UnixEThread.h
+++ b/iocore/eventsystem/P_UnixEThread.h
@@ -32,6 +32,7 @@
 
 #include "I_EThread.h"
 #include "I_EventProcessor.h"
+#include "tscore/ink_atomic.h"
 #include 
 
 const ink_hrtime DELAY_FOR_RETRY = HRTIME_MSECONDS(10);
diff --git a/iocore/eventsystem/unit_tests/test_EventSystem.cc 
b/iocore/eventsystem/unit_tests/test_EventSystem.cc
index 5de42b03c..776724fad 100644
--- a/iocore/eventsystem/unit_tests/test_EventSystem.cc
+++ b/iocore/eventsystem/unit_tests/test_EventSystem.cc
@@ -25,6 +25,7 @@
 #include "catch.hpp"
 
 #include "I_EventSystem.h"
+#include "tscore/ink_atomic.h"
 #include "tscore/I_Layout.h"
 #include "tscore/TSSystemState.h"
 
diff --git a/iocore/net/P_UDPConnection.h b/iocore/net/P_UDPConnection.h
index 10e57c2d9..95aedbcc8 100644
--- a/iocore/net/P_UDPConnection.h
+++ b/iocore/net/P_UDPConnection.h
@@ -30,6 +30,7 @@
  /
 #pragma once
 
+#include "tscore/ink_atomic.h"
 #include "I_UDPNet.h"
 
 class UDPConnectionInternal : public UDPConnection
diff --git a/plugins/experimental/memcache/tsmemcache.cc 
b/plugins/experimental/memcache/tsmemcache.cc
index 9443c97cc..daabb181b 100644
--- a/plugins/experimental/memcache/tsmemcache.cc
+++ b/plugins/experimental/memcache/tsmemcache.cc
@@ -24,6 +24,7 @@
 #include "tsmemcache.h"
 #include "I_NetVConnection.h"
 #include "I_NetProcessor.h"
+#include "tscore/ink_atomic.h"
 
 /*
   TODO
diff --git a/proxy/logging/LogBuffer.h b/proxy/logging/LogBuffer.h
index dafccecc2..bd8d32fab 100644
--- a/proxy/logging/LogBuffer.h
+++ b/proxy/logging/LogBuffer.h
@@ -24,6 +24,7 @@
 #pragma once
 
 #include "tscore/ink_platform.h"
+#include "tscore/ink_atomic.h"
 #include "tscore/Diags.h"
 #include "LogFormat.h"
 #include "LogLimits.h"
diff --git a/proxy/logging/LogFile.cc b/proxy/logging/LogFile.cc
index 7327fac32..1f73033f9 100644
--- a/proxy/logging/LogFile.cc
+++ b/proxy/logging/LogFile.cc
@@ -93,27 +93,6 @@ LogFile::LogFile(const char *name, const char *header, 
LogFileFormat format, uin
   This (copy) constructor builds a LogFile object from another LogFile object.
   -*/
 

[trafficserver] branch 10-Dev updated: libswoc: update IPAllow. (#9193)

2022-12-03 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new 74dd418ea libswoc: update IPAllow. (#9193)
74dd418ea is described below

commit 74dd418ea35cdae723fe17f7a3d84db51418e668
Author: Alan M. Carroll 
AuthorDate: Sat Dec 3 22:24:28 2022 -0600

libswoc: update IPAllow. (#9193)
---
 proxy/IPAllow.cc | 589 ---
 proxy/IPAllow.h  | 115 +++
 2 files changed, 289 insertions(+), 415 deletions(-)

diff --git a/proxy/IPAllow.cc b/proxy/IPAllow.cc
index 33917af14..f0d3bd7e4 100644
--- a/proxy/IPAllow.cc
+++ b/proxy/IPAllow.cc
@@ -25,83 +25,40 @@
  */
 
 #include 
+
 #include "IPAllow.h"
-#include "tscore/BufferWriter.h"
-#include "tscore/ts_file.h"
-#include "tscore/ink_memory.h"
 #include "tscore/Filenames.h"
+#include "tscpp/util/ts_errata.h"
 
-#include "yaml-cpp/yaml.h"
-
-using ts::TextView;
+#include "swoc/Vectray.h"
+#include "swoc/BufferWriter.h"
+#include "swoc/bwf_std.h"
+#include "swoc/bwf_ex.h"
+#include "swoc/bwf_ip.h"
 
-namespace
-{
-void
-SignalError(ts::BufferWriter , bool )
-{
-  if (!flag) {
-flag = true;
-  }
-  Error("%s", w.data());
-}
+#include "yaml-cpp/yaml.h"
 
-template 
-void
-ParseError(ts::TextView fmt, Args &&... args)
-{
-  ts::LocalBufferWriter<1024> w;
-  w.printv(fmt, std::forward_as_tuple(args...));
-  w.write('\0');
-  Warning("%s", w.data());
-}
+using swoc::TextView;
 
-} // namespace
+using swoc::BufferWriter;
+using swoc::bwf::Spec;
 
-namespace ts
+namespace swoc
 {
 BufferWriter &
-bwformat(BufferWriter , BWFSpec const , IpAllow const *obj)
+bwformat(BufferWriter , Spec const , IpAllow const *obj)
 {
   return w.print("{}[{}]", obj->MODULE_NAME, obj->get_config_file().c_str());
 }
 
+// This needs to be in namespace "swoc" or "YAML" or ADL doesn't find the 
overload.
 BufferWriter &
-bwformat(BufferWriter , BWFSpec const , YAML::Mark const )
+bwformat(BufferWriter , Spec const , YAML::Mark const )
 {
   return w.print("Line {}", mark.line);
 }
 
-BufferWriter &
-bwformat(BufferWriter , BWFSpec const , std::error_code const )
-{
-  return w.print("[{}:{}]", ec.value(), ec.message());
-}
-
-} // namespace ts
-
-namespace YAML
-{
-template <> struct convert {
-  static Node
-  encode(ts::TextView const )
-  {
-Node zret;
-zret = std::string(tv.data(), tv.size());
-return zret;
-  }
-  static bool
-  decode(const Node , ts::TextView )
-  {
-if (!node.IsScalar()) {
-  return false;
-}
-tv.assign(node.Scalar());
-return true;
-  }
-};
-
-} // namespace YAML
+} // namespace swoc
 
 enum AclOp {
   ACL_OP_ALLOW, ///< Allow access.
@@ -119,6 +76,15 @@ static ConfigUpdateHandler *ipAllowUpdate;
 //
 //   Begin API functions
 //
+swoc::TextView
+IpAllow::localize(swoc::TextView src)
+{
+  auto span = _arena.alloc(src.size() + 1).rebind(); // always make a 
C-str if copying.
+  memcpy(span.data(), src.data(), src.size());
+  span[src.size()] = '\0';
+  return span.remove_suffix(1); // don't put the extra terminating nul in the 
view.
+}
+
 void
 IpAllow::startup()
 {
@@ -144,10 +110,12 @@ IpAllow::reconfigure()
 
   Note("%s loading ...", ts::filename::IP_ALLOW);
 
-  new_table = new self_type("proxy.config.cache.ip_allow.filename");
-  int retStatus = new_table->BuildTable();
-  if (retStatus) {
-Error("%s failed to load", ts::filename::IP_ALLOW);
+  new_table   = new self_type("proxy.config.cache.ip_allow.filename");
+  auto errata = new_table->BuildTable();
+  if (!errata.is_ok()) {
+std::string text;
+swoc::bwprint(text, "{} failed to load\n{}", ts::filename::IP_ALLOW, 
errata);
+Error("%s", text.c_str());
 delete new_table;
   } else {
 configid = configProcessor.set(configid, new_table);
@@ -174,27 +142,30 @@ IpAllow::release()
 }
 
 IpAllow::ACL
-IpAllow::match(sockaddr const *ip, match_key_t key)
+IpAllow::match(swoc::IPAddr const , match_key_t key)
 {
-  self_type *self = acquire();
-  void *raw   = nullptr;
+  self_type *self  = acquire();
+  Record const *record = nullptr;
   if (SRC_ADDR == key) {
-self->_src_map.contains(ip, );
-Record *r = static_cast(raw);
-// Special check - if checking in accept is enabled and the record is a 
deny all,
-// then return a missing record instead to force an immediate deny. 
Otherwise it's delayed
-// until after remap, to allow remap rules to tweak the result.
-if (raw && r->_method_mask == 0 && r->_nonstandard_methods.empty() && 
accept_check_p) {
-

[trafficserver] branch 10-Dev updated: Upgrade stats over http plugin to use libswoc. (#9207)

2022-11-30 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new 06db30135 Upgrade stats over http plugin to use libswoc. (#9207)
06db30135 is described below

commit 06db301350d1816bd190fabe2ffb7f2e0a5a0ec7
Author: Alan M. Carroll 
AuthorDate: Wed Nov 30 10:53:27 2022 -0600

Upgrade stats over http plugin to use libswoc. (#9207)
---
 plugins/stats_over_http/stats_over_http.cc | 87 +-
 .../stats_over_http/stats_over_http.test.py|  2 +
 2 files changed, 38 insertions(+), 51 deletions(-)

diff --git a/plugins/stats_over_http/stats_over_http.cc 
b/plugins/stats_over_http/stats_over_http.cc
index c8ea08bd7..303d170c7 100644
--- a/plugins/stats_over_http/stats_over_http.cc
+++ b/plugins/stats_over_http/stats_over_http.cc
@@ -42,14 +42,13 @@
 #include 
 #include 
 
+#include 
+
 #include "ink_autoconf.h"
 #if HAVE_BROTLI_ENCODE_H
 #include 
 #endif
 
-#include "tscore/ink_defs.h"
-#include "tscore/IpMap.h"
-
 #define PLUGIN_NAME "stats_over_http"
 #define FREE_TMOUT 30
 #define STR_BUFFER_SIZE 1024
@@ -57,8 +56,8 @@
 #define SYSTEM_RECORD_TYPE (0x100)
 #define DEFAULT_RECORD_TYPES (SYSTEM_RECORD_TYPE | TS_RECORDTYPE_PROCESS | 
TS_RECORDTYPE_PLUGIN)
 
-std::string_view const DEFAULT_IP  = "0.0.0.0/0";
-std::string_view const DEFAULT_IP6 = "::/0";
+static const swoc::IP4Range DEFAULT_IP{swoc::IP4Addr::MIN, swoc::IP4Addr::MAX};
+static const swoc::IP6Range DEFAULT_IP6{swoc::IP6Addr::MIN, 
swoc::IP6Addr::MAX};
 
 /* global holding the path used for access to this JSON data */
 std::string const DEFAULT_URL_PATH = "_stats";
@@ -92,7 +91,7 @@ static bool wrap_counters= false;
 struct config_t {
   unsigned int recordTypes;
   std::string stats_path;
-  IpMap allow_ip_map;
+  ts::IPAddrSet addrs;
 };
 struct config_holder_t {
   char *config_path;
@@ -359,8 +358,7 @@ wrap_unsigned_counter(uint64_t value)
 }
 
 static void
-json_out_stat(TSRecordType rec_type ATS_UNUSED, void *edata, int registered 
ATS_UNUSED, const char *name,
-  TSRecordDataType data_type, TSRecordData *datum)
+json_out_stat(TSRecordType rec_type, void *edata, int registered, const char 
*name, TSRecordDataType data_type, TSRecordData *datum)
 {
   stats_state *my_state = static_cast(edata);
 
@@ -384,8 +382,7 @@ json_out_stat(TSRecordType rec_type ATS_UNUSED, void 
*edata, int registered ATS_
 }
 
 static void
-csv_out_stat(TSRecordType rec_type ATS_UNUSED, void *edata, int registered 
ATS_UNUSED, const char *name, TSRecordDataType data_type,
- TSRecordData *datum)
+csv_out_stat(TSRecordType rec_type, void *edata, int registered, const char 
*name, TSRecordDataType data_type, TSRecordData *datum)
 {
   stats_state *my_state = static_cast(edata);
   switch (data_type) {
@@ -737,37 +734,29 @@ is_ipmap_allowed(const config_t *config, const struct 
sockaddr *addr)
 return true;
   }
 
-  if (config->allow_ip_map.contains(addr, nullptr)) {
+  if (config->addrs.contains(swoc::IPAddr(addr))) {
 return true;
   }
 
   return false;
 }
 static void
-parseIpMap(config_t *config, const char *ipStr)
+parseIpMap(config_t *config, swoc::TextView txt)
 {
-  IpAddr min, max;
-  ts::TextView ipstring("");
-
-  if (ipStr != 0) {
-ipstring.assign(ipStr, strlen(ipStr));
-  }
-
   // sent null ipstring, fill with default open IPs
-  if (ipStr == nullptr) {
-ats_ip_range_parse(DEFAULT_IP6, min, max);
-config->allow_ip_map.fill(min, max, nullptr);
-ats_ip_range_parse(DEFAULT_IP, min, max);
-config->allow_ip_map.fill(min, max, nullptr);
+  if (txt.empty()) {
+config->addrs.fill(DEFAULT_IP6);
+config->addrs.fill(DEFAULT_IP);
 TSDebug(PLUGIN_NAME, "Empty allow settings, setting all IPs in allow 
list");
 return;
   }
 
-  while (ipstring) {
-ts::TextView token{ipstring.take_prefix_at(',')};
-ats_ip_range_parse(std::string_view{token}, min, max);
-config->allow_ip_map.fill(min, max, nullptr);
-TSDebug(PLUGIN_NAME, "Added %.*s to allow ip list", int(token.length()), 
token.data());
+  while (txt) {
+auto token{txt.take_prefix_at(',')};
+if (swoc::IPRange r; r.load(token)) {
+  config->addrs.fill(r);
+  TSDebug(PLUGIN_NAME, "Added %.*s to allow ip list", int(token.length()), 
token.data());
+}
   }
 }
 
@@ -779,7 +768,6 @@ new_config(std::fstream )
   config->recordTypes = DEFAULT_RECORD_TYPES;
   config->stats_path  = "";
   std::string cur_line;
-  IpAddr min, max;
 
   if (!fh) {
 TSDebug(PLUGIN_NAME, "No config file, using defaults");
@@ -787,37 +775,34 @@ new_config(std::fstream )
   }
 
   while (std::getline(fh, cur_line)) {
-// skip empty lines
-if (

[trafficserver] branch 10-Dev updated: libswoc: update maxmind plugin to IPSpace. (#9208)

2022-11-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new 9ef7ffa28 libswoc: update maxmind plugin to IPSpace. (#9208)
9ef7ffa28 is described below

commit 9ef7ffa28c1fe7e1f536025be12f0967d896e492
Author: Alan M. Carroll 
AuthorDate: Mon Nov 21 17:42:56 2022 -0600

libswoc: update maxmind plugin to IPSpace. (#9208)
---
 include/tscpp/util/ts_ip.h   |  9 +
 lib/swoc/include/swoc/IPRange.h  |  3 +++
 plugins/experimental/maxmind_acl/mmdb.cc | 21 +++--
 plugins/experimental/maxmind_acl/mmdb.h  |  6 +++---
 4 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/include/tscpp/util/ts_ip.h b/include/tscpp/util/ts_ip.h
index 2248b985d..92dbd0585 100644
--- a/include/tscpp/util/ts_ip.h
+++ b/include/tscpp/util/ts_ip.h
@@ -394,6 +394,9 @@ public:
   /// @return Number of ranges in the set.
   size_t count() const;
 
+  /// Remove all addresses in the set.
+  void clear();
+
 protected:
   /// Empty struct to use for payload.
   /// This declares the struct and defines the singleton instance used.
@@ -435,6 +438,12 @@ IPAddrSet::count() const
   return _addrs.count();
 }
 
+inline void
+IPAddrSet::clear()
+{
+  _addrs.clear();
+}
+
 inline bool
 IPAddrSet::Mark::operator==(IPAddrSet::Mark::self_type const )
 {
diff --git a/lib/swoc/include/swoc/IPRange.h b/lib/swoc/include/swoc/IPRange.h
index 919cb4807..b36780792 100644
--- a/lib/swoc/include/swoc/IPRange.h
+++ b/lib/swoc/include/swoc/IPRange.h
@@ -373,6 +373,9 @@ public:
   /// @return The IPv6 range.
   IP6Range const & ip6() const { return _range._ip6; }
 
+  /// @return The range family.
+  sa_family_t family() const { return _family; }
+
   /** Compute the mask for @a this as a network.
*
* @return If @a this is a network, the mask for that network. Otherwise an 
invalid mask.
diff --git a/plugins/experimental/maxmind_acl/mmdb.cc 
b/plugins/experimental/maxmind_acl/mmdb.cc
index 0fd1bb08f..7157e1d8a 100644
--- a/plugins/experimental/maxmind_acl/mmdb.cc
+++ b/plugins/experimental/maxmind_acl/mmdb.cc
@@ -242,10 +242,10 @@ Acl::loaddeny(const YAML::Node )
 if (ip.IsSequence()) {
   // Do IP Deny processing
   for (auto & : ip) {
-IpAddr min, max;
-ats_ip_range_parse(std::string_view{i.as()}, min, 
max);
-deny_ip_map.fill(min, max, nullptr);
-TSDebug(PLUGIN_NAME, "loading ip: valid: %d, fam %d ", 
min.isValid(), min.family());
+if (swoc::IPRange r; r.load(i.Scalar())) {
+  deny_ip_map.fill(r);
+  TSDebug(PLUGIN_NAME, "Denying ip fam %d ", r.family());
+}
   }
 } else {
   TSDebug(PLUGIN_NAME, "Invalid IP deny list yaml");
@@ -323,10 +323,10 @@ Acl::loadallow(const YAML::Node )
 if (ip.IsSequence()) {
   // Do IP Allow processing
   for (auto & : ip) {
-IpAddr min, max;
-ats_ip_range_parse(std::string_view{i.as()}, min, 
max);
-allow_ip_map.fill(min, max, nullptr);
-TSDebug(PLUGIN_NAME, "loading ip: valid: %d, fam %d ", 
min.isValid(), min.family());
+if (swoc::IPRange r; r.load(i.Scalar())) {
+  allow_ip_map.fill(r);
+  TSDebug(PLUGIN_NAME, "loading ip: valid: fam %d ", r.family());
+}
   }
 } else {
   TSDebug(PLUGIN_NAME, "Invalid IP allow list yaml");
@@ -749,12 +749,13 @@ Acl::eval_ip(const sockaddr *sock) const
   }
 #endif
 
-  if (allow_ip_map.contains(sock, nullptr)) {
+  swoc::IPAddr addr(sock);
+  if (allow_ip_map.contains(addr)) {
 // Allow map has this ip, we know we want to allow it
 return ALLOW_IP;
   }
 
-  if (deny_ip_map.contains(sock, nullptr)) {
+  if (deny_ip_map.contains(addr)) {
 // Deny map has this ip, explicitly deny
 return DENY_IP;
   }
diff --git a/plugins/experimental/maxmind_acl/mmdb.h 
b/plugins/experimental/maxmind_acl/mmdb.h
index 2bdb9df00..372cfdacd 100644
--- a/plugins/experimental/maxmind_acl/mmdb.h
+++ b/plugins/experimental/maxmind_acl/mmdb.h
@@ -36,7 +36,7 @@
 #include 
 #include 
 #include 
-#include "tscore/IpMap.h"
+#include "tscpp/util/ts_ip.h"
 
 #ifdef HAVE_PCRE_PCRE_H
 #include 
@@ -91,8 +91,8 @@ protected:
   std::unordered_map> allow_regex;
   std::unordered_map> deny_regex;
 
-  IpMap allow_ip_map;
-  IpMap deny_ip_map;
+  ts::IPAddrSet allow_ip_map;
+  ts::IPAddrSet deny_ip_map;
 
   // Anonymous blocking default to off
   bool _anonymous_ip  = false;



[trafficserver] branch 10-Dev updated: libswoc: Add ATS IP address utitilies on top of libswoc. (#9209)

2022-11-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new 8df36ae51 libswoc: Add ATS IP address utitilies on top of libswoc. 
(#9209)
8df36ae51 is described below

commit 8df36ae51db5536a2b88b37c364e02316c256a90
Author: Alan M. Carroll 
AuthorDate: Mon Nov 21 14:12:47 2022 -0600

libswoc: Add ATS IP address utitilies on top of libswoc. (#9209)

libswoc: Add ATS IP address utilities on top of libswoc.
---
 include/tscpp/util/Makefile.am |   1 +
 include/tscpp/util/ts_ip.h | 450 +
 src/tscpp/util/Makefile.am |   2 +-
 src/tscpp/util/ts_ip.cc| 123 +++
 4 files changed, 575 insertions(+), 1 deletion(-)

diff --git a/include/tscpp/util/Makefile.am b/include/tscpp/util/Makefile.am
index 1c9826e4c..bde4eb3d0 100644
--- a/include/tscpp/util/Makefile.am
+++ b/include/tscpp/util/Makefile.am
@@ -20,6 +20,7 @@ library_includedir=$(includedir)/tscpp/util
 
 library_include_HEADERS = \
 ts_diag_levels.h \
+ts_ip.h \
IntrusiveDList.h \
LocalBuffer.h \
PostScript.h \
diff --git a/include/tscpp/util/ts_ip.h b/include/tscpp/util/ts_ip.h
new file mode 100644
index 0..2248b985d
--- /dev/null
+++ b/include/tscpp/util/ts_ip.h
@@ -0,0 +1,450 @@
+/** @file
+
+  IP address handling support.
+
+  Built on top of libswoc IP networking support to provide utilities 
specialized for ATS.
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license agreements.
+  See the NOTICE file distributed with this work for additional information 
regarding copyright
+  ownership.  The ASF licenses this file to you under the Apache License, 
Version 2.0 (the
+  "License"); you may not use this file except in compliance with the License. 
 You may obtain a
+  copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software 
distributed under the License
+  is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+  or implied. See the License for the specific language governing permissions 
and limitations under
+  the License.
+*/
+
+#pragma once
+
+#include 
+
+#include "swoc/swoc_ip.h"
+
+namespace ts
+{
+/// Pair of addresses, each optional.
+/// Used in situations where both an IPv4 and IPv6 may be needed.
+class IPAddrPair
+{
+public:
+  using self_type = IPAddrPair;
+
+  IPAddrPair() = default; ///< Default construct empty pair.
+
+  /** Construct with IPv4 address.
+   *
+   * @param a4 Address.
+   */
+  IPAddrPair(swoc::IP4Addr a4);
+
+  /** Construct with IPv6 address.
+   *
+   * @param a6 Address.
+   */
+  IPAddrPair(swoc::IP6Addr a6);
+
+  /// @return @c true if either address is present.
+  bool has_value() const;
+
+  /// @return @c true if an IPv4 address is present.
+  bool has_ip4() const;
+
+  /// @return @c true if an IPv6 address is present.
+  bool has_ip6() const;
+
+  /// @return The IPv4 address
+  /// @note Does not check if the address is present.
+  swoc::IP4Addr const () const;
+
+  /// @return The IPv6 address
+  /// @note Does not check if the address is present.
+  swoc::IP6Addr const () const;
+
+  /** Assign the IPv4 address.
+   *
+   * @param addr Address to assign.
+   * @return @a this
+   */
+  self_type =(swoc::IP4Addr const );
+
+  /** Assign the IPv6 address.
+   *
+   * @param addr Address to assign.
+   * @return @a this
+   */
+  self_type =(swoc::IP6Addr const );
+
+  /** Assign an address.
+   *
+   * @param addr Address to assign.
+   * @return @a this
+   *
+   * The appropriate internal address is assigned based on the address in @a 
addr.
+   */
+  self_type =(swoc::IPAddr const );
+
+protected:
+  std::optional _ip4;
+  std::optional _ip6;
+};
+
+inline IPAddrPair::IPAddrPair(swoc::IP4Addr a4) : _ip4(a4) {}
+inline IPAddrPair::IPAddrPair(swoc::IP6Addr a6) : _ip6(a6) {}
+
+inline bool
+IPAddrPair::has_value() const
+{
+  return _ip4.has_value() || _ip6.has_value();
+}
+
+inline bool
+IPAddrPair::has_ip4() const
+{
+  return _ip4.has_value();
+}
+
+inline bool
+IPAddrPair::has_ip6() const
+{
+  return _ip6.has_value();
+}
+
+inline swoc::IP4Addr const &
+IPAddrPair::ip4() const
+{
+  return _ip4.value();
+}
+
+inline swoc::IP6Addr const &
+IPAddrPair::ip6() const
+{
+  return _ip6.value();
+}
+
+inline auto
+IPAddrPair::operator=(swoc::IP4Addr const ) -> self_type &
+{
+  _ip4 = addr;
+  return *this;
+}
+
+inline auto
+IPAddrPair::operator=(swoc::IP6Addr const ) -> self_type &
+{
+  _ip6 = addr;
+  return *this;
+}
+
+inline auto
+IPAddrPair::operator=(swoc::IPAddr const ) -> self_type &
+{
+  if (addr.is_ip4()) {
+_ip4 = a

[trafficserver] branch 10-Dev updated: libswoc: Export "ts_diag_levels.h". (#9210)

2022-11-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new bd333e8bc libswoc: Export "ts_diag_levels.h". (#9210)
bd333e8bc is described below

commit bd333e8bcde8b67717d7430bc8038c8117a33487
Author: Alan M. Carroll 
AuthorDate: Mon Nov 21 08:01:12 2022 -0600

libswoc: Export "ts_diag_levels.h". (#9210)
---
 include/tscpp/util/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/tscpp/util/Makefile.am b/include/tscpp/util/Makefile.am
index 185f6c5df..1c9826e4c 100644
--- a/include/tscpp/util/Makefile.am
+++ b/include/tscpp/util/Makefile.am
@@ -19,6 +19,7 @@
 library_includedir=$(includedir)/tscpp/util
 
 library_include_HEADERS = \
+ts_diag_levels.h \
IntrusiveDList.h \
LocalBuffer.h \
PostScript.h \



[trafficserver] branch 10-Dev updated: libswoc: Fix duplicate export of string_view_util.h (#9211)

2022-11-21 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new 0d55fe25f libswoc: Fix duplicate export of string_view_util.h (#9211)
0d55fe25f is described below

commit 0d55fe25f6c43bdf43799c11298fbf3e22184ea8
Author: Alan M. Carroll 
AuthorDate: Mon Nov 21 08:00:29 2022 -0600

libswoc: Fix duplicate export of string_view_util.h (#9211)
---
 lib/swoc/Makefile.am | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/swoc/Makefile.am b/lib/swoc/Makefile.am
index 4e86e5e10..b928917f5 100644
--- a/lib/swoc/Makefile.am
+++ b/lib/swoc/Makefile.am
@@ -55,7 +55,6 @@ library_include_HEADERS = \
 include/swoc/string_view_util.h \
 include/swoc/TextView.h \
 include/swoc/Vectray.h \
-   include/swoc/string_view_util.h \
 include/swoc/HashFNV.h
 endif
 



[trafficserver] branch 10-Dev updated (f638450a0 -> db516eb9e)

2022-11-19 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from f638450a0 Merge master into 10-Dev
 add db516eb9e libswoc: Replace ts::Scalar with swoc::Scalar (#9206)

No new revisions were added by this update.

Summary of changes:
 include/tscore/MemArena.h|   9 +-
 include/tscore/Scalar.h  | 993 ---
 iocore/hostdb/HostDB.cc  |   8 +-
 iocore/hostdb/test_HostFile.cc   |   9 +-
 proxy/hdrs/HTTP.cc   |   2 +-
 proxy/hdrs/HdrHeap.cc|  10 +-
 proxy/hdrs/HdrHeap.h |   6 +-
 src/traffic_cache_tool/CacheDefs.cc  |   6 +-
 src/traffic_cache_tool/CacheDefs.h   |  22 +-
 src/traffic_cache_tool/CacheScan.cc  |   4 +-
 src/tscore/Makefile.am   |   1 -
 src/tscore/MemArena.cc   |   2 +
 src/tscore/unit_tests/test_Scalar.cc | 301 ---
 13 files changed, 42 insertions(+), 1331 deletions(-)
 delete mode 100644 include/tscore/Scalar.h
 delete mode 100644 src/tscore/unit_tests/test_Scalar.cc



[trafficserver] branch 10-Dev updated: Errata severity (#9199)

2022-11-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new 9c6eb61f6 Errata severity (#9199)
9c6eb61f6 is described below

commit 9c6eb61f6fd21fa2a3bc2ecd622283ba3ab85524
Author: Alan M. Carroll 
AuthorDate: Fri Nov 18 13:56:45 2022 -0600

Errata severity (#9199)

libswoc: Enable Errata to use ATS core severity levels.
---
 include/tscore/DiagsTypes.h | 15 ++
 include/tscpp/util/ts_diag_levels.h | 38 +++
 include/tscpp/util/ts_errata.h  | 40 +
 lib/swoc/Makefile.am|  1 +
 src/tscore/Makefile.am  |  1 +
 src/tscpp/api/Makefile.am   |  2 +-
 src/tscpp/util/Makefile.am  |  3 ++-
 src/tscpp/util/ts_diags.cc  | 33 ++
 8 files changed, 118 insertions(+), 15 deletions(-)

diff --git a/include/tscore/DiagsTypes.h b/include/tscore/DiagsTypes.h
index e199bdcc5..b9d1145a1 100644
--- a/include/tscore/DiagsTypes.h
+++ b/include/tscore/DiagsTypes.h
@@ -43,6 +43,8 @@
 #include "SourceLocation.h"
 #include "DbgCtl.h"
 
+#include "tscpp/util/ts_diag_levels.h"
+
 #define DIAGS_MAGIC 0x12345678
 #define BYTES_IN_MB 100
 
@@ -59,19 +61,6 @@ struct DiagsModeOutput {
   bool to_diagslog;
 };
 
-enum DiagsLevel { // do not renumber --- used as array index
-  DL_Diag = 0,// process does not die
-  DL_Debug,   // process does not die
-  DL_Status,  // process does not die
-  DL_Note,// process does not die
-  DL_Warning, // process does not die
-  DL_Error,   // process does not die
-  DL_Fatal,   // causes process termination
-  DL_Alert,   // causes process termination
-  DL_Emergency,   // causes process termination, exits with UNRECOVERABLE_EXIT
-  DL_Undefined// must be last, used for size!
-};
-
 enum StdStream { STDOUT = 0, STDERR };
 
 enum RollingEnabledValues { NO_ROLLING = 0, ROLL_ON_TIME, ROLL_ON_SIZE, 
ROLL_ON_TIME_OR_SIZE, INVALID_ROLLING_VALUE };
diff --git a/include/tscpp/util/ts_diag_levels.h 
b/include/tscpp/util/ts_diag_levels.h
new file mode 100644
index 0..46536eab9
--- /dev/null
+++ b/include/tscpp/util/ts_diag_levels.h
@@ -0,0 +1,38 @@
+/** @file Diagnostic definitions and functions.
+
+@section license License
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+#pragma once
+
+/// Severity level for diagnostics.
+/// @internal Used as array indices, do not renumber or rearrange.
+/// @see DiagTypes.h
+enum DiagsLevel {
+  DL_Diag = 0,  // process does not die
+  DL_Debug, // process does not die
+  DL_Status,// process does not die
+  DL_Note,  // process does not die
+  DL_Warning,   // process does not die
+  DL_Error, // process does not die
+  DL_Fatal, // causes process termination
+  DL_Alert, // causes process termination
+  DL_Emergency, // causes process termination, exits with UNRECOVERABLE_EXIT
+  DL_Undefined  // must be last, used for size!
+};
diff --git a/include/tscpp/util/ts_errata.h b/include/tscpp/util/ts_errata.h
new file mode 100644
index 0..729a56740
--- /dev/null
+++ b/include/tscpp/util/ts_errata.h
@@ -0,0 +1,40 @@
+/** @file Diagnostic definitions and functions.
+
+@section license License
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the

[trafficserver] branch 10-Dev updated: libswoc - replace string_view_util with libswoc version. (#9203)

2022-11-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new ce009fb40 libswoc - replace string_view_util with libswoc version. 
(#9203)
ce009fb40 is described below

commit ce009fb40fe1507454e83d30b0e7caf4de919c6a
Author: Alan M. Carroll 
AuthorDate: Fri Nov 18 12:39:22 2022 -0600

libswoc - replace string_view_util with libswoc version. (#9203)

* libswoc - replace string_view_util with libswoc version.

* Possible linking fix.
---
 include/tscpp/util/Makefile.am |  1 -
 include/tscpp/util/TextView.h  |  2 +-
 lib/Makefile.am|  3 +-
 lib/swoc/Makefile.am   | 22 +++---
 lib/swoc/include/swoc/TextView.h   |  2 +-
 .../swoc/include/swoc}/string_view_util.h  | 34 +++---
 lib/swoc/src/Errata.cc |  2 +-
 .../util => lib/swoc/src}/string_view_util.cc  | 30 +--
 proxy/http/remap/Makefile.am   |  3 ++
 proxy/http2/Makefile.am|  8 +++--
 src/traffic_cache_tool/Makefile.inc|  1 -
 src/tscore/Makefile.am | 15 +-
 src/tscpp/util/Makefile.am | 10 +++
 13 files changed, 54 insertions(+), 79 deletions(-)

diff --git a/include/tscpp/util/Makefile.am b/include/tscpp/util/Makefile.am
index a1d18fd19..185f6c5df 100644
--- a/include/tscpp/util/Makefile.am
+++ b/include/tscpp/util/Makefile.am
@@ -23,6 +23,5 @@ library_include_HEADERS = \
LocalBuffer.h \
PostScript.h \
Strerror.h \
-   string_view_util.h \
TextView.h \
TsSharedMutex.h
diff --git a/include/tscpp/util/TextView.h b/include/tscpp/util/TextView.h
index dae73abee..77ede1928 100644
--- a/include/tscpp/util/TextView.h
+++ b/include/tscpp/util/TextView.h
@@ -34,7 +34,7 @@
 #include 
 #include 
 
-#include "tscpp/util/string_view_util.h"
+#include "swoc/string_view_util.h"
 
 namespace ts
 {
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 592ffa9e9..e966b9ff8 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -44,10 +44,9 @@ all-local:: swoc
 
 clean-local::
$(MAKE) -C swoc clean
-endif
 
-if EXPORT_SWOC_HEADERS
 install-data-local::
$(MAKE) -C swoc install
+
 endif
 
diff --git a/lib/swoc/Makefile.am b/lib/swoc/Makefile.am
index 70442b7ec..b928917f5 100644
--- a/lib/swoc/Makefile.am
+++ b/lib/swoc/Makefile.am
@@ -16,19 +16,17 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-include $(top_srcdir)/build/tidy.mk
-
-noinst_LTLIBRARIES = libtsswoc.la
+lib_LTLIBRARIES = libtsswoc.la
 
 library_includedir=$(includedir)/swoc
 
-AM_CPPFLAGS += -I$(abs_top_srcdir)/include -I$(abs_top_srcdir)/lib/swoc/include
-
-libtsswoc_la_LDFLAGS = @AM_LDFLAGS@ -no-undefined -version-info 
@TS_LIBTOOL_VERSION@
+AM_CPPFLAGS += @SWOC_INCLUDES@
 
+libtsswoc_la_LDFLAGS = @AM_LDFLAGS@ -no-undefined -release 1.4.0
 libtsswoc_la_SOURCES = \
-   src/ArenaWriter.cc  src/bw_format.cc  src/bw_ip_format.cc  
src/Errata.cc  src/MemArena.cc  src/RBTree.cc  src/swoc_file.cc  src/swoc_ip.cc 
 src/TextView.cc
+   src/ArenaWriter.cc  src/bw_format.cc  src/bw_ip_format.cc  
src/Errata.cc  src/MemArena.cc  src/RBTree.cc  src/swoc_file.cc  src/swoc_ip.cc 
 src/TextView.cc src/string_view_util.cc
 
+if EXPORT_SWOC_HEADERS
 library_include_HEADERS = \
 include/swoc/ArenaWriter.h \
 include/swoc/BufferWriter.h \
@@ -41,22 +39,24 @@ library_include_HEADERS = \
 include/swoc/Errata.h \
 include/swoc/IntrusiveDList.h \
 include/swoc/IntrusiveHashMap.h \
+include/swoc/IPAddr.h \
+include/swoc/IPEndpoint.h \
+include/swoc/IPRange.h \
+include/swoc/IPSrv.h \
 include/swoc/Lexicon.h \
 include/swoc/MemArena.h \
 include/swoc/MemSpan.h \
 include/swoc/RBTree.h \
 include/swoc/Scalar.h \
 include/swoc/swoc_file.h \
-include/swoc/IPEndpoint.h \
-include/swoc/IPAddr.h \
-include/swoc/IPSrv.h \
-include/swoc/IPRange.h \
 include/swoc/swoc_ip.h \
 include/swoc/swoc_meta.h \
 include/swoc/swoc_version.h\
+include/swoc/string_view_util.h \
 include/swoc/TextView.h \
 include/swoc/Vectray.h \
 include/swoc/HashFNV.h
+endif
 
 clean-local:
 
diff --git a/lib/swoc/include/swoc/TextView.h b/lib/swoc/include/swoc/TextView.h
index 4d7dba981..e1537416f 100644
--- a/lib/swoc/include/swoc/TextView.h
+++ b/lib/swoc/include/swoc/TextView.h
@@ -20,7 +20,7 @@
 #include 
 
 #include "swoc/swoc_version.h"
-#include "tscpp/ut

[trafficserver] branch 10-Dev updated (a270bcd1c -> 41e19a662)

2022-11-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from a270bcd1c libswoc: update to 1.4.0 (#9200)
 add 41e19a662 Add CMake build directories to .gitignore. (#9205)

No new revisions were added by this update.

Summary of changes:
 .gitignore | 1 +
 1 file changed, 1 insertion(+)



[trafficserver] branch 10-Dev updated: Update README.md for C++17. (#9198)

2022-11-16 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new cf43dfa7a Update README.md for C++17. (#9198)
cf43dfa7a is described below

commit cf43dfa7a11270442dbac00d566051f85a7c88a2
Author: Alan M. Carroll 
AuthorDate: Wed Nov 16 09:33:13 2022 -0600

Update README.md for C++17. (#9198)
---
 README.md | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 1827ff407..f4971d199 100644
--- a/README.md
+++ b/README.md
@@ -88,8 +88,7 @@ trafficserver . Top src dir
 
   <https://cwiki.apache.org/confluence/display/TS/Building>.
 
-  As of ATS v7.0.0 and later, gcc 4.8.1 or later is required, since we now use
-  and require the C++11 standard.
+  As of ATS v9.0.0 and later, gcc 7 or later is required, since we now use and 
require the C++17 standard.
 
 ### Fedora / CentOS / RHEL:
 ```



[trafficserver] branch master updated: Add event loop timing histogram data. (#9114)

2022-11-13 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 218825320 Add event loop timing histogram data. (#9114)
218825320 is described below

commit 218825320263e29a0af98354d27c9d106642e1e7
Author: Alan M. Carroll 
AuthorDate: Sun Nov 13 07:36:03 2022 -0600

Add event loop timing histogram data. (#9114)
---
 .../monitoring/statistics/core/eventloop.en.rst|  72 -
 include/tscpp/util/Histogram.h | 195 ++
 iocore/eventsystem/I_EThread.h | 294 -
 iocore/eventsystem/UnixEThread.cc  |  98 ---
 iocore/eventsystem/UnixEventProcessor.cc   | 106 +---
 proxy/http/HttpSM.cc   |   8 +-
 src/tscore/Makefile.am |   1 +
 src/tscore/unit_tests/test_Histogram.cc|  56 
 8 files changed, 660 insertions(+), 170 deletions(-)

diff --git a/doc/admin-guide/monitoring/statistics/core/eventloop.en.rst 
b/doc/admin-guide/monitoring/statistics/core/eventloop.en.rst
index 637701310..964a16550 100644
--- a/doc/admin-guide/monitoring/statistics/core/eventloop.en.rst
+++ b/doc/admin-guide/monitoring/statistics/core/eventloop.en.rst
@@ -25,15 +25,15 @@ general mechanism is
 
 *  Dispatch any pending events.
 
-*  Check for any pending I/O activity. This wait a variable amount of time. It 
is at most
-   :ts:cv:`proxy.config.thread.max_heartbeat_mseconds` milliseconds. It is 
reduced to the amount of
-   time until the next scheduled event. Although this is done in milliseconds, 
system timers are
+*  Check for any pending I/O activity. This waits a variable amount of time, 
but at most
+   :ts:cv:`proxy.config.thread.max_heartbeat_mseconds` milliseconds. It is 
reduced to wake up before
+   the next scheduled event. Although this is done in milliseconds, system 
timers are
rarely that accurate.
 
-*  For each network connection dispatch an event to the corresponding network 
virtual connection
-   object.
+*  For each network connection that has pending I/O, dispatch an event to the 
corresponding network
+   virtual connection object.
 
-*  Dispatch any events generated while handling I/O in the previous step
+*  Dispatch any events generated while handling I/O in the previous steps.
 
 Event loops that take a long time will have a noticeable impact on transaction 
latency. There are a
 number of statistics gathered to help determine if this is the problem. 
Because instantaneous values
@@ -41,7 +41,8 @@ are not useful, the data is gathered in three different time 
buckets - 10, 100,
 There is a parallel set of statistics for each, and each larger time period 
includes the smaller
 ones. The statistic values are all "for this time period". For example, the 
statistic
 "proxy.process.eventloop.count.100s" is "the number of event loops executed in 
the last 100
-seconds".
+seconds". The histogram metrics provide a more detailed look at the 
distribution of event loop times
+to distinguish whether long times are common or an outlier.
 
 In general, the maximum loop time will create a floor under response latency. 
If that is frequently
 high then it is likely transactions are experiencing significant latency.
@@ -144,3 +145,60 @@ high then it is likely transactions are experiencing 
significant latency.
 :units: nanoseconds
 
 The maximum amount of time spent in a single loop in the last 1000 seconds.
+
+.. rubric:: Histogram Metrics
+
+.. ts:stat:: global proxy.process.eventloop.time.*ms integer
+
+This is a set of statistics that provide a histogram of event loop times. 
Each is labeled
+with a value indicating the minimum time for the bucket. The maximum is 
less than the minimum
+of the next bucket. E.g. there is a "10ms" and a "20ms" statistic. The 
"10ms" statistic counts
+the number of times the event loop took at least 10ms and less than 20ms. 
The exception is the
+last bucket which has no maximum. The histogram is semi-logarithmic so 
that bucket sizes increase
+exponentially with smaller intermediate steps. Every 60 seconds the 
accumulated values are
+decreased by half to provide an exponential decay of recent activity. The 
current set of
+statistics is ::
+
+proxy.process.eventloop.time.0ms 2210
+proxy.process.eventloop.time.5ms 293
+proxy.process.eventloop.time.10ms 1848
+proxy.process.eventloop.time.15ms 1483
+proxy.process.eventloop.time.20ms 0
+proxy.process.eventloop.time.25ms 0
+proxy.process.eventloop.time.30ms 0
+proxy.process.eventloop.time.35ms 348
+proxy.process.eventloop.time.40ms 0
+proxy.process.eventloop.time.50ms 0
+proxy.process.event

[trafficserver] branch 10-Dev updated: Add libswoc paths to base CMake file. (#9191)

2022-11-13 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new 15d235873 Add libswoc paths to base CMake file. (#9191)
15d235873 is described below

commit 15d2358737857a558ebb7aa38c299ace49895545
Author: Alan M. Carroll 
AuthorDate: Sun Nov 13 07:35:27 2022 -0600

Add libswoc paths to base CMake file. (#9191)
---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 753c7520b..8402a7a02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,7 @@ include_directories(
 include
 tests/include
 lib
+lib/swoc/include
 lib/yamlcpp/include
 proxy
 proxy/hdrs



[trafficserver] branch 10-Dev updated (d05bd099d -> b24796c61)

2022-11-13 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from d05bd099d Remove trafficserver default paramater invocations in 
AuTests (#9157)
 add b24796c61 Fix missing virtual destructor in JSONRPCRequest. (#9190)

No new revisions were added by this update.

Summary of changes:
 include/shared/rpc/RPCRequests.h | 2 ++
 1 file changed, 2 insertions(+)



[trafficserver] branch 10-Dev updated: libswoc: Clean up ts::MemSpan (#9144)

2022-10-17 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch 10-Dev
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/10-Dev by this push:
 new 2a04747e8 libswoc: Clean up ts::MemSpan (#9144)
2a04747e8 is described below

commit 2a04747e81953e697d6059e16e778d2e0e36367e
Author: Alan M. Carroll 
AuthorDate: Mon Oct 17 18:25:36 2022 -0500

libswoc: Clean up ts::MemSpan (#9144)
---
 build/libswoc.m4 |   4 +-
 build/plugins.mk |   3 +-
 include/records/I_RecCore.h  |   2 +-
 include/records/P_RecMessage.h   |   2 +-
 include/tscore/BufferWriter.h|   7 +-
 include/tscore/MemArena.h|  22 +-
 include/tscpp/util/MemSpan.h | 877 ---
 iocore/aio/Makefile.am   |   7 +-
 iocore/cache/Makefile.am |   3 +
 iocore/dns/Makefile.am   |   1 +
 iocore/eventsystem/Makefile.am   |   8 +-
 iocore/hostdb/I_HostDBProcessor.h|   7 +-
 iocore/hostdb/Makefile.am|   5 +-
 iocore/net/Makefile.am   |  22 +-
 iocore/net/SSLCertLookup.cc  |   2 +-
 iocore/net/quic/Makefile.am  |   4 +-
 iocore/utils/Makefile.am |   2 +-
 lib/swoc/Makefile.am |   2 +-
 mgmt/Makefile.am |   1 +
 mgmt/MgmtDefs.h  |   4 +-
 mgmt/api/Makefile.am |   1 +
 mgmt/config/Makefile.am  |   4 +-
 mgmt/rpc/Makefile.am |   2 +-
 mgmt/rpc/server/IPCSocketServer.cc   |   2 +-
 mgmt/rpc/server/IPCSocketServer.h|   4 +-
 mgmt/utils/Makefile.am   |   6 +-
 proxy/Makefile.am|   1 +
 proxy/hdrs/Makefile.am   |   6 +-
 proxy/http/Makefile.am   |   3 +-
 proxy/http/remap/Makefile.am |   3 +-
 proxy/http2/Makefile.am  |   3 +-
 proxy/http3/Makefile.am  |   4 +-
 proxy/logging/LogConfig.cc   |   2 +-
 proxy/logging/LogConfig.h|   4 +-
 proxy/logging/unit-tests/test_LogUtils.h |   4 +-
 proxy/shared/Makefile.am |   1 +
 src/records/Makefile.am  |   4 +-
 src/records/RecMessage.cc|   2 +-
 src/shared/rpc/IPCSocketClient.cc|   4 +-
 src/traffic_cache_tool/CacheDefs.h   |   2 +-
 src/traffic_cache_tool/CacheScan.cc  |   6 +-
 src/traffic_cache_tool/CacheScan.h   |   2 +-
 src/traffic_cache_tool/CacheTool.cc  |   2 +-
 src/traffic_cache_tool/Makefile.inc  |   5 +-
 src/traffic_crashlog/Makefile.inc|   1 +
 src/traffic_ctl/Makefile.inc |   4 +-
 src/traffic_layout/Makefile.inc  |   5 +-
 src/traffic_logcat/Makefile.inc  |   4 +-
 src/traffic_logstats/Makefile.inc|   4 +-
 src/traffic_quic/Makefile.inc|   4 +-
 src/traffic_server/Makefile.inc  |   3 +
 src/traffic_top/Makefile.inc |   5 +-
 src/tscore/BufferWriterFormat.cc |   2 +
 src/tscore/Makefile.am   |   5 +-
 src/tscore/MemArena.cc   |   1 +
 src/tscore/unit_tests/test_BufferWriterFormat.cc |  12 +-
 src/tscore/unit_tests/test_MemArena.cc   |  18 +-
 src/tscpp/util/Makefile.am   |   1 -
 src/tscpp/util/unit_tests/test_MemSpan.cc|  91 ---
 tools/Makefile.am|   2 +-
 60 files changed, 151 insertions(+), 1073 deletions(-)

diff --git a/build/libswoc.m4 b/build/libswoc.m4
index 0858ec85c..65c1d61e4 100644
--- a/build/libswoc.m4
+++ b/build/libswoc.m4
@@ -55,7 +55,7 @@ if test "$has_libswoc" != "no"; then
   saved_ldflags=$LDFLAGS
   saved_cppflags=$CPPFLAGS
 
-  SWOC_LIBS=-lswoc
+  SWOC_LIBS=-ltsswoc
   if test "$libswoc_base_dir" != "/usr"; then
 SWOC_INCLUDES=-I${swoc_include}
 SWOC_LDFLAGS=-L${swoc_ldflags}
@@ -75,7 +75,7 @@ fi
 [
   has_libswoc=no
   SWOC_INCLUDES=-I\${abs_top_srcdir}/lib/swoc/include
-  SWOC_LIBS=-lswoc
+  SWOC_LIBS=-ltsswoc
   SWOC_LDFLAGS=-L\${abs_top_builddir}/lib/swoc
 ])
 
diff --git a/build/plugins.mk b/build/plugins.mk
index 4556fc22e..bd00dd78f 100644
--- a/build/plugins.mk
+++ b/build/plugins.mk
@@ -30,7 +30,8 @@ TS_PLUGIN_CPPFLAGS = \
   -I$(abs_top_srcdir)/include/cppapi/include \
   -I$(abs_top_builddir)/lib/cppapi/

[trafficserver] branch master updated: Fix outbound client (local) override for disable. (#9104)

2022-09-26 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 0b3b1c0a7 Fix outbound client (local) override for disable. (#9104)
0b3b1c0a7 is described below

commit 0b3b1c0a796d21799d1630728ae177d137ba50c1
Author: Alan M. Carroll 
AuthorDate: Mon Sep 26 18:00:53 2022 -0500

Fix outbound client (local) override for disable. (#9104)
---
 iocore/net/SSLConfig.cc |  2 +-
 iocore/net/SSLNetVConnection.cc | 21 +++--
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index 6857915f9..336c084cc 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -784,7 +784,7 @@ SSLConfigParams::getCTX(const std::string _cert, 
const std::string _f
   ctx_key = client_cert;
   ts::bwprint(top_level_key, "{}:{}", ca_bundle_file, ca_bundle_path);
 
-  Debug("ssl_client_ctx", "Look for client cert %s %s", top_level_key.c_str(), 
ctx_key.c_str());
+  Debug("ssl_client_ctx", "Look for client cert \"%s\" \"%s\"", 
top_level_key.c_str(), ctx_key.c_str());
 
   ink_mutex_acquire();
   auto ctx_map_iter = top_level_ctx_map.find(top_level_key);
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index b9401165b..5b612e1bb 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -1109,15 +1109,24 @@ SSLNetVConnection::sslStartHandShake(int event, int 
)
   SSL_CTX *clientCTX   = nullptr;
 
   // First Look to see if there are override parameters
+  Debug("ssl", "Checking for outbound client cert override [%p]", 
options.ssl_client_cert_name.get());
   if (options.ssl_client_cert_name) {
-std::string certFilePath = 
Layout::get()->relative_to(params->clientCertPathOnly, 
options.ssl_client_cert_name.get());
+std::string certFilePath;
 std::string keyFilePath;
-if (options.ssl_client_private_key_name) {
-  keyFilePath = Layout::get()->relative_to(params->clientKeyPathOnly, 
options.ssl_client_private_key_name);
-}
 std::string caCertFilePath;
-if (options.ssl_client_ca_cert_name) {
-  caCertFilePath = 
Layout::get()->relative_to(params->clientCACertPath, 
options.ssl_client_ca_cert_name);
+// Enable override to explicitly disable the client certificate. That 
is, don't fill
+// in any of the cert paths if the cert file name is empty or "NULL".
+if (*options.ssl_client_cert_name != '\0' && 0 != strcasecmp("NULL", 
options.ssl_client_cert_name)) {
+  certFilePath = 
Layout::get()->relative_to(params->clientCertPathOnly, 
options.ssl_client_cert_name.get());
+  if (options.ssl_client_private_key_name) {
+keyFilePath = 
Layout::get()->relative_to(params->clientKeyPathOnly, 
options.ssl_client_private_key_name);
+  }
+  if (options.ssl_client_ca_cert_name) {
+caCertFilePath = 
Layout::get()->relative_to(params->clientCACertPath, 
options.ssl_client_ca_cert_name);
+  }
+  Debug("ssl", "Using outbound client cert `%s'", 
options.ssl_client_cert_name.get());
+} else {
+  Debug("ssl", "Clearing outbound client cert");
 }
 sharedCTX =
   params->getCTX(certFilePath, keyFilePath, caCertFilePath.empty() ? 
params->clientCACertFilename : caCertFilePath.c_str(),



[trafficserver] branch master updated (30374bcd4 -> 032417a55)

2022-08-29 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from 30374bcd4 Update expected ALPN output for recent versions of curl 
(#9072)
 add 032417a55 Update build / code structure to build third party libraries 
better. (#9060)

No new revisions were added by this update.

Summary of changes:
 .gitignore |  4 +--
 CMakeLists.txt |  4 +--
 Makefile.am|  7 ++---
 build/libswoc.m4   |  2 +-
 configure.ac   |  6 ++--
 doc/Doxyfile   |  2 +-
 doc/developer-guide/config-vars.en.rst |  2 +-
 {lib => include}/records/DynamicStats.h|  0
 {lib => include}/records/I_RecAlarms.h |  0
 {lib => include}/records/I_RecCore.h   |  0
 {lib => include}/records/I_RecDefs.h   |  0
 {lib => include}/records/I_RecEvents.h |  0
 {lib => include}/records/I_RecHttp.h   |  0
 {lib => include}/records/I_RecLocal.h  |  0
 {lib => include}/records/I_RecMutex.h  |  0
 {lib => include}/records/I_RecProcess.h|  0
 {lib => include}/records/I_RecSignals.h|  0
 {lib => include}/records/P_RecCore.h   |  0
 {lib => include}/records/P_RecDefs.h   |  0
 {lib => include}/records/P_RecFile.h   |  0
 {lib => include}/records/P_RecLocal.h  |  0
 {lib => include}/records/P_RecMessage.h|  0
 {lib => include}/records/P_RecProcess.h|  0
 {lib => include}/records/P_RecUtils.h  |  0
 {lib => include}/records/test_RecordsConfig.h  |  0
 iocore/aio/Makefile.am |  2 +-
 iocore/cache/Makefile.am   |  2 +-
 iocore/eventsystem/Makefile.am |  2 +-
 iocore/hostdb/Makefile.am  |  2 +-
 iocore/net/Makefile.am |  4 +--
 iocore/net/quic/Makefile.am|  4 +--
 lib/Makefile.am| 34 +-
 mgmt/Alarms.h  |  2 +-
 proxy/hdrs/Makefile.am |  4 +--
 proxy/http/Makefile.am |  2 +-
 proxy/http/remap/Makefile.am   | 10 +++
 proxy/http2/Makefile.am|  4 +--
 proxy/http3/Makefile.am|  4 +--
 {lib => src}/records/Makefile.am   |  6 ++--
 {lib => src}/records/P_RecCore.cc  |  8 ++---
 {lib => src}/records/RecConfigParse.cc |  8 ++---
 {lib => src}/records/RecCore.cc|  6 ++--
 {lib => src}/records/RecDebug.cc   |  4 +--
 {lib => src}/records/RecFile.cc|  6 ++--
 {lib => src}/records/RecHttp.cc|  0
 {lib => src}/records/RecLocal.cc   | 10 +++
 {lib => src}/records/RecMessage.cc | 10 +++
 {lib => src}/records/RecMutex.cc   |  2 +-
 {lib => src}/records/RecProcess.cc | 10 +++
 {lib => src}/records/RecRawStats.cc|  4 +--
 {lib => src}/records/RecUtils.cc   |  4 +--
 {lib => src}/records/test_I_RecLocal.cc|  0
 {lib => src}/records/test_I_RecProcess.cc  |  0
 {lib => src}/records/test_P_RecProcess.cc  |  0
 {lib => src}/records/test_RecProcess.i |  0
 {lib => src}/records/test_RecTree.cc   |  0
 {lib => src}/records/test_RecordsConfig.cc |  0
 {lib => src}/records/test_records.config   |  0
 {lib => src}/records/unit_tests/test_Diags.h   |  0
 .../records/unit_tests/test_DynamicStats.cc|  4 +--
 {lib => src}/records/unit_tests/test_RecHttp.cc|  0
 {lib => src}/records/unit_tests/unit_test_main.cc  |  0
 .../unit_tests/unit_test_main_on_eventsystem.cc|  0
 src/traffic_crashlog/Makefile.inc  |  2 +-
 src/traffic_ctl/Makefile.inc   |  2 +-
 src/traffic_layout/Makefile.inc|  2 +-
 src/traffic_logcat/Makefile.inc|  2 +-
 src/traffic_logstats/Makefile.inc  |  2 +-
 src/traffic_manager/Makefile.inc   |  2 +-
 src/traffic_quic/Makefile.inc  |  4 +--
 src/traffic_server/Makefile.inc|  2 +-
 src/traffic_top/Makefile.inc   |  2 +-
 72 files changed, 107 insertions(+), 98 deletions(-)
 rename {lib => include}/records/DynamicStats.h (100%)
 rename {lib => include}/records/I_R

[trafficserver] branch master updated (b91b573fc -> f6a779f8c)

2022-06-06 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from b91b573fc Change ats_scoped_obj to std::unique_ptr . (#8882)
 add f6a779f8c Update to libswoc 1.3.8 (#8885)

No new revisions were added by this update.

Summary of changes:
 ci/rat-regex.txt |   1 +
 lib/swoc/Makefile.am |   1 +
 lib/swoc/include/swoc/MemSpan.h  |  80 ++-
 lib/swoc/include/swoc/TextView.h |  68 --
 lib/swoc/include/swoc/Vectray.h  | 431 +++
 lib/swoc/include/swoc/swoc_ip.h  |  84 +--
 lib/swoc/include/swoc/swoc_version.h |   4 +-
 7 files changed, 610 insertions(+), 59 deletions(-)
 create mode 100644 lib/swoc/include/swoc/Vectray.h



[trafficserver] branch master updated: Add configuration to require minimum number of rules in remap.config. (#8802)

2022-05-05 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 692223c50 Add configuration to require minimum number of rules in 
remap.config. (#8802)
692223c50 is described below

commit 692223c506aa8e08b9700e00741125bd5081c35c
Author: Alan M. Carroll 
AuthorDate: Thu May 5 21:14:15 2022 -0500

Add configuration to require minimum number of rules in remap.config. 
(#8802)
---
 doc/admin-guide/files/records.config.en.rst|  9 +++
 doc/admin-guide/files/remap.config.en.rst  |  6 +-
 mgmt/RecordsConfig.cc  |  2 +
 proxy/ReverseProxy.cc  |  2 +-
 proxy/http/remap/RemapConfig.cc|  3 +
 proxy/http/remap/UrlRewrite.cc | 22 +++---
 proxy/http/remap/UrlRewrite.h  |  8 +++
 tests/gold_tests/remap/reload_1.replay.yaml| 39 ++
 tests/gold_tests/remap/reload_2.replay.yaml| 39 ++
 tests/gold_tests/remap/reload_3.replay.yaml| 39 ++
 tests/gold_tests/remap/reload_4.replay.yaml| 39 ++
 tests/gold_tests/remap/reload_server.replay.yaml   | 51 +
 .../remap/remap_load_empty_failure.test.py | 30 
 .../remap/remap_load_empty_success.test.py | 33 +
 .../remap/remap_load_missing_failure.test.py   | 29 
 .../remap/remap_load_missing_success.test.py   | 35 +
 tests/gold_tests/remap/remap_reload.test.py| 83 ++
 17 files changed, 458 insertions(+), 11 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index e359a3cef..94330a9ba 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -3490,6 +3490,15 @@ URL Remap Rules
Set this variable to ``1`` if you want to retain the client host
header in a request during remapping.
 
+.. ts:cv:: CONFIG proxy.config.url_remap.min_rules_required INT 0
+   :reloadable:
+
+   The minimum number of rules :file:`remap.config` must have to be considered 
valid. An otherwise
+   valid configuration with fewer than this many rules is considered to be 
invalid as if it had a syntax
+   error. A value of zero allows :file:`remap.config` to be empty or absent.
+
+   This is dynamic to enable different requirements for startup and reloading.
+
 .. _records-config-ssl-termination:
 
 SSL Termination
diff --git a/doc/admin-guide/files/remap.config.en.rst 
b/doc/admin-guide/files/remap.config.en.rst
index 6df6863ce..aba51f79f 100644
--- a/doc/admin-guide/files/remap.config.en.rst
+++ b/doc/admin-guide/files/remap.config.en.rst
@@ -44,7 +44,11 @@ Refer to  :ref:`reverse-proxy-and-http-redirects`, for 
information about
 redirecting HTTP requests and using reverse proxy.
 
 After you modify the :file:`remap.config` run the
-:option:`traffic_ctl config reload` to apply the changes.
+:option:`traffic_ctl config reload` to apply the changes. The current 
configuration is replaced
+with the new configuration only if there are no errors in the file. Any syntax 
error will prevent
+an update. Even if syntactically correct the file is considered valid only if 
it has at least :ts:cv:`proxy.config.url_remap.min_rules_required`
+rules in it. This defaults to 0, but can be set higher if it is desirable to 
prevent loading an
+empty or missing file.
 
 Format
 ==
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 9cf5bc01b..2be112110 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1102,6 +1102,8 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.plugin.dynamic_reload_mode", RECD_INT, "1", 
RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.url_remap.min_rules_required", RECD_INT, "0", 
RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-9]+", RECA_NULL}
+  ,
 
   
//##
   //#
diff --git a/proxy/ReverseProxy.cc b/proxy/ReverseProxy.cc
index c04f6cdfb..8c07b 100644
--- a/proxy/ReverseProxy.cc
+++ b/proxy/ReverseProxy.cc
@@ -67,7 +67,7 @@ init_reverse_proxy()
 
   Note("%s loading ...", ts::filename::REMAP);
   if (!rewrite_table->load()) {
-Warning("%s failed to load", ts::filename::REMAP);
+Emergency("%s failed to load", ts::filename::REMAP);
   } else {
 Note("%s finished loading", ts::filename::REMAP);
   }
diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc
index 61afbd702..03e50203c 100644
--- a/proxy/http/remap/RemapConfig.cc
+++ b/proxy/http/remap/RemapConfig.cc
@@ -944,6 +944,9 @@ remap_parse_config

[trafficserver] branch master updated (80ead42 -> 07837b9)

2022-03-17 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 80ead42  Adds user-agent to OCSP requests (#8722)
 add 07837b9  libswoc: Make libswoc implementation overridable, header 
export optional. (#8733)

No new revisions were added by this update.

Summary of changes:
 build/libswoc.m4 | 97 
 configure.ac |  6 
 lib/Makefile.am  |  6 +++-
 3 files changed, 108 insertions(+), 1 deletion(-)
 create mode 100644 build/libswoc.m4


[trafficserver] branch master updated: libswoc - Update to 1.3.7 (#8709)

2022-03-04 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new e91317c  libswoc - Update to 1.3.7 (#8709)
e91317c is described below

commit e91317cb0be17a1314e2d7d92325b7e2d257c2b2
Author: Alan M. Carroll 
AuthorDate: Fri Mar 4 15:30:48 2022 -0600

libswoc - Update to 1.3.7 (#8709)
---
 lib/swoc/include/swoc/Lexicon.h  |   2 +-
 lib/swoc/include/swoc/MemSpan.h  |  43 +++---
 lib/swoc/include/swoc/TextView.h |  35 +
 lib/swoc/include/swoc/ext/HashFNV.h  | 256 +++
 lib/swoc/include/swoc/swoc_ip.h  |   3 +-
 lib/swoc/include/swoc/swoc_version.h |   4 +-
 lib/swoc/src/swoc_file.cc|  18 +--
 7 files changed, 327 insertions(+), 34 deletions(-)

diff --git a/lib/swoc/include/swoc/Lexicon.h b/lib/swoc/include/swoc/Lexicon.h
index cd8a196..90ea861 100644
--- a/lib/swoc/include/swoc/Lexicon.h
+++ b/lib/swoc/include/swoc/Lexicon.h
@@ -18,7 +18,7 @@
 #include "swoc/IntrusiveHashMap.h"
 #include "swoc/MemArena.h"
 #include "swoc/bwf_base.h"
-#include "swoc/HashFNV.h"
+#include "swoc/ext/HashFNV.h"
 
 namespace swoc { inline namespace SWOC_VERSION_NS {
 namespace detail {
diff --git a/lib/swoc/include/swoc/MemSpan.h b/lib/swoc/include/swoc/MemSpan.h
index 17e9880..f5aad67 100644
--- a/lib/swoc/include/swoc/MemSpan.h
+++ b/lib/swoc/include/swoc/MemSpan.h
@@ -277,8 +277,8 @@ public:
   /// Copy constructor.
   constexpr MemSpan(self_type const ) = default;
 
-  /// Copy assignment operator.
-  constexpr self_type& operator=(self_type const ) = default;
+  /// Copy assignment
+  constexpr self_type & operator = (self_type const& that) = default;
 
   /** Cross type copy constructor.
*
@@ -364,21 +364,21 @@ public:
*/
   template  MemSpan rebind() const;
 
-  /// Set the span.
-  /// This is faster but equivalent to constructing a new span with the same
-  /// arguments and assigning it.
-  /// @return @c this.
-  self_type (value_type *ptr, ///< Buffer start.
-size_t n ///< # of bytes
-  );
+  /** Update the span.
+   *
+   * @param ptr Start of span memory.
+   * @param n Number of elements in the span.
+   * @return @a this
+   */
+  self_type (value_type *ptr, size_t n);
 
-  /// Set the span.
-  /// This is faster but equivalent to constructing a new span with the same
-  /// arguments and assigning it.
-  /// @return @c this.
-  self_type (value_type *first, ///< First valid element.
-value_type const *last ///< First invalid element.
-  );
+  /** Update the span.
+   *
+   * @param first First element in the span.
+   * @param last One past the last element in the span.
+   * @return @a this
+   */
+  self_type (value_type *first, value_type const *last);
 
   /// Clear the span (become an empty span).
   self_type ();
@@ -416,12 +416,13 @@ public:
 
   /** Return a sub span of @a this span.
*
-   * @param offset Offset (index) of first element in subspan.
-   * @param count Number of elements in the subspan.
-   * @return A subspan starting at @a offset for @a count elements.
+   * @param offset Offset (index) of first element.
+   * @param count Number of elements.
+   * @return The span starting at @a offset for @a count elements in @a this.
*
-   * The result is clipped by @a this - if @a offset is out of range an empty 
span is returned.
-   * Otherwise @c count is clipped by the number of elements available in @a 
this.
+   * The result is clipped by @a this - if @a offset is out of range an empty 
span is returned. Otherwise @c count is clipped by the
+   * number of elements available in @a this. In effect the intersection of 
the span described by ( @a offset , @a count ) and @a
+   * this span is returned, which may be the empty span.
*/
   constexpr self_type subspan(size_t offset, size_t count) const;
 
diff --git a/lib/swoc/include/swoc/TextView.h b/lib/swoc/include/swoc/TextView.h
index 5e27ddf..e32d861 100644
--- a/lib/swoc/include/swoc/TextView.h
+++ b/lib/swoc/include/swoc/TextView.h
@@ -79,6 +79,22 @@ public:
*/
   constexpr TextView(char const *first, char const *last) noexcept;
 
+  /** Construct from any character container following STL standards.
+   *
+   * @tparam C Container type.
+   * @param c container
+   *
+   * The container type must have the methods @c data and @c size which must 
return values convertible
+   * to @c char @c const @c * and @c size_t respectively.
+   */
+  template < typename C
+, typename = std::enable_if_t<
+std::is_convertible_v().data()), char const*> 
&&
+std::is_convertible_v().size()), size_t>
+, void
+  >
+  > constexpr TextView(C const& c);
+
   /** Construct from literal string or array.
 

[trafficserver] branch master updated (394a9ee -> b87db52)

2022-02-18 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 394a9ee  Fix missing unique_lock definition. (#8680)
 add b87db52  Fix clang build issue for libswoc (#8658)

No new revisions were added by this update.

Summary of changes:
 include/tscpp/util/Makefile.am   |   1 +
 lib/swoc/include/swoc/swoc_ip.h  | 369 ++-
 lib/swoc/include/swoc/swoc_version.h |   4 +-
 lib/swoc/src/swoc_ip.cc  | 127 
 4 files changed, 270 insertions(+), 231 deletions(-)


[trafficserver] branch master updated (3b26cfb -> 2fbec37)

2022-02-08 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 3b26cfb  Add libswoc to ATS for core and plugins. (#8628)
 add 2fbec37  DNS: Fix lack of nameserver failover in low use 
circumstances. (#7843)

No new revisions were added by this update.

Summary of changes:
 iocore/dns/DNS.cc   | 28 +---
 iocore/dns/P_DNSProcessor.h | 23 +++
 2 files changed, 36 insertions(+), 15 deletions(-)


[trafficserver] branch master updated (048e6e8 -> 3b26cfb)

2022-02-08 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


from 048e6e8  Update lua plugin examples (#8646)
 add 3b26cfb  Add libswoc to ATS for core and plugins. (#8628)

No new revisions were added by this update.

Summary of changes:
 configure.ac   |1 +
 lib/Makefile.am|2 +-
 lib/swoc/Makefile.am   |   59 +
 lib/swoc/include/swoc/ArenaWriter.h|   63 +
 lib/swoc/include/swoc/BufferWriter.h   |  638 
 lib/swoc/include/swoc/DiscreteRange.h  | 1479 +
 lib/swoc/include/swoc/Errata.h | 1287 
 lib/swoc/include/swoc/HashFNV.h|  256 ++
 .../swoc/include/swoc}/IntrusiveDList.h|  381 +--
 .../swoc/include/swoc}/IntrusiveHashMap.h  |  196 +-
 lib/swoc/include/swoc/Lexicon.h|  723 +
 lib/swoc/include/swoc/MemArena.h   |  629 
 .../tscpp/util => lib/swoc/include/swoc}/MemSpan.h |  457 +--
 lib/swoc/include/swoc/RBTree.h |  227 ++
 {include/tscore => lib/swoc/include/swoc}/Scalar.h |  947 +++---
 lib/swoc/include/swoc/TextView.h   | 1891 
 lib/swoc/include/swoc/bwf_base.h   | 1199 
 lib/swoc/include/swoc/bwf_ex.h |  218 ++
 lib/swoc/include/swoc/bwf_fwd.h|   21 +
 lib/swoc/include/swoc/bwf_ip.h |   93 +
 lib/swoc/include/swoc/bwf_std.h|   36 +
 lib/swoc/include/swoc/swoc_file.h  |  270 ++
 lib/swoc/include/swoc/swoc_ip.h| 3244 
 lib/swoc/include/swoc/swoc_meta.h  |  201 ++
 lib/swoc/include/swoc/swoc_version.h   |   33 +
 lib/swoc/src/ArenaWriter.cc|   47 +
 lib/swoc/src/Errata.cc |  170 +
 lib/swoc/src/MemArena.cc   |  253 ++
 lib/swoc/src/RBTree.cc |  350 +++
 lib/swoc/src/TextView.cc   |  234 ++
 lib/swoc/src/bw_format.cc  | 1015 ++
 lib/swoc/src/bw_ip_format.cc   |  350 +++
 lib/swoc/src/swoc_file.cc  |  204 ++
 lib/swoc/src/swoc_ip.cc| 1074 +++
 tools/git/pre-commit   |2 +-
 35 files changed, 17306 insertions(+), 944 deletions(-)
 create mode 100644 lib/swoc/Makefile.am
 create mode 100644 lib/swoc/include/swoc/ArenaWriter.h
 create mode 100644 lib/swoc/include/swoc/BufferWriter.h
 create mode 100644 lib/swoc/include/swoc/DiscreteRange.h
 create mode 100644 lib/swoc/include/swoc/Errata.h
 create mode 100644 lib/swoc/include/swoc/HashFNV.h
 copy {include/tscpp/util => lib/swoc/include/swoc}/IntrusiveDList.h (67%)
 copy {include/tscore => lib/swoc/include/swoc}/IntrusiveHashMap.h (85%)
 create mode 100644 lib/swoc/include/swoc/Lexicon.h
 create mode 100644 lib/swoc/include/swoc/MemArena.h
 copy {include/tscpp/util => lib/swoc/include/swoc}/MemSpan.h (65%)
 create mode 100644 lib/swoc/include/swoc/RBTree.h
 copy {include/tscore => lib/swoc/include/swoc}/Scalar.h (53%)
 create mode 100644 lib/swoc/include/swoc/TextView.h
 create mode 100644 lib/swoc/include/swoc/bwf_base.h
 create mode 100644 lib/swoc/include/swoc/bwf_ex.h
 create mode 100644 lib/swoc/include/swoc/bwf_fwd.h
 create mode 100644 lib/swoc/include/swoc/bwf_ip.h
 create mode 100644 lib/swoc/include/swoc/bwf_std.h
 create mode 100644 lib/swoc/include/swoc/swoc_file.h
 create mode 100644 lib/swoc/include/swoc/swoc_ip.h
 create mode 100644 lib/swoc/include/swoc/swoc_meta.h
 create mode 100644 lib/swoc/include/swoc/swoc_version.h
 create mode 100644 lib/swoc/src/ArenaWriter.cc
 create mode 100644 lib/swoc/src/Errata.cc
 create mode 100644 lib/swoc/src/MemArena.cc
 create mode 100644 lib/swoc/src/RBTree.cc
 create mode 100644 lib/swoc/src/TextView.cc
 create mode 100644 lib/swoc/src/bw_format.cc
 create mode 100644 lib/swoc/src/bw_ip_format.cc
 create mode 100644 lib/swoc/src/swoc_file.cc
 create mode 100644 lib/swoc/src/swoc_ip.cc


[trafficserver] branch master updated: Move the string_view utilities out of TextView into their own files. (#8627)

2022-01-22 Thread amc
This is an automated email from the ASF dual-hosted git repository.

amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
 new 8bb6043  Move the string_view utilities out of TextView into their own 
files. (#8627)
8bb6043 is described below

commit 8bb60439fbf1adfecbbc704c5c86ff7d7050c22b
Author: Alan M. Carroll 
AuthorDate: Sat Jan 22 17:57:14 2022 -0600

Move the string_view utilities out of TextView into their own files. (#8627)
---
 include/tscpp/util/TextView.h | 75 +-
 include/tscpp/util/string_view_util.h | 99 +++
 src/traffic_cache_tool/Makefile.inc   |  1 +
 src/tscpp/util/Makefile.am|  2 +-
 src/tscpp/util/TextView.cc| 41 ---
 src/tscpp/util/string_view_util.cc| 63 ++
 6 files changed, 165 insertions(+), 116 deletions(-)

diff --git a/include/tscpp/util/TextView.h b/include/tscpp/util/TextView.h
index 6d14070..dae73ab 100644
--- a/include/tscpp/util/TextView.h
+++ b/include/tscpp/util/TextView.h
@@ -34,80 +34,7 @@
 #include 
 #include 
 
-/** Compare views with ordering, ignoring case.
- *
- * @param lhs input view
- * @param rhs input view
- * @return The ordered comparison value.
- *
- * - -1 if @a lhs is less than @a rhs
- * -  1 if @a lhs is greater than @a rhs
- * -  0 if the views have identical content.
- *
- * If one view is the prefix of the other, the shorter view is less (first in 
the ordering).
- */
-int strcasecmp(const std::string_view , const std::string_view );
-
-/** Compare views with ordering.
- *
- * @param lhs input view
- * @param rhs input view
- * @return The ordered comparison value.
- *
- * - -1 if @a lhs is less than @a rhs
- * -  1 if @a lhs is greater than @a rhs
- * -  0 if the views have identical content.
- *
- * If one view is the prefix of the other, the shorter view is less (first in 
the ordering).
- *
- * @note For string views, there is no difference between @c strcmp and @c 
memcmp.
- * @see strcmp
- */
-int memcmp(const std::string_view , const std::string_view );
-
-/** Copy bytes.
- *
- * @param dst Destination buffer.
- * @param src Original string.
- * @return @a dest
- *
- * This is a convenience for
- * @code
- *   memcpy(dst, src.data(), size.size());
- * @endcode
- * Therefore @a dst must point at a buffer large enough to hold @a src. If 
this is not already
- * determined, then presuming @c DST_SIZE is the size of the buffer at @a dst
- * @code
- *   memcpy(dst, src.prefix(DST_SIZE));
- * @endcode
- *
- */
-inline void *
-memcpy(void *dst, const std::string_view )
-{
-  return memcpy(dst, src.data(), src.size());
-}
-
-/** Compare views with ordering.
- *
- * @param lhs input view
- * @param rhs input view
- * @return The ordered comparison value.
- *
- * - -1 if @a lhs is less than @a rhs
- * -  1 if @a lhs is greater than @a rhs
- * -  0 if the views have identical content.
- *
- * If one view is the prefix of the other, the shorter view is less (first in 
the ordering).
- *
- * @note For string views, there is no difference between @c strcmp and @c 
memcmp.
- * @see memcmp
- */
-inline int
-strcmp(const std::string_view , const std::string_view )
-{
-  return memcmp(lhs, rhs);
-}
+#include "tscpp/util/string_view_util.h"
 
 namespace ts
 {
diff --git a/include/tscpp/util/string_view_util.h 
b/include/tscpp/util/string_view_util.h
new file mode 100644
index 000..5be1cd4
--- /dev/null
+++ b/include/tscpp/util/string_view_util.h
@@ -0,0 +1,99 @@
+/** @file
+
+   Utility overloads for @c std::string_view
+
+   @section license License
+
+   Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+   agreements.  See the NOTICE file distributed with this work for additional 
information regarding
+   copyright ownership.  The ASF licenses this file to you under the Apache 
License, Version 2.0
+   (the "License"); you may not use this file except in compliance with the 
License.  You may obtain
+   a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software 
distributed under the License
+   is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+   or implied. See the License for the specific language governing permissions 
and limitations under
+   the License.
+ */
+
+#pragma once
+#include 
+#include 
+#include 
+
+/** Compare views with ordering, ignoring case.
+ *
+ * @param lhs input view
+ * @param rhs input view
+ * @return The ordered comparison value.
+ *
+ * - -1 if @a lhs is less than @a rhs
+ * -  1 if @a lhs is greater than @a rhs
+ * -  0 if the views have identical content.
+ *
+ * If one view is the prefix of the other, the shorter view is less (first in 
the ordering).
+ */
+int str

  1   2   3   4   5   6   7   8   9   10   >