[trafficserver] branch master updated: Fix bug with reverse dns lookup from hosts files (#10392)

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

cmcfarlen 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 cf64a4d590 Fix bug with reverse dns lookup from hosts files (#10392)
cf64a4d590 is described below

commit cf64a4d5900811e2c74ddaa6b29cd562bad09e4e
Author: Chris McFarlen 
AuthorDate: Mon Sep 11 11:47:21 2023 -0500

Fix bug with reverse dns lookup from hosts files (#10392)

* Fix bug with reverse dns lookup from hosts files
Include autest to verify

* add parent port

* fix parent select so localhost isn't marked down

-

Co-authored-by: Chris McFarlen 
---
 iocore/hostdb/HostDB.cc|  2 +-
 tests/gold_tests/dns/dns_reverse_lookup.test.py| 95 ++
 tests/gold_tests/dns/hosts_file|  1 +
 .../reverse_lookup.replay.yaml}| 40 -
 4 files changed, 136 insertions(+), 2 deletions(-)

diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index dee38a2c2a..8dca07a3c6 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -1383,7 +1383,7 @@ HostDBContinuation::do_dns()
   if (auto static_hosts = hostDB.acquire_host_file(); static_hosts) {
 if (auto r = static_hosts->lookup(hash); r && action.continuation) {
   // Set the TTL based on how often we stat() the host file
-  r = lookup_done(hash.host_name, static_hosts->ttl, nullptr, r);
+  r = lookup_done(r->name_view(), static_hosts->ttl, nullptr, r);
   reply_to_cont(action.continuation, r.get());
   hostdb_cont_free(this);
   return;
diff --git a/tests/gold_tests/dns/dns_reverse_lookup.test.py 
b/tests/gold_tests/dns/dns_reverse_lookup.test.py
new file mode 100644
index 00..a14eda030b
--- /dev/null
+++ b/tests/gold_tests/dns/dns_reverse_lookup.test.py
@@ -0,0 +1,95 @@
+'''
+Verify that ATS can perform a reverse lookup when necessary
+'''
+#  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.
+
+from ports import get_port
+import os
+
+Test.Summary = '''
+Verify ATS can perform a reverse lookup when necessary
+'''
+
+#
+# This test verifies a fix for a regression that incorrectly marked a hostdb 
record as failed doing a reverse DNS
+# lookup from the hosts file.  If a parent.config exists, then ATS will 
perform a reverse lookup on remaps that
+# have an ip address in the map-to url. While this doesn't fail the initil 
request, subsequent requests that resolve
+# to the same host record will see the failed lookup attempt and fail the 
request with a host not found.
+#
+# This test verfiies the correct behavior in case future code chages introduce 
a similar regression
+#
+
+
+class DNSReverseLookupTest:
+replay_file = "replay/reverse_lookup.replay.yaml"
+
+def __init__(self):
+self._server = Test.MakeVerifierServerProcess("server", 
DNSReverseLookupTest.replay_file)
+self._configure_trafficserver()
+
+def _configure_trafficserver(self):
+self._ts = Test.MakeATSProcess("ts", enable_cache=False)
+
+# This first rule would trigger the bug
+self._ts.Disk.remap_config.AddLine(
+f"map /test1 http://127.0.0.1:{self._server.Variables.http_port}/;,
+)
+# This first rule would fail in the presense of the bug, but this test 
verifies correct behavior
+self._ts.Disk.remap_config.AddLine(
+f"map /test2 http://localhost:{self._server.Variables.http_port}/;,
+)
+self._ts.Disk.parent_config.AddLine(
+f'dest_domain=. parent=parent_host:{self._ts.Variables.port} 
round_robin=consistent_hash go_direct=false'
+)
+self._ts.Disk.parent_config.AddLine(
+# this doesn't need to match, just exist so ats will do the 
reverse lookup
+f'dest_host=other_host scheme=http parent="parent_host:8080"'
+)
+
+self._ts.Disk.records_config.update({
+'proxy.conf

[trafficserver] branch master updated (ecbc7d051c -> ac849aa9a9)

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

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


from ecbc7d051c CID-1508974 (#10397)
 add ac849aa9a9 cmake: Add remaining plugins without external deps (#10395)

No new revisions were added by this update.

Summary of changes:
 plugins/experimental/CMakeLists.txt  |  4 
 .../geoip_acl}/CMakeLists.txt|  6 --
 .../{maxmind_acl => memcache}/CMakeLists.txt | 20 +++-
 .../rate_limit}/CMakeLists.txt   | 13 -
 .../url_sig}/CMakeLists.txt  |  3 ++-
 5 files changed, 25 insertions(+), 21 deletions(-)
 copy plugins/{cache_range_requests => experimental/geoip_acl}/CMakeLists.txt 
(89%)
 copy plugins/experimental/{maxmind_acl => memcache}/CMakeLists.txt (68%)
 copy plugins/{background_fetch => experimental/rate_limit}/CMakeLists.txt (81%)
 copy plugins/{authproxy => experimental/url_sig}/CMakeLists.txt (89%)



[trafficserver] branch master updated (90b6087dcf -> 01409a61ba)

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

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


from 90b6087dcf Fix a crash due to bad disks (#10287)
 add 01409a61ba cmake: add more executables (#10284)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt | 14 
 include/tscore/ink_config.h.cmake.in   |  4 
 proxy/http/unit_tests/CMakeLists.txt   |  1 -
 proxy/http3/CMakeLists.txt | 14 +---
 src/api/CMakeLists.txt |  2 ++
 .../traffic_cache_tool}/CMakeLists.txt | 14 ++--
 {lib/fastlz => src/traffic_logcat}/CMakeLists.txt  |  7 +++---
 .../config => src/traffic_logstats}/CMakeLists.txt | 25 +-
 src/traffic_logstats/tests/test_logstats_json  |  4 
 src/traffic_logstats/tests/test_logstats_summary   |  6 +-
 {lib/fastlz => src/traffic_top}/CMakeLists.txt |  8 +++
 .../cachekey => src/traffic_via}/CMakeLists.txt| 17 ---
 src/traffic_via/test_traffic_via   |  6 +-
 src/traffic_wccp/CMakeLists.txt|  1 +
 14 files changed, 68 insertions(+), 55 deletions(-)
 copy {plugins/cachekey => src/traffic_cache_tool}/CMakeLists.txt (81%)
 copy {lib/fastlz => src/traffic_logcat}/CMakeLists.txt (81%)
 copy {mgmt/config => src/traffic_logstats}/CMakeLists.txt (61%)
 copy {lib/fastlz => src/traffic_top}/CMakeLists.txt (74%)
 copy {plugins/cachekey => src/traffic_via}/CMakeLists.txt (70%)



[trafficserver] branch master updated (e06d2404ed -> ac37de5191)

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

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


from e06d2404ed cmake: add tests for proxy/http3 (#10310)
 add ac37de5191 cmake: Add support for building benchmarks (#10316)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt | 14 ++---
 .../unit_tests => tools/benchmark}/CMakeLists.txt  | 34 --
 2 files changed, 29 insertions(+), 19 deletions(-)
 copy {plugins/experimental/access_control/unit_tests => 
tools/benchmark}/CMakeLists.txt (61%)



[trafficserver] branch master updated (541d174c8e -> bb1d435161)

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

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


from 541d174c8e Fix ip_allow optional methods specification (#10246)
 add bb1d435161 cmake: add tests for proxy/hdrs (#10283)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt  |  3 --
 proxy/hdrs/CMakeLists.txt   | 23 
 proxy/hdrs/Makefile.am  | 11 +-
 proxy/hdrs/{ => unit_tests}/test_Huffmancode.cc | 47 ++---
 proxy/hdrs/unit_tests/unit_test_main.cc |  3 ++
 src/api/CMakeLists.txt  |  4 +--
 src/tests/CMakeLists.txt|  2 +-
 src/tscore/CMakeLists.txt   |  6 +++-
 src/tscpp/util/CMakeLists.txt   |  4 +--
 9 files changed, 55 insertions(+), 48 deletions(-)
 rename proxy/hdrs/{ => unit_tests}/test_Huffmancode.cc (95%)



[trafficserver] branch master updated (bb1d435161 -> 068e184c81)

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

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


from bb1d435161 cmake: add tests for proxy/hdrs (#10283)
 add 068e184c81 setup default install path, runtime user and group (#10299)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt   | 20 
 include/tscore/ink_config.h.cmake.in |  5 ++---
 2 files changed, 22 insertions(+), 3 deletions(-)



[trafficserver] branch master updated (068e184c81 -> f3631b11fc)

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

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


from 068e184c81 setup default install path, runtime user and group (#10299)
 add f3631b11fc cmake: add unit tests for proxy/logging (#10301)

No new revisions were added by this update.

Summary of changes:
 proxy/logging/CMakeLists.txt | 19 +++
 1 file changed, 19 insertions(+)



[trafficserver] branch master updated (f3631b11fc -> 6e56c81c17)

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

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


from f3631b11fc cmake: add unit tests for proxy/logging (#10301)
 add 6e56c81c17 add tests for src/records (#10302)

No new revisions were added by this update.

Summary of changes:
 src/records/CMakeLists.txt | 12 
 1 file changed, 12 insertions(+)



[trafficserver] branch master updated (6e56c81c17 -> 2320ca36a6)

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

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


from 6e56c81c17 add tests for src/records (#10302)
 add 2320ca36a6 Cmake: Add tests in proxy/http proxy/http2 (#10305)

No new revisions were added by this update.

Summary of changes:
 proxy/http/CMakeLists.txt  | 13 +
 proxy/http2/CMakeLists.txt | 47 ++
 src/tests/CMakeLists.txt   |  6 ++
 3 files changed, 66 insertions(+)



[trafficserver] branch master updated (2320ca36a6 -> e06d2404ed)

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

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


from 2320ca36a6 Cmake: Add tests in proxy/http proxy/http2 (#10305)
 add e06d2404ed cmake: add tests for proxy/http3 (#10310)

No new revisions were added by this update.

Summary of changes:
 proxy/http3/CMakeLists.txt | 40 
 1 file changed, 40 insertions(+)



[trafficserver] branch master updated: cmake: Generate files in rc, install the trafficserver script (#10367)

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

cmcfarlen 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 282526427b cmake: Generate files in rc, install the trafficserver 
script (#10367)
282526427b is described below

commit 282526427bd8863a438f890714c3e0863ca589cd
Author: Chris McFarlen 
AuthorDate: Mon Sep 11 22:04:01 2023 -0500

cmake: Generate files in rc, install the trafficserver script (#10367)

* Generate files from the rc directory and install the trafficserver script
* setup variable for substitution in rc/ files
---
 CMakeLists.txt|  1 +
 rc/CMakeLists.txt | 37 +
 2 files changed, 38 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5601108801..7a1c7ac053 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -441,6 +441,7 @@ endif()
 if(ENABLE_DOCS)
 add_subdirectory(doc)
 endif()
+add_subdirectory(rc)
 
 if(ENABLE_BENCHMARKS)
 message(STATUS "Building benchmarks in tools/benchmark")
diff --git a/rc/CMakeLists.txt b/rc/CMakeLists.txt
new file mode 100644
index 00..fc278dbb8c
--- /dev/null
+++ b/rc/CMakeLists.txt
@@ -0,0 +1,37 @@
+###
+#
+#  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.
+#
+###
+
+set(PACKAGE_NAME "trafficserver")
+set(PACKAGE_VERSION ${TS_VERSION_STRING})
+set(PACKAGE_BUGREPORT "d...@trafficserver.apache.org")
+
+# TODO: Use layouts
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exp_bindir ${CMAKE_INSTALL_PREFIX}/bin)
+set(exp_runtimedir ${CMAKE_INSTALL_PREFIX}/var)
+set(exp_logdir ${CMAKE_INSTALL_PREFIX}/log)
+set(pkgsysuser ${TS_PKGSYSUSER})
+set(pkgsysgroupe ${TS_PKGSYSGROUP})
+
+configure_file(trafficserver.in trafficserver @ONLY)
+configure_file(trafficserver.conf.in trafficserver.conf @ONLY)
+configure_file(trafficserver.service.in trafficserver.service @ONLY)
+
+install(
+  FILES ${CMAKE_CURRENT_BINARY_DIR}/trafficserver
+  TYPE BIN
+  PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE 
WORLD_READ WORLD_EXECUTE)



[trafficserver] branch master updated (de68cd0224 -> cd3a3ea0ab)

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

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


from de68cd0224 cmake: add unit tests from mgmt/rpc (#10366)
 add cd3a3ea0ab Cmake autest (#10327)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt| 24 ---
 cmake/ConfigureTransparentProxy.cmake |  2 +-
 cmake/install_configs.cmake   |  5 ++-
 cmake/proxy-verifier.cmake| 79 +++
 configs/CMakeLists.txt|  2 +-
 tests/CMakeLists.txt  | 29 +
 tests/autest.sh.in| 13 ++
 tests/tools/plugins/CMakeLists.txt| 10 -
 8 files changed, 144 insertions(+), 20 deletions(-)
 create mode 100644 cmake/proxy-verifier.cmake
 create mode 100755 tests/autest.sh.in



[trafficserver] branch master updated (d50428d9a8 -> de68cd0224)

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

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


from d50428d9a8 Adjust CMakeLists with git worktree (#10298)
 add de68cd0224 cmake: add unit tests from mgmt/rpc (#10366)

No new revisions were added by this update.

Summary of changes:
 mgmt/rpc/CMakeLists.txt | 33 +++--
 1 file changed, 31 insertions(+), 2 deletions(-)



[trafficserver] branch master updated: Add resolv find package script (#10624)

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

cmcfarlen 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 e3e379bf7b Add resolv find package script (#10624)
e3e379bf7b is described below

commit e3e379bf7bcd427596e8fd082b55ba2b195b3001
Author: Chris McFarlen 
AuthorDate: Mon Oct 16 15:02:53 2023 -0500

Add resolv find package script (#10624)

* Add resolv find package script
---
 CMakeLists.txt |  3 ++
 .../CMakeLists.txt => cmake/Findresolv.cmake   | 44 ++
 iocore/eventsystem/CMakeLists.txt  |  2 +-
 src/tscore/CMakeLists.txt  |  5 +--
 4 files changed, 17 insertions(+), 37 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 88bac33e31..59966792ad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -421,6 +421,9 @@ check_struct_has_member("struct sockaddr_in6" sin6_len 
"netinet/in.h" HAVE_STRUC
 check_struct_has_member("struct stat" st_mtimespec "sys/stat.h" 
HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
 check_struct_has_member("struct stat" st_mtim "sys/stat.h" 
HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
 
+# find resolv library if available
+find_package(resolv)
+
 if(ENABLE_DOCS OR ENABLE_AUTEST)
 find_package(Python3 REQUIRED)
 find_program(PipEnv pipenv REQUIRED)
diff --git a/iocore/eventsystem/CMakeLists.txt b/cmake/Findresolv.cmake
similarity index 50%
copy from iocore/eventsystem/CMakeLists.txt
copy to cmake/Findresolv.cmake
index aa0c3fc0fe..eefa1a89c0 100644
--- a/iocore/eventsystem/CMakeLists.txt
+++ b/cmake/Findresolv.cmake
@@ -15,41 +15,19 @@
 #
 ###
 
+find_library(resolv_LIBRARY resolv)
+find_path(resolv_INCLUDE_DIR resolv.h)
 
-add_library(inkevent STATIC
-EventSystem.cc
-IOBuffer.cc
-Inline.cc
-Lock.cc
-MIOBufferWriter.cc
-PQ-List.cc
-Processor.cc
-ProtectedQueue.cc
-ProxyAllocator.cc
-SocketManager.cc
-Tasks.cc
-Thread.cc
-UnixEThread.cc
-UnixEvent.cc
-UnixEventProcessor.cc
-ConfigProcessor.cc
-RecRawStatsImpl.cc
-RecProcess.cc)
-add_library(ts::inkevent ALIAS inkevent)
+mark_as_advanced(resolv_FOUND resolv_LIBRARY resolv_INCLUDE_DIR)
 
-target_include_directories(inkevent PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
-
-target_link_libraries(inkevent
-PUBLIC
-ts::records
-ts::tscore
-PRIVATE
-libswoc
-resolv # transitive
-tscpputil # transitive
-yaml-cpp::yaml-cpp # transitive
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(resolv
+REQUIRED_VARS resolv_LIBRARY resolv_INCLUDE_DIR
 )
 
-if(TS_USE_HWLOC)
-target_link_libraries(inkevent PRIVATE hwloc::hwloc)
+# Add the library but only add libraries if resolv is found
+add_library(resolv::resolv INTERFACE IMPORTED)
+if(resolv_FOUND)
+  target_include_directories(resolv::resolv INTERFACE ${resolv_INCLUDE_DIRS})
+  target_link_libraries(resolv::resolv INTERFACE ${resolv_LIBRARY})
 endif()
diff --git a/iocore/eventsystem/CMakeLists.txt 
b/iocore/eventsystem/CMakeLists.txt
index aa0c3fc0fe..c2d005bfaa 100644
--- a/iocore/eventsystem/CMakeLists.txt
+++ b/iocore/eventsystem/CMakeLists.txt
@@ -45,7 +45,7 @@ target_link_libraries(inkevent
 ts::tscore
 PRIVATE
 libswoc
-resolv # transitive
+resolv::resolv # transitive
 tscpputil # transitive
 yaml-cpp::yaml-cpp # transitive
 )
diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index 6be2921cb1..af86033818 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -118,8 +118,7 @@ target_link_libraries(tscore
 PCRE::PCRE
 libswoc
 yaml-cpp::yaml-cpp
-PRIVATE
-resolv
+resolv::resolv
 )
 
 if(TS_USE_POSIX_CAP)
@@ -174,7 +173,7 @@ if(BUILD_TESTING)
 ts::tscore
 ts::tsapicore
 yaml-cpp::yaml-cpp
-resolv
+resolv::resolv
 ts::tscpputil
 OpenSSL::Crypto
 OpenSSL::SSL



[trafficserver] branch master updated: Add rat target (#10614)

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

cmcfarlen 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 8be51230ed Add rat target (#10614)
8be51230ed is described below

commit 8be51230ed6df71e125c70b17e853ab3c4266909
Author: Chris McFarlen 
AuthorDate: Mon Oct 16 13:03:12 2023 -0500

Add rat target (#10614)
---
 CMakeLists.txt   | 6 ++
 ci/rat-regex.txt | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f73b3f1c5..b17f9455e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -610,6 +610,12 @@ if(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git AND NOT EXISTS 
${CMAKE_SOURCE_DIR}/.git
 configure_file(${CMAKE_SOURCE_DIR}/tools/git/pre-commit 
${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit COPYONLY)
 endif()
 
+# Add a target to run the rat tool.  If java isn't installed this will fail, 
but its not normally run
+add_custom_target(rat
+  COMMENT "Running Apache RAT"
+  COMMAND java -jar ${CMAKE_SOURCE_DIR}/ci/apache-rat-0.13-SNAPSHOT.jar -E 
${CMAKE_SOURCE_DIR}/ci/rat-regex.txt -d ${CMAKE_SOURCE_DIR}
+)
+
 # Create an empty directories for ATS runtime
 install(DIRECTORY DESTINATION var/log/trafficserver)
 install(DIRECTORY DESTINATION var/trafficserver)
diff --git a/ci/rat-regex.txt b/ci/rat-regex.txt
index 83c7189229..01b75babc6 100644
--- a/ci/rat-regex.txt
+++ b/ci/rat-regex.txt
@@ -70,3 +70,5 @@ port\.h
 ^swoc$
 ^tests/gold_tests/autest-site/min_cfg$
 ^clang-tidy.conf$
+^build.*$
+^cmake-build.*$



[trafficserver] branch master updated: Break cycle between iocore/hostdb and proxy/http libraries (#10595)

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

cmcfarlen 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 0afb53d14a Break cycle between iocore/hostdb and proxy/http libraries 
(#10595)
0afb53d14a is described below

commit 0afb53d14a2dc393164b0f6a69e07955a887d319
Author: Chris McFarlen 
AuthorDate: Fri Oct 13 14:52:16 2023 -0500

Break cycle between iocore/hostdb and proxy/http libraries (#10595)

* Break cycle between iocore/hostdb and proxy/http libraries

* add private dep on logging from http

* one more link fix

-

Co-authored-by: Chris McFarlen 
---
 iocore/hostdb/CMakeLists.txt |   2 -
 iocore/hostdb/HostDB.cc  |  83 ---
 proxy/http/CMakeLists.txt|   1 +
 proxy/http/HttpConfig.cc | 102 +--
 proxy/http/HttpConfig.h  |  25 ---
 src/api/InkAPI.cc|   4 +-
 src/tests/CMakeLists.txt |   2 +-
 7 files changed, 103 insertions(+), 116 deletions(-)

diff --git a/iocore/hostdb/CMakeLists.txt b/iocore/hostdb/CMakeLists.txt
index db9ea717bd..178d7f62be 100644
--- a/iocore/hostdb/CMakeLists.txt
+++ b/iocore/hostdb/CMakeLists.txt
@@ -41,6 +41,4 @@ target_link_libraries(inkhostdb
 ts::inkdns
 ts::inkevent
 ts::tscore
-PRIVATE
-ts::proxy
 )
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index d2a03d6eee..2a30189b50 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -37,7 +37,6 @@
 #include 
 #include 
 #include 
-#include 
 
 using swoc::TextView;
 using std::chrono::duration_cast;
@@ -116,88 +115,6 @@ name_of(HostDBType t)
   }
   return "";
 }
-
-/** Template for creating conversions and initialization for @c std::chrono 
based configuration variables.
- *
- * @tparam V The exact type of the configuration variable.
- *
- * The tricky template code is to enable having a class instance for each 
configuration variable, instead of for each _type_ of
- * configuration variable. This is required because the callback interface 
requires functions and so the actual storage must be
- * accessible from that function. *
- */
-template  struct ConfigDuration {
-  using self_type = ConfigDuration;
-  V *_var; ///< Pointer to the variable to control.
-
-  /** Constructor.
-   *
-   * @param v The variable to update.
-   */
-  ConfigDuration(V ) : _var() {}
-
-  /// Convert to the mgmt (configuration) type.
-  static MgmtInt
-  to_mgmt(void const *data)
-  {
-return static_cast(static_cast(data)->count());
-  }
-
-  /// Convert from the mgmt (configuration) type.
-  static void
-  from_mgmt(void *data, MgmtInt i)
-  {
-*static_cast(data) = V{i};
-  }
-
-  /// The conversion structure, which handles @c MgmtInt.
-  static inline const MgmtConverter Conversions{_mgmt, _mgmt};
-
-  /** Process start up conversion from configuration.
-   *
-   * @param type The data type in the configuration.
-   * @param data The data in the configuration.
-   * @param var Pointer to the variable to update.
-   * @return @c true if @a data was successfully converted and stored, @c 
false if not.
-   *
-   * @note @a var is the target variable because it was explicitly set to be 
the value of @a _var in @c Enable.
-   */
-  static bool
-  callback(char const *, RecDataT type, RecData data, void *var)
-  {
-if (RECD_INT == type) {
-  (*self_type::Conversions.store_int)(var, data.rec_int);
-  return true;
-}
-return false;
-  }
-
-  /** Enable.
-   *
-   * @param name Name of the configuration variable.
-   *
-   * This enables both reading from the configuration and handling the 
callback for dynamic
-   * updates of the variable.
-   */
-  void
-  Enable(std::string_view name)
-  {
-Enable_Config_Var(name, _type::callback, _var);
-  }
-};
-
-ConfigDuration 
HostDBDownServerCacheTimeVar{HttpConfig::m_master.oride.down_server_timeout};
-// Make the conversions visible to the plugin API. This allows exporting just 
the conversions
-// without having to export the class definition. Again, the compiler doesn't 
allow doing this
-// in one line.
-extern MgmtConverter const 
-MgmtConverter const  = 
HostDBDownServerCacheTimeVar.Conversions;
-
-void
-HostDB_Config_Init()
-{
-  
HostDBDownServerCacheTimeVar.Enable("proxy.config.http.down_server.cache_time");
-}
-
 // Static configuration information
 
 HostDBCache hostDB;
diff --git a/proxy/http/CMakeLists.txt b/proxy/http/CMakeLists.txt
index b69a8c4728..96a8f84708 100644
--- a/proxy/http/CMakeLists.txt
+++ b/proxy/http/CMakeLists.txt
@@ -67,6 +67,7 @@ target_link_libraries(http
 ts::http_remap
 ts::inkcache
 ts::inkutils
+ts::logging
 )
 
 if(TS_USE_QUIC)
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 7e7

[trafficserver] branch master updated: sslhdr library needs public ssl (#10602)

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

cmcfarlen 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 8cb10912ff sslhdr library needs public ssl (#10602)
8cb10912ff is described below

commit 8cb10912ffd2ff0c22e04b2729d91a18ee226349
Author: Chris McFarlen 
AuthorDate: Fri Oct 13 14:51:48 2023 -0500

sslhdr library needs public ssl (#10602)

* sslhdr library needs public ssl

* swap around links

-

Co-authored-by: Chris McFarlen 
---
 plugins/experimental/sslheaders/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/experimental/sslheaders/CMakeLists.txt 
b/plugins/experimental/sslheaders/CMakeLists.txt
index 24e3419c00..2cac100a49 100644
--- a/plugins/experimental/sslheaders/CMakeLists.txt
+++ b/plugins/experimental/sslheaders/CMakeLists.txt
@@ -21,9 +21,9 @@ set_target_properties(sslhdr PROPERTIES 
POSITION_INDEPENDENT_CODE TRUE)
 
 if(BUILD_TESTING)
   add_executable(test_sslhdr unit_tests/unit_test_main.cc 
unit_tests/test_sslheaders.cc)
-  target_link_libraries(test_sslhdr PRIVATE sslhdr catch2::catch2)
+  target_link_libraries(test_sslhdr PRIVATE sslhdr catch2::catch2 OpenSSL::SSL)
 endif()
 
 
 add_atsplugin(sslheaders sslheaders.cc)
-target_link_libraries(sslheaders PRIVATE sslhdr)
+target_link_libraries(sslheaders PRIVATE sslhdr OpenSSL::SSL)



[trafficserver] branch master updated: Add presets for debian and ubuntu with hardening flags (#10629)

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

cmcfarlen 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 bfef3a7a92 Add presets for debian and ubuntu with hardening flags 
(#10629)
bfef3a7a92 is described below

commit bfef3a7a92988119bb0c840b87eacb5d72f34a24
Author: Chris McFarlen 
AuthorDate: Tue Oct 17 05:49:43 2023 -0500

Add presets for debian and ubuntu with hardening flags (#10629)
---
 CMakePresets.json | 20 
 1 file changed, 20 insertions(+)

diff --git a/CMakePresets.json b/CMakePresets.json
index af4e200519..a087cffbe1 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -48,6 +48,14 @@
 "CMAKE_C_FLAGS_DEBUG": "-g -fsanitize=address,undefined"
   }
 },
+{
+  "name": "hardened",
+  "hidden": true,
+  "cacheVariables": {
+"CMAKE_CXX_FLAGS": "-D_FORTIFY_SOURCE=2 -fPIE -fstack-protector",
+"CMAKE_EXE_LINKER_FLAGS": "-pie -Wl,-z,relro -Wl,-z,now"
+  }
+},
 {
   "name": "dev-asan",
   "displayName": "dev with asan",
@@ -106,6 +114,18 @@
   "displayName": "CI Fedora Quiche Autest",
   "description": "CI Pipeline config for Fedora Linux (autest build)",
   "inherits": ["ci-fedora", "autest"]
+},
+{
+  "name": "ci-debian",
+  "displayName": "CI Debian Hardened Build",
+  "description": "CI Pipeline config for Debian with hardening flags",
+  "inherits": ["ci", "hardened"]
+},
+{
+  "name": "ci-ubuntu",
+  "displayName": "CI Ubuntu Hardened Build",
+  "description": "CI Pipeline config for Ubuntu with hardening flags",
+  "inherits": ["ci", "hardened"]
 }
   ],
   "buildPresets": [



[trafficserver] branch master updated: fix case on cache var (#10633)

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

cmcfarlen 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 8122b6a72d fix case on cache var (#10633)
8122b6a72d is described below

commit 8122b6a72d450825b15be641aafc929f9336525f
Author: Chris McFarlen 
AuthorDate: Thu Oct 19 15:49:12 2023 -0500

fix case on cache var (#10633)
---
 CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 64b1bd45db..a5b18e5fbe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,7 +29,7 @@ math(EXPR TS_VERSION_NUMBER "${TS_VERSION_MAJOR} * 100 + 
${TS_VERSION_MINOR}
 # with a newer standard than what our codebase currently has to comply with.
 set(CMAKE_CXX_STANDARD
 17
-CACHE String "The C++ standard to compile with (default 17)"
+CACHE STRING "The C++ standard to compile with (default 17)"
 )
 set(CMAKE_CXX_STANDARD_REQUIRED ON)
 set(CMAKE_CXX_EXTENSIONS OFF)



(trafficserver) branch master updated (1306496ce3 -> 1157fc44b3)

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

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


from 1306496ce3 Fix release builds on linux (#10700)
 add 1157fc44b3 cmake: chown some paths at install time (#10698)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt|  6 ++
 src/iocore/aio/CMakeLists.txt => cmake/post_install.cmake | 14 +++---
 2 files changed, 13 insertions(+), 7 deletions(-)
 copy src/iocore/aio/CMakeLists.txt => cmake/post_install.cmake (75%)



(trafficserver) branch master updated: link inknet (#10713)

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

cmcfarlen 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 bc8f53c8aa link inknet (#10713)
bc8f53c8aa is described below

commit bc8f53c8aa30a77e0cde3be42879597d507cfdac
Author: Chris McFarlen 
AuthorDate: Wed Nov 1 15:08:07 2023 -0500

link inknet (#10713)
---
 src/tests/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 7349586316..336184e79b 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -137,6 +137,7 @@ target_compile_definitions(test_net PRIVATE 
LIBINKNET_UNIT_TEST_DIR=${LIBINKNET_
 target_link_libraries(test_net PRIVATE hdrs proxy)
 
 add_stubbed_test(EventSystem ${CMAKE_SOURCE_DIR}/src/iocore/net/NetVCTest.cc 
${CMAKE_SOURCE_DIR}/src/iocore/eventsystem/unit_tests/test_EventSystem.cc)
+target_link_libraries(EventSystem PRIVATE ts::inknet)
 add_stubbed_test(IOBuffer 
${CMAKE_SOURCE_DIR}/src/iocore/eventsystem/unit_tests/test_IOBuffer.cc)
 
 add_stubbed_test(



(trafficserver) branch master updated (bc8f53c8aa -> 84612346c1)

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

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


from bc8f53c8aa link inknet (#10713)
 add 84612346c1 Add ENABLE_EVENT_TRACKER option (#10677)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt | 4 
 1 file changed, 4 insertions(+)



(trafficserver) branch master updated (b070028fc5 -> fe86768e3e)

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

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


from b070028fc5 Remove the dependency for HttpConfig from iocore/cache 
(#10711)
 add fe86768e3e Fix libunwind findpackage script. (#10715)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt | 8 
 cmake/Findunwind.cmake | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)



(trafficserver) branch master updated: Cleanup AppVersionInfo and turn it into a singleton (#10712)

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

cmcfarlen 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 2344ea4ad5 Cleanup AppVersionInfo and turn it into a singleton (#10712)
2344ea4ad5 is described below

commit 2344ea4ad5f05f932132587ddcad654d16134f7b
Author: Chris McFarlen 
AuthorDate: Tue Nov 7 10:03:07 2023 -0600

Cleanup AppVersionInfo and turn it into a singleton (#10712)

* Cleanup AppVersionInfo and turn it into a singleton

* move version back to tscore
---
 include/iocore/eventsystem/EventSystem.h   |  1 +
 include/records/RecCore.h  |  2 +-
 include/tscore/Version.h   | 54 +-
 src/api/CMakeLists.txt |  8 ++--
 src/api/InkAPI.cc  |  6 +--
 src/api/{ => unit_tests}/test_Metrics.cc   |  0
 src/iocore/cache/CacheVC.cc|  2 +-
 src/iocore/cache/unit_tests/stub.cc|  4 --
 src/proxy/http/unit_tests/unit_test_main.cc|  4 --
 src/proxy/http2/test_HPACK.cc  |  6 +--
 src/proxy/logging/LogAccess.cc | 13 +++---
 src/proxy/logging/LogStandalone.cc | 30 ++--
 .../logging/unit-tests/benchmark_LogObject.cc  |  1 -
 src/records/P_RecCore.cc   |  6 ++-
 src/tests/CMakeLists.txt   |  2 +-
 src/traffic_cache_tool/CMakeLists.txt  |  2 +-
 src/traffic_crashlog/traffic_crashlog.cc   |  7 ++-
 src/traffic_ctl/CMakeLists.txt |  2 +-
 src/traffic_logcat/logcat.cc   |  5 +-
 src/traffic_logstats/logstats.cc   |  4 +-
 src/traffic_quic/traffic_quic.cc   |  5 +-
 src/traffic_server/Crash.cc|  4 +-
 src/traffic_server/traffic_server.cc   | 39 
 src/traffic_top/traffic_top.cc |  3 +-
 src/traffic_via/CMakeLists.txt |  2 +-
 src/traffic_via/traffic_via.cc | 10 ++--
 src/tscore/ArgParser.cc|  5 +-
 src/tscore/CMakeLists.txt  |  4 +-
 src/tscore/Regression.cc   |  4 +-
 src/tscore/Version.cc  | 31 +
 src/tscore/ink_args.cc |  4 +-
 src/tscore/unit_tests/test_Version.cc  |  8 ++--
 tools/jtest/jtest.cc   |  6 +--
 33 files changed, 174 insertions(+), 110 deletions(-)

diff --git a/include/iocore/eventsystem/EventSystem.h 
b/include/iocore/eventsystem/EventSystem.h
index dae0387965..9e80c8ee49 100644
--- a/include/iocore/eventsystem/EventSystem.h
+++ b/include/iocore/eventsystem/EventSystem.h
@@ -25,6 +25,7 @@
 #pragma once
 #define _I_EventSystem_h
 
+#include "tscore/Version.h"
 #include "tscore/ink_platform.h"
 #include "ts/apidefs.h"
 
diff --git a/include/records/RecCore.h b/include/records/RecCore.h
index f938e1c61e..981be93fff 100644
--- a/include/records/RecCore.h
+++ b/include/records/RecCore.h
@@ -83,7 +83,7 @@ RecErrT _RecRegisterStatFloat(RecT rec_type, const char 
*name, RecFloat data_def
 #define RecRegisterStatFloat(rec_type, name, data_default, persist_type) \
   _RecRegisterStatFloat((rec_type), (name), (data_default), 
REC_PERSISTENCE_TYPE(persist_type))
 
-RecErrT _RecRegisterStatString(RecT rec_type, const char *name, RecString 
data_default, RecPersistT persist_type);
+RecErrT _RecRegisterStatString(RecT rec_type, const char *name, RecStringConst 
data_default, RecPersistT persist_type);
 #define RecRegisterStatString(rec_type, name, data_default, persist_type) \
   _RecRegisterStatString((rec_type), (name), (data_default), 
REC_PERSISTENCE_TYPE(persist_type))
 
diff --git a/include/tscore/Version.h b/include/tscore/Version.h
index 7f89f9cfc9..215e7003ea 100644
--- a/include/tscore/Version.h
+++ b/include/tscore/Version.h
@@ -135,7 +135,7 @@ ModuleVersion::check(ModuleVersion const )
 
 class AppVersionInfo
 {
-public:
+private:
   int defined;
   char PkgStr[128];
   char AppStr[128];
@@ -148,7 +148,59 @@ public:
   char BldCompileFlagsStr[128];
   char FullVersionInfoStr[256];
 
+public:
   AppVersionInfo();
   void setup(const char *pkg_name, const char *app_name, const char 
*app_version, const char *build_date, const char *build_time,
  const char *build_machine, const char *build_person, const char 
*build_cflags);
+  void setup(const char *app_name);
+
+  const char *
+  package() const
+  {
+return PkgStr;
+  }
+  const char *
+  application() const
+  {
+return AppStr;
+  }
+  const char *
+  version() const
+  {
+return VersionStr;
+  }
+  const char *
+  build_number() const
+  {
+  

(trafficserver) branch master updated: Cleanup build with tsapibackend (#10725)

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

cmcfarlen 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 aa0b33958c Cleanup build with tsapibackend (#10725)
aa0b33958c is described below

commit aa0b33958c795260c9fd263b8c1009785a4fc3f8
Author: Chris McFarlen 
AuthorDate: Tue Nov 7 18:26:17 2023 -0600

Cleanup build with tsapibackend (#10725)

* Introduce tsapibackend

* unit tests only link with the library they are testing

* cleanup some links for traffic_ programs

* remove dup stubs

* run cmake-format

* add overridable_txn_vars

-

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt |   3 -
 .../uri_signing/unit_tests/CMakeLists.txt  |   2 +-
 src/api/CMakeLists.txt |  34 +++--
 src/api/HttpHookState.cc   | 103 +
 src/api/InkAPI.cc  |  85 ---
 src/iocore/aio/CMakeLists.txt  |  10 ++
 src/iocore/cache/CMakeLists.txt|  35 +
 src/iocore/cache/unit_tests/main.cc|  40 -
 src/iocore/cache/unit_tests/stub.cc|  37 +
 src/iocore/eventsystem/CMakeLists.txt  |  15 ++
 .../eventsystem/unit_tests/test_MIOBufferWriter.cc |   2 +-
 src/iocore/net/CMakeLists.txt  |  30 ++--
 src/iocore/net/libinknet_stub.cc   |  39 +
 src/mgmt/rpc/CMakeLists.txt|   2 +-
 src/proxy/CMakeLists.txt   |   2 +-
 src/tests/CMakeLists.txt   | 162 -
 src/traffic_layout/CMakeLists.txt  |  12 +-
 src/traffic_logcat/CMakeLists.txt  |  16 +-
 src/traffic_logstats/CMakeLists.txt|  12 +-
 19 files changed, 287 insertions(+), 354 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0bd4c2a04c..10d37354dd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -607,9 +607,6 @@ endif()
 if(ENABLE_CRIPTS)
   add_subdirectory(src/cripts)
 endif()
-if(BUILD_TESTING)
-  add_subdirectory(src/tests)
-endif()
 if(ENABLE_AUTEST)
   add_subdirectory(tests)
 endif()
diff --git a/plugins/experimental/uri_signing/unit_tests/CMakeLists.txt 
b/plugins/experimental/uri_signing/unit_tests/CMakeLists.txt
index 8e5360f762..0cca0ae709 100644
--- a/plugins/experimental/uri_signing/unit_tests/CMakeLists.txt
+++ b/plugins/experimental/uri_signing/unit_tests/CMakeLists.txt
@@ -28,7 +28,6 @@ add_executable(
   ${PROJECT_SOURCE_DIR}/parse.cc
   ${PROJECT_SOURCE_DIR}/timing.cc
   ${PROJECT_SOURCE_DIR}/uri_signing.cc
-  ${CMAKE_SOURCE_DIR}/src/shared/overridable_txn_vars.cc
 )
 target_compile_definitions(uri_signing_test PRIVATE UNITTEST)
 target_include_directories(uri_signing_test PRIVATE ${PROJECT_SOURCE_DIR})
@@ -44,6 +43,7 @@ target_link_libraries(
   ts::configmanager
   ts::logging
   ts::inknet
+  ts::overridable_txn_vars
   OpenSSL::SSL
   OpenSSL::Crypto
 )
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
index d785a3d6c8..fc6c15b2c7 100644
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -15,7 +15,9 @@
 #
 ###
 
-add_library(tsapi SHARED InkAPI.cc InkIOCoreAPI.cc)
+# plugin api *only*
+add_library(tsapi SHARED InkAPI.cc InkIOCoreAPI.cc FetchSM.cc # OSCP stapling
+)
 add_library(ts::tsapi ALIAS tsapi)
 
 set(TSAPI_PUBLIC_HEADERS
@@ -32,23 +34,31 @@ set(TSAPI_PUBLIC_HEADERS
 target_link_libraries(tsapi PRIVATE libswoc yaml-cpp::yaml-cpp PCRE::PCRE 
OpenSSL::SSL)
 set_target_properties(tsapi PROPERTIES PUBLIC_HEADER "${TSAPI_PUBLIC_HEADERS}")
 
+# Items common between api and other ts libraries
 add_library(
-  tsapicore STATIC
-  APIHook.cc
-  APIHooks.cc
-  Metrics.cc
-  ConfigUpdateCbTable.cc
-  InkContInternal.cc
-  InkVConnInternal.cc
-  FetchSM.cc
-  LifecycleAPIHooks.cc
-  DbgCtl.cc
+  tsapibackend
+  ConfigUpdateCbTable.cc # configmanager
+  InkContInternal.cc # proxy, http
+  InkVConnInternal.cc # proxy, http
+  APIHook.cc # iocore
+  APIHooks.cc # proxy
+  LifecycleAPIHooks.cc # proxy, http
+  HttpHookState.cc # proxy, http
+)
+add_library(ts::tsapibackend ALIAS tsapibackend)
+target_link_libraries(
+  tsapibackend
+  PUBLIC ts::inknet ts::http
+  PRIVATE ts::proxy ts::hdrs ts::tscore
 )
+
+# Items that even tscore can depend on
+add_library(tsapicore Metrics.cc DbgCtl.cc)
 add_library(ts::tsapicore ALIAS tsapicore)
 target_link_libraries(tsapicore PRIVATE ts::tscore)
 set_target_properties(tsapicore PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
 
-install(TARGETS tsapi PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ts)
+install(TARGETS tsapi tsapicore tsapibackend PUBLIC_HEADER D

(trafficserver) branch master updated: cmake: use cmake to implement layout setup (#10695)

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

cmcfarlen 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 a6e2824e14 cmake: use cmake to implement layout setup (#10695)
a6e2824e14 is described below

commit a6e2824e14621321f95ce94767a96e8ee7ba2d5d
Author: Chris McFarlen 
AuthorDate: Mon Oct 30 18:53:57 2023 -0500

cmake: use cmake to implement layout setup (#10695)

* cmake: use cmake to implement layout setup

* add layout.cmake

* add layout.cmake

* add layout-default preset

-

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt   |  6 ++--
 CMakePresets.json| 19 ++
 cmake/add_atsplugin.cmake|  2 +-
 cmake/layout.cmake   | 70 
 configs/CMakeLists.txt   |  4 +--
 include/tscore/ink_config.h.cmake.in | 28 +++
 6 files changed, 110 insertions(+), 19 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 97d2eb19ee..bbced889e7 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,6 +41,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 list(APPEND CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
 
+include(layout)
+
 if(CMAKE_BUILD_TYPE STREQUAL "Debug")
   add_compile_definitions(DEBUG _DEBUG)
 endif()
@@ -694,8 +696,8 @@ add_custom_target(
 )
 
 # Create an empty directories for ATS runtime
-install(DIRECTORY DESTINATION var/log/trafficserver)
-install(DIRECTORY DESTINATION var/trafficserver)
+install(DIRECTORY DESTINATION ${CMAKE_INSTALL_LOGDIR})
+install(DIRECTORY DESTINATION ${CMAKE_INSTALL_RUNSTATEDIR})
 
 # Display build summary
 include(CMakePrintHelpers)
diff --git a/CMakePresets.json b/CMakePresets.json
index 399ee240aa..2474514675 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -17,6 +17,25 @@
 "CMAKE_COMPILE_WARNING_AS_ERROR": "ON"
   }
 },
+{
+  "name": "layout-defaults",
+  "displayName": "Default install layout paths template",
+  "hidden": true,
+  "cacheVariables": {
+"CMAKE_INSTALL_BINDIR": "bin",
+"CMAKE_INSTALL_SBINDIR": "bin",
+"CMAKE_INSTALL_LIBDIR": "lib",
+"CMAKE_INSTALL_SYSCONFDIR": "etc/trafficserver",
+"CMAKE_INSTALL_DATADIR": "share/trafficserver",
+"CMAKE_INSTALL_INCLUDEDIR": "include",
+"CMAKE_INSTALL_LIBEXECDIR": "libexec/trafficserver",
+"CMAKE_INSTALL_RUNSTATEDIR": "var/trafficserver",
+"CMAKE_INSTALL_INFODIR": "share/info",
+"CMAKE_INSTALL_MANDIR": "share/man",
+"CMAKE_INSTALL_LOGDIR": "var/log/trafficserver",
+"CMAKE_INSTALL_CACHEDIR": "var/trafficserver"
+  }
+},
 {
   "name": "autest",
   "inherits": ["default"],
diff --git a/cmake/add_atsplugin.cmake b/cmake/add_atsplugin.cmake
index 27f5d8c1de..7f6ea485f5 100644
--- a/cmake/add_atsplugin.cmake
+++ b/cmake/add_atsplugin.cmake
@@ -22,7 +22,7 @@ function(add_atsplugin name)
   target_link_libraries(${name} PRIVATE ts::tsapi)
   set_target_properties(${name} PROPERTIES PREFIX "")
   set_target_properties(${name} PROPERTIES SUFFIX ".so")
-  install(TARGETS ${name} DESTINATION libexec/trafficserver)
+  install(TARGETS ${name} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR})
 endfunction()
 
 if(APPLE)
diff --git a/cmake/layout.cmake b/cmake/layout.cmake
new file mode 100644
index 00..8883f1740c
--- /dev/null
+++ b/cmake/layout.cmake
@@ -0,0 +1,70 @@
+###
+#
+#  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.
+#
+###
+
+
+# trafficserver default layout:
+set(CMAKE_

(trafficserver) branch master updated (a6e2824e14 -> d13cefafbe)

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

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


from a6e2824e14 cmake: use cmake to implement layout setup (#10695)
 add d13cefafbe cmake: resolve install prefix later to pickup prefix 
override (#10693)

No new revisions were added by this update.

Summary of changes:
 cmake/install_configs.cmake | 5 +++--
 configs/CMakeLists.txt  | 2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)



(trafficserver) branch master updated: cmake: add ENABLE_FIPS option (#10679)

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

cmcfarlen 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 7f299f4443 cmake: add ENABLE_FIPS option (#10679)
7f299f4443 is described below

commit 7f299f44430894b176da206e3e011c215230314e
Author: Chris McFarlen 
AuthorDate: Mon Oct 30 19:50:50 2023 -0500

cmake: add ENABLE_FIPS option (#10679)

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt   | 3 +++
 include/tscore/ink_config.h.cmake.in | 1 +
 2 files changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbced889e7..709ceb8c2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -107,6 +107,7 @@ auto_option(UNWIND FEATURE_VAR TS_USE_REMOTE_UNWINDING 
PACKAGE_DEPENDS unwind)
 
 option(ENABLE_ASAN "Use address sanitizer (default OFF)")
 option(ENABLE_FUZZING "Enable fuzzing (default OFF)")
+option(ENABLE_FIPS "Enable fips compliance (default OFF)")
 option(BUILD_REGRESSION_TESTING "Build regression tests (default ON)" ON)
 option(BUILD_EXPERIMENTAL_PLUGINS "Build the experimental plugins (default 
OFF)")
 set(DEFAULT_STACK_SIZE
@@ -539,6 +540,8 @@ if(ENABLE_FUZZING)
   endif()
 endif()
 
+set(TS_ENABLE_FIPS ${ENABLE_FIPS})
+
 # Common includes for everyone
 include_directories(${CMAKE_SOURCE_DIR}/include ${CMAKE_BINARY_DIR}/include)
 
diff --git a/include/tscore/ink_config.h.cmake.in 
b/include/tscore/ink_config.h.cmake.in
index 2e99ad4e6b..69b3bfeba4 100644
--- a/include/tscore/ink_config.h.cmake.in
+++ b/include/tscore/ink_config.h.cmake.in
@@ -186,6 +186,7 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
 #cmakedefine01 TS_USE_DIAGS
 #cmakedefine01 TS_USE_EPOLL
 #cmakedefine01 TS_USE_FAST_SDK
+#cmakedefine01 TS_ENABLE_FIPS
 #cmakedefine01 TS_USE_GET_DH_2048_256
 #cmakedefine01 TS_USE_HELLO_CB
 #cmakedefine01 TS_USE_HWLOC



[trafficserver] branch master updated: generate svg files from uml for docs (#10667)

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

cmcfarlen 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 27b4c43cbd generate svg files from uml for docs (#10667)
27b4c43cbd is described below

commit 27b4c43cbdb77fdaf3b5a8920e29987f694d7595
Author: Chris McFarlen 
AuthorDate: Tue Oct 24 14:39:07 2023 -0500

generate svg files from uml for docs (#10667)

Co-authored-by: Chris McFarlen 
---
 doc/CMakeLists.txt | 46 +-
 1 file changed, 45 insertions(+), 1 deletion(-)

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 973c5269e2..af7fc3860d 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -29,6 +29,49 @@ configure_file(ext/traffic-server.cmake.in.py 
ext/traffic-server.py)
 configure_file(conf.cmake.in.py conf.py)
 configure_file(manpages.cmake.in.py manpages.py)
 
+# copy static directory to build
+add_custom_target(
+  generate_docs_setup
+  COMMENT "Copy static files to build directory"
+  COMMAND ${CMAKE_COMMAND} -E copy_directory
+  ${CMAKE_CURRENT_SOURCE_DIR}/static
+  ${CMAKE_CURRENT_BINARY_DIR}/static
+)
+
+# generate svg files from uml files
+set(UML_FILES
+  uml/JsonRPCManager.uml
+  uml/TLS-Bridge-Messages.uml
+  uml/TLS-Bridge-Plugin.uml
+  uml/hdr-heap-class.plantuml
+  uml/hdr-heap-str-alloc.plantuml
+  uml/host-resolve.plantuml
+  uml/l4-basic-sequence.uml
+  uml/l4-example-cdn-layout.uml
+  uml/l4-pre-warming-overview.uml
+  uml/l4-sni-routing-seq.uml
+  uml/l4-tcp-routing.uml
+  uml/traffic_ctl-class-diagram.uml
+  uml/url_rewrite.plantuml
+)
+# unfortunately, sphinx can't look else for files than its source directory
+# so these files must be create in the source tree
+foreach(UML ${UML_FILES})
+  cmake_path(GET UML STEM uml_name)
+  list(APPEND SVG_FILES ${CMAKE_CURRENT_SOURCE_DIR}/uml/images/${uml_name}.svg)
+  add_custom_command(
+OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/uml/images/${uml_name}.svg
+COMMAND ${Java_JAVA_EXECUTABLE} -jar ${PLANTUML_JAR} -o 
${CMAKE_CURRENT_SOURCE_DIR}/uml/images -tsvg ${CMAKE_CURRENT_SOURCE_DIR}/${UML}
+DEPENDS ${UML}
+VERBATIM
+  )
+endforeach()
+add_custom_target(
+  generate_svg_from_uml
+  DEPENDS
+  ${SVG_FILES}
+)
+
 # Docs are built with python so we need a target to setup pipenv
 set(RUNPIPENV PIPENV_PIPFILE=${CMAKE_CURRENT_SOURCE_DIR}/Pipfile ${PipEnv})
 add_custom_command(
@@ -44,9 +87,10 @@ add_custom_target(
   COMMAND ${RUNPIPENV} run python ${CMAKE_CURRENT_SOURCE_DIR}/checkvers.py 
--check-version
   COMMAND ${RUNPIPENV} run python -m sphinx -c ${CMAKE_CURRENT_BINARY_DIR} -b 
html ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}/docbuild/html
-  DEPENDS Pipfile.lock
+  DEPENDS generate_docs_setup generate_svg_from_uml Pipfile.lock
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 )
+
 #add_custom_command(
 #TARGET generate_docs
 #POST_BUILD



[trafficserver] branch master updated: cmake: disable in-source builds. (#10661)

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

cmcfarlen 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 28bf6321a9 cmake: disable in-source builds. (#10661)
28bf6321a9 is described below

commit 28bf6321a9557f6190f9bab219e257243d327c9d
Author: Chris McFarlen 
AuthorDate: Tue Oct 24 14:39:23 2023 -0500

cmake: disable in-source builds. (#10661)

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt | 4 
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fd337ae2c0..8a3ea44a36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,10 @@
 #
 ###
 
+if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
+  message(FATAL_ERROR "In source builds are disabled.  Use a preset, -B or run 
from a different directory")
+endif()
+
 cmake_minimum_required(VERSION 3.20..3.27)
 project(ats VERSION 10.0.0)
 



[trafficserver] branch master updated: cmake: Install include files (#10650)

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

cmcfarlen 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 dbb5efb214 cmake: Install include files (#10650)
dbb5efb214 is described below

commit dbb5efb214118cfbdbd7bcd15bf4cc71390ae9fe
Author: Chris McFarlen 
AuthorDate: Tue Oct 24 13:10:34 2023 -0500

cmake: Install include files (#10650)

* cmake: Install include files

* also include tscpp/api headers.

-

Co-authored-by: Chris McFarlen 
---
 lib/CMakeLists.txt|   2 +-
 lib/swoc/CMakeLists.txt   | 131 +-
 src/api/CMakeLists.txt|  16 +-
 src/tscpp/api/CMakeLists.txt  |  36 +++-
 src/tscpp/util/CMakeLists.txt |  23 +++-
 5 files changed, 151 insertions(+), 57 deletions(-)

diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 287bc6bbcb..7df31a2e6d 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -38,4 +38,4 @@ set(SWOC_INCLUDE_DIR
 add_library(catch2::catch2 INTERFACE IMPORTED GLOBAL)
 target_include_directories(catch2::catch2 INTERFACE 
"${CMAKE_CURRENT_SOURCE_DIR}/catch2")
 
-install(TARGETS libswoc fastlz)
+install(TARGETS fastlz)
diff --git a/lib/swoc/CMakeLists.txt b/lib/swoc/CMakeLists.txt
index 8ecd08f2f1..38770302fc 100644
--- a/lib/swoc/CMakeLists.txt
+++ b/lib/swoc/CMakeLists.txt
@@ -5,46 +5,51 @@ set(LIBSWOC_VERSION "1.5.5")
 set(CMAKE_CXX_STANDARD 17)
 cmake_policy(SET CMP0087 NEW)
 # override "lib64" to be "lib" unless the user explicitly sets it.
-set(CMAKE_INSTALL_LIBDIR "lib" CACHE STRING "directory for libraries" FORCE)
+set(CMAKE_INSTALL_LIBDIR
+"lib"
+CACHE STRING "directory for libraries" FORCE
+)
 include(GNUInstallDirs)
 include(CMakeDependentOption)
 
-cmake_dependent_option(LIBSWOC_INSTALL
-"Enable generation of libswoc install targets" ON
-"NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT" OFF)
+cmake_dependent_option(
+  LIBSWOC_INSTALL "Enable generation of libswoc install targets" ON "NOT 
CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT"
+  OFF
+)
 
 set(HEADER_FILES
-include/swoc/swoc_version.h
-include/swoc/ArenaWriter.h
-include/swoc/BufferWriter.h
-include/swoc/bwf_base.h
-include/swoc/bwf_ex.h
-include/swoc/bwf_ip.h
-include/swoc/bwf_std.h
-include/swoc/DiscreteRange.h
-include/swoc/Errata.h
-include/swoc/IntrusiveDList.h
-include/swoc/IntrusiveHashMap.h
-include/swoc/swoc_ip.h
-include/swoc/IPEndpoint.h
-include/swoc/IPAddr.h
-include/swoc/IPSrv.h
-include/swoc/IPRange.h
-include/swoc/Lexicon.h
-include/swoc/MemArena.h
-include/swoc/MemSpan.h
-include/swoc/Scalar.h
-include/swoc/TextView.h
-include/swoc/swoc_file.h
-include/swoc/swoc_meta.h
-include/swoc/string_view.h
-include/swoc/Vectray.h
-)
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/ArenaWriter.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/BufferWriter.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/DiscreteRange.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/Errata.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/HashFNV.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/IPAddr.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/IPEndpoint.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/IPRange.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/IPSrv.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/IntrusiveDList.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/IntrusiveHashMap.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/Lexicon.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/MemArena.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/MemSpan.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/RBTree.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/Scalar.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/TextView.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/Vectray.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/bwf_base.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/bwf_ex.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/bwf_fwd.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/bwf_ip.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/bwf_std.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/string_view_util.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/swoc_file.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/swoc_ip.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/swoc_meta.h
+${CMAKE_CURRENT_SOURCE_DIR}/include/swoc/swoc_version.h
+)
 
 # These are external but required.
-set(EXTERNAL_HEADER_FILES
-include/swoc/ext/HashFNV.h
-)
+set(EXTERNAL_HEADER_FILES include/swoc/ext/HashFNV.h)
 
 set(CC_FILES
 src/bw_format.cc
@@ -57,39 +62,59 @@ set(CC_FILES
 src/swoc_file.cc
 src/TextView.cc
   

[trafficserver] branch master updated: Manually apply upstream fix for deprecation warning (#10630)

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

cmcfarlen 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 3114ca72db Manually apply upstream fix for deprecation warning (#10630)
3114ca72db is described below

commit 3114ca72db2b987877add044cf9c15fbf01fdb5d
Author: Chris McFarlen 
AuthorDate: Tue Oct 17 11:17:40 2023 -0500

Manually apply upstream fix for deprecation warning (#10630)
---
 lib/yamlcpp/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/yamlcpp/CMakeLists.txt b/lib/yamlcpp/CMakeLists.txt
index c02fe28882..6275d48893 100644
--- a/lib/yamlcpp/CMakeLists.txt
+++ b/lib/yamlcpp/CMakeLists.txt
@@ -1,5 +1,6 @@
 # 3.5 is actually available almost everywhere, but this a good minimum
-cmake_minimum_required(VERSION 3.4)
+# manual edit the upper version limit from upstream to avoid deprecation 
warning
+cmake_minimum_required(VERSION 3.4...3.14)
 
 # enable MSVC_RUNTIME_LIBRARY target property
 # see https://cmake.org/cmake/help/latest/policy/CMP0091.html



[trafficserver] branch master updated: Cmake freebsd fix (#10631)

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

cmcfarlen 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 d416614d02 Cmake freebsd fix (#10631)
d416614d02 is described below

commit d416614d026988224199d398e3cbebcec7b39efe
Author: Chris McFarlen 
AuthorDate: Tue Oct 17 12:28:38 2023 -0500

Cmake freebsd fix (#10631)

* add freebsd specific section with pthread

* cleanup

-

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt | 9 +
 1 file changed, 9 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42236f369a..4c339d7979 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -507,6 +507,15 @@ if(HOST_OS STREQUAL "darwin")
   set(CMAKE_MACOSX_RPATH 1)
 endif(HOST_OS STREQUAL "darwin")
 
+if(HOST_OS STREQUAL "freebsd")
+  set(CMAKE_THREAD_LIBS_INIT "-lpthread")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+  set(CMAKE_HAVE_THREADS_LIBRARY 1)
+  set(CMAKE_USE_WIN32_THREADS_INIT 0)
+  set(CMAKE_USE_PTHREADS_INIT 1)
+  set(THREADS_PREFER_PTHREAD_FLAG ON)
+endif()
+
 # Set the rpath for installed binaries
 set(CMAKE_INSTALL_RPATH 
"${CMAKE_INSTALL_PREFIX}/lib;${CMAKE_INSTALL_PREFIX}/lib64")
 set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)



[trafficserver] branch master updated (e1d39607e3 -> aa6df8acd0)

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

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


from e1d39607e3 CID1508860: double lock confusion (#10443)
 add aa6df8acd0 Set the proper variable when find_package fails to find the 
package (#10468)

No new revisions were added by this update.

Summary of changes:
 cmake/AutoOptionHelpers.cmake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[trafficserver] branch master updated: CID1508860: double lock confusion (#10443)

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

cmcfarlen 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 e1d39607e3 CID1508860: double lock confusion (#10443)
e1d39607e3 is described below

commit e1d39607e35adf430162c01ad8d731a735072c40
Author: Chris McFarlen 
AuthorDate: Tue Sep 19 15:05:34 2023 -0500

CID1508860: double lock confusion (#10443)

* CID1508860: double lock confusion

* fix renames inside conditional code. Fix casts

-

Co-authored-by: Chris McFarlen 
---
 iocore/aio/AIO.cc | 24 
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index 889002715d..d08a979a3c 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -77,8 +77,9 @@ AIOTestData::ink_aio_stats(int event, void *d)
   ink_hrtime now   = ink_get_hrtime();
   double time_msec = (double)(now - start) / (double)HRTIME_MSECOND;
   int i= (aio_reqs[0] == nullptr) ? 1 : 0;
-  for (; i < num_filedes; ++i)
+  for (; i < num_filedes; ++i) {
 printf("%0.2f\t%i\t%i\t%i\n", time_msec, aio_reqs[i]->filedes, 
aio_reqs[i]->pending, aio_reqs[i]->queued);
+  }
   printf("Num Requests: %i Num Queued: %i num Moved: %i\n\n", data->num_req, 
data->num_queue, data->num_temp);
   eventProcessor.schedule_in(this, HRTIME_MSECONDS(50), ET_CALL);
   return EVENT_DONE;
@@ -306,7 +307,7 @@ aio_queue_req(AIOCallbackInternal *op, int fromAPI = 0)
   op->link.next  = nullptr;
   op->link.prev  = nullptr;
 #ifdef AIO_STATS
-  ink_atomic_increment((int *)>num_req, 1);
+  ink_atomic_increment(>num_req, 1);
 #endif
   if (!fromAPI && (!req || req->filedes != op->aiocb.aio_fildes)) {
 /* search for the matching file descriptor */
@@ -423,9 +424,8 @@ ink_aio_thread_num_set(int thread_num)
 void *
 AIOThreadInfo::aio_thread_main(AIOThreadInfo *thr_info)
 {
-  AIO_Reqs *my_aio_req  = thr_info->req;
-  AIO_Reqs *current_req = nullptr;
-  AIOCallback *op   = nullptr;
+  AIO_Reqs *my_aio_req = thr_info->req;
+  AIOCallback *op  = nullptr;
   ink_mutex_acquire(_aio_req->aio_mutex);
   for (;;) {
 do {
@@ -433,7 +433,6 @@ AIOThreadInfo::aio_thread_main(AIOThreadInfo *thr_info)
 ink_mutex_release(_aio_req->aio_mutex);
 return nullptr;
   }
-  current_req = my_aio_req;
   /* check if any pending requests on the atomic list */
   aio_move(my_aio_req);
   if (!(op = my_aio_req->aio_todo.pop())) {
@@ -441,9 +440,11 @@ AIOThreadInfo::aio_thread_main(AIOThreadInfo *thr_info)
   }
 #ifdef AIO_STATS
   num_requests--;
-  current_req->queued--;
-  ink_atomic_increment((int *)_req->pending, 1);
+  my_aio_req->queued--;
+  ink_atomic_increment(_aio_req->pending, 1);
 #endif
+  ink_mutex_release(_aio_req->aio_mutex);
+
   // update the stats;
   if (op->aiocb.aio_lio_opcode == LIO_WRITE) {
 Metrics::increment(aio_rsb.write_count);
@@ -452,11 +453,10 @@ AIOThreadInfo::aio_thread_main(AIOThreadInfo *thr_info)
 Metrics::increment(aio_rsb.read_count);
 Metrics::increment(aio_rsb.kb_read, op->aiocb.aio_nbytes >> 10);
   }
-  ink_mutex_release(_req->aio_mutex);
-  cache_op((AIOCallbackInternal *)op);
-  ink_atomic_increment(_req->requests_queued, -1);
+  cache_op(reinterpret_cast(op));
+  ink_atomic_increment(_aio_req->requests_queued, -1);
 #ifdef AIO_STATS
-  ink_atomic_increment((int *)_req->pending, -1);
+  ink_atomic_increment(_aio_req->pending, -1);
 #endif
   op->link.prev = nullptr;
   op->link.next = nullptr;



[trafficserver] branch master updated: cmake: bigobj subdir has executables, not plugins (#10481)

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

cmcfarlen 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 21539517ba cmake: bigobj subdir has executables, not plugins (#10481)
21539517ba is described below

commit 21539517ba320a37f2b844d10b53427aaa77e739
Author: Chris McFarlen 
AuthorDate: Thu Sep 21 13:47:26 2023 -0500

cmake: bigobj subdir has executables, not plugins (#10481)

Co-authored-by: Chris McFarlen 
---
 tests/gold_tests/bigobj/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/gold_tests/bigobj/CMakeLists.txt 
b/tests/gold_tests/bigobj/CMakeLists.txt
index ba725bf4a7..b56709f853 100644
--- a/tests/gold_tests/bigobj/CMakeLists.txt
+++ b/tests/gold_tests/bigobj/CMakeLists.txt
@@ -15,5 +15,5 @@
 #
 ###
 
-add_autest_plugin(check_ramp check_ramp.c)
-add_autest_plugin(push_request push_request.c)
+add_executable(check_ramp check_ramp.c)
+add_executable(push_request push_request.c)



[trafficserver] branch master updated (21539517ba -> 26eed77592)

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

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


from 21539517ba cmake: bigobj subdir has executables, not plugins (#10481)
 add 26eed77592 add conveinience function to lookup name->IntType* (#10474)

No new revisions were added by this update.

Summary of changes:
 include/api/Metrics.h   | 11 +++
 src/api/test_Metrics.cc | 13 +
 2 files changed, 24 insertions(+)



[trafficserver] branch master updated: Move sandbox path into runtime directory (#10518)

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

cmcfarlen 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 2d0553fd25 Move sandbox path into runtime directory (#10518)
2d0553fd25 is described below

commit 2d0553fd2506d452589525750c4d5dc728577e61
Author: Chris McFarlen 
AuthorDate: Mon Sep 25 11:21:47 2023 -0500

Move sandbox path into runtime directory (#10518)
---
 tests/gold_tests/jsonrpc/plugins/jsonrpc_plugin_handler_test.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gold_tests/jsonrpc/plugins/jsonrpc_plugin_handler_test.cc 
b/tests/gold_tests/jsonrpc/plugins/jsonrpc_plugin_handler_test.cc
index 96b1bc713f..83567dc954 100644
--- a/tests/gold_tests/jsonrpc/plugins/jsonrpc_plugin_handler_test.cc
+++ b/tests/gold_tests/jsonrpc/plugins/jsonrpc_plugin_handler_test.cc
@@ -163,7 +163,7 @@ CB_handle_rpc_io_call(TSCont contp, TSEvent event, void 
*data)
 
   // Basic stuffs here.
   // We open the file if exist, we update/add the host in the structure. For 
simplicity we do not delete anything.
-  fs::path sandbox  = fs::current_path();
+  fs::path sandbox  = fs::current_path() / "runtime";
   fs::path dumpFile = sandbox / "my_test_plugin_dump.yaml";
   bool newFile{false};
   if (!fs::exists(dumpFile)) {



[trafficserver] branch master updated: cmake: Update gaps in config checks (#10489)

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

cmcfarlen 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 8bcc93f7ae cmake: Update gaps in config checks (#10489)
8bcc93f7ae is described below

commit 8bcc93f7ae392677408c225796100d809e758cf2
Author: Chris McFarlen 
AuthorDate: Mon Sep 25 09:03:12 2023 -0500

cmake: Update gaps in config checks (#10489)

* Update gaps in config checks

* fix a few more issues

* test build fixes

* fixup more tls autests

-

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt   | 80 
 include/tscore/ink_config.h.cmake.in | 60 ++
 plugins/experimental/cookie_remap/CMakeLists.txt |  1 +
 tests/gold_tests/chunked_encoding/CMakeLists.txt |  2 +-
 tests/gold_tests/timeout/CMakeLists.txt  |  2 +-
 tests/gold_tests/tls/CMakeLists.txt  |  5 --
 6 files changed, 143 insertions(+), 7 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c871c59903..928accafe3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,29 +146,49 @@ include(CheckIncludeFile)
 include(CheckIncludeFiles)
 include(CheckIncludeFileCXX)
 include(CheckSymbolExists)
+include(CheckTypeSize)
+include(CheckSourceCompiles)
+include(CheckStructHasMember)
 
+CHECK_INCLUDE_FILE(alloca.h HAVE_ALLOCA_H)
+CHECK_INCLUDE_FILE(cpio.h HAVE_CPIO_H)
 CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
 CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
 CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
 CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
+CHECK_INCLUDE_FILE(ifaddrs.h HAVE_IFADDRS_H)
 CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
 CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
 CHECK_INCLUDE_FILE(linux/major.h HAVE_LINUX_MAJOR_H)
+CHECK_INCLUDE_FILE(malloc.h HAVE_MALLOC_H)
+CHECK_INCLUDE_FILE(mcheck.h HAVE_MCHECK_H)
+CHECK_INCLUDE_FILE(machine/endian.h HAVE_MACHINE_ENDIAN_H)
+CHECK_INCLUDE_FILE(sys/byteorder.h HAVE_SYS_BYTEORDER_H)
 CHECK_INCLUDE_FILE(sys/disk.h HAVE_SYS_DISK_H)
 CHECK_INCLUDE_FILE(sys/disklabel.h HAVE_SYS_DISKLABEL_H)
+CHECK_INCLUDE_FILE(sys/endian.h HAVE_SYS_ENDIAN_H)
 CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H)
 CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
+CHECK_INCLUDE_FILE(sys/sockio.h HAVE_SYS_SOCKIO_H)
 CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
+CHECK_INCLUDE_FILE(sys/statfs.h HAVE_SYS_STATFS_H)
 CHECK_INCLUDE_FILE(sys/statvfs.h HAVE_SYS_STATVFS_H)
 CHECK_INCLUDE_FILE(sys/uio.h HAVE_SYS_UIO_H)
+CHECK_INCLUDE_FILE(sys/sysinfo.h HAVE_SYS_SYSINFO_H)
 CHECK_INCLUDE_FILE(sys/sysmacros.h HAVE_SYS_SYSMACROS_H)
+CHECK_INCLUDE_FILE(sys/systeminfo.h HAVE_SYS_SYSTEMINFO_H)
+CHECK_INCLUDE_FILE(sys/sysctl.h HAVE_SYS_SYSCTL_H)
 CHECK_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H)
 CHECK_INCLUDE_FILE(sys/mount.h HAVE_SYS_MOUNT_H)
 CHECK_INCLUDE_FILE(sys/param.h HAVE_SYS_PARAM_H)
+CHECK_INCLUDE_FILE(sysexits.h HAVE_SYSEXITS_H)
+CHECK_INCLUDE_FILE(stropts.h HAVE_STROPTS_H)
 CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+CHECK_INCLUDE_FILE(values.h HAVE_VALUES_H)
 CHECK_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H)
 CHECK_INCLUDE_FILE(netinet/in_systm.h HAVE_NETINET_IN_SYSTM_H)
 CHECK_INCLUDE_FILE(netinet/tcp.h HAVE_NETINET_TCP_H)
+CHECK_INCLUDE_FILE(netinet/ip.h HAVE_NETINET_IP_H)
 CHECK_INCLUDE_FILE(netinet/ip_icmp.h HAVE_NETINET_IP_ICMP_H)
 CHECK_INCLUDE_FILE(netdb.h HAVE_NETDB_H)
 CHECK_INCLUDE_FILE(arpa/inet.h HAVE_ARPA_INET_H)
@@ -267,6 +287,10 @@ set(HAVE_NCURSES_H ${CURSES_HAVE_NCURSES_H})
 set(HAVE_NCURSES_CURSES_H ${CURSES_HAVE_NCURSES_CURSES_H})
 set(HAVE_NCURSES_NCURSES_H ${CURSES_HAVE_NCURSES_NCURSES_H})
 
+# curl is used in traffic_top
+find_package(CURL)
+set(HAVE_CURL ${CURL_FOUND})
+
 include(Check128BitCas)
 include(ConfigureTransparentProxy)
 
@@ -287,10 +311,29 @@ check_symbol_exists(kqueue "sys/event.h" TS_USE_KQUEUE)
 set(CMAKE_REQUIRED_LIBRARIES uring)
 check_symbol_exists(io_uring_queue_init "liburing.h" HAVE_IOURING)
 unset(CMAKE_REQUIRED_LIBRARIES)
+check_symbol_exists(getpagesize unistd.h HAVE_GETPAGESIZE)
+check_symbol_exists(getpeereid unistd.h HAVE_GETPEEREID)
+check_symbol_exists(getpeerucred unistd.h HAVE_GETPEERUCRED)
 check_symbol_exists(getresuid unistd.h HAVE_GETRESUID)
 check_symbol_exists(getresgid unistd.h HAVE_GETRESGID)
+check_symbol_exists(malloc_usable_size malloc.h HAVE_MALLOC_USABLE_SIZE)
+check_symbol_exists(mcheck_pedantic mcheck.h HAVE_MCHECK_PEDANTIC)
+check_symbol_exists(posix_fadvise fcntl.h HAVE_POSIX_FADVISE)
+check_symbol_exists(posix_fallocate fcntl.h HAVE_POSIX_FALLOCATE)
+check_symbol_exists(posix_madvise sys/mman.h HAVE_POSIX_MADVISE)
 check_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4)
 check_symbol_exists(eventfd sys/eventfd.h HAVE_EVENTFD)
+check_symbol_exists(sysconf unistd.h HAVE_SYSCONF)
+check_symbol_exists(recvmmsg sys/so

[trafficserver] branch master updated: cmake: fix support for je/mi malloc and the mallocallocator (#10407)

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

cmcfarlen 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 d7f27c4145 cmake: fix support for je/mi malloc and the mallocallocator 
(#10407)
d7f27c4145 is described below

commit d7f27c4145686ac4996a09084746438be639b6f0
Author: Chris McFarlen 
AuthorDate: Mon Sep 25 16:59:12 2023 -0500

cmake: fix support for je/mi malloc and the mallocallocator (#10407)

* fix support for je/mi malloc and the mallocallocator

* also fix includes for jemiallocator

* fix target for linking jemalloc

* restore default off to jemalloc auto_option

-

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt| 7 +--
 include/tscore/JeMiAllocator.h| 4 
 include/tscore/ink_config.h.cmake.in  | 2 ++
 include/tscore/ink_memory.h   | 4 
 plugins/experimental/memory_profile/memory_profile.cc | 4 +---
 5 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 928accafe3..623dfbf5a4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -51,12 +51,13 @@ include(AutoOptionHelpers)
 auto_option(HWLOC FEATURE_VAR TS_USE_HWLOC PACKAGE_DEPENDS hwloc)
 auto_option(JEMALLOC
 FEATURE_VAR TS_HAS_JEMALLOC
+DEFAULT OFF
 PACKAGE_DEPENDS jemalloc
 )
 auto_option(MIMALLOC
 FEATURE_VAR TS_HAS_MIMALLOC
-PACKAGE_DEPENDS mimalloc
 DEFAULT OFF
+PACKAGE_DEPENDS mimalloc
 )
 auto_option(LUAJIT PACKAGE_DEPENDS LuaJIT)
 auto_option(UNWIND FEATURE_VAR TS_USE_REMOTE_UNWINDING PACKAGE_DEPENDS unwind)
@@ -67,6 +68,7 @@ option(BUILD_REGRESSION_TESTING "Build regression tests 
(default ON)" ON)
 option(BUILD_EXPERIMENTAL_PLUGINS "Build the experimental plugins (default 
OFF)")
 set(DEFAULT_STACK_SIZE 1048576 CACHE STRING "Default stack size (default 
1048576)")
 option(ENABLE_FAST_SDK "Use fast SDK APIs (default OFF)")
+option(ENABLE_MALLOC_ALLOCATOR "Use direct malloc allocator over freelist 
allocator (default OFF)")
 option(ENABLE_DOCS "Build docs (default OFF)")
 option(ENABLE_DISK_FAILURE_TESTS "Build disk failure tests (enables AIO fault 
injection, default OFF)" OFF)
 if(ENABLE_DISK_FAILURE_TESTS)
@@ -249,7 +251,7 @@ if(TS_HAS_JEMALLOC AND TS_HAS_MIMALLOC)
 endif()
 
 if(TS_HAS_JEMALLOC)
-link_libraries(jemalloc)
+link_libraries(jemalloc::jemalloc)
 elseif(TS_HAS_MIMALLOC)
 link_libraries(mimalloc)
 endif()
@@ -278,6 +280,7 @@ if(ENABLE_ASAN)
 add_link_options(-fsanitize=address)
 endif()
 
+set(TS_USE_MALLOC_ALLOCATOR ${ENABLE_MALLOC_ALLOCATOR})
 find_package(ZLIB REQUIRED)
 
 # ncurses is used in traffic_top
diff --git a/include/tscore/JeMiAllocator.h b/include/tscore/JeMiAllocator.h
index b7b35ee4bb..3976778d0b 100644
--- a/include/tscore/JeMiAllocator.h
+++ b/include/tscore/JeMiAllocator.h
@@ -32,7 +32,11 @@
 #include 
 
 #if TS_HAS_JEMALLOC
+#if __has_include()
 #include 
+#else
+#include 
+#endif
 #if (JEMALLOC_VERSION_MAJOR == 0)
 #error jemalloc has bogus version
 #endif
diff --git a/include/tscore/ink_config.h.cmake.in 
b/include/tscore/ink_config.h.cmake.in
index 7ab4ce20b9..9c44ba14e9 100644
--- a/include/tscore/ink_config.h.cmake.in
+++ b/include/tscore/ink_config.h.cmake.in
@@ -176,6 +176,7 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
 #cmakedefine01 TS_HAS_IN6_IS_ADDR_UNSPECIFIED
 #cmakedefine01 TS_HAS_IP_TOS
 #cmakedefine01 TS_HAS_JEMALLOC
+#cmakedefine01 TS_HAS_MIMALLOC
 #cmakedefine01 TS_HAS_PROFILER
 #cmakedefine01 TS_HAS_QUICHE
 #cmakedefine01 TS_HAS_SO_MARK
@@ -190,6 +191,7 @@ const int DEFAULT_STACKSIZE = @DEFAULT_STACK_SIZE@;
 #cmakedefine01 TS_USE_HWLOC
 #cmakedefine01 TS_USE_KQUEUE
 #cmakedefine01 TS_USE_LINUX_IO_URING
+#cmakedefine01 TS_USE_MALLOC_ALLOCATOR
 #cmakedefine01 TS_USE_POSIX_CAP
 #cmakedefine01 TS_USE_QUIC
 #cmakedefine01 TS_USE_REMOTE_UNWINDING
diff --git a/include/tscore/ink_memory.h b/include/tscore/ink_memory.h
index 3dbac7b75a..a7acbbc3f4 100644
--- a/include/tscore/ink_memory.h
+++ b/include/tscore/ink_memory.h
@@ -49,7 +49,11 @@
 #endif
 
 #if TS_HAS_JEMALLOC
+#if __has_include()
 #include 
+#else
+#include 
+#endif
 #elif TS_HAS_MIMALLOC
 #include 
 #elif HAVE_MALLOC_H
diff --git a/plugins/experimental/memory_profile/memory_profile.cc 
b/plugins/experimental/memory_profile/memory_profile.cc
index b9c49923a4..c8e146b859 100644
--- a/plugins/experimental/memory_profile/memory_profile.cc
+++ b/plugins/experimental/memory_profile/memory_profile.cc
@@ -33,9 +33,7 @@
 #include 
 #include 
 #include 
-#if TS_HAS_JEMALLOC
-#include 
-#endif
+#include 
 
 #define PLUGIN_NAME "memory_profile"
 



[trafficserver] branch master updated: Add sslheaders and remove extra cert_update plugin (#10519)

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

cmcfarlen 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 f7a8898c1a Add sslheaders and remove extra cert_update plugin (#10519)
f7a8898c1a is described below

commit f7a8898c1a431dbd95e7a8f17314fe6ecb2de0f2
Author: Chris McFarlen 
AuthorDate: Tue Sep 26 15:07:04 2023 -0500

Add sslheaders and remove extra cert_update plugin (#10519)
---
 example/plugins/c-api/CMakeLists.txt   | 92 +++---
 plugins/experimental/CMakeLists.txt|  1 +
 .../experimental/{ => sslheaders}/CMakeLists.txt   | 36 +++--
 tests/tools/plugins/CMakeLists.txt |  2 -
 tests/tools/plugins/Makefile.inc   |  3 -
 tests/tools/plugins/cert_update.cc | 91 -
 6 files changed, 59 insertions(+), 166 deletions(-)

diff --git a/example/plugins/c-api/CMakeLists.txt 
b/example/plugins/c-api/CMakeLists.txt
index cce968816f..9262c13bc1 100644
--- a/example/plugins/c-api/CMakeLists.txt
+++ b/example/plugins/c-api/CMakeLists.txt
@@ -18,49 +18,49 @@
 
 include(add_atsplugin)
 
-add_atsplugin(example_cache_scan ./cache_scan/cache_scan.cc)
-add_atsplugin(example_lifecycle_plugin ./lifecycle_plugin/lifecycle_plugin.cc)
-add_atsplugin(example_request_buffer ./request_buffer/request_buffer.cc)
-add_atsplugin(example_secure_link ./secure_link/secure_link.cc)
-target_link_libraries(example_secure_link PRIVATE OpenSSL::SSL)
-add_atsplugin(example_remap ./remap/remap.cc)
-add_atsplugin(example_redirect_1 ./redirect_1/redirect_1.cc)
-add_atsplugin(example_query_remap ./query_remap/query_remap.cc)
-add_atsplugin(example_thread_pool ./thread_pool/psi.cc ./thread_pool/thread.cc)
-add_atsplugin(example_bnull_transform ./bnull_transform/bnull_transform.cc)
-add_atsplugin(example_replace_header ./replace_header/replace_header.cc)
-add_atsplugin(example_ssl_sni ./ssl_sni/ssl_sni.cc)
-target_link_libraries(example_ssl_sni PRIVATE OpenSSL::SSL)
-add_atsplugin(example_passthru ./passthru/passthru.cc)
-add_atsplugin(example_response_header_1 
./response_header_1/response_header_1.cc)
-add_atsplugin(example_denylist_1 ./denylist_1/denylist_1.cc)
-add_atsplugin(example_denylist_0 ./denylist_0/denylist_0.cc)
-add_atsplugin(example_server_push ./server_push/server_push.cc)
-add_atsplugin(example_basic_auth ./basic_auth/basic_auth.cc)
-add_atsplugin(example_verify_cert ./verify_cert/verify_cert.cc)
-target_link_libraries(example_verify_cert PRIVATE OpenSSL::SSL)
-add_atsplugin(example_intercept ./intercept/intercept.cc)
-add_atsplugin(example_null_transform ./null_transform/null_transform.cc)
-add_atsplugin(example_ssl_sni_allowlist 
./ssl_sni_allowlist/ssl_sni_allowlist.cc)
-target_link_libraries(example_ssl_sni_allowlist PRIVATE OpenSSL::SSL)
-add_atsplugin(example_protocol ./protocol/Protocol.cc ./protocol/TxnSM.cc)
-add_atsplugin(example_file_1 ./file_1/file_1.cc)
-add_atsplugin(example_output_header ./output_header/output_header.cc)
-add_atsplugin(example_session_hooks ./session_hooks/session_hooks.cc)
-add_atsplugin(example_add_header ./add_header/add_header.cc)
-add_atsplugin(example_version ./version/version.cc)
-add_atsplugin(example_ssl_preaccept ./ssl_preaccept/ssl_preaccept.cc)
-add_atsplugin(example_txn_data_sink ./txn_data_sink/txn_data_sink.cc)
-add_atsplugin(example_remap_header_add ./remap_header_add/remap_header_add.cc)
-add_atsplugin(example_disable_http2 ./disable_http2/disable_http2.cc)
-target_link_libraries(example_disable_http2 PRIVATE OpenSSL::SSL)
-add_atsplugin(example_server_transform ./server_transform/server_transform.cc)
-add_atsplugin(example_append_transform ./append_transform/append_transform.cc)
-add_atsplugin(example_thread_1 ./thread_1/thread_1.cc)
-add_atsplugin(example_vconn_args ./vconn_args/vconn_args.cc)
-add_atsplugin(example_cert_update ./cert_update/cert_update.cc)
-add_atsplugin(example_hello ./hello/hello.cc)
-add_atsplugin(example_statistic ./statistic/statistic.cc)
-add_atsplugin(example_protocol_stack ./protocol_stack/protocol_stack.cc)
-add_atsplugin(example_client_context_dump 
./client_context_dump/client_context_dump.cc)
-target_link_libraries(example_client_context_dump PRIVATE OpenSSL::SSL)
+add_atsplugin(cache_scan ./cache_scan/cache_scan.cc)
+add_atsplugin(lifecycle_plugin ./lifecycle_plugin/lifecycle_plugin.cc)
+add_atsplugin(request_buffer ./request_buffer/request_buffer.cc)
+add_atsplugin(secure_link ./secure_link/secure_link.cc)
+target_link_libraries(secure_link PRIVATE OpenSSL::SSL)
+add_atsplugin(remap ./remap/remap.cc)
+add_atsplugin(redirect_1 ./redirect_1/redirect_1.cc)
+add_atsplugin(query_remap ./query_remap/query_remap.cc)
+add_atsplugin(thread_pool ./thread_pool/psi.cc ./thread_pool/thread.cc)
+add_atsplugin(bnull_transform ./bnull_transform/bnull_transform.cc)
+add_atsplugin(replace_hea

[trafficserver] branch master updated: Compile all sources passed to the add_autest_plugin function (#10529)

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

cmcfarlen 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 ed6c9e4904 Compile all sources passed to the add_autest_plugin 
function (#10529)
ed6c9e4904 is described below

commit ed6c9e49048cf02a91697cf55dd2491bc788e15a
Author: Chris McFarlen 
AuthorDate: Tue Sep 26 17:51:59 2023 -0500

Compile all sources passed to the add_autest_plugin function (#10529)

Co-authored-by: Chris McFarlen 
---
 tests/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 2959346f50..467cb0019d 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -15,8 +15,8 @@
 #
 ###
 
-function(ADD_AUTEST_PLUGIN _NAME _SOURCES)
-add_library(${_NAME} MODULE ${_SOURCES})
+function(ADD_AUTEST_PLUGIN _NAME)
+add_library(${_NAME} MODULE ${ARGN})
 set_target_properties(${_NAME} PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.libs"
 PREFIX ""



[trafficserver] branch master updated (c99bf26ad0 -> d44734434a)

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

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


from c99bf26ad0 Add support for Wasmtime (#10515)
 add d44734434a fix filename for hook_tunnel_plugin cmake (#10528)

No new revisions were added by this update.

Summary of changes:
 tests/tools/plugins/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[trafficserver] branch master updated: Cleanup io_uring metrics and the cmake build (#10473)

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

cmcfarlen 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 52cdad0989 Cleanup io_uring metrics and the cmake build (#10473)
52cdad0989 is described below

commit 52cdad0989a52fb6952f8e7bb2f91a868b2cf486
Author: Chris McFarlen 
AuthorDate: Wed Sep 27 14:10:27 2023 -0500

Cleanup io_uring metrics and the cmake build (#10473)

Co-authored-by: Chris McFarlen 
---
 iocore/aio/AIO.cc |  5 -
 iocore/aio/CMakeLists.txt |  3 +++
 iocore/aio/P_AIO.h|  5 -
 iocore/aio/test_AIO.cc| 10 --
 iocore/io_uring/CMakeLists.txt| 15 ---
 iocore/io_uring/io_uring.cc   | 23 +++
 iocore/io_uring/unit_tests/test_diskIO.cc | 12 ++--
 iocore/net/CMakeLists.txt |  4 
 8 files changed, 56 insertions(+), 21 deletions(-)

diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index d08a979a3c..08e60b4b59 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -114,11 +114,6 @@ ink_aio_init(ts::ModuleVersion v, AIOBackend backend)
   aio_rsb.kb_read = intm.newMetricPtr("proxy.process.cache.aio.KB_read");
   aio_rsb.kb_write= intm.newMetricPtr("proxy.process.cache.aio.KB_write");
 
-#if TS_USE_LINUX_IO_URING
-  aio_rsb.io_uring_submitted = 
intm.newMetricPtr("proxy.process.io_uring.submitted");
-  aio_rsb.io_uring_completed = 
intm.newMetricPtr("proxy.process.io_uring.completed");
-#endif
-
   memset(_reqs, 0, MAX_DISKS_POSSIBLE * sizeof(AIO_Reqs *));
   ink_mutex_init(_mutex);
 
diff --git a/iocore/aio/CMakeLists.txt b/iocore/aio/CMakeLists.txt
index f39e4be2ba..66a5f902d1 100644
--- a/iocore/aio/CMakeLists.txt
+++ b/iocore/aio/CMakeLists.txt
@@ -33,3 +33,6 @@ target_link_libraries(aio
 ts::inkevent
 ts::tscore
 )
+if(TS_USE_LINUX_IO_URING)
+target_link_libraries(aio PUBLIC ts::inkuring)
+endif()
diff --git a/iocore/aio/P_AIO.h b/iocore/aio/P_AIO.h
index 2f794e7054..567368972a 100644
--- a/iocore/aio/P_AIO.h
+++ b/iocore/aio/P_AIO.h
@@ -137,11 +137,6 @@ struct AIOStatsBlock {
   Metrics::IntType *kb_read;
   Metrics::IntType *write_count;
   Metrics::IntType *kb_write;
-
-#if TS_USE_LINUX_IO_URING
-  Metrics::IntType *io_uring_submitted;
-  Metrics::IntType *io_uring_completed;
-#endif
 };
 
 extern AIOStatsBlock aio_rsb;
diff --git a/iocore/aio/test_AIO.cc b/iocore/aio/test_AIO.cc
index 7f11f13378..c6acef9de3 100644
--- a/iocore/aio/test_AIO.cc
+++ b/iocore/aio/test_AIO.cc
@@ -220,8 +220,14 @@ dump_summary()
   printf("-\n");
   printf("IO_URING results\n");
   printf("-\n");
-  printf("submissions: %lu\n", Metrics::read(aio_rsb.io_uring_submitted);
-  printf("completions: %lu\n", Metrics::read(aio_rsb.io_uring_completed);
+
+  auto  = Metrics::getInstance();
+
+  Metrics::IntType *completed = 
m.lookup(m.lookup("proxy.process.io_uring.completed"));
+  Metrics::IntType *submitted = 
m.lookup(m.lookup("proxy.process.io_uring.submitted"));
+
+  printf("submissions: %lu\n", Metrics::read(submitted));
+  printf("completions: %lu\n", Metrics::read(completed));
 #endif
 
   if (delete_disks) {
diff --git a/iocore/io_uring/CMakeLists.txt b/iocore/io_uring/CMakeLists.txt
index 50d26e7b07..9871fed2d7 100644
--- a/iocore/io_uring/CMakeLists.txt
+++ b/iocore/io_uring/CMakeLists.txt
@@ -17,7 +17,10 @@
 
 add_library(inkuring STATIC
 io_uring.cc
+IOUringEventIO.cc
 )
+add_library(ts::inkuring ALIAS inkuring)
+
 include_directories(
 ${CMAKE_SOURCE_DIR}/iocore/dns
 ${CMAKE_SOURCE_DIR}/iocore/io_uring
@@ -25,16 +28,22 @@ include_directories(
 ${CMAKE_SOURCE_DIR}/iocore/cache
 )
 
+target_link_libraries(inkuring
+PUBLIC
+ts::tscore
+uring
+PRIVATE
+ts::tsapicore
+)
+
 add_executable(test_iouring
 unit_tests/test_diskIO.cc)
 target_link_libraries(test_iouring
-PUBLIC
-ts::tscore
 PRIVATE
 inkuring
 libswoc
 tscpputil
-uring
+catch2::catch2
 )
 
 target_include_directories(test_iouring PRIVATE ${CMAKE_SOURCE_DIR}/include 
${CATCH_INCLUDE_DIR})
diff --git a/iocore/io_uring/io_uring.cc b/iocore/io_uring/io_uring.cc
index 0598a095ba..cf744f54e5 100644
--- a/iocore/io_uring/io_uring.cc
+++ b/iocore/io_uring/io_uring.cc
@@ -32,10 +32,25 @@ Linux io_uring helper library
 #include "tscore/ink_hrtime.h"
 #include "tscore/Diags.h"
 
+#include 
+
+using ts::Metrics;
+
 std::atomic main_wq_fd;
 
 IOUringConfig IOUringContext::config;
 
+struct IOUringStatsBlock {
+  Metrics::IntType *io_uring_submitted;
+  Metrics::IntType *io_ur

[trafficserver] branch master updated (e2a88784c0 -> 3d2fd948e0)

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

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


from e2a88784c0 libswoc: Update to 1.5.5 (#10523)
 add 3d2fd948e0 Add cmake preset for running autest on ci (#10533)

No new revisions were added by this update.

Summary of changes:
 CMakePresets.json | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)



[trafficserver] branch master updated (04b8c5acd6 -> a6cf7dcbe8)

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

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


from 04b8c5acd6 Change unable to bind or listen to a fatal error (#10549)
 add a6cf7dcbe8 cmake: Support external yaml-cpp (#10554)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt | 24 ++
 example/plugins/c-api/CMakeLists.txt   |  4 +++-
 lib/CMakeLists.txt | 16 ---
 lib/swoc/CMakeLists.txt|  1 +
 plugins/cache_promote/CMakeLists.txt   |  2 +-
 plugins/compress/CMakeLists.txt|  2 +-
 plugins/conf_remap/CMakeLists.txt  |  2 ++
 plugins/esi/CMakeLists.txt |  2 +-
 plugins/esi/common/CMakeLists.txt  |  2 +-
 plugins/esi/lib/CMakeLists.txt |  2 +-
 .../cert_reporting_tool/CMakeLists.txt |  1 +
 plugins/experimental/money_trace/CMakeLists.txt|  1 +
 plugins/header_rewrite/CMakeLists.txt  |  2 +-
 plugins/regex_remap/CMakeLists.txt |  2 +-
 plugins/xdebug/CMakeLists.txt  |  1 +
 proxy/CMakeLists.txt   |  1 -
 src/tests/CMakeLists.txt   |  2 +-
 src/tscore/CMakeLists.txt  |  2 +-
 18 files changed, 42 insertions(+), 27 deletions(-)



[trafficserver] branch master updated (fb1b3a1b92 -> e97a83ef64)

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

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


from fb1b3a1b92 Cmake presets (#10457)
 add e97a83ef64 Fix cmake autooptions (#10456)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt|  6 --
 cmake/AutoOptionHelpers.cmake | 10 +++---
 2 files changed, 7 insertions(+), 9 deletions(-)



[trafficserver] branch master updated (5737f77e9c -> fb1b3a1b92)

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

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


from 5737f77e9c This fixes CID 1518257 (#10404)
 add fb1b3a1b92 Cmake presets (#10457)

No new revisions were added by this update.

Summary of changes:
 .gitignore|   2 +
 CMakePresets.json | 112 ++
 2 files changed, 114 insertions(+)
 create mode 100644 CMakePresets.json



[trafficserver] branch master updated: Honor BUILD_SHARED_LIBS for tscore. (#10588)

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

cmcfarlen 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 87accee634 Honor BUILD_SHARED_LIBS for tscore. (#10588)
87accee634 is described below

commit 87accee634fe2f90e91064b841a522b0b38fb55b
Author: Chris McFarlen 
AuthorDate: Thu Oct 12 16:42:57 2023 -0500

Honor BUILD_SHARED_LIBS for tscore. (#10588)

Co-authored-by: Chris McFarlen 
---
 plugins/esi/common/CMakeLists.txt  | 2 +-
 plugins/esi/fetcher/CMakeLists.txt | 2 +-
 plugins/esi/lib/CMakeLists.txt | 2 +-
 plugins/esi/test/CMakeLists.txt| 2 +-
 src/tscore/CMakeLists.txt  | 4 +++-
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/plugins/esi/common/CMakeLists.txt 
b/plugins/esi/common/CMakeLists.txt
index 7e702736d8..771112335f 100644
--- a/plugins/esi/common/CMakeLists.txt
+++ b/plugins/esi/common/CMakeLists.txt
@@ -15,7 +15,7 @@
 #
 ###
 
-add_library(esi-common DocNode.cc gzip.cc Utils.cc)
+add_library(esi-common STATIC DocNode.cc gzip.cc Utils.cc)
 target_link_libraries(esi-common PRIVATE ZLIB::ZLIB libswoc)
 target_include_directories(esi-common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
 set_target_properties(esi-common PROPERTIES POSITION_INDEPENDENT_CODE ON)
diff --git a/plugins/esi/fetcher/CMakeLists.txt 
b/plugins/esi/fetcher/CMakeLists.txt
index b65c681537..24f779e1d3 100644
--- a/plugins/esi/fetcher/CMakeLists.txt
+++ b/plugins/esi/fetcher/CMakeLists.txt
@@ -15,7 +15,7 @@
 #
 ###
 
-add_library(fetcher HttpDataFetcherImpl.cc)
+add_library(fetcher STATIC HttpDataFetcherImpl.cc)
 target_link_libraries(fetcher PUBLIC esi-common)
 target_include_directories(fetcher PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
 set_target_properties(fetcher PROPERTIES POSITION_INDEPENDENT_CODE ON)
diff --git a/plugins/esi/lib/CMakeLists.txt b/plugins/esi/lib/CMakeLists.txt
index fb79365e51..544b00692e 100644
--- a/plugins/esi/lib/CMakeLists.txt
+++ b/plugins/esi/lib/CMakeLists.txt
@@ -15,7 +15,7 @@
 #
 ###
 
-add_library(esicore
+add_library(esicore STATIC
 EsiGunzip.cc
 EsiGzip.cc
 EsiParser.cc
diff --git a/plugins/esi/test/CMakeLists.txt b/plugins/esi/test/CMakeLists.txt
index 3f4875a233..3b92cec414 100644
--- a/plugins/esi/test/CMakeLists.txt
+++ b/plugins/esi/test/CMakeLists.txt
@@ -15,7 +15,7 @@
 #
 ###
 
-add_library(esitest
+add_library(esitest STATIC
 HandlerMap.cc
 StubIncludeHandler.cc
 TestHandlerManager.cc
diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index 1d48196dd3..63dba24821 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -29,7 +29,7 @@ add_custom_command(
 
 add_custom_target(ParseRules ALL DEPENDS ParseRulesCType 
ParseRulesCTypeToUpper ParseRulesCTypeToLower)
 
-add_library(tscore STATIC
+add_library(tscore
 AcidPtr.cc
 AcidPtr.cc
 Arena.cc
@@ -119,6 +119,8 @@ target_link_libraries(tscore
 PCRE::PCRE
 libswoc
 yaml-cpp::yaml-cpp
+PRIVATE
+resolv
 )
 
 if(TS_USE_POSIX_CAP)



[trafficserver] branch master updated: Fix freebsd ci build (#10632)

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

cmcfarlen 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 21b2e87a53 Fix freebsd ci build (#10632)
21b2e87a53 is described below

commit 21b2e87a5301809e4a4f17f3dd0cbf111524d16f
Author: Chris McFarlen 
AuthorDate: Tue Oct 17 15:48:40 2023 -0500

Fix freebsd ci build (#10632)

* Link backtrace libraries if any are found

* link libswoc even without brotli

-

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt  | 3 +++
 plugins/compress/CMakeLists.txt | 3 ++-
 src/tscore/CMakeLists.txt   | 4 
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c339d7979..2b88568d8d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -260,6 +260,9 @@ check_include_file(endian.h HAVE_ENDIAN_H)
 find_package(Backtrace)
 if(Backtrace_FOUND)
   set(TS_HAS_BACKTRACE TRUE)
+  if(Backtrace_LIBRARIES)
+message(STATUS "Backtrace found (library ${Backtrace_LIBRARIES})")
+  endif()
 endif()
 
 find_package(brotli)
diff --git a/plugins/compress/CMakeLists.txt b/plugins/compress/CMakeLists.txt
index 17bd8e7d97..63d80cf2e2 100644
--- a/plugins/compress/CMakeLists.txt
+++ b/plugins/compress/CMakeLists.txt
@@ -16,6 +16,7 @@
 ###
 
 add_atsplugin(compress compress.cc configuration.cc misc.cc)
+target_link_libraries(compress PRIVATE libswoc)
 if(HAVE_BROTLI_ENCODE_H)
-  target_link_libraries(compress PRIVATE brotli::brotlienc libswoc)
+  target_link_libraries(compress PRIVATE brotli::brotlienc)
 endif()
diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index ea72a796d7..f77f054f36 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -120,6 +120,10 @@ if(TS_USE_HWLOC)
   target_link_libraries(tscore PUBLIC hwloc::hwloc)
 endif()
 
+if(Backtrace_LIBRARIES)
+  target_link_libraries(tscore PRIVATE ${Backtrace_LIBRARIES})
+endif()
+
 add_dependencies(tscore ParseRules)
 target_include_directories(tscore PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
 if(TS_HAS_128BIT_CAS AND TS_NEEDS_MCX16_FOR_CAS)



[trafficserver] branch master updated: Cmake readme (#10653)

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

cmcfarlen 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 62f52506d3 Cmake readme (#10653)
62f52506d3 is described below

commit 62f52506d3948d6824fa9793e3ba8fa7d73b7760
Author: Chris McFarlen 
AuthorDate: Fri Oct 20 17:24:39 2023 -0500

Cmake readme (#10653)

* quick readme for cmake

* fix wrapping

-

Co-authored-by: Chris McFarlen 
---
 README.md | 107 ++
 1 file changed, 107 insertions(+)

diff --git a/README.md b/README.md
index 57068a2a57..8c5ec6bd68 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,113 @@ Traffic Server is a high-performance building block for 
cloud services.
 It's more than just a caching proxy server; it also has support for
 plugins to build large scale web applications.
 
+# Important notice to ATS developers
+
+ATS is transitioning to cmake as its build system.  At the moment, the 
autotools build is broken and will soon be removed from the repository.  Below 
is a quick-start guide to cmake:
+
+### Step 1: Configuration
+
+With cmake, you definitely want to create an out-of-source build.  You will 
give that directory to every cmake command.  For these examples, it will just 
be `build`
+
+```
+$ cmake -B build
+```
+
+This will configure the project with defaults.
+
+If you want to customize the build, you can pass values for variables on the 
command line.  Or, you can interactively change them using the `ccmake` program.
+
+```
+$ cmake -B build -DCMAKE_INSTALL_PREFIX=/tmp/ats 
-DBUILD_EXPERIMENTAL_PLUGINS=ON
+```
+
+-- or --
+
+```
+$ ccmake build
+```
+
+ Specifying locations of dependencies
+
+To specify the location of a dependency (like --with-*), you generally set a 
variable with the `ROOT`. The big exception to this is for openssl. This 
variable is called `OPENSSL_ROOT_DIR`
+
+```
+$ cmake -B build -Djemalloc_ROOT=/opt/jemalloc -DPCRE_ROOT=/opt/edge 
-DOPENSSL_ROOT_DIR=/opt/boringssl
+```
+
+ Using presets to configure the build
+
+cmake has a feature for grouping configurations together to make configuration 
and reproduction easier.  The file CMakePresets.json declares presets that you 
can use from the command line.  You can provide your own CMakeUserPresets.json 
and further refine those via inheritance:
+
+```
+$ cmake --preset dev
+```
+
+You can start out your user presets by just copying `CMakePresets.json` and 
removing everything in `configurePresets`
+
+Here is an example user preset:
+
+```
+
+{
+  "name": "clang",
+  "hidden": true,
+  "environment": {
+"LDFLAGS": "-L/opt/homebrew/opt/llvm/lib 
-L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++ 
-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
+"CPPFLAGS": "-I/opt/homebrew/opt/llvm/include",
+"CXXFLAGS": "-stdlib=libc++",
+"CC": "/opt/homebrew/opt/llvm/bin/clang",
+"CXX": "/opt/homebrew/opt/llvm/bin/clang++"
+  }
+},
+{
+  "name": "mydev",
+  "displayName": "my development",
+  "description": "My Development Presets",
+  "binaryDir": "${sourceDir}/cmake-build-dev-clang",
+  "inherits": ["clang", "dev"],
+  "cacheVariables": {
+"CMAKE_INSTALL_PREFIX": "/opt/ats-cmake",
+"jemalloc_ROOT": "/opt/homebrew",
+"ENABLE_LUAJIT": false,
+"ENABLE_JEMALLOC": true,
+"ENABLE_MIMALLOC": false,
+"ENABLE_MALLOC_ALLOCATOR": true,
+"BUILD_EXPERIMENTAL_PLUGINS": true,
+"BUILD_REGRESSION_TESTING": true
+  }
+},
+```
+
+And then use it like:
+
+```
+cmake --preset mydev
+```
+
+## Building the project
+
+```
+$ cmake --build build
+```
+
+```
+$ cmake --build build -t traffic_server
+```
+
+## running tests
+
+```
+$ cd build
+$ ctest
+```
+
+## installing
+
+```
+$ cmake --install build
+```
+
 ## DIRECTORY STRUCTURE
 ```
 trafficserver . Top src dir



[trafficserver] branch master updated: Move DbgCtl.cc from tscore to tsapicore (#10585)

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

cmcfarlen 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 4a86eea6b2 Move DbgCtl.cc from tscore to tsapicore (#10585)
4a86eea6b2 is described below

commit 4a86eea6b23e682a27dc626dc7ff4bafc7c24dc2
Author: Chris McFarlen 
AuthorDate: Fri Oct 13 16:53:22 2023 -0500

Move DbgCtl.cc from tscore to tsapicore (#10585)

* Move DbgCtl.cc from tscore to tsapicore

* actually move DbgCtl.cc

* appease gnu ld

* set PIC on tsapicore

* update autotools

* fix library order

-

Co-authored-by: Chris McFarlen 
---
 iocore/hostdb/Makefile.am |  2 +-
 iocore/net/Makefile.am|  2 ++
 mgmt/rpc/CMakeLists.txt   |  3 +++
 mgmt/rpc/Makefile.am  |  2 ++
 proxy/hdrs/CMakeLists.txt |  3 ++-
 proxy/hdrs/Makefile.am|  3 +++
 proxy/http2/Makefile.am   |  2 ++
 proxy/logging/Makefile.am |  2 ++
 src/api/CMakeLists.txt|  2 ++
 src/{tscore => api}/DbgCtl.cc |  0
 src/api/Makefile.am   |  1 +
 src/tscore/CMakeLists.txt |  2 +-
 src/tscore/Makefile.am| 11 +--
 13 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/iocore/hostdb/Makefile.am b/iocore/hostdb/Makefile.am
index 24cd5d2cd4..d2847bca92 100644
--- a/iocore/hostdb/Makefile.am
+++ b/iocore/hostdb/Makefile.am
@@ -66,8 +66,8 @@ test_CPP_FLAGS = \
 test_LD_ADD = \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/records/librecords_p.a \
-   $(top_builddir)/src/tscore/libtscore.a \
$(top_builddir)/src/api/libtsapicore.a \
+   $(top_builddir)/src/tscore/libtscore.a \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
@SWOC_LIBS@ @HWLOC_LIBS@ @YAMLCPP_LIBS@ @OPENSSL_LIBS@ @LIBPCRE@ 
@LIBCAP@
 
diff --git a/iocore/net/Makefile.am b/iocore/net/Makefile.am
index cfa445cb63..504732eed5 100644
--- a/iocore/net/Makefile.am
+++ b/iocore/net/Makefile.am
@@ -53,6 +53,7 @@ test_certlookup_SOURCES = \
 test_certlookup_LDADD = \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/tscore/libtscore.a \
+   $(top_builddir)/src/api/libtsapicore.a \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/proxy/ParentSelectionStrategy.o \
@YAMLCPP_LIBS@ \
@@ -86,6 +87,7 @@ test_UDPNet_LDADD = \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/proxy/hdrs/libhdrs.a \
$(top_builddir)/src/tscore/libtscore.a \
+   $(top_builddir)/src/api/libtsapicore.a \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/src/api/libtsapicore.a \
$(top_builddir)/proxy/ParentSelectionStrategy.o \
diff --git a/mgmt/rpc/CMakeLists.txt b/mgmt/rpc/CMakeLists.txt
index 45c2d2fc5d..3d4266b277 100644
--- a/mgmt/rpc/CMakeLists.txt
+++ b/mgmt/rpc/CMakeLists.txt
@@ -39,6 +39,8 @@ set_target_properties(jsonrpc_protocol PROPERTIES 
POSITION_INDEPENDENT_CODE TRUE
 target_link_libraries(jsonrpc_protocol
 PUBLIC
 ts::tscore
+PRIVATE
+ts::tsapicore
 )
 
 add_library(jsonrpc_server STATIC
@@ -78,6 +80,7 @@ if(BUILD_TESTING)
 jsonrpc/unit_tests/test_basic_protocol.cc
   )
   target_link_libraries(test_jsonrpc
+ts::tsapicore
 catch2::catch2
 ts::jsonrpc_protocol
 libswoc
diff --git a/mgmt/rpc/Makefile.am b/mgmt/rpc/Makefile.am
index f6cd65082c..d2014a6032 100644
--- a/mgmt/rpc/Makefile.am
+++ b/mgmt/rpc/Makefile.am
@@ -65,6 +65,7 @@ test_jsonrpc_LDADD = \
libjsonrpc_protocol.la \
$(top_builddir)/src/tscpp/util/libtscpputil.la \
$(top_builddir)/src/tscore/libtscore.a \
+   $(top_builddir)/src/api/libtsapicore.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/src/tscore/libtscore.a \
@@ -105,6 +106,7 @@ test_jsonrpcserver_LDADD = \
libjsonrpc_protocol.la \
libjsonrpc_server.la \
$(top_builddir)/src/tscore/libtscore.a \
+   $(top_builddir)/src/api/libtsapicore.a \
$(top_builddir)/iocore/eventsystem/libinkevent.a \
$(top_builddir)/src/records/librecords_p.a \
$(top_builddir)/src/api/libtsapicore.a \
diff --git a/proxy/hdrs/CMakeLists.txt b/proxy/hdrs/CMakeLists.txt
index d5b092cc6f..4ace93dfac 100644
--- a/proxy/hdrs/CMakeLists.txt
+++ b/proxy/hdrs/CMakeLists.txt
@@ -45,6 +45,7 @@ target_link_libraries(hdrs
 ts::tscore
 PRIVATE
 ts::inkevent
+ts::tsapicore
 )
 
 if(BUILD_TESTING)
@@ -68,6 +69,6 @@ if(BUILD_TESTING)
 unit_tests/test_XPACK.cc
   )
   target_include_directories(test_proxy_hdrs_xpack PRIVATE 
${CMAKE_CURRENT_SOURCE_DIR})
-  target_link_libraries(test_proxy_hdrs_xpack PRIVATE ts::tscore libswoc 
catch2::cat

[trafficserver] branch master updated: Move APIHook classes to tsapicore (#10148)

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

cmcfarlen 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 1ecdebb4d4 Move APIHook classes to tsapicore (#10148)
1ecdebb4d4 is described below

commit 1ecdebb4d45490cc8c7c4a9f654b024803ea2d90
Author: JosiahWI <41302989+josia...@users.noreply.github.com>
AuthorDate: Wed Oct 11 09:32:00 2023 -0500

Move APIHook classes to tsapicore (#10148)

* Move APIHook classes to tsapi

This moves APIHook, APIHooks, and FeatureAPIHooks to tsapi. It also
moves the global ssl hooks to inknet, and the global http tooks to
proxy. This removes the definitions of all those classes from the
various stubs (in inknet, inkcache, and http_remap).

* Clean up after rebase

* Stub the tsapi C interface used by FetchSM

* Add missing inkdns dep to inkhostdb

* Add missing deps to inknet and proxy

* Move lifecycle_hooks to g_lifecycle_hooks

* Fix logcat dependencies
---
 include/api/APIHook.h |  45 +
 include/api/APIHooks.h|  52 ++
 include/api/FeatureAPIHooks.h | 154 
 include/api/InkAPIInternal.h  | 212 +-
 include/api/LifecycleAPIHooks.h   |  35 
 iocore/cache/CMakeLists.txt   |   2 +
 iocore/cache/test/main.cc |   6 +
 iocore/cache/test/stub.cc |  91 +++---
 iocore/hostdb/CMakeLists.txt  |   1 +
 iocore/net/CMakeLists.txt |   2 +
 iocore/net/Makefile.am|   2 +
 iocore/net/Net.cc |   2 +
 iocore/net/SSLAPIHooks.cc |  32 
 iocore/net/SSLAPIHooks.h  |  60 ++
 iocore/net/SSLNetVConnection.cc   |  19 +-
 iocore/net/SSLSecret.cc   |   5 +-
 iocore/net/SSLUtils.cc|   5 +-
 iocore/net/TLSSessionResumptionSupport.cc |   3 +-
 iocore/net/libinknet_stub.cc  |  37 
 iocore/net/unit_tests/unit_test_main.cc   |   2 +
 mgmt/rpc/CMakeLists.txt   |   1 +
 mgmt/rpc/handlers/plugins/Plugins.cc  |   6 +-
 proxy/CMakeLists.txt  |   5 +-
 proxy/HttpAPIHooks.cc |  32 
 proxy/HttpAPIHooks.h  |  37 
 proxy/Makefile.am |   2 +
 proxy/http/CMakeLists.txt |   3 +
 proxy/http/HttpProxyServerMain.cc |   3 +-
 proxy/http/remap/CMakeLists.txt   |   5 +-
 proxy/http/remap/unit-tests/nexthop_test_stubs.cc |   4 -
 src/api/APIHook.cc|  76 
 src/api/APIHooks.cc   |  58 ++
 src/api/CMakeLists.txt|   3 +
 src/api/InkAPI.cc |  83 +
 src/api/LifecycleAPIHooks.cc  |  32 
 src/api/Makefile.am   |  14 +-
 src/tests/CMakeLists.txt  |   3 +-
 src/traffic_logcat/CMakeLists.txt |  18 +-
 src/traffic_server/traffic_server.cc  |  11 +-
 39 files changed, 744 insertions(+), 419 deletions(-)

diff --git a/include/api/APIHook.h b/include/api/APIHook.h
new file mode 100644
index 00..caec587892
--- /dev/null
+++ b/include/api/APIHook.h
@@ -0,0 +1,45 @@
+/** @file
+
+  Internal SDK stuff
+
+  @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 "ts/InkAPIPrivateIOCore.h"
+
+#include "tscore/List.h"
+
+/// A single API hook that can be invoked.
+class APIHook
+{
+public:
+  INKContInternal *m_cont;
+  int invoke(int event, void *edata) const;
+  APIHook *next() const;
+  APIHook *prev() const;
+  LINK(APIHook, m_li

[trafficserver] branch master updated (82e9674f59 -> 441d4f7236)

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

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


from 82e9674f59 TLS early data: logging updates (#10115)
 add 441d4f7236 fall back to configure file for older cmake versions 
(#10236)

No new revisions were added by this update.

Summary of changes:
 cmake/install_configs.cmake | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)



[trafficserver] branch master updated: Add example subdir to cmake enabled with 'ENABLE_EXAMPLE' cmake option (#10211)

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

cmcfarlen 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 2fd4caf49c Add example subdir to cmake enabled with 'ENABLE_EXAMPLE' 
cmake option (#10211)
2fd4caf49c is described below

commit 2fd4caf49c8ef9b5517f8f5fa41af54f5852fa9d
Author: Chris McFarlen 
AuthorDate: Mon Aug 21 15:22:19 2023 -0500

Add example subdir to cmake enabled with 'ENABLE_EXAMPLE' cmake option 
(#10211)

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt |  4 ++
 .../CMakeLists.txt => cmake/add_atsplugin.cmake| 37 
 example/CMakeLists.txt | 21 +++
 example/plugins/CMakeLists.txt | 18 ++
 example/plugins/c-api/CMakeLists.txt   | 66 ++
 plugins/CMakeLists.txt | 14 +
 6 files changed, 110 insertions(+), 50 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 88987ddcc3..2a3016c9df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,6 +79,7 @@ set(ENABLE_TPROXY
 option(ENABLE_QUICHE   "Use quiche (default OFF)")
 option(ENABLE_UNWIND   "Use libunwind if found on system (default ON)" ON)
 option(ENABLE_WCCP "Use WCCP v2 (default OFF)")
+option(ENABLE_EXAMPLE  "Build example directory (default OFF)")
 set(TS_MAX_HOST_NAME_LEN 256 CACHE STRING "Max host name length (default 256)")
 set(MAX_EVENT_THREADS
 4096
@@ -387,6 +388,9 @@ add_subdirectory(src/tests)
 add_subdirectory(tests)
 add_subdirectory(plugins)
 add_subdirectory(configs)
+if(ENABLE_EXAMPLE)
+add_subdirectory(example)
+endif()
 
 add_custom_target(clang-format-install
 COMMAND ${CMAKE_SOURCE_DIR}/tools/clang-format.sh --install
diff --git a/plugins/CMakeLists.txt b/cmake/add_atsplugin.cmake
similarity index 58%
copy from plugins/CMakeLists.txt
copy to cmake/add_atsplugin.cmake
index 4bdc856c44..899d351694 100644
--- a/plugins/CMakeLists.txt
+++ b/cmake/add_atsplugin.cmake
@@ -28,40 +28,3 @@ endfunction()
 if(APPLE)
   set(CMAKE_MODULE_LINKER_FLAGS "-undefined dynamic_lookup")
 endif()
-
-add_subdirectory(authproxy)
-add_subdirectory(background_fetch)
-add_subdirectory(cache_promote)
-add_subdirectory(cache_range_requests)
-add_subdirectory(cachekey)
-add_subdirectory(certifier)
-add_subdirectory(compress)
-add_subdirectory(conf_remap)
-add_subdirectory(escalate)
-add_subdirectory(esi)
-
-add_subdirectory(generator)
-add_subdirectory(header_rewrite)
-add_subdirectory(libloader)
-add_subdirectory(multiplexer)
-add_subdirectory(prefetch)
-add_subdirectory(regex_remap)
-add_subdirectory(regex_revalidate)
-add_subdirectory(remap_purge)
-add_subdirectory(s3_auth)
-add_subdirectory(server_push_preload)
-add_subdirectory(stats_over_http)
-add_subdirectory(tcpinfo)
-add_subdirectory(xdebug)
-
-if(ENABLE_LUAJIT)
-add_subdirectory(lua)
-endif()
-
-if(BUILD_EXPERIMENTAL_PLUGINS)
-add_subdirectory(experimental)
-endif()
-
-if(HOST_OS STREQUAL "linux")
-add_subdirectory(healthchecks)
-endif()
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
new file mode 100644
index 00..15bea86104
--- /dev/null
+++ b/example/CMakeLists.txt
@@ -0,0 +1,21 @@
+###
+#
+#  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.
+#
+###
+
+
+# It might be better if this is a subproject
+
+add_subdirectory(plugins)
diff --git a/example/plugins/CMakeLists.txt b/example/plugins/CMakeLists.txt
new file mode 100644
index 00..7814cabb19
--- /dev/null
+++ b/example/plugins/CMakeLists.txt
@@ -0,0 +1,18 @@
+###
+#
+#  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 wi

[trafficserver] branch master updated: cmake out of source doc build support (#10252)

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

cmcfarlen 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 44fb76f39d cmake out of source doc build support (#10252)
44fb76f39d is described below

commit 44fb76f39d3043adb95806fada8b04b0aa97273b
Author: Chris McFarlen 
AuthorDate: Tue Aug 22 11:30:01 2023 -0500

cmake out of source doc build support (#10252)

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt |  12 +
 doc/CMakeLists.txt |  60 +
 doc/conf.cmake.in.py   | 495 ++
 doc/ext/local-config.cmake.in.py   |  18 ++
 doc/ext/traffic-server.cmake.in.py | 535 +
 doc/manpages.cmake.in.py   |  98 +++
 6 files changed, 1218 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2a3016c9df..9603fbf086 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,6 +55,7 @@ option(ENABLE_FAST_SDK "Use fast SDK APIs (default OFF)")
 option(ENABLE_JEMALLOC "Use jemalloc (default OFF)")
 option(ENABLE_LUAJIT   "Use LuaJIT (default OFF)")
 option(ENABLE_MIMALLOC "Use mimalloc (default OFF)")
+option(ENABLE_DOCS "Build docs (default OFF)")
 
 if(CMAKE_SYSTEM_NAME STREQUAL Linux)
 set(DEFAULT_POSIX_CAP ON)
@@ -296,6 +297,13 @@ check_symbol_exists(
 )
 check_symbol_exists(TLS1_3_VERSION "openssl/ssl.h" TS_USE_TLS13)
 
+# document tools
+if(ENABLE_DOCS)
+  find_package(Python3 REQUIRED)
+  find_package(Java COMPONENTS Runtime REQUIRED)
+  find_program(PipEnv pipenv REQUIRED)
+endif()
+
 # Catch2 for tests
 set(CATCH_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/lib/catch2)
 
@@ -392,6 +400,10 @@ if(ENABLE_EXAMPLE)
 add_subdirectory(example)
 endif()
 
+if(ENABLE_DOCS)
+add_subdirectory(doc)
+endif()
+
 add_custom_target(clang-format-install
 COMMAND ${CMAKE_SOURCE_DIR}/tools/clang-format.sh --install
 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
new file mode 100644
index 00..cabf6fa921
--- /dev/null
+++ b/doc/CMakeLists.txt
@@ -0,0 +1,60 @@
+###
+#
+#  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.
+#
+###
+
+
+set(PLANTUML_DATE "1.2018.1")
+set(PLANTUML_ARCHIVE 
${CMAKE_CURRENT_BINARY_DIR}/plantuml-${PLANTUML_DATE}.tar.bz2 )
+set(PLANTUML_JAR 
${CMAKE_CURRENT_BINARY_DIR}/plantuml-${PLANTUML_DATE}/plantuml.jar)
+
+file(DOWNLOAD
+
https://ci.trafficserver.apache.org/bintray/plantuml-${PLANTUML_DATE}.tar.bz2
+${PLANTUML_ARCHIVE}
+EXPECTED_HASH SHA1=4dbf218641a777007f9bc72ca8017a41a23e1081
+)
+file(ARCHIVE_EXTRACT
+INPUT ${PLANTUML_ARCHIVE}
+PATTERNS *.jar)
+
+configure_file(ext/local-config.cmake.in.py ext/local-config.py)
+configure_file(ext/traffic-server.cmake.in.py ext/traffic-server.py)
+configure_file(conf.cmake.in.py conf.py)
+configure_file(manpages.cmake.in.py manpages.py)
+
+# Docs are built with python so we need a target to setup pipenv
+set(RUNPIPENV PIPENV_PIPFILE=${CMAKE_CURRENT_SOURCE_DIR}/Pipfile ${PipEnv})
+add_custom_command(
+OUTPUT Pipfile.lock
+COMMAND ${RUNPIPENV} install
+COMMENT "Setup pipenv"
+DEPENDS Pipfile
+WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
+
+add_custom_target(
+generate_docs
+COMMAND ${RUNPIPENV} run python ${CMAKE_CURRENT_SOURCE_DIR}/checkvers.py 
--check-version
+COMMAND ${RUNPIPENV} run python -m sphinx -c ${CMAKE_CURRENT_BINARY_DIR} 
-b html ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/docbuild/html
+DEPENDS
+  Pipfile.lock
+WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+)
+#add_custom_command(
+#TARGET generate_docs
+#POST_BUILD
+#COMMAND ${RUNPIPENV} --rm
+#COMMENT "Cleaning up pipenv"
+#)
diff --git a/doc/conf.cmake.in.py b/doc/conf.cmake.in.py
new file mode 100644
index 00..e5f534bbff
--- /dev/null
+++ b/doc/conf.cmake.in.py
@@ -0,0 +1,495 @@
+# -*- coding: utf-8 -*-
+#
+# Apache Traffic Server docum

[trafficserver] branch master updated (161badf80c -> 286b98ef84)

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

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


from 161badf80c Update the HTTP/3 library dependencies (#10270)
 add 286b98ef84 remove example/plugins/cpp-api (#10235)

No new revisions were added by this update.

Summary of changes:
 configure.ac   |   1 -
 example/plugins/Makefile.am|   2 +-
 example/plugins/cpp-api/Makefile.am| 108 -
 .../cpp-api/async_http_fetch/AsyncHttpFetch.cc | 232 ---
 .../AsyncHttpFetchStreaming.cc | 176 
 example/plugins/cpp-api/async_timer/AsyncTimer.cc  |  96 -
 example/plugins/cpp-api/boom/README.txt|  72 
 example/plugins/cpp-api/boom/boom.cc   | 457 -
 .../cpp-api/clientredirect/ClientRedirect.cc   |  87 
 .../plugins/cpp-api/clientrequest/ClientRequest.cc | 144 ---
 .../CustomErrorRemapPlugin.cc  |  62 ---
 .../cpp-api/customresponse/CustomResponse.cc   |  95 -
 .../DelayTransformationPlugin.cc   | 123 --
 .../plugins/cpp-api/globalhook/GlobalHookPlugin.cc |  52 ---
 .../GzipTransformationPlugin.cc| 206 --
 .../plugins/cpp-api/helloworld/HelloWorldPlugin.cc |  43 --
 example/plugins/cpp-api/intercept/intercept.cc |  91 
 .../InternalTransactionHandling.cc |  85 
 .../cpp-api/logger_example/LoggerExample.cc| 142 ---
 .../MultipleTransactionHookPlugins.cc  | 112 -
 .../NullTransformationPlugin.cc| 108 -
 example/plugins/cpp-api/post_buffer/PostBuffer.cc  |  91 
 .../plugins/cpp-api/remap_plugin/RemapPlugin.cc|  97 -
 .../cpp-api/serverresponse/ServerResponse.cc   | 125 --
 .../plugins/cpp-api/stat_example/StatExample.cc|  81 
 .../timeout_example/TimeoutExamplePlugin.cc|  69 
 .../transactionhook/TransactionHookPlugin.cc   |  77 
 example/plugins/cpp-api/websocket/README.txt   |  14 -
 example/plugins/cpp-api/websocket/WSBuffer.cc  | 259 
 example/plugins/cpp-api/websocket/WSBuffer.h   |  90 
 example/plugins/cpp-api/websocket/WebSocket.cc | 158 ---
 example/plugins/cpp-api/websocket/WebSocket.h  |  66 ---
 32 files changed, 1 insertion(+), 3620 deletions(-)
 delete mode 100644 example/plugins/cpp-api/Makefile.am
 delete mode 100644 example/plugins/cpp-api/async_http_fetch/AsyncHttpFetch.cc
 delete mode 100644 
example/plugins/cpp-api/async_http_fetch_streaming/AsyncHttpFetchStreaming.cc
 delete mode 100644 example/plugins/cpp-api/async_timer/AsyncTimer.cc
 delete mode 100644 example/plugins/cpp-api/boom/README.txt
 delete mode 100644 example/plugins/cpp-api/boom/boom.cc
 delete mode 100644 example/plugins/cpp-api/clientredirect/ClientRedirect.cc
 delete mode 100644 example/plugins/cpp-api/clientrequest/ClientRequest.cc
 delete mode 100644 
example/plugins/cpp-api/custom_error_remap_plugin/CustomErrorRemapPlugin.cc
 delete mode 100644 example/plugins/cpp-api/customresponse/CustomResponse.cc
 delete mode 100644 
example/plugins/cpp-api/delay_transformation_plugin/DelayTransformationPlugin.cc
 delete mode 100644 example/plugins/cpp-api/globalhook/GlobalHookPlugin.cc
 delete mode 100644 
example/plugins/cpp-api/gzip_transformation/GzipTransformationPlugin.cc
 delete mode 100644 example/plugins/cpp-api/helloworld/HelloWorldPlugin.cc
 delete mode 100644 example/plugins/cpp-api/intercept/intercept.cc
 delete mode 100644 
example/plugins/cpp-api/internal_transaction_handling/InternalTransactionHandling.cc
 delete mode 100644 example/plugins/cpp-api/logger_example/LoggerExample.cc
 delete mode 100644 
example/plugins/cpp-api/multiple_transaction_hooks/MultipleTransactionHookPlugins.cc
 delete mode 100644 
example/plugins/cpp-api/null_transformation_plugin/NullTransformationPlugin.cc
 delete mode 100644 example/plugins/cpp-api/post_buffer/PostBuffer.cc
 delete mode 100644 example/plugins/cpp-api/remap_plugin/RemapPlugin.cc
 delete mode 100644 example/plugins/cpp-api/serverresponse/ServerResponse.cc
 delete mode 100644 example/plugins/cpp-api/stat_example/StatExample.cc
 delete mode 100644 
example/plugins/cpp-api/timeout_example/TimeoutExamplePlugin.cc
 delete mode 100644 
example/plugins/cpp-api/transactionhook/TransactionHookPlugin.cc
 delete mode 100644 example/plugins/cpp-api/websocket/README.txt
 delete mode 100644 example/plugins/cpp-api/websocket/WSBuffer.cc
 delete mode 100644 example/plugins/cpp-api/websocket/WSBuffer.h
 delete mode 100644 example/plugins/cpp-api/websocket/WebSocket.cc
 delete mode 100644 example/plugins/cpp-api/websocket/WebSocket.h



[trafficserver] branch master updated (c0199ed2a0 -> 0b61b060e5)

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

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


from c0199ed2a0 suppress coverity false positive on race condition (#10278)
 add 0b61b060e5 replace net_config_poll_timeout with 
EThread::default_wait_interval_ms (#10289)

No new revisions were added by this update.

Summary of changes:
 iocore/aio/AIO.cc|  2 +-
 iocore/aio/test_AIO.cc   |  3 ---
 iocore/eventsystem/I_EThread.h   | 10 ++
 iocore/eventsystem/I_SocketManager.h |  2 --
 iocore/eventsystem/UnixEThread.cc|  1 +
 iocore/net/I_Net.h   |  1 -
 iocore/net/Net.cc|  9 -
 iocore/net/PollCont.cc   |  2 +-
 iocore/net/PollCont.h|  4 ++--
 iocore/net/UnixUDPNet.cc |  2 +-
 iocore/net/test_I_UDPNet.cc  |  1 -
 src/traffic_quic/traffic_quic.cc |  1 -
 src/traffic_server/traffic_server.cc |  8 
 13 files changed, 24 insertions(+), 22 deletions(-)



[trafficserver] branch master updated (0b61b060e5 -> 313406a04e)

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

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


from 0b61b060e5 replace net_config_poll_timeout with 
EThread::default_wait_interval_ms (#10289)
 add 313406a04e untangle fds_limit global (#10288)

No new revisions were added by this update.

Summary of changes:
 include/tscore/ink_sys_control.h |  2 ++
 iocore/net/P_UnixNet.h   |  4 ++--
 iocore/net/UnixNet.cc|  1 -
 proxy/logging/LogStandalone.cc   |  5 +
 src/records/CMakeLists.txt   |  2 ++
 src/traffic_server/traffic_server.cc | 24 
 src/tscore/ink_sys_control.cc| 17 +
 7 files changed, 36 insertions(+), 19 deletions(-)



[trafficserver] branch master updated (3de9b5c7b7 -> 42940f56eb)

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

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


from 3de9b5c7b7 Fix connect failure count (#10294)
 add 42940f56eb remove deprecated 'NATIVE' AIO mode (#10269)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt |   9 -
 configure.ac   |  29 
 .../testing/blackbox-testing.en.rst|   5 -
 include/tscore/ink_config.h.cmake.in   |   1 -
 include/tscore/ink_config.h.in |   1 -
 iocore/aio/AIO.cc  | 182 +
 iocore/aio/I_AIO.h |  69 
 iocore/aio/P_AIO.h |  33 
 iocore/aio/test_AIO.cc |   6 -
 iocore/cache/Cache.cc  |  71 
 src/traffic_layout/info.cc |   1 -
 src/traffic_server/CMakeLists.txt  |   3 -
 src/traffic_server/InkAPI.cc   |  11 +-
 tests/README.md|   9 -
 14 files changed, 5 insertions(+), 425 deletions(-)



[trafficserver] branch master updated: Experimental io_uring AIO implementation for disk IO (#8992)

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

cmcfarlen 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 2bd6ff422 Experimental io_uring AIO implementation for disk IO (#8992)
2bd6ff422 is described below

commit 2bd6ff4225425a1ca4bb5139d9f1a05fed003f69
Author: Chris McFarlen 
AuthorDate: Wed Oct 26 10:05:43 2022 -0500

Experimental io_uring AIO implementation for disk IO (#8992)

* add io_uring feature to build

* link liburing library. Start adding implementation

* rename to DiskHandler to match native aio

* better way to integrate with net

* wip

* add diskhandler to main thread, link sqe ops for aio ops with multiple 
operations

* cleanup

* build should work without io_uring configured

* add config

* Finish config, attach parent wq, configure bounded/unbounded queues

* restore accidental line removal

* remove unused include

* set io opcode and increment stats

* Forward declare DiskHandler

* io_uring stats

* fix AIO_STAT_COUNT

* fix newline at end of file

Co-authored-by: Chris McFarlen 
---
 configure.ac |  28 
 include/tscore/ink_config.h.in   |   1 +
 iocore/aio/AIO.cc| 276 +--
 iocore/aio/I_AIO.h   |  57 +++-
 iocore/aio/P_AIO.h   |   4 +
 iocore/eventsystem/I_EThread.h   |   2 +-
 iocore/net/P_UnixNet.h   |   4 +
 iocore/net/UnixNet.cc|  35 +
 mgmt/RecordsConfig.cc|  12 ++
 src/traffic_server/InkAPI.cc |   2 +-
 src/traffic_server/Makefile.inc  |   1 +
 src/traffic_server/traffic_server.cc |  14 +-
 12 files changed, 417 insertions(+), 19 deletions(-)

diff --git a/configure.ac b/configure.ac
index 6f7f268f8..23ca94fdc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1687,6 +1687,34 @@ AS_IF([test "x$enable_linux_native_aio" = "xyes"], [
 AC_MSG_RESULT([$enable_linux_native_aio])
 TS_ARG_ENABLE_VAR([use], [linux_native_aio])
 
+# Check for enabling io_uring on linux
+
+AC_MSG_CHECKING([whether to enable Linux io_uring])
+AC_ARG_ENABLE([experimental-linux-io-uring],
+  [AS_HELP_STRING([--enable-experimental-linux-io-uring], [WARNING this is 
experimental: enable Linux io_uring support @<:@default=no@:>@])],
+  [enable_linux_io_uring="${enableval}"],
+  [enable_linux_io_uring=no]
+)
+
+AS_IF([test "x$enable_linux_io_uring" = "xyes"], [
+  URING_LIBS="-luring"
+  if test $host_os_def  != "linux"; then
+AC_MSG_ERROR([Linux io_uring can only be enabled on Linux systems])
+  fi
+
+  AC_CHECK_HEADERS([liburing.h], [],
+[AC_MSG_ERROR([Linux io_uring requires liburing.h (install liburing)])]
+  )
+
+  AC_SEARCH_LIBS([io_uring_queue_init], [uring], [AC_SUBST([URING_LIBS])],
+[AC_MSG_ERROR([Linux io_uring require uring])]
+  )
+])
+
+AC_MSG_RESULT([$enable_linux_io_uring])
+TS_ARG_ENABLE_VAR([use], [linux_io_uring])
+
+
 # Check for hwloc library.
 # If we don't find it, disable checking for header.
 use_hwloc=0
diff --git a/include/tscore/ink_config.h.in b/include/tscore/ink_config.h.in
index af3a0bbf3..30737e19c 100644
--- a/include/tscore/ink_config.h.in
+++ b/include/tscore/ink_config.h.in
@@ -80,6 +80,7 @@
 #define TS_USE_TLS_SET_CIPHERSUITES @use_tls_set_ciphersuites@
 #define TS_HAS_TLS_KEYLOGGING @has_tls_keylogging@
 #define TS_USE_LINUX_NATIVE_AIO @use_linux_native_aio@
+#define TS_USE_LINUX_IO_URING @use_linux_io_uring@
 #define TS_USE_REMOTE_UNWINDING @use_remote_unwinding@
 #define TS_USE_TLS_OCSP @use_tls_ocsp@
 #define TS_HAS_TLS_EARLY_DATA @has_tls_early_data@
diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index d76ed0bf0..078d2b58d 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -28,8 +28,14 @@
 #include "tscore/TSSystemState.h"
 #include "tscore/ink_hw.h"
 
+#include 
+
 #include "P_AIO.h"
 
+#if AIO_MODE == AIO_MODE_IO_URING
+#include 
+#endif
+
 #if AIO_MODE == AIO_MODE_NATIVE
 #define AIO_PERIOD -HRTIME_MSECONDS(10)
 #else
@@ -44,22 +50,35 @@ AIO_Reqs *aio_reqs[MAX_DISKS_POSSIBLE];
 /* number of unique file descriptors in the aio_reqs array */
 int num_filedes = 1;
 
+#if AIO_MODE == AIO_MODE_THREAD
 // acquire this mutex before inserting a new entry in the aio_reqs array.
 // Don't need to acquire this for searching the array
 static ink_mutex insert_mutex;
+#endif
 
 int thread_is_created = 0;
 #endif // AIO_MODE == AIO_MODE_NATIVE
 RecInt cache_config_threads_per_disk = 12;
 RecInt api_config_threads_per_disk   = 12;
 
+// config for io_uring mode
+#if AIO_MODE == AIO_MODE_IO_URING
+RecInt aio_io_uring_queue_entries = 1024;
+RecInt aio_io_uring_

[trafficserver] branch master updated: aio_thread_main does not have to be static (#9021)

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

cmcfarlen 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 0ca449ca7 aio_thread_main does not have to be static (#9021)
0ca449ca7 is described below

commit 0ca449ca725860c0412b3a64f32f0569383c5e8b
Author: cukiernik 
AuthorDate: Wed Oct 12 23:37:51 2022 +0200

aio_thread_main does not have to be static (#9021)
---
 iocore/aio/AIO.cc | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index 9384ed7c6..d76ed0bf0 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -181,11 +181,10 @@ ink_aio_start()
 
 #if AIO_MODE != AIO_MODE_NATIVE
 
-static void *aio_thread_main(void *arg);
-
 struct AIOThreadInfo : public Continuation {
   AIO_Reqs *req;
   int sleep_wait;
+  void *aio_thread_main(AIOThreadInfo *thr_info);
 
   int
   start(int event, Event *e)
@@ -436,12 +435,11 @@ ink_aio_thread_num_set(int thread_num)
 }
 
 void *
-aio_thread_main(void *arg)
+AIOThreadInfo::aio_thread_main(AIOThreadInfo *thr_info)
 {
-  AIOThreadInfo *thr_info = static_cast(arg);
-  AIO_Reqs *my_aio_req= thr_info->req;
-  AIO_Reqs *current_req   = nullptr;
-  AIOCallback *op = nullptr;
+  AIO_Reqs *my_aio_req  = thr_info->req;
+  AIO_Reqs *current_req = nullptr;
+  AIOCallback *op   = nullptr;
   ink_mutex_acquire(_aio_req->aio_mutex);
   for (;;) {
 do {



[trafficserver] branch master updated: Log trnx visited parent attempts (#9099)

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

cmcfarlen 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 e20e0bc78 Log trnx visited parent attempts (#9099)
e20e0bc78 is described below

commit e20e0bc78dcdad5025e5b7273dfd027ae4fd96e0
Author: Fabi Dias <110875544+fab...@users.noreply.github.com>
AuthorDate: Wed Oct 12 15:34:34 2022 -0600

Log trnx visited parent attempts (#9099)

* add parent counter to transaction metrics in findParent and nextParent.

* add to documentation

Co-authored-by: Fabielle Dias <>
---
 doc/admin-guide/monitoring/statistics/core/http-connection.en.rst | 5 +
 proxy/http/HttpConfig.cc  | 4 
 proxy/http/HttpConfig.h   | 2 +-
 proxy/http/HttpTransact.cc| 2 ++
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst 
b/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
index e00885c29..a2d95c4e0 100644
--- a/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
+++ b/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
@@ -159,6 +159,11 @@ HTTP Connection
 
Counts the number of times a multi-hop proxy loop was detected
 
+.. ts:stat:: global proxy.process.http_parent_count integer
+   :type: counter
+
+   Counts the number of times current parent or next parent was detected
+
 HTTP/2
 --
 
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 5b97d15aa..68288a23b 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1074,6 +1074,10 @@ register_stat_callbacks()
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS, 
"proxy.process.http.dead_server.no_requests", RECD_COUNTER, RECP_PERSISTENT,
  (int)http_dead_server_no_requests, RecRawStatSyncSum);
+
+  // Current transaction stats parent counter
+  RecRegisterRawStat(http_rsb, RECT_PROCESS, 
"proxy.process.http_parent_count", RECD_COUNTER, RECP_PERSISTENT,
+ (int)http_parent_count, RecRawStatSyncCount);
 }
 
 static bool
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 469b1c720..1b3090587 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -366,7 +366,7 @@ enum {
   http_origin_private,
   http_origin_close_private,
   http_origin_raw,
-
+  http_parent_count,
   http_stat_count
 };
 
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index d84dc4248..3a18c904a 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -187,6 +187,7 @@ inline static void
 findParent(HttpTransact::State *s)
 {
   url_mapping *mp = s->url_map.getMapping();
+  HTTP_INCREMENT_DYN_STAT(http_parent_count);
   if (s->response_action.handled) {
 s->parent_result.hostname = s->response_action.action.hostname;
 s->parent_result.port = s->response_action.action.port;
@@ -277,6 +278,7 @@ nextParent(HttpTransact::State *s)
   TxnDebug("parent_down", "connection to parent %s failed, conn_state: %s, 
request to origin: %s", s->parent_result.hostname,
HttpDebugNames::get_server_state_name(s->current.state), 
s->request_data.get_host());
   url_mapping *mp = s->url_map.getMapping();
+  HTTP_INCREMENT_DYN_STAT(http_parent_count);
   if (s->response_action.handled) {
 s->parent_result.hostname = s->response_action.action.hostname;
 s->parent_result.port = s->response_action.action.port;



[trafficserver] branch master updated (4335cf868 -> ed13a31f2)

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

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


from 4335cf868 Add Au test for various HTTP requests that are not RFC 
compliant. (#9035)
 add ed13a31f2 fix contradicting documentation and say a bit about the 
resident size of a volume directory (#9133)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/storage/index.en.rst   | 2 +-
 doc/developer-guide/cache-architecture/architecture.en.rst | 4 
 2 files changed, 5 insertions(+), 1 deletion(-)



[trafficserver] branch master updated (ed13a31f2 -> 4f4ee2e21)

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

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


from ed13a31f2 fix contradicting documentation and say a bit about the 
resident size of a volume directory (#9133)
 add 4f4ee2e21 Allocator that just uses malloc and bypasses custom jemalloc 
or freelists (#9108)

No new revisions were added by this update.

Summary of changes:
 configure.ac  |  11 
 include/tscore/Allocator.h| 117 +++---
 include/tscore/ink_config.h.in|   2 +
 iocore/eventsystem/I_ProxyAllocator.h |   3 +-
 mgmt/RecordsConfig.cc |   2 +
 src/traffic_server/traffic_server.cc  |   6 ++
 6 files changed, 130 insertions(+), 11 deletions(-)



[trafficserver] branch master updated: Hugepage support for iobuffer (#9228)

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

cmcfarlen 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 49bd4ec23 Hugepage support for iobuffer (#9228)
49bd4ec23 is described below

commit 49bd4ec23b55cfc8e9b40fe6550d21c2dae8bd36
Author: Chris McFarlen 
AuthorDate: Thu Jan 5 15:04:36 2023 -0600

Hugepage support for iobuffer (#9228)

* Make iobufs use FreelistAllocator and updates to hugepages support

* remove benchmark from Makefile

* fix build issues

* add missing documentation for new config items

* fix table

* provide default value for new config

* remove todo that will not happen

* use bool for use_hugepages variable

Co-authored-by: Chris McFarlen 
---
 doc/admin-guide/files/records.config.en.rst | 46 +++
 include/tscore/Allocator.h  | 24 --
 include/tscore/ink_queue.h  | 10 --
 iocore/cache/Cache.cc   |  6 +++-
 iocore/cache/CacheDir.cc|  4 +--
 iocore/cache/P_CacheInternal.h  |  1 +
 iocore/eventsystem/EventSystem.cc   | 24 +-
 iocore/eventsystem/IOBuffer.cc  | 24 +++---
 iocore/eventsystem/I_IOBuffer.h |  3 +-
 mgmt/RecordsConfig.cc   |  6 
 proxy/http/remap/Makefile.am|  1 +
 src/traffic_server/traffic_server.cc|  8 ++---
 src/tscore/ink_queue.cc | 49 +++--
 13 files changed, 162 insertions(+), 44 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index b0ddaa630..068ae8c82 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -4916,6 +4916,52 @@ Sockets
platforms.  (Currently only Linux).  IO buffers are allocated with the 
MADV_DONTDUMP
with madvise() on Linux platforms that support MADV_DONTDUMP.  Enabled by 
default.
 
+.. ts:cv:: CONFIG proxy.config.allocator.iobuf_chunk_sizes STRING
+
+   This configures the chunk sizes of each of the IO buffer allocators.  The 
chunk size is the number
+   of buffers allocated in a batch when the allocator's freelist is exhausted. 
 This must be specified as a
+   space separated list of up to 15 numbers.  If not specified or if any value 
specified is 0, the default
+   value will be used.
+
+   The list of numbers will specify the chunk sizes in the following order:
+
+   ``128 256 512 1k 2k 4k 8k 16k 32k 64k 128k 256k 512k 1M 2M``
+
+   The defaults for each allocator is:
+
+   ``128 128 128 128 128 128 32 32 32 32 32 32 32 32 32``
+
+   Even though this is specified, the actual chunk size might be modified 
based on the system's page size (or hugepage
+   size if enabled).
+
+   You might want to adjust these values to reduce the overall number of 
allocations that ATS needs to make based
+   on your configured RAM cache size.  On a running system, you can send 
SIGUSR1 to the ATS process to have it
+   log the allocator statistics and see how many of each buffer size have been 
allocated.
+
+.. ts:cv:: CONFIG proxy.config.allocator.iobuf_use_hugepages INT 0
+
+   This setting controls whether huge pages allocations are used to allocate 
io buffers.  If enabled, and hugepages are
+   not available, this will fall back to normal size pages. Using hugepages 
for iobuffer can sometimes improve performance
+   by utilizing more of the TLB and reducing TLB misses.
+
+   = ==
+   Value Description
+   = ==
+   ``0`` IO buffer allocation uses normal pages sizes
+   ``1`` IO buffer allocation uses huge pages
+   = ==
+
+.. ts:cv:: CONFIG proxy.config.cache.dir.enable_hugepages INT 0
+
+   This setting controls whether huge pages allocations are used to allocate 
memory for cache volume dir entries.
+
+   = ==
+   Value Description
+   = ==
+   ``0`` Use normal pages sizes
+   ``1`` Use huge pages
+   = ==
+
 .. ts:cv:: CONFIG proxy.config.ssl.misc.io.max_buffer_index INT 8
 
Configures the max IOBuffer Block index used for various SSL Operations
diff --git a/include/tscore/Allocator.h b/include/tscore/Allocator.h
index 2b630318a..00e1ce6a8 100644
--- a/include/tscore/Allocator.h
+++ b/include/tscore/Allocator.h
@@ -97,16 +97,18 @@ public:
 @param chunk_size number of units to be allocated if free pool

[trafficserver] branch master updated (5f27946ba -> e8ccdb21b)

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

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


from 5f27946ba Clean RefCountObj (#9217)
 add e8ccdb21b update gdb-helpers (#9201)

No new revisions were added by this update.

Summary of changes:
 tools/gdb-helpers.py | 29 +++--
 1 file changed, 23 insertions(+), 6 deletions(-)



[trafficserver] branch master updated (71a80d1ab -> f51f9df4f)

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

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


from 71a80d1ab authproxy: Handle WRITE_READY event (#9243)
 add f51f9df4f Add autest to reproduce the conditional get cache body drain 
issue (#9244)

No new revisions were added by this update.

Summary of changes:
 proxy/http/HttpSM.cc   |  3 +
 ...caching.test.py => conditional-get-hit.test.py} | 21 ++---
 .../replay/conditional-get-cache-hit.yaml} | 92 --
 3 files changed, 57 insertions(+), 59 deletions(-)
 copy tests/gold_tests/cache/{alternate-caching.test.py => 
conditional-get-hit.test.py} (69%)
 copy tests/gold_tests/{dns/replay/multiple_host_requests.replay.yaml => 
cache/replay/conditional-get-cache-hit.yaml} (50%)



[trafficserver] branch 8.1.x updated (c16631ab0 -> 490be6547)

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

cmcfarlen pushed a change to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


from c16631ab0 remove trailing space
 add 490be6547 drain request body on cache noop action (#9241)

No new revisions were added by this update.

Summary of changes:
 proxy/http/HttpSM.cc | 3 +++
 1 file changed, 3 insertions(+)



[trafficserver] branch master updated: Output diags to stderr before reconfig (#9164)

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

cmcfarlen 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 114d6befe Output diags to stderr before reconfig (#9164)
114d6befe is described below

commit 114d6befe7058c5e7ed51a8d8314662ba35cb807
Author: Chris McFarlen 
AuthorDate: Tue Nov 8 10:00:26 2022 -0600

Output diags to stderr before reconfig (#9164)

* Output diags to stderr before reconfig

Co-authored-by: Chris McFarlen 
---
 proxy/shared/DiagsConfig.cc | 5 +
 src/tscore/ink_cap.cc   | 8 
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/proxy/shared/DiagsConfig.cc b/proxy/shared/DiagsConfig.cc
index 08afcbffa..3e505020d 100644
--- a/proxy/shared/DiagsConfig.cc
+++ b/proxy/shared/DiagsConfig.cc
@@ -238,6 +238,11 @@ DiagsConfig::config_diags_norecords()
 c.enabled(DiagsTagType_Action, 0);
   }
 
+  // Route all outputs to stderr by default until reconfigured with 
records.config
+  for (auto  : c.outputs) {
+o.to_stderr = true;
+  }
+
 #if !defined(__GNUC__)
   _diags->config = c;
 #else
diff --git a/src/tscore/ink_cap.cc b/src/tscore/ink_cap.cc
index 03b1249b5..23aeec2c5 100644
--- a/src/tscore/ink_cap.cc
+++ b/src/tscore/ink_cap.cc
@@ -278,7 +278,7 @@ RestrictCapabilities()
 if (cap_set_flag(caps, CAP_PERMITTED, 1, perm_list + i, CAP_SET) < 0) {
 } else {
   if (cap_set_proc(caps) == -1) { // it failed, back out
-Warning("CAP_PERMITTED failed for option %d", i);
+Debug("privileges", "CAP_PERMITTED failed for option %d", i);
   } else {
 if (cap_set_flag(caps_good, CAP_PERMITTED, 1, perm_list + i, CAP_SET) 
< 0) {
 }
@@ -294,7 +294,7 @@ RestrictCapabilities()
 if (cap_set_flag(caps, CAP_EFFECTIVE, 1, eff_list + i, CAP_SET) < 0) {
 } else {
   if (cap_set_proc(caps) == -1) { // it failed, back out
-Warning("CAP_EFFECTIVE failed for option %d", i);
+Debug("privileges", "CAP_EFFECTIVE failed for option %d", i);
   } else {
 if (cap_set_flag(caps_good, CAP_EFFECTIVE, 1, eff_list + i, CAP_SET) < 
0) {
 }
@@ -314,14 +314,14 @@ RestrictCapabilities()
 cap_flag_value_t val;
 if (cap_get_flag(caps_good, perm_list[i], CAP_PERMITTED, ) < 0) {
 } else {
-  Warning("CAP_PERMITTED offiset %d is %s", i, val == CAP_SET ? "set" : 
"unset");
+  Debug("privileges", "CAP_PERMITTED offset %d is %s", i, val == CAP_SET ? 
"set" : "unset");
 }
   }
   for (int i = 0; i < EFF_CAP_COUNT; i++) {
 cap_flag_value_t val;
 if (cap_get_flag(caps_good, eff_list[i], CAP_EFFECTIVE, ) < 0) {
 } else {
-  Warning("CAP_EFFECTIVE offiset %d is %s", i, val == CAP_SET ? "set" : 
"unset");
+  Debug("privileges", "CAP_EFFECTIVE offset %d is %s", i, val == CAP_SET ? 
"set" : "unset");
 }
   }
 



[trafficserver] branch master updated: reconfigure should not apply a bad config even if exit_on_load_fail is off(0) (#9163)

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

cmcfarlen 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 167a33d99 reconfigure should not apply a bad config even if 
exit_on_load_fail is off(0) (#9163)
167a33d99 is described below

commit 167a33d99b114293035e4490e9ad0a07443e2487
Author: Chris McFarlen 
AuthorDate: Wed Nov 2 18:36:52 2022 -0500

reconfigure should not apply a bad config even if exit_on_load_fail is 
off(0) (#9163)
---
 iocore/net/SSLConfig.cc   | 2 +-
 tests/gold_tests/tls/ssl_multicert_loader.test.py | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index 336c084cc..29b2fcfb8 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -570,7 +570,7 @@ SSLCertificateConfig::reconfigure()
 
   // 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 || !params->configExitOnLoadError) {
+  if (retStatus) {
 configid = configProcessor.set(configid, lookup);
   } else {
 delete lookup;
diff --git a/tests/gold_tests/tls/ssl_multicert_loader.test.py 
b/tests/gold_tests/tls/ssl_multicert_loader.test.py
index dad0aa17b..53cb1e733 100644
--- a/tests/gold_tests/tls/ssl_multicert_loader.test.py
+++ b/tests/gold_tests/tls/ssl_multicert_loader.test.py
@@ -31,6 +31,7 @@ server.addResponse("sessionlog.json", request_header, 
response_header)
 ts.Disk.records_config.update({
 'proxy.config.ssl.server.cert.path': f'{ts.Variables.SSLDir}',
 'proxy.config.ssl.server.private_key.path': f'{ts.Variables.SSLDir}',
+'proxy.config.ssl.server.multicert.exit_on_load_fail': 0,
 })
 
 ts.addDefaultSSLFiles()
@@ -107,7 +108,7 @@ tr4.Processes.Default.StartBefore(ts2)
 
 ts2.ReturnCode = 2
 ts2.Ready = 0  # Need this to be 0 because we are testing shutdown, this is to 
make autest not think ats went away for a bad reason.
-ts.Disk.traffic_out.Content = Testers.ExcludesExpression(
+ts2.Disk.traffic_out.Content = Testers.ExcludesExpression(
 'Traffic Server is fully initialized',
 'process should fail when invalid certificate specified')
 ts2.Disk.diags_log.Content = Testers.IncludesExpression('FATAL: failed to load 
SSL certificate file', 'check diags.log"')



[trafficserver] branch master updated (bdb802ba8 -> 2f9d60137)

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

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


from bdb802ba8 QUIC: Add support to configure UDP max payload limit. (#9486)
 add 2f9d60137 Remove support for port event polling (#9476)

No new revisions were added by this update.

Summary of changes:
 configure.ac   | 13 +---
 .../testing/blackbox-testing.en.rst|  1 -
 include/tscore/ink_config.h.in |  1 -
 include/tscore/ink_platform.h  |  3 -
 iocore/eventsystem/UnixEThread.cc  |  2 -
 iocore/net/P_UnixNet.h | 72 +-
 iocore/net/P_UnixPollDescriptor.h  | 16 -
 iocore/net/SSLNetVConnection.cc|  7 ---
 iocore/net/UnixNet.cc  | 34 --
 iocore/net/UnixUDPNet.cc   |  5 --
 src/traffic_layout/info.cc |  1 -
 tests/README.md|  1 -
 12 files changed, 2 insertions(+), 154 deletions(-)



[trafficserver] branch master updated (c7ed799cc -> 8a265a504)

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

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


from c7ed799cc Fixes silent header duplication that occurs upon successful 
revalidation when duplicate headers are present (#9527)
 add 8a265a504 Add dockerfile for building h3 tools for testing (#9357)

No new revisions were added by this update.

Summary of changes:
 tools/build_h3_tools.sh |   4 +-
 tools/http3/Dockerfile  | 105 
 2 files changed, 107 insertions(+), 2 deletions(-)
 create mode 100644 tools/http3/Dockerfile



[trafficserver] branch master updated (8a265a504 -> a2d8a0953)

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

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


from 8a265a504 Add dockerfile for building h3 tools for testing (#9357)
 add a2d8a0953 cleanup cache inlines to avoid duplicate symbol definitions 
(#9443)

No new revisions were added by this update.

Summary of changes:
 iocore/cache/CMakeLists.txt|  1 -
 iocore/cache/I_CacheDefs.h |  2 ++
 iocore/cache/Inline.cc | 30 ---
 iocore/cache/Makefile.am   |  1 -
 iocore/cache/P_CacheArray.h| 25 +++-
 iocore/cache/P_CacheDir.h  | 15 ++
 iocore/cache/P_CacheHttp.h |  2 +-
 iocore/cache/P_CacheInternal.h | 67 --
 iocore/cache/P_CacheVol.h  | 52 
 9 files changed, 81 insertions(+), 114 deletions(-)
 delete mode 100644 iocore/cache/Inline.cc



[trafficserver] branch master updated (a2d8a0953 -> 8b8145f01)

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

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


from a2d8a0953 cleanup cache inlines to avoid duplicate symbol definitions 
(#9443)
 add 8b8145f01 Fix records events deps (#9511)

No new revisions were added by this update.

Summary of changes:
 include/records/I_RecDefs.h|  14 ++
 include/records/I_RecProcess.h |  16 +-
 iocore/eventsystem/CMakeLists.txt  |   5 +-
 iocore/eventsystem/I_EventSystem.h |   1 +
 iocore/eventsystem/Makefile.am |   2 +
 {src/records => iocore/eventsystem}/RecProcess.cc  |  51 +
 .../eventsystem/RecProcess.h   |  37 ++-
 iocore/eventsystem/RecRawStatsImpl.cc  | 254 +
 mgmt/rpc/Makefile.am   |   4 -
 proxy/logging/LogStandalone.cc |   3 +-
 src/records/CMakeLists.txt |  29 +--
 src/records/Makefile.am|   6 +-
 src/records/RecCore.cc |  21 ++
 src/records/RecRawStats.cc | 233 ++-
 src/traffic_crashlog/Makefile.inc  |   2 +-
 src/traffic_crashlog/traffic_crashlog.cc   |   1 +
 src/traffic_layout/Makefile.inc|   2 +-
 src/traffic_layout/engine.cc   |   2 +
 src/traffic_layout/info.cc |   1 +
 src/traffic_quic/traffic_quic.cc   |   2 +
 src/traffic_server/CMakeLists.txt  |   2 +-
 src/traffic_server/traffic_server.cc   |   3 +-
 src/tscore/CMakeLists.txt  |   2 +-
 23 files changed, 349 insertions(+), 344 deletions(-)
 rename {src/records => iocore/eventsystem}/RecProcess.cc (85%)
 copy src/tscore/ink_rwlock.cc => iocore/eventsystem/RecProcess.h (62%)
 create mode 100644 iocore/eventsystem/RecRawStatsImpl.cc



[trafficserver] branch master updated (d07a6acc7 -> a6df23009)

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

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


from d07a6acc7 Avoid memory allocation in CryptoHash (#9474)
 add a6df23009 Separate io_uring into a separate library. AIO in io_uring 
mode uses new io_uring lib. (#9462)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt |   8 +-
 configure.ac   |   3 +
 iocore/CMakeLists.txt  |   2 +
 iocore/Makefile.am |   3 +
 iocore/aio/AIO.cc  | 160 ++--
 iocore/aio/CMakeLists.txt  |   2 +-
 iocore/aio/I_AIO.h |  48 +---
 iocore/aio/Makefile.am |   1 +
 iocore/cache/CMakeLists.txt|   1 +
 iocore/dns/CMakeLists.txt  |   1 +
 iocore/hostdb/CMakeLists.txt   |   1 +
 iocore/{hostdb => io_uring}/CMakeLists.txt |  22 +-
 iocore/io_uring/I_IO_URING.h   |  85 +++
 .../Makefile.inc => iocore/io_uring/Makefile.am|  45 ++--
 .../P_RecLocal.h => iocore/io_uring/P_IO_URING.h   |   4 +-
 iocore/io_uring/io_uring.cc| 182 ++
 iocore/io_uring/unit_tests/test_diskIO.cc  | 271 +
 iocore/net/CMakeLists.txt  |   1 +
 iocore/net/P_UnixNet.h |   7 +-
 iocore/net/UnixNet.cc  |  35 ++-
 mgmt/config/CMakeLists.txt |   6 +-
 mgmt/rpc/CMakeLists.txt|   7 +-
 src/traffic_server/CMakeLists.txt  |   6 +-
 src/traffic_server/Makefile.inc|   5 +
 src/traffic_server/traffic_server.cc   |   8 +-
 25 files changed, 654 insertions(+), 260 deletions(-)
 copy iocore/{hostdb => io_uring}/CMakeLists.txt (75%)
 create mode 100644 iocore/io_uring/I_IO_URING.h
 copy src/traffic_via/Makefile.inc => iocore/io_uring/Makefile.am (60%)
 copy include/records/P_RecLocal.h => iocore/io_uring/P_IO_URING.h (89%)
 create mode 100644 iocore/io_uring/io_uring.cc
 create mode 100644 iocore/io_uring/unit_tests/test_diskIO.cc



[trafficserver] branch master updated (a6df23009 -> 07a1543c8)

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

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


from a6df23009 Separate io_uring into a separate library. AIO in io_uring 
mode uses new io_uring lib. (#9462)
 add 07a1543c8 Hugepage config cleanup (#9479)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/files/records.yaml.en.rst  | 35 +++-
 iocore/cache/Cache.cc  |  6 +-
 iocore/cache/CacheDir.cc   |  4 +-
 iocore/cache/P_CacheInternal.h |  1 -
 iocore/eventsystem/EventSystem.cc  | 20 ++-
 iocore/eventsystem/IOBuffer.cc | 77 ++
 iocore/eventsystem/I_IOBuffer.h|  2 +
 iocore/eventsystem/unit_tests/test_IOBuffer.cc | 45 +++
 iocore/hostdb/Makefile.am  |  5 +-
 proxy/logging/Makefile.am  |  6 +-
 src/records/RecordsConfig.cc   |  4 --
 src/traffic_quic/Makefile.inc  |  2 +-
 12 files changed, 145 insertions(+), 62 deletions(-)



[trafficserver] branch master updated (465e0e460 -> 7c9215eae)

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

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


from 465e0e460 On arm64 macOS, do not use pagezero linker flag when using 
luajit (#9430)
 add 7c9215eae Fixes comparison with the wrong type (#9441)

No new revisions were added by this update.

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



[trafficserver] branch master updated: Remove UDP_stubs.h (#9413)

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

cmcfarlen 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 2402444b58 Remove UDP_stubs.h (#9413)
2402444b58 is described below

commit 2402444b5864411f2415ae142ba81d7637656531
Author: Chris McFarlen 
AuthorDate: Thu Feb 16 10:45:25 2023 -0600

Remove UDP_stubs.h (#9413)

Remove UDP_stubs.h
---
 include/tscore/UDP_stubs.h |  36 --
 iocore/aio/test_AIO.cc |   3 -
 iocore/net/I_UDPPacket.h   |  62 +++--
 iocore/net/P_UDPNet.h  |   1 -
 iocore/net/P_UDPPacket.h   | 143 -
 iocore/net/QUICPacketHandler.cc|   2 +-
 iocore/net/QUICPacketHandler_quiche.cc |   2 +-
 iocore/net/UnixUDPNet.cc   | 141 +++-
 iocore/net/quic/test/test_QUICAddrVerifyState.cc   |   2 -
 iocore/net/quic/test/test_QUICFlowController.cc|   2 -
 iocore/net/quic/test/test_QUICFrame.cc |   2 -
 iocore/net/quic/test/test_QUICFrameDispatcher.cc   |   2 -
 iocore/net/quic/test/test_QUICHandshakeProtocol.cc |   2 -
 iocore/net/quic/test/test_QUICLossDetector.cc  |   2 -
 iocore/net/quic/test/test_QUICPacketFactory.cc |   2 -
 .../quic/test/test_QUICPacketHeaderProtector.cc|   2 -
 iocore/net/quic/test/test_QUICPathValidator.cc |   2 -
 iocore/net/quic/test/test_QUICStream.cc|   2 -
 iocore/net/quic/test/test_QUICStreamManager.cc |   2 -
 iocore/net/quic/test/test_QUICStreamState.cc   |   2 -
 iocore/net/quic/test/test_QUICVersionNegotiator.cc |   2 -
 proxy/http/remap/unit-tests/nexthop_test_stubs.cc  |   3 -
 proxy/http/unit_tests/unit_test_main.cc|   3 -
 proxy/http3/test/main_qpack.cc |   3 -
 proxy/logging/LogStandalone.cc |   2 +-
 src/traffic_logcat/logcat.cc   |   3 -
 src/traffic_logstats/logstats.cc   |   3 -
 src/traffic_server/InkIOCoreAPI.cc |   4 +-
 28 files changed, 166 insertions(+), 271 deletions(-)

diff --git a/include/tscore/UDP_stubs.h b/include/tscore/UDP_stubs.h
deleted file mode 100644
index 353a837fbc..00
--- a/include/tscore/UDP_stubs.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
- *
- *  A brief file description
- *
- *  @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.
- */
-
-// This is needed to avoid library dependency ugliness.
-// ToDo: This would be good to eliminate in the libraries...
-#include "I_NetVConnection.h"
-#include "P_UDPConnection.h"
-#include "P_UDPPacket.h"
-
-void
-UDPConnection::Release()
-{
-}
-
-ClassAllocator udpPacketAllocator("udpPacketAllocator");
-int fds_limit = 8000;
diff --git a/iocore/aio/test_AIO.cc b/iocore/aio/test_AIO.cc
index 5b450f1167..22ac40f461 100644
--- a/iocore/aio/test_AIO.cc
+++ b/iocore/aio/test_AIO.cc
@@ -33,9 +33,6 @@
 using std::cout;
 using std::endl;
 
-// ToDo: It would be nice to decouple these UDP dependencies ...
-#include "tscore/UDP_stubs.h"
-
 // Necessary for AIO
 int net_config_poll_timeout = 10;
 
diff --git a/iocore/net/I_UDPPacket.h b/iocore/net/I_UDPPacket.h
index 56e5a37e23..59c7aa28c2 100644
--- a/iocore/net/I_UDPPacket.h
+++ b/iocore/net/I_UDPPacket.h
@@ -53,7 +53,6 @@ public:
   /**
  Add IOBufferBlock (chain) to end of packet.
  @param block block chain to add.
-
*/
   void append_block(IOBufferBlock *block);
 
@@ -63,48 +62,29 @@ public:
   int from_size;
 
   LINK(UDPPacket, link);
-};
 
-/**
-   Create a new packet to be sent over UDPConnection. This actually
-   copies data from a buffer.
+  // Factory (static) methods
 
+  /**
+ Create a new packet to be sent over UDPConnection.  Packet has no
+ destination or data.
+  */
+  static UDPPacket *new_UDPPacket();
 
-   @param to  address of where to send packet
-   @param when ink_hrtime relative to ink_get_hrtime_internal

[trafficserver] branch master updated (396c49762 -> b3f30efa7)

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

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


from 396c49762 libswoc: Remove TextView from inet.cc (#9438)
 add b3f30efa7 cmake fixes to build on Linux (#9459)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt   | 20 
 include/tscore/ink_config.h.cmake.in | 14 ++
 include/tscore/ink_file.h|  3 ++-
 iocore/eventsystem/CMakeLists.txt|  5 ++---
 iocore/net/CMakeLists.txt| 13 -
 lib/CMakeLists.txt   |  1 +
 src/tscore/CMakeLists.txt|  2 +-
 7 files changed, 52 insertions(+), 6 deletions(-)



[trafficserver] branch master updated (736dd5a866 -> 38456d4b46)

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

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


from 736dd5a866 Update build_h3_tools for mac (#9608)
 add 38456d4b46 Change submit_and_wait to take ink_hrtime. Fix test_AIO for 
io_uring. (#9555)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt |  1 +
 iocore/aio/CMakeLists.txt  |  1 +
 iocore/aio/sample.cfg  |  2 +
 iocore/aio/test_AIO.cc | 88 --
 iocore/io_uring/I_IO_URING.h   |  3 +-
 iocore/io_uring/io_uring.cc| 10 ++--
 iocore/io_uring/unit_tests/test_diskIO.cc  |  9 +--
 {proxy/shared => src/tests}/CMakeLists.txt | 13 +++--
 src/traffic_server/CMakeLists.txt  |  3 +-
 src/traffic_server/traffic_server.cc   |  2 +-
 src/traffic_via/test_traffic_via   |  6 +-
 11 files changed, 114 insertions(+), 24 deletions(-)
 copy {proxy/shared => src/tests}/CMakeLists.txt (70%)



[trafficserver] branch master updated: add traffic_ctl to cmake (#9628)

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

cmcfarlen 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 e678432baa add traffic_ctl to cmake (#9628)
e678432baa is described below

commit e678432baa612948faba2c63f82f13eff90331b3
Author: Chris McFarlen 
AuthorDate: Mon Apr 24 11:29:56 2023 -0500

add traffic_ctl to cmake (#9628)

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt |  1 +
 src/traffic_ctl/CMakeLists.txt | 38 ++
 2 files changed, 39 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index daefcf79fd..dd4bf2a7bb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -190,6 +190,7 @@ add_subdirectory(mgmt/utils)
 add_subdirectory(mgmt/config)
 add_subdirectory(mgmt/rpc)
 add_subdirectory(src/traffic_server)
+add_subdirectory(src/traffic_ctl)
 add_subdirectory(src/tests)
 add_subdirectory(plugins)
 add_subdirectory(configs)
diff --git a/src/traffic_ctl/CMakeLists.txt b/src/traffic_ctl/CMakeLists.txt
new file mode 100644
index 00..8ab0222cea
--- /dev/null
+++ b/src/traffic_ctl/CMakeLists.txt
@@ -0,0 +1,38 @@
+###
+#
+#  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_executable(traffic_ctl
+traffic_ctl.cc
+CtrlCommands.cc
+CtrlPrinters.cc
+FileConfigCommand.cc
+${CMAKE_SOURCE_DIR}/src/shared/rpc/IPCSocketClient.cc
+)
+
+target_include_directories(traffic_ctl PRIVATE
+${IOCORE_INCLUDE_DIRS}
+${PROXY_INCLUDE_DIRS}
+${CMAKE_SOURCE_DIR}/mgmt
+${CMAKE_SOURCE_DIR}/mgmt/utils
+)
+target_link_libraries(traffic_ctl
+tscore
+yaml-cpp
+libswoc
+)
+
+install(TARGETS traffic_server)



[trafficserver] branch master updated (3a92d6433d -> 7b34a528bd)

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

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


from 3a92d6433d add 'how it works' section to the slice plugin docs (#9638)
 add 7b34a528bd add targets for clang-format (#9645)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt | 37 +
 1 file changed, 37 insertions(+)



[trafficserver] branch master updated (b2870aafd1 -> d40ca1a4fd)

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

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


from b2870aafd1 quic: Fix session cleanup assert. (#9622)
 add d40ca1a4fd Cmake plugins and install things (#9597)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt |  9 +
 include/ts/Makefile.am => configs/CMakeLists.txt   | 17 -
 iocore/eventsystem/CMakeLists.txt  |  2 +-
 lib/CMakeLists.txt |  3 ++
 lib/fastlz/CMakeLists.txt  |  1 +
 cmake/FindPCRE.cmake => plugins/CMakeLists.txt | 34 +++---
 {lib/fastlz => plugins/authproxy}/CMakeLists.txt   |  4 +--
 .../background_fetch}/CMakeLists.txt   |  9 +++--
 .../cache_promote}/CMakeLists.txt  | 10 --
 .../cache_range_requests}/CMakeLists.txt   |  6 ++--
 {lib/fastlz => plugins/cachekey}/CMakeLists.txt| 10 --
 {lib/fastlz => plugins/certifier}/CMakeLists.txt   |  4 +--
 {lib/fastlz => plugins/compress}/CMakeLists.txt|  8 +++--
 plugins/compress/compress.cc   |  2 +-
 plugins/compress/configuration.cc  |  2 +-
 {lib/fastlz => plugins/conf_remap}/CMakeLists.txt  |  6 ++--
 {lib/fastlz => plugins/generator}/CMakeLists.txt   |  4 +--
 {lib/fastlz => plugins/xdebug}/CMakeLists.txt  |  4 +--
 src/records/CMakeLists.txt |  3 +-
 src/traffic_server/CMakeLists.txt  |  2 ++
 src/tscore/CMakeLists.txt  |  2 ++
 {iocore/utils => src/tscpp/api}/CMakeLists.txt | 40 ++
 src/tscpp/util/CMakeLists.txt  |  1 +
 23 files changed, 111 insertions(+), 72 deletions(-)
 copy include/ts/Makefile.am => configs/CMakeLists.txt (75%)
 copy cmake/FindPCRE.cmake => plugins/CMakeLists.txt (52%)
 copy {lib/fastlz => plugins/authproxy}/CMakeLists.txt (92%)
 copy {lib/fastlz => plugins/background_fetch}/CMakeLists.txt (87%)
 copy {lib/fastlz => plugins/cache_promote}/CMakeLists.txt (85%)
 copy {lib/fastlz => plugins/cache_range_requests}/CMakeLists.txt (92%)
 copy {lib/fastlz => plugins/cachekey}/CMakeLists.txt (87%)
 copy {lib/fastlz => plugins/certifier}/CMakeLists.txt (92%)
 copy {lib/fastlz => plugins/compress}/CMakeLists.txt (90%)
 copy {lib/fastlz => plugins/conf_remap}/CMakeLists.txt (92%)
 copy {lib/fastlz => plugins/generator}/CMakeLists.txt (92%)
 copy {lib/fastlz => plugins/xdebug}/CMakeLists.txt (92%)
 copy {iocore/utils => src/tscpp/api}/CMakeLists.txt (57%)



[trafficserver] branch master updated (e9f9bc40e8 -> 1a01e92135)

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

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


from e9f9bc40e8 cmake build, fixed warning using older openssl APIs (#9648)
 add 1a01e92135 Try to do less work in hot function HttpHookState::getNext 
(#9660)

No new revisions were added by this update.

Summary of changes:
 proxy/InkAPIInternal.h   |  3 ---
 src/traffic_server/InkAPI.cc | 37 -
 2 files changed, 12 insertions(+), 28 deletions(-)



[trafficserver] branch master updated (dfad359c2 -> 99eb23a59)

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

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


from dfad359c2 Cleanup: Use swoc::meta instead of ts::meta. (#9566)
 add 99eb23a59 fixup cmake build for master and add conditional for 
io_uring support (#9571)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt   | 12 
 include/tscore/ink_config.h.cmake.in |  6 ++
 include/tscore/ink_ssl.h | 14 --
 iocore/CMakeLists.txt|  2 ++
 proxy/http/CMakeLists.txt|  1 +
 proxy/http2/CMakeLists.txt   |  1 +
 src/tscpp/util/unit_tests/test_IntrusiveDList.cc |  6 +++---
 7 files changed, 33 insertions(+), 9 deletions(-)



[trafficserver] branch master updated: combine UDPPacket and UDPPacketInternal (#9424)

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

cmcfarlen 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 de8e2439f combine UDPPacket and UDPPacketInternal (#9424)
de8e2439f is described below

commit de8e2439fdd4dc491bb7af512b8f8603a81a7be1
Author: Chris McFarlen 
AuthorDate: Wed Mar 29 15:48:30 2023 -0500

combine UDPPacket and UDPPacketInternal (#9424)

* combine UDPPacket and UDPPacketInternal

* remove UDPPacketInternal from uncompiled code

* PR comments

* Re-introduce internal class as a private aggregate of udppacket.  Include 
friend declarations for class that need private access

-

Co-authored-by: Chris McFarlen 
---
 iocore/net/I_UDPConnection.h  |  11 +-
 iocore/net/I_UDPPacket.h  |  76 ++-
 iocore/net/Makefile.am|   1 -
 iocore/net/P_QUICNet.h|   6 +-
 iocore/net/P_UDPConnection.h  |   9 --
 iocore/net/P_UDPNet.h |  61 -
 iocore/net/P_UDPPacket.h  |  57 
 iocore/net/P_UnixUDPConnection.h  |   3 +-
 iocore/net/QUICNet.cc |  10 +-
 iocore/net/QUICPacketHandler.cc   |   2 +-
 iocore/net/QUICPacketHandler_quiche.cc|   2 +-
 iocore/net/UnixUDPConnection.cc   |  17 ++-
 iocore/net/UnixUDPNet.cc  | 217 --
 iocore/net/quic/QUICPacketReceiveQueue.cc |   2 +-
 14 files changed, 217 insertions(+), 257 deletions(-)

diff --git a/iocore/net/I_UDPConnection.h b/iocore/net/I_UDPConnection.h
index a56f5cd5d..a9ae05fe8 100644
--- a/iocore/net/I_UDPConnection.h
+++ b/iocore/net/I_UDPConnection.h
@@ -71,7 +71,7 @@ public:
  Callbacks:
  cont->handleEvent(NET_EVENT_DATAGRAM_ERROR, UDPConnection *) on error
  
- cont->handleEvent(NET_EVENT_DATAGRAM_READ_READY, 
QueueUDPPacketInternal *) on incoming packets.
+ cont->handleEvent(NET_EVENT_DATAGRAM_READ_READY, QueueUDPPacket 
*) on incoming packets.
 
  @return Action* Always returns nullptr.  Can't be
  cancelled via this Action.
@@ -100,6 +100,15 @@ public:
   void bindToThread(Continuation *c, EThread *t);
 
   virtual void UDPConnection_is_abstract() = 0;
+
+  // this is for doing packet scheduling: we keep two values so that we can
+  // implement cancel.  The first value tracks the startTime of the last
+  // packet that was sent on this connection; the second value tracks the
+  // startTime of the last packet when we are doing scheduling;  whenever the
+  // associated continuation cancels a packet, we rest lastPktStartTime to be
+  // the same as the lastSentPktStartTime.
+  uint64_t lastSentPktStartTime = 0;
+  uint64_t lastPktStartTime = 0;
 };
 
 extern UDPConnection *new_UDPConnection(int fd);
diff --git a/iocore/net/I_UDPPacket.h b/iocore/net/I_UDPPacket.h
index 59c7aa28c..d3705ed7f 100644
--- a/iocore/net/I_UDPPacket.h
+++ b/iocore/net/I_UDPPacket.h
@@ -32,6 +32,23 @@
 #pragma once
 
 #include "I_UDPConnection.h"
+
+struct UDPPacketInternal {
+  // packet scheduling stuff: keep it a doubly linked list
+  uint64_t pktLength= 0;
+  uint16_t segment_size = 0;
+
+  int reqGenerationNum = 0;
+  ink_hrtime delivery_time = 0; // when to deliver packet
+
+  Ptr chain;
+  Continuation *cont  = nullptr; // callback on error
+  UDPConnection *conn = nullptr; // connection where packet should be sent to.
+
+  int in_the_priority_queue = 0;
+  int in_heap   = 0;
+};
+
 /** @name UDPPacket
 UDP packet functions used by UDPConnection
  */
@@ -41,14 +58,21 @@
  */
 class UDPPacket
 {
+  friend class UDPQueue;
+  friend class PacketQueue;
+  friend class UDPConnection;
+  friend class UnixUDPConnection;
+
 public:
-  virtual ~UDPPacket() {}
-  virtual void free(); // fast deallocate
+  UDPPacket();
+  ~UDPPacket();
+  void free(); // fast deallocate
+
   void setContinuation(Continuation *c);
   void setConnection(UDPConnection *c);
   UDPConnection *getConnection();
   IOBufferBlock *getIOBlockChain();
-  int64_t getPktLength() const;
+  int64_t getPktLength();
 
   /**
  Add IOBufferBlock (chain) to end of packet.
@@ -62,7 +86,6 @@ public:
   int from_size;
 
   LINK(UDPPacket, link);
-
   // Factory (static) methods
 
   /**
@@ -87,4 +110,49 @@ public:
  Internal function only
   */
   static UDPPacket *new_incoming_UDPPacket(struct sockaddr *from, struct 
sockaddr *to, Ptr );
+
+private:
+  SLINK(UDPPacket, alink); // atomic link
+  UDPPacketInternal p;
 };
+
+// Inline definitions
+
+inline void
+UDPPacket::setContinuation(Continuation *c)
+{
+  p.cont = c;
+}
+
+inline void
+UDPPacket::setConnection(UDPConnection *c)
+{
+  /*Code reviewed by Case Larsen.  Previously, we just had
+ ink_assert(!conn).  This prevents tunneling of pack

[trafficserver] branch master updated (20709e32c5 -> 601500d044)

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

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


from 20709e32c5 Removes the UglyStub file (#9401)
 add 601500d044 update cmake for rpc and swoc (#9409)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt |  17 +++-
 cmake/subproject_version.cmake |  37 
 include/tscore/ink_config.h.cmake.in   |   2 +-
 iocore/eventsystem/CMakeLists.txt  |   1 +
 lib/CMakeLists.txt |   1 +
 lib/swoc/CMakeLists.txt| 132 +
 {iocore/dns => mgmt/config}/CMakeLists.txt |  25 +++---
 mgmt/config/Makefile.am|   2 +-
 {iocore/cache => mgmt/rpc}/CMakeLists.txt  |  57 +++--
 src/records/CMakeLists.txt |   6 ++
 src/traffic_server/CMakeLists.txt  |   7 +-
 src/tscpp/util/CMakeLists.txt  |   3 +-
 12 files changed, 242 insertions(+), 48 deletions(-)
 create mode 100644 cmake/subproject_version.cmake
 create mode 100644 lib/swoc/CMakeLists.txt
 copy {iocore/dns => mgmt/config}/CMakeLists.txt (84%)
 copy {iocore/cache => mgmt/rpc}/CMakeLists.txt (65%)



[trafficserver] branch master updated: Remove mgmt library (#9388)

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

cmcfarlen 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 cab52476be Remove mgmt library (#9388)
cab52476be is described below

commit cab52476be1025bf4696145e3a9324bf3f03d849
Author: Chris McFarlen 
AuthorDate: Fri Feb 10 13:34:18 2023 -0600

Remove mgmt library (#9388)

* remove mgmt library

* remove libmgmt from build

* fix library order for clang

* missed a few

* link mgmt utils lib

* fix include for quic test

-

Co-authored-by: Chris McFarlen 
---
 include/records/I_RecCore.h|   1 -
 .../records/I_RecordsConfig.h  |   0
 include/tscpp/util/Makefile.am |   3 +-
 {mgmt => include/tscpp/util}/YamlCfg.h |   0
 iocore/aio/Makefile.am |   2 -
 iocore/cache/Makefile.am   |   1 -
 iocore/cache/test/main.h   |   2 +-
 iocore/dns/P_SplitDNSProcessor.h   |   2 +-
 .../eventsystem/ConfigProcessor.cc |   2 +-
 .../eventsystem/ConfigProcessor.h  |   0
 iocore/eventsystem/Makefile.am |   5 +-
 iocore/eventsystem/unit_tests/test_IOBuffer.cc |   2 +-
 iocore/hostdb/Makefile.am  |   2 -
 iocore/net/Makefile.am |   4 -
 iocore/net/P_SSLCertLookup.h   |   2 +-
 iocore/net/P_SSLClientCoordinator.h|   2 +-
 iocore/net/P_SSLConfig.h   |   2 +-
 iocore/net/SSLNetVConnection.cc|   2 -
 iocore/net/SSLSNIConfig.h  |   2 +-
 iocore/net/quic/Makefile.am|   1 -
 iocore/net/quic/QUICConfig.h   |   2 +-
 iocore/net/quic/test/event_processor_main.cc   |   2 +-
 iocore/net/quic/test/main.cc   |   2 +-
 mgmt/DerivativeMetrics.cc  | 138 ---
 mgmt/DerivativeMetrics.h   |  40 --
 mgmt/Makefile.am   |  25 --
 mgmt/WebMgmtUtils.cc   | 423 -
 mgmt/WebMgmtUtils.h|  54 ---
 mgmt/rpc/Makefile.am   |   9 +-
 proxy/CacheControl.cc  |   2 +-
 proxy/ControlMatcher.cc|   2 +-
 proxy/IPAllow.h|   2 +-
 proxy/InkAPIInternal.h |   2 +-
 proxy/ParentSelection.cc   |   2 +-
 proxy/ParentSelection.h|   2 +-
 proxy/ReverseProxy.cc  |   2 +-
 proxy/StatPages.cc |   2 +-
 proxy/Transform.cc |   2 +-
 proxy/hdrs/Makefile.am |   2 -
 proxy/http/HttpCacheSM.h   |   2 +-
 proxy/http/HttpConfig.cc   |   2 +-
 proxy/http/HttpConfig.h|   2 +-
 proxy/http/HttpSM.cc   |   2 +-
 proxy/http/HttpTransact.h  |   2 +-
 proxy/http/Makefile.am |   3 +-
 proxy/http/remap/Makefile.am   |   4 -
 proxy/http/remap/NextHopConsistentHash.cc  |   2 +-
 proxy/http/remap/NextHopSelectionStrategy.cc   |   2 +-
 proxy/http/remap/NextHopStrategyFactory.cc |   2 +-
 proxy/http/remap/UrlRewrite.cc |   2 +-
 proxy/http2/Makefile.am|   2 -
 proxy/http2/unit_tests/main.cc |   2 +-
 proxy/http3/Http3Config.h  |   2 +-
 proxy/http3/Makefile.am|   1 -
 proxy/http3/test/main.cc   |   2 +-
 proxy/http3/test/main_qpack.cc |   2 +-
 proxy/logging/LogConfig.h  |   2 +-
 proxy/logging/LogStandalone.cc |   2 +-
 proxy/logging/unit-tests/benchmark_LogObject.cc|   2 -
 src/records/Makefile.am|   9 +-
 src/records/P_RecCore.cc   |   3 -
 src/records/RecCore.cc |   2 +-
 src/records/RecUtils.cc|   2 +-
 src/records/RecYAMLDecoder.cc  |   2 +-
 {mgmt => src/records}/RecordsConfig.cc |   2 +-
 {mgmt => src/records}/RecordsConfigUtils.cc|   2 +-
 src/traffic_crashlog/Makefile.inc  |   1 -
 src/traffic_crashlog/traffic_crashlog.cc   |   2 +-
 src/traffic_layout/Makefile.inc|   1 -
 src/traffic_layout/

[trafficserver] branch master updated: improve cmake support (#9290)

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

cmcfarlen 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 7cdb749203 improve cmake support (#9290)
7cdb749203 is described below

commit 7cdb74920304cf29b54d09c1cc592bc78ee17550
Author: Chris McFarlen 
AuthorDate: Fri Feb 10 13:33:29 2023 -0600

improve cmake support (#9290)

* add a bunch of CMakeLists.txt

* Add license headers

* yamlcpp doesnt need apache license

* add license

* license

* build traffic_server

* catch tests

-

Co-authored-by: Chris McFarlen 
---
 CMakeLists.txt   | 204 ---
 cmake/FindPCRE.cmake |  34 ++
 include/tscore/ink_config.h.cmake.in |  97 +++
 iocore/CMakeLists.txt|  34 ++
 iocore/aio/CMakeLists.txt|  21 
 iocore/cache/CMakeLists.txt  |  49 
 iocore/dns/CMakeLists.txt|  37 ++
 iocore/eventsystem/CMakeLists.txt|  37 ++
 iocore/eventsystem/I_MIOBufferWriter.h   |   2 +-
 iocore/hostdb/CMakeLists.txt |  38 ++
 iocore/net/CMakeLists.txt|  81 
 iocore/utils/CMakeLists.txt  |  32 +
 lib/CMakeLists.txt   |  25 
 lib/fastlz/CMakeLists.txt|  20 +++
 lib/yamlcpp/CMakeLists.txt   |   2 +-
 mgmt/CMakeLists.txt  |  44 +++
 mgmt/utils/CMakeLists.txt|  46 +++
 proxy/CMakeLists.txt |  63 ++
 proxy/hdrs/CMakeLists.txt|  34 ++
 proxy/http/CMakeLists.txt|  49 
 proxy/http/remap/CMakeLists.txt  |  44 +++
 proxy/http2/CMakeLists.txt   |  37 ++
 proxy/logging/CMakeLists.txt |  42 +++
 proxy/shared/CMakeLists.txt  |  34 ++
 src/records/CMakeLists.txt   |  59 +
 src/traffic_server/CMakeLists.txt|  57 +
 src/tscore/CMakeLists.txt| 151 +++
 src/tscore/unit_tests/test_Extendible.cc |   6 -
 src/tscpp/util/CMakeLists.txt|  33 +
 29 files changed, 1304 insertions(+), 108 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8402a7a02b..f8b909aac8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,108 +23,112 @@
 #
 ###
 
-cmake_minimum_required(VERSION 3.7)
+cmake_minimum_required(VERSION 3.23)
 project(ats)
 
+enable_testing()
 set(CMAKE_CXX_STANDARD 17)
 
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+
+# Gather some environment info
+string(TOLOWER ${CMAKE_HOST_SYSTEM_NAME} HOST_OS)
+set(BUILD_NUMBER "0" CACHE STRING "The build number")
+execute_process(COMMAND id -nu OUTPUT_VARIABLE BUILD_PERSON 
OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process(COMMAND id -ng OUTPUT_VARIABLE BUILD_GROUP 
OUTPUT_STRIP_TRAILING_WHITESPACE)
+execute_process(COMMAND uname -n OUTPUT_VARIABLE BUILD_MACHINE 
OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+# Options
+set(DEFAULT_STACK_SIZE 1048576 CACHE STRING "Default stack size (default 
1048576)")
+set(TS_MAX_HOST_NAME_LEN 256 CACHE STRING "Max host name length (default 256)")
+set(TS_USE_SET_RBIO 1 CACHE STRING "Use openssl set_rbio (default 1)")
+set(TS_USE_DIAGS 1 CACHE STRING "Use diags (default 1)")
+
+set(TS_VERSION_MAJOR 10)
+set(TS_VERSION_MINOR 0)
+set(TS_VERSION_MICRO 0)
+set(TS_LIBTOOL_MAJOR ${TS_VERSION_MAJOR}${TS_VERSION_MINOR})
+set(TS_LIBTOOL_VERSION 
${TS_LIBTOOL_MAJOR}:${TS_VERSION_MICRO}:${TS_VERSION_MINOR})
+set(TS_VERSION_STRING TS_VERSION_S)
+set(TS_VERSION_NUMBER TS_VERSION_N)
+
+# Check include files
+include(CheckIncludeFile)
+include(CheckIncludeFiles)
+include(CheckIncludeFileCXX)
+include(CheckSymbolExists)
+
+CHECK_INCLUDE_FILE(dlfcn.h HAVE_DLFCN_H)
+CHECK_INCLUDE_FILE(float.h HAVE_FLOAT_H)
+CHECK_INCLUDE_FILE(stdlib.h HAVE_STDLIB_H)
+CHECK_INCLUDE_FILE(stdint.h HAVE_STDINT_H)
+CHECK_INCLUDE_FILE(inttypes.h HAVE_INTTYPES_H)
+CHECK_INCLUDE_FILE(string.h HAVE_STRING_H)
+CHECK_INCLUDE_FILE(sys/ioctl.h HAVE_SYS_IOCTL_H)
+CHECK_INCLUDE_FILE(sys/types.h HAVE_SYS_TYPES_H)
+CHECK_INCLUDE_FILE(sys/stat.h HAVE_SYS_STAT_H)
+CHECK_INCLUDE_FILE(sys/statvfs.h HAVE_SYS_STATVFS_H)
+CHECK_INCLUDE_FILE(sys/uio.h HAVE_SYS_UIO_H)
+CHECK_INCLUDE_FILE(sys/mman.h HAVE_SYS_MMAN_H)
+CHECK_INCLUDE_FILE(unistd.h HAVE_UNISTD_H)
+CHECK_INCLUDE_FILE(netinet/in.h HAVE_NETINET_IN_H)
+CHECK_INCLUDE_FILE(netinet/in_systm.h HAVE_NETINET_IN_SYSTM_H)
+CHECK_INCLUDE_FILE(netinet/tcp.h HAVE_NETINET_TCP_H)
+CHECK_INCLUDE_FILE(netinet/ip_icmp.h HAVE_NETINET_IP_ICMP_H)
+CHECK_INCLUDE_FILE(netdb.h HAVE_NETDB_H)
+CHECK_INCLUDE

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

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

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


from a46778a461 Updated parent retry attempt logic (#9620)
 add 2df27d7cf3 setup pre-commit hook at cmake generation time (#9669)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt | 11 +++
 1 file changed, 11 insertions(+)



[trafficserver] branch NewAPIMetricsPOC updated: add cmake support and a unittest. Fix crasher

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

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


The following commit(s) were added to refs/heads/NewAPIMetricsPOC by this push:
 new 342049b15f add cmake support and a unittest. Fix crasher
342049b15f is described below

commit 342049b15f11d6dd762afd82d45e161759e0141f
Author: Chris McFarlen 
AuthorDate: Thu Jul 6 15:44:14 2023 -0500

add cmake support and a unittest. Fix crasher
---
 CMakeLists.txt |  1 +
 include/api/Metrics.h  |  3 +-
 .../TSVConnFd => src/api}/CMakeLists.txt   | 13 ---
 src/api/Metrics.cc |  2 +-
 src/api/test_Metrics.cc| 40 ++
 src/records/CMakeLists.txt |  1 +
 .../gold_tests/pluginTest/TSVConnFd/CMakeLists.txt |  4 ++-
 7 files changed, 56 insertions(+), 8 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d17008f78e..fdb08b4bfc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -335,6 +335,7 @@ configure_file(include/ts/apidefs.h.in include/ts/apidefs.h)
 
 enable_testing()
 
+add_subdirectory(src/api)
 add_subdirectory(src/tscpp/util)
 add_subdirectory(src/tscpp/api)
 add_subdirectory(src/tscore)
diff --git a/include/api/Metrics.h b/include/api/Metrics.h
index 0379c7ceb4..f343c0d786 100644
--- a/include/api/Metrics.h
+++ b/include/api/Metrics.h
@@ -32,6 +32,7 @@
 #include 
 
 #include "records/P_RecDefs.h"
+#include "ts/apidefs.h"
 
 namespace ts
 {
@@ -63,7 +64,7 @@ public:
 
   virtual ~Metrics() = default;
 
-  Metrics() { _addBlob(); }
+  Metrics() { _blobs[0] = new MetricStorage(); }
 
   // Singleton
   static Metrics ();
diff --git a/tests/gold_tests/pluginTest/TSVConnFd/CMakeLists.txt 
b/src/api/CMakeLists.txt
similarity index 72%
copy from tests/gold_tests/pluginTest/TSVConnFd/CMakeLists.txt
copy to src/api/CMakeLists.txt
index 6c066fd313..718d9eda5c 100644
--- a/tests/gold_tests/pluginTest/TSVConnFd/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -15,9 +15,12 @@
 #
 ###
 
-add_library(TSVConnFd SHARED TSVConnFd.cc)
+add_library(tsapi STATIC Metrics.cc)
 
-set_target_properties(TSVConnFd PROPERTIES
-LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.libs"
-PREFIX ""
-)
+add_executable(test_Metrics
+test_Metrics.cc
+)
+target_link_libraries(test_Metrics PRIVATE tsapi tscore)
+target_include_directories(test_Metrics PRIVATE ${CMAKE_SOURCE_DIR}/include 
${CATCH_INCLUDE_DIR})
+
+add_test(NAME test_Metrics COMMAND $)
diff --git a/src/api/Metrics.cc b/src/api/Metrics.cc
index a95588c172..b2d04d31df 100644
--- a/src/api/Metrics.cc
+++ b/src/api/Metrics.cc
@@ -44,7 +44,7 @@ Metrics::_addBlob() // The mutex must be held before calling 
this!
   ink_assert(blob);
   ink_assert(_cur_blob < Metrics::METRICS_MAX_BLOBS);
 
-  _blobs[_cur_blob++] = blob;
+  _blobs[++_cur_blob] = blob;
   _cur_off= 0;
 }
 
diff --git a/src/api/test_Metrics.cc b/src/api/test_Metrics.cc
new file mode 100644
index 00..83f7d4df80
--- /dev/null
+++ b/src/api/test_Metrics.cc
@@ -0,0 +1,40 @@
+/** @file
+
+TextView unit tests.
+
+@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.
+*/
+
+#define CATCH_CONFIG_MAIN
+#include "catch.hpp"
+
+#include "api/Metrics.h"
+
+TEST_CASE("Metrics", "[libtsapi][Metrics]")
+{
+  ts::Metrics m;
+
+  auto fooid = m.newMetric("foo");
+
+  REQUIRE(fooid == 0);
+
+  m.increment(fooid);
+
+  m.recordsDump([](RecT, void *, int, const char *name, int value, RecData *) 
{ printf("Fooo: %s: %d\n", name, value); }, nullptr);
+}
diff --git a/src/records/CMakeLists.txt b/src/records/CMakeLists.txt
index a833909460..c4c01f1a1b 100644
--- a/src/records/CMakeLists.txt
+++ b/src/records/CMakeLists.txt
@@ -48,6 +48,7 @@ target_link_libraries(records_p
 #ts::inkevent cyclic dependency; I_RecProcess.h and P_RecProcess.h
 ts::tscore
 ts::tscpputil
+  

[trafficserver] 04/05: Move the dumper, fix valid()

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

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

commit 2017e8d984a46dd302237754b6a8a91f9e2362cb
Author: Leif Hedstrom 
AuthorDate: Thu Jul 6 15:05:09 2023 -0600

Move the dumper, fix valid()
---
 include/api/Metrics.h | 34 ++
 src/api/Metrics.cc| 31 +++
 2 files changed, 33 insertions(+), 32 deletions(-)

diff --git a/include/api/Metrics.h b/include/api/Metrics.h
index f343c0d786..0ab82324b8 100644
--- a/include/api/Metrics.h
+++ b/include/api/Metrics.h
@@ -113,40 +113,10 @@ public:
   {
 std::tuple idx = _splitID(id);
 
-return (id >= 0 && std::get<0>(idx) < _cur_blob && std::get<1>(idx) < 
METRICS_MAX_SIZE);
+return (id >= 0 && std::get<0>(idx) <= _cur_blob && std::get<1>(idx) < 
METRICS_MAX_SIZE);
   }
 
-  void
-  recordsDump(RecDumpEntryCb callback, void *edata)
-  {
-return;
-int16_t blob_ix, off_ix;
-int16_t off_max = METRICS_MAX_SIZE;
-
-{
-  std::lock_guard lock(_mutex);
-
-  // Capture these while protected, in case the blobs change
-  blob_ix = _cur_blob;
-  off_ix  = _cur_off;
-}
-
-for (int i = 0; i <= blob_ix; ++i) {
-  auto blob = _blobs[i];
-  auto= std::get<0>(*blob);
-  auto  = std::get<1>(*blob);
-  RecData datum;
-
-  if (i == blob_ix) {
-off_max = off_ix;
-  }
-  for (int j = 0; j < off_max; ++j) {
-datum.rec_int = metrics[j].load();
-// ToDo: The recordtype here is fine for now, but we should probably 
make this generic
-callback(RECT_PLUGIN, edata, 1, std::get<0>(names[i]).c_str(), 
TS_RECORDDATATYPE_INT, );
-  }
-}
-  }
+  void recordsDump(RecDumpEntryCb callback, void *edata);
 
 private:
   static constexpr std::tuple
diff --git a/src/api/Metrics.cc b/src/api/Metrics.cc
index b2d04d31df..c87239b61a 100644
--- a/src/api/Metrics.cc
+++ b/src/api/Metrics.cc
@@ -97,4 +97,35 @@ Metrics::lookup(IdType id) const
   return &(atomics[std::get<1>(idx)]);
 }
 
+void
+Metrics::recordsDump(RecDumpEntryCb callback, void *edata)
+{
+  int16_t blob_ix, off_ix;
+  int16_t off_max = METRICS_MAX_SIZE;
+
+  {
+std::lock_guard lock(_mutex);
+
+// Capture these while protected, in case the blobs change
+blob_ix = _cur_blob;
+off_ix  = _cur_off;
+  }
+
+  for (int i = 0; i <= blob_ix; ++i) {
+auto blob = _blobs[i];
+auto= std::get<0>(*blob);
+auto  = std::get<1>(*blob);
+RecData datum;
+
+if (i == blob_ix) {
+  off_max = off_ix;
+}
+for (int j = 0; j < off_max; ++j) {
+  datum.rec_int = metrics[j].load();
+  // ToDo: The recordtype here is fine for now, but we should probably 
make this generic
+  callback(RECT_PLUGIN, edata, 1, std::get<0>(names[i]).c_str(), 
TS_RECORDDATATYPE_INT, );
+}
+  }
+}
+
 } // namespace ts



[trafficserver] 01/05: Initial cut at a new Metrics API

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

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

commit 3a9e3ecd34ca1357b8629e3c81c80c6244c4abee
Author: Leif Hedstrom 
AuthorDate: Wed Jul 5 17:18:31 2023 -0600

Initial cut at a new Metrics API
---
 configure.ac  |   1 +
 include/api/Metrics.h | 166 ++
 src/Makefile.am   |   2 +-
 src/{ => api}/Makefile.am |  48 ++-
 src/api/Metrics.cc| 100 +++
 src/records/RecCore.cc|   5 ++
 src/traffic_crashlog/Makefile.inc |   1 +
 src/traffic_layout/Makefile.inc   |   1 +
 src/traffic_logcat/Makefile.inc   |   3 +-
 src/traffic_logstats/Makefile.inc |   3 +-
 src/traffic_server/InkAPI.cc  |  85 ---
 src/traffic_server/Makefile.inc   |   1 +
 12 files changed, 321 insertions(+), 95 deletions(-)

diff --git a/configure.ac b/configure.ac
index 555a8a7baa..fd4690c137 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2401,6 +2401,7 @@ AC_CONFIG_FILES([
   src/tscpp/util/Makefile
   src/tscore/Makefile
   src/records/Makefile
+  src/api/Makefile
   tools/Makefile
   tools/trafficserver.pc
   tools/tsxs
diff --git a/include/api/Metrics.h b/include/api/Metrics.h
new file mode 100644
index 00..aa7ab61168
--- /dev/null
+++ b/include/api/Metrics.h
@@ -0,0 +1,166 @@
+/** @file
+
+  A brief file description
+
+  @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 
+#include 
+
+#include "records/P_RecDefs.h"
+
+namespace ts
+{
+class Metrics
+{
+private:
+  using self_type  = Metrics;
+  using IdType = int32_t;
+  using AtomicType = std::atomic;
+
+public:
+  static constexpr uint16_t METRICS_MAX_BLOBS = 2048;
+  static constexpr uint16_t METRICS_MAX_SIZE  = 8192;  // For a total of 
16M metrics
+  static constexpr IdType NOT_FOUND   = INT32_MIN; // <16-bit,16-bit> 
= 
+
+private:
+  using NameAndId   = std::tuple;
+  using NameContainer   = std::array;
+  using AtomicContainer = std::array;
+  using MetricStorage   = std::tuple;
+  using MetricBlobs = std::array;
+  using LookupTable = std::unordered_map;
+
+public:
+  Metrics(const self_type &)  = delete;
+  self_type =(const self_type &) = delete;
+  Metrics =(Metrics &&)  = delete;
+  Metrics(Metrics &&) = delete;
+
+  virtual ~Metrics() = default;
+
+  Metrics() { _addBlob(); }
+
+  // Singleton
+  static Metrics ();
+
+  IdType newMetric(const std::string_view name);
+  IdType lookup(const std::string_view name);
+  AtomicType *lookup(IdType id) const;
+
+  // Inlined, for performance
+  int64_t
+  increment(IdType id, uint64_t val = 1)
+  {
+auto metric = lookup(id);
+
+return (metric ? metric->fetch_add(val) : NOT_FOUND);
+  }
+
+  int64_t
+  decrement(IdType id, uint64_t val = 1)
+  {
+auto metric = lookup(id);
+
+return (metric ? metric->fetch_sub(val) : NOT_FOUND);
+  }
+
+  int64_t
+  get(IdType id) const
+  {
+auto metric = lookup(id);
+
+return (metric ? metric->load() : NOT_FOUND);
+  }
+
+  void
+  set(IdType id, int64_t val)
+  {
+auto metric = lookup(id);
+
+if (metric) {
+  metric->store(val);
+}
+  }
+
+  bool
+  valid(IdType id) const
+  {
+std::tuple idx = _splitID(id);
+
+return (id >= 0 && std::get<0>(idx) < _cur_blob && std::get<1>(idx) < 
METRICS_MAX_SIZE);
+  }
+
+  void
+  recordsDump(RecDumpEntryCb callback, void *edata)
+  {
+return;
+int16_t blob_ix, off_ix;
+int16_t off_max = METRICS_MAX_SIZE;
+
+{
+  std::lock_guard lock(_mutex);
+
+  // Capture these while protected, in case the blobs change
+  blob_ix = _cur_blob;
+  off_ix  = _cur_off;
+}
+
+for (int i = 0; i <= blob_ix; ++i) {
+  auto blob = _blobs[i];
+  auto= std::get<0>(*blob);
+  auto  = std::get<1>(*blob);
+  RecData datum;
+
+

[trafficserver] 03/05: add cmake support and a unittest. Fix crasher

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

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

commit 4e5de6e08e732487d54db5ca5dc3a0a88400cf60
Author: Chris McFarlen 
AuthorDate: Thu Jul 6 15:44:14 2023 -0500

add cmake support and a unittest. Fix crasher
---
 CMakeLists.txt |  1 +
 include/api/Metrics.h  |  3 ++-
 src/api/CMakeLists.txt | 26 ++
 src/api/Metrics.cc |  2 +-
 src/api/test_Metrics.cc| 40 
 src/records/CMakeLists.txt |  1 +
 6 files changed, 71 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d17008f78e..fdb08b4bfc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -335,6 +335,7 @@ configure_file(include/ts/apidefs.h.in include/ts/apidefs.h)
 
 enable_testing()
 
+add_subdirectory(src/api)
 add_subdirectory(src/tscpp/util)
 add_subdirectory(src/tscpp/api)
 add_subdirectory(src/tscore)
diff --git a/include/api/Metrics.h b/include/api/Metrics.h
index 0379c7ceb4..f343c0d786 100644
--- a/include/api/Metrics.h
+++ b/include/api/Metrics.h
@@ -32,6 +32,7 @@
 #include 
 
 #include "records/P_RecDefs.h"
+#include "ts/apidefs.h"
 
 namespace ts
 {
@@ -63,7 +64,7 @@ public:
 
   virtual ~Metrics() = default;
 
-  Metrics() { _addBlob(); }
+  Metrics() { _blobs[0] = new MetricStorage(); }
 
   // Singleton
   static Metrics ();
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
new file mode 100644
index 00..718d9eda5c
--- /dev/null
+++ b/src/api/CMakeLists.txt
@@ -0,0 +1,26 @@
+###
+#
+#  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(tsapi STATIC Metrics.cc)
+
+add_executable(test_Metrics
+test_Metrics.cc
+)
+target_link_libraries(test_Metrics PRIVATE tsapi tscore)
+target_include_directories(test_Metrics PRIVATE ${CMAKE_SOURCE_DIR}/include 
${CATCH_INCLUDE_DIR})
+
+add_test(NAME test_Metrics COMMAND $)
diff --git a/src/api/Metrics.cc b/src/api/Metrics.cc
index a95588c172..b2d04d31df 100644
--- a/src/api/Metrics.cc
+++ b/src/api/Metrics.cc
@@ -44,7 +44,7 @@ Metrics::_addBlob() // The mutex must be held before calling 
this!
   ink_assert(blob);
   ink_assert(_cur_blob < Metrics::METRICS_MAX_BLOBS);
 
-  _blobs[_cur_blob++] = blob;
+  _blobs[++_cur_blob] = blob;
   _cur_off= 0;
 }
 
diff --git a/src/api/test_Metrics.cc b/src/api/test_Metrics.cc
new file mode 100644
index 00..83f7d4df80
--- /dev/null
+++ b/src/api/test_Metrics.cc
@@ -0,0 +1,40 @@
+/** @file
+
+TextView unit tests.
+
+@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.
+*/
+
+#define CATCH_CONFIG_MAIN
+#include "catch.hpp"
+
+#include "api/Metrics.h"
+
+TEST_CASE("Metrics", "[libtsapi][Metrics]")
+{
+  ts::Metrics m;
+
+  auto fooid = m.newMetric("foo");
+
+  REQUIRE(fooid == 0);
+
+  m.increment(fooid);
+
+  m.recordsDump([](RecT, void *, int, const char *name, int value, RecData *) 
{ printf("Fooo: %s: %d\n", name, value); }, nullptr);
+}
diff --git a/src/records/CMakeLists.txt b/src/records/CMakeLists.txt
index a833909460..c4c01f1a1b 100644
--- a/src/records/CMakeLists.txt
+++ b/src/records/CMakeLists.txt
@@ -48,6 +48,7 @@ target_link_libr

[trafficserver] 02/05: Fix the two array sizes to be correct

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

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

commit 929fb79cb2566914f358559fa59a13547f140a2c
Author: Leif Hedstrom 
AuthorDate: Thu Jul 6 14:18:40 2023 -0600

Fix the two array sizes to be correct
---
 include/api/Metrics.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/api/Metrics.h b/include/api/Metrics.h
index aa7ab61168..0379c7ceb4 100644
--- a/include/api/Metrics.h
+++ b/include/api/Metrics.h
@@ -43,8 +43,8 @@ private:
   using AtomicType = std::atomic;
 
 public:
-  static constexpr uint16_t METRICS_MAX_BLOBS = 2048;
-  static constexpr uint16_t METRICS_MAX_SIZE  = 8192;  // For a total of 
16M metrics
+  static constexpr uint16_t METRICS_MAX_BLOBS = 8192;
+  static constexpr uint16_t METRICS_MAX_SIZE  = 2048;  // For a total of 
16M metrics
   static constexpr IdType NOT_FOUND   = INT32_MIN; // <16-bit,16-bit> 
= 
 
 private:



[trafficserver] 05/05: Adding some comments, because you will ask

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

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

commit e36897821358c4f93f317bd541719ae7a0838601
Author: Leif Hedstrom 
AuthorDate: Thu Jul 6 15:42:50 2023 -0600

Adding some comments, because you will ask
---
 include/api/Metrics.h | 6 +-
 src/api/Metrics.cc| 5 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/api/Metrics.h b/include/api/Metrics.h
index 0ab82324b8..1c6a7e95a3 100644
--- a/include/api/Metrics.h
+++ b/include/api/Metrics.h
@@ -40,7 +40,7 @@ class Metrics
 {
 private:
   using self_type  = Metrics;
-  using IdType = int32_t;
+  using IdType = int32_t; // Could be a tuple, but one way or another, 
they have to be combined to an int32_t.
   using AtomicType = std::atomic;
 
 public:
@@ -69,6 +69,10 @@ public:
   // Singleton
   static Metrics ();
 
+  // Yes, we don't return objects here, but rather ID's and atomic's directly. 
We could
+  // make these objects, but that's a lot of object instances to manage, and 
right now the
+  // ID in the containers is very small and sufficient to work with. But 
agreed, it's not
+  // very C++-like (but compatible with old librecords ATS code!).
   IdType newMetric(const std::string_view name);
   IdType lookup(const std::string_view name);
   AtomicType *lookup(IdType id) const;
diff --git a/src/api/Metrics.cc b/src/api/Metrics.cc
index c87239b61a..fc500df46a 100644
--- a/src/api/Metrics.cc
+++ b/src/api/Metrics.cc
@@ -97,6 +97,9 @@ Metrics::lookup(IdType id) const
   return &(atomics[std::get<1>(idx)]);
 }
 
+// ToDo: This is probably not great, and likely we should have some better
+// way exposing iterators over the Metrics. That avoids this ugly dependency
+// between librecords and this code.
 void
 Metrics::recordsDump(RecDumpEntryCb callback, void *edata)
 {
@@ -123,7 +126,7 @@ Metrics::recordsDump(RecDumpEntryCb callback, void *edata)
 for (int j = 0; j < off_max; ++j) {
   datum.rec_int = metrics[j].load();
   // ToDo: The recordtype here is fine for now, but we should probably 
make this generic
-  callback(RECT_PLUGIN, edata, 1, std::get<0>(names[i]).c_str(), 
TS_RECORDDATATYPE_INT, );
+  callback(RECT_PLUGIN, edata, 1, std::get<0>(names[j]).c_str(), 
TS_RECORDDATATYPE_INT, );
 }
   }
 }



[trafficserver] branch NewAPIMetricsPOC updated (60d9fdd4d6 -> e368978213)

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

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


 discard 60d9fdd4d6 Adding some comments, because you will ask
 discard bd437d7e3f Move the dumper, fix valid()
 discard 342049b15f add cmake support and a unittest. Fix crasher
 discard 754b69182b Fix the two array sizes to be correct
 discard 1f97374d9a Merge branch 'master' into NewAPIMetricsPOC
 discard e550beb625 Initial cut at a new Metrics API
 add 2c66fbd394 Fix build_h3_tools for Darwin builds (#9964)
 add a34afa931d Fix test plugin for mac build (#9967)
 new 3a9e3ecd34 Initial cut at a new Metrics API
 new 929fb79cb2 Fix the two array sizes to be correct
 new 4e5de6e08e add cmake support and a unittest. Fix crasher
 new 2017e8d984 Move the dumper, fix valid()
 new e368978213 Adding some comments, because you will ask

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (60d9fdd4d6)
\
 N -- N -- N   refs/heads/NewAPIMetricsPOC (e368978213)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tools/build_h3_tools.sh | 12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)



[trafficserver] branch master updated: Fix test plugin for mac build (#9967)

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

cmcfarlen 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 a34afa931d Fix test plugin for mac build (#9967)
a34afa931d is described below

commit a34afa931d23291fc4c3ae1864b1c2f7c304a1dd
Author: Chris McFarlen 
AuthorDate: Thu Jul 6 18:21:58 2023 -0500

Fix test plugin for mac build (#9967)

* Fix test plugin for mac build

* restore target name

* consolidate properties

-

Co-authored-by: Chris McFarlen 
---
 tests/gold_tests/pluginTest/TSVConnFd/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/gold_tests/pluginTest/TSVConnFd/CMakeLists.txt 
b/tests/gold_tests/pluginTest/TSVConnFd/CMakeLists.txt
index 6c066fd313..13817d9175 100644
--- a/tests/gold_tests/pluginTest/TSVConnFd/CMakeLists.txt
+++ b/tests/gold_tests/pluginTest/TSVConnFd/CMakeLists.txt
@@ -15,9 +15,11 @@
 #
 ###
 
-add_library(TSVConnFd SHARED TSVConnFd.cc)
+add_library(TSVConnFd MODULE TSVConnFd.cc)
 
 set_target_properties(TSVConnFd PROPERTIES
 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/.libs"
 PREFIX ""
+SUFFIX ".so"
 )
+target_link_libraries(TSVConnFd PRIVATE tscore traffic_server)



[trafficserver] branch NewAPIMetricsPOC updated: fix cmake and const pass

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

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


The following commit(s) were added to refs/heads/NewAPIMetricsPOC by this push:
 new f872b88d77 fix cmake and const pass
f872b88d77 is described below

commit f872b88d77373c21b297e7952c5785a640a95422
Author: Chris McFarlen 
AuthorDate: Fri Jul 7 09:59:51 2023 -0500

fix cmake and const pass
---
 include/api/Metrics.h   | 16 
 src/api/CMakeLists.txt  |  2 +-
 src/api/Metrics.cc  |  4 ++--
 src/api/test_Metrics.cc |  2 +-
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/include/api/Metrics.h b/include/api/Metrics.h
index 35f573bc8b..e85f30033e 100644
--- a/include/api/Metrics.h
+++ b/include/api/Metrics.h
@@ -45,8 +45,8 @@ private:
 
 public:
   static constexpr uint16_t METRICS_MAX_BLOBS = 8192;
-  static constexpr uint16_t METRICS_MAX_SIZE  = 2048;  // For a total of 
16M metrics
-  static constexpr IdType NOT_FOUND   = INT32_MIN; // <16-bit,16-bit> 
= 
+  static constexpr uint16_t METRICS_MAX_SIZE  = 2048;  
 // For a total of 16M metrics
+  static constexpr IdType NOT_FOUND   = 
std::numeric_limits::min(); // <16-bit,16-bit> = 
 
 private:
   using NameAndId   = std::tuple;
@@ -79,7 +79,7 @@ public:
   // ID in the containers is very small and sufficient to work with. But 
agreed, it's not
   // very C++-like (but compatible with old librecords ATS code!).
   IdType newMetric(const std::string_view name);
-  IdType lookup(const std::string_view name);
+  IdType lookup(const std::string_view name) const;
   AtomicType *lookup(IdType id) const;
 
   AtomicType &
@@ -89,7 +89,7 @@ public:
   }
 
   IdType
-  operator[](const std::string_view name)
+  operator[](const std::string_view name) const
   {
 return lookup(name);
   }
@@ -132,12 +132,12 @@ public:
   bool
   valid(IdType id) const
   {
-std::tuple idx = _splitID(id);
+auto [blob, entry] = _splitID(id);
 
-return (id >= 0 && std::get<0>(idx) <= _cur_blob && std::get<1>(idx) < 
METRICS_MAX_SIZE);
+return (id >= 0 && blob <= _cur_blob && entry < METRICS_MAX_SIZE);
   }
 
-  void recordsDump(RecDumpEntryCb callback, void *edata);
+  void recordsDump(RecDumpEntryCb callback, void *edata) const;
 
 private:
   static constexpr std::tuple
@@ -148,7 +148,7 @@ private:
 
   void _addBlob();
 
-  std::mutex _mutex;
+  mutable std::mutex _mutex;
   LookupTable _lookups;
   MetricBlobs _blobs;
   uint16_t _cur_blob = 0;
diff --git a/src/api/CMakeLists.txt b/src/api/CMakeLists.txt
index 718d9eda5c..b0f0bbc5d2 100644
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -15,7 +15,7 @@
 #
 ###
 
-add_library(tsapi STATIC Metrics.cc)
+add_library(tsapi SHARED Metrics.cc)
 
 add_executable(test_Metrics
 test_Metrics.cc
diff --git a/src/api/Metrics.cc b/src/api/Metrics.cc
index 7135ba94f8..44bbb94657 100644
--- a/src/api/Metrics.cc
+++ b/src/api/Metrics.cc
@@ -75,7 +75,7 @@ Metrics::newMetric(std::string_view name)
 }
 
 Metrics::IdType
-Metrics::lookup(const std::string_view name)
+Metrics::lookup(const std::string_view name) const
 {
   std::lock_guard lock(_mutex);
   auto it = _lookups.find(name);
@@ -106,7 +106,7 @@ Metrics::lookup(IdType id) const
 // way exposing iterators over the Metrics. That avoids this ugly dependency
 // between librecords and this code.
 void
-Metrics::recordsDump(RecDumpEntryCb callback, void *edata)
+Metrics::recordsDump(RecDumpEntryCb callback, void *edata) const
 {
   int16_t off_max = METRICS_MAX_SIZE;
 
diff --git a/src/api/test_Metrics.cc b/src/api/test_Metrics.cc
index 83f7d4df80..0c28f91fb3 100644
--- a/src/api/test_Metrics.cc
+++ b/src/api/test_Metrics.cc
@@ -32,7 +32,7 @@ TEST_CASE("Metrics", "[libtsapi][Metrics]")
 
   auto fooid = m.newMetric("foo");
 
-  REQUIRE(fooid == 0);
+  REQUIRE(fooid == 1);
 
   m.increment(fooid);
 



  1   2   3   4   5   >