(trafficserver) branch master updated: Convert records to use Regex wrappers instead of pcre directly (#11279)

2024-04-23 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 cbe91698e2 Convert records to use Regex wrappers instead of pcre 
directly (#11279)
cbe91698e2 is described below

commit cbe91698e2054ddb0ac33d34a92e270fa9194909
Author: Bryan Call 
AuthorDate: Tue Apr 23 09:07:35 2024 -0700

Convert records to use Regex wrappers instead of pcre directly (#11279)
---
 src/records/RecUtils.cc | 22 +-
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/src/records/RecUtils.cc b/src/records/RecUtils.cc
index 8aaeecd4ba..51e76977cb 100644
--- a/src/records/RecUtils.cc
+++ b/src/records/RecUtils.cc
@@ -21,18 +21,11 @@
   limitations under the License.
  */
 
-#if __has_include("pcre/pcre.h")
-#include 
-#elif __has_include("pcre.h")
-#include 
-#else
-#error "Unable to locate PCRE heeader"
-#endif
-
 #include "tscore/ink_platform.h"
 #include "tscore/ink_memory.h"
 #include "tscore/ParseRules.h"
 #include "tscore/Tokenizer.h"
+#include "tsutil/Regex.h"
 #include "records/RecordsConfig.h"
 #include "P_RecUtils.h"
 #include "P_RecCore.h"
@@ -390,18 +383,13 @@ namespace
 bool
 recordRegexCheck(const char *pattern, const char *value)
 {
-  pcre *regex;
-  const char *error;
-  int erroffset;
+  Regex regex;
 
-  regex = pcre_compile(pattern, 0, , , nullptr);
-  if (!regex) {
+  bool rval = regex.compile(pattern);
+  if (rval == false) {
 return false;
   } else {
-int r = pcre_exec(regex, nullptr, value, strlen(value), 0, 0, nullptr, 0);
-
-pcre_free(regex);
-return (r != -1) ? true : false;
+return regex.exec(value);
   }
 
   return false; // no-op



(trafficserver) branch master updated (9e14e07ccd -> e20845453c)

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

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


from 9e14e07ccd tslua.so: handle unrecognized status codes (#11272)
 add e20845453c Regex: fix memory leak if the match buffer is too small 
(#11244)

No new revisions were added by this update.

Summary of changes:
 include/tsutil/Regex.h  |  2 +-
 src/tsutil/Regex.cc | 20 +---
 src/tsutil/unit_tests/test_Regex.cc | 10 ++
 3 files changed, 24 insertions(+), 8 deletions(-)



(trafficserver) branch master updated: Fixed asan leak issues with RegexContext (#11184)

2024-04-11 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 a39b8f112d Fixed asan leak issues with RegexContext (#11184)
a39b8f112d is described below

commit a39b8f112dc977e0f2d41daa3dc42d2fe5b7cd05
Author: Bryan Call 
AuthorDate: Thu Apr 11 15:29:56 2024 -0700

Fixed asan leak issues with RegexContext (#11184)
---
 src/tsutil/DbgCtl.cc | 16 -
 src/tsutil/Regex.cc  | 66 +---
 2 files changed, 72 insertions(+), 10 deletions(-)

diff --git a/src/tsutil/DbgCtl.cc b/src/tsutil/DbgCtl.cc
index da17985893..18112318f2 100644
--- a/src/tsutil/DbgCtl.cc
+++ b/src/tsutil/DbgCtl.cc
@@ -150,7 +150,7 @@ DbgCtl::_new_reference(char const *tag)
   DebugInterface *p = DebugInterface::get_instance();
   debug_assert(tag != nullptr);
 
-  // DbgCtl instances may be declared as static objects in the destructors of 
objects not destoyed till program exit.
+  // DbgCtl instances may be declared as static objects in the destructors of 
objects not destroyed till program exit.
   // So, we must handle the case where the construction of such instances of 
DbgCtl overlaps with the destruction of
   // other instances of DbgCtl.  That is why it is important to make sure the 
reference count is non-zero before
   // constructing _RegistryAccessor.  The _RegistryAccessor constructor is 
thereby able to assume that, if it creates
@@ -158,6 +158,20 @@ DbgCtl::_new_reference(char const *tag)
 
   ++_RegistryAccessor::registry_reference_count;
 
+  // There is a mutex in the C/C++ runtime that both dlopen() and 
_cxa_thread_atexit() lock while running.
+  // Creating a _RegistryAccessor instance locks the registry mutex.  If the 
subsequent code in this function triggers
+  // the construction of a thread_local variable (with a non-trivial 
destructor), the following deadlock scenario is
+  // possible:
+  // 1.  Thread 1 calls a DbgCtl constructor, which locks the registry mutex, 
but then is suspended.
+  // 2.  Thread 2 calls dlopen() for a plugin, locking the runtime mutex.  It 
then executes the constructor for a
+  // statically allocated DbgCtl object, which blocks on locking the 
registry mutex.
+  // 3.  Thread 1 resumes, and calls member functions of the derived class of 
DebugInterface.  If this causes the
+  // the construction of a thread_local variable with a non-trivial 
destructor, _cxa_thread_atexit() will be called
+  // to set up a call of the variable's destructor at thread exit.  The 
call to _cxa_thread_atexit() will block on
+  // the runtime mutex (held by Thread 2).  So Thread 1 holds the registry 
mutex and is blocked waiting for the
+  // runtime mutex.  And Thread 2 holds the runtime mutex and is blocked 
waiting for the registry mutex.  Deadlock.
+  //
+  // This deadlock is avoided by having the thread_local variable register its 
destruction in a non-thread_local class.
   _RegistryAccessor ra;
 
   auto {ra.data()};
diff --git a/src/tsutil/Regex.cc b/src/tsutil/Regex.cc
index faea3b8546..37e4b4337b 100644
--- a/src/tsutil/Regex.cc
+++ b/src/tsutil/Regex.cc
@@ -25,6 +25,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 //
 namespace
@@ -41,7 +43,19 @@ my_free(void *ptr, void * /*caller*/)
 {
   free(ptr);
 }
-} // namespace
+
+class RegexContext; // defined below
+class RegexContextCleanup
+{
+public:
+  void push_back(RegexContext *ctx);
+  ~RegexContextCleanup();
+
+private:
+  std::vector _contexts;
+  std::mutex _mutex;
+};
+RegexContextCleanup regex_context_cleanup;
 
 //
 class RegexContext
@@ -50,13 +64,20 @@ public:
   static RegexContext *
   get_instance()
   {
-if (!_regex_context) {
+if (_shutdown == true) {
+  return nullptr;
+}
+
+if (_regex_context == nullptr) {
   _regex_context = new RegexContext();
+  regex_context_cleanup.push_back(_regex_context);
 }
 return _regex_context;
   }
   ~RegexContext()
   {
+_shutdown = true;
+
 if (_general_context != nullptr) {
   pcre2_general_context_free(_general_context);
 }
@@ -100,17 +121,28 @@ private:
   pcre2_match_context *_match_context = nullptr;
   pcre2_jit_stack *_jit_stack = nullptr;
   thread_local static RegexContext *_regex_context;
+  static bool _shutdown; // flag to indicate destructor was called, so no new 
instances can be created
 };
 
 thread_local RegexContext *RegexContext::_regex_context = nullptr;
+bool RegexContext::_shutdown= false;
 
 //
-namespace
+
+RegexContextCleanup::~RegexContextCleanup()
 {
-struct RegexContextCleanup

svn commit: r68294 - in /release/trafficserver: trafficserver-9.2.4.tar.bz2 trafficserver-9.2.4.tar.bz2.asc trafficserver-9.2.4.tar.bz2.sha512

2024-04-03 Thread bcall
Author: bcall
Date: Wed Apr  3 18:39:21 2024
New Revision: 68294

Log:
Release 9.2.4

Added:
release/trafficserver/trafficserver-9.2.4.tar.bz2   (with props)
release/trafficserver/trafficserver-9.2.4.tar.bz2.asc   (with props)
release/trafficserver/trafficserver-9.2.4.tar.bz2.sha512

Added: release/trafficserver/trafficserver-9.2.4.tar.bz2
==
Binary file - no diff available.

Propchange: release/trafficserver/trafficserver-9.2.4.tar.bz2
--
svn:mime-type = application/x-bzip2

Added: release/trafficserver/trafficserver-9.2.4.tar.bz2.asc
==
Binary file - no diff available.

Propchange: release/trafficserver/trafficserver-9.2.4.tar.bz2.asc
--
svn:mime-type = application/pgp-signature

Added: release/trafficserver/trafficserver-9.2.4.tar.bz2.sha512
==
--- release/trafficserver/trafficserver-9.2.4.tar.bz2.sha512 (added)
+++ release/trafficserver/trafficserver-9.2.4.tar.bz2.sha512 Wed Apr  3 
18:39:21 2024
@@ -0,0 +1 @@
+8f75a1997466ddfaa2fad7ba7ea20dd46c6442eae4d75cf26670feb4ed0dc16b71e14ebd4ecf907abefed9e8d37ce7d7735de578659183c63c42d09adc744888
 *trafficserver-9.2.4.tar.bz2




(trafficserver) annotated tag 9.2.4-rc0 updated (90fbf13db0 -> df0a8c2824)

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

bcall pushed a change to annotated tag 9.2.4-rc0
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


*** WARNING: tag 9.2.4-rc0 was modified! ***

from 90fbf13db0 (commit)
  to df0a8c2824 (tag)
 tagging 90fbf13db0858cef0e0a094f445d846b60a4c1ef (commit)
 replaces 9.2.3
  by Bryan Call
  on Wed Apr 3 08:39:02 2024 -0700

- Log -
Release Candidate 9.2.4-rc0
-BEGIN PGP SIGNATURE-

iQIzBAABCAAdFiEEsoAf+ddX58RtiQxsTRVBELhFCOwFAmYNeBYACgkQTRVBELhF
COzm7RAAnOLuuuOAcgB3uguMgUeU9X3N/U5etWp7CVjmPHgxq5aT25XP+yCYtzPc
zofAUV62tMqJCEXp2Bw9Ty1yJ8MKfwImWHMqTHurB3/1oPnE0MLXgd1um1yS92Fo
pAS+BLWdSJnSvtLL1bDhlXsCcJfSXjuzv7QhyIcpsNcyEYiq60SxPVb8pMik5Rjm
sKdD9JdfY003MN8CilpfnntJnm2WjZS6DjBAJSelaHY41oGuYR2yfbn1uvrXQlmE
CefWttla/nKGlUOSMgKOoFhPdxWXtgIm8kVhPESRBLWQyh/B3tXe96n/Vskfb5fm
ZcDzxUNIJgRLNxzYaysyWG03On7RcG6bvRDEYNr+PZT/l446QIECpFu9Aydaqqo+
8+2iY85yLRIvLtmfL8FBGZKuClTGcw5nJsEy31Nc26W4gQ6/YT/deVoAYx+pW0av
HZT48qkcb0bvcmjj7BS7bHDr17A0tR9/QITUxUWsAKfp4JR4pbS7dv3i90UW8AmF
H4fGCnMPEreZ8D5Kgv54xgldwmS/L8aBl9OmViFDEi52DG6czqsV3jNbICjQD5z2
wGmT1g6YbSkBCJrzLtN+1Egy2JhEqIKpjFOz2+u/KEUy6Me/bp4b0idaHyXxxR89
wualauc9Xe5kf5E6NCSKEMdvY9be2yVSRCQmok0NRff06ocKwWU=
=/QAB
-END PGP SIGNATURE-
---


No new revisions were added by this update.

Summary of changes:



(trafficserver) branch 9.2.x updated: Updated CHANGELOG

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new 90fbf13db0 Updated CHANGELOG
90fbf13db0 is described below

commit 90fbf13db0858cef0e0a094f445d846b60a4c1ef
Author: Bryan Call 
AuthorDate: Wed Apr 3 08:36:56 2024 -0700

Updated CHANGELOG
---
 CHANGELOG-9.2.4 | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/CHANGELOG-9.2.4 b/CHANGELOG-9.2.4
index 7f4ca35302..a1560f9661 100644
--- a/CHANGELOG-9.2.4
+++ b/CHANGELOG-9.2.4
@@ -8,7 +8,22 @@ Changes with Apache Traffic Server 9.2.4
   #10551 - Make NextHopConsistentHash unit test stable
   #10556 - s3_auth: Clear handling TSAction in the config_reloader
   #10579 - Fix typo in docs for sni.yml
+  #10590 - applying additional accepts PR to 9.2.x
   #10591 - Fix typo in block_errors documentation
   #10621 - Fixed h2spec 6.4.3 test (#10584)
   #10622 - Fix H2 debug message for a rate limit (#10583)
   #10625 - Make bad disk detection more robust (backport for 9.2.x)
+  #10640 - Add VIA RWW cache result as acceptable for an IMS_HIT
+  #10673 - Do not overwrite the error code of GOAWAY frame
+  #10744 - Update accept thread configuration changes from #10687 applied to 
9.2.x
+  #10896 - 9.2.x: yapf: use yapf instead of autopep8
+  #10925 - Use slice req method type in Data obj
+  #10962 - adds stdint.h include to ink_file.h needed for rocky9/clang16
+  #10988 - header_freq: Fix msg lock issues
+  #11009 - Segmentation crash caused by setting 
unavailable_server_retry_responses in parent.config
+  #11021 - Ensure connection retry attempts can reach the config specified 
value
+  #11030 - Allows the set-body to run as a pseudo remap hook
+  #11044 - delete simple_server_retry_responses
+  #11073 - Fix a bug in parsing chunked messages
+  #11085 - doc: max_rst_stream_frames_per_minute defaults to 200
+  #11206 - Add proxy.config.http2.max_continuation_frames_per_minute



(trafficserver) branch 9.2.x updated: proxy.config.http2.max_continuation_frames_per_minute (#11206)

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new b8c6a23b74 proxy.config.http2.max_continuation_frames_per_minute 
(#11206)
b8c6a23b74 is described below

commit b8c6a23b74af1772e5cb0de25b38c234a418cb1d
Author: Masakazu Kitajo 
AuthorDate: Wed Apr 3 09:31:37 2024 -0600

proxy.config.http2.max_continuation_frames_per_minute (#11206)

This adds the ability to rate limite HTTP/2 CONTINUATION frames per
stream per minute.

Co-authored-by: Brian Neradt 
---
 doc/admin-guide/files/records.config.en.rst| 11 +++-
 .../statistics/core/http-connection.en.rst | 11 +++-
 iocore/net/P_SNIActionPerformer.h  | 17 ++
 iocore/net/SSLSNIConfig.cc |  4 ++
 iocore/net/TLSSNISupport.h |  1 +
 iocore/net/YamlSNIConfig.cc|  4 ++
 iocore/net/YamlSNIConfig.h |  2 +
 mgmt/RecordsConfig.cc  |  2 +
 proxy/http2/HTTP2.cc   | 66 --
 proxy/http2/HTTP2.h|  2 +
 proxy/http2/Http2ConnectionState.cc| 36 ++--
 proxy/http2/Http2ConnectionState.h | 12 ++--
 12 files changed, 126 insertions(+), 42 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index f3df888708..979c8bda2f 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -4287,8 +4287,15 @@ HTTP/2 Configuration
 .. ts:cv:: CONFIG proxy.config.http2.max_rst_stream_frames_per_minute INT 200
:reloadable:
 
-   Specifies how many RST_STREAM frames |TS| receives for a minute at maximum.
-   Clients exceeded this limit will be immediately disconnected with an error
+   Specifies how many RST_STREAM frames |TS| receives per minute at maximum.
+   Clients exceeding this limit will be immediately disconnected with an error
+   code of ENHANCE_YOUR_CALM.
+
+.. ts:cv:: CONFIG proxy.config.http2.max_continuation_frames_per_minute INT 120
+   :reloadable:
+
+   Specifies how many CONTINUATION frames |TS| receives per minute at maximum.
+   Clients exceeding this limit will be immediately disconnected with an error
code of ENHANCE_YOUR_CALM.
 
 .. ts:cv:: CONFIG proxy.config.http2.min_avg_window_update FLOAT 2560.0
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 b22da8e1c6..ee47a147c0 100644
--- a/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
+++ b/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
@@ -263,10 +263,17 @@ HTTP/2
 .. ts:stat:: global 
proxy.process.http2.max_rst_stream_frames_per_minute_exceeded integer
:type: counter
 
-   Represents the total number of closed HTTP/2 connections for exceeding the
-   maximum allowed number of rst_stream frames per minute limit which is 
configured by
+   Represents the total number of HTTP/2 connections closed for exceeding the
+   maximum allowed number of ``RST_STREAM`` frames per minute limit which is 
configured by
:ts:cv:`proxy.config.http2.max_rst_stream_frames_per_minute`.
 
+.. ts:stat:: global 
proxy.process.http2.max_continuation_frames_per_minute_exceeded integer
+   :type: counter
+
+   Represents the total number of HTTP/2 connections closed for exceeding the
+   maximum allowed number of ``CONTINUATION`` frames per minute limit which is
+   configured by 
:ts:cv:`proxy.config.http2.max_continuation_frames_per_minute`.
+
 .. ts:stat:: global proxy.process.http2.insufficient_avg_window_update integer
:type: counter
 
diff --git a/iocore/net/P_SNIActionPerformer.h 
b/iocore/net/P_SNIActionPerformer.h
index e223ac7d0b..eebe44b75a 100644
--- a/iocore/net/P_SNIActionPerformer.h
+++ b/iocore/net/P_SNIActionPerformer.h
@@ -186,6 +186,23 @@ private:
   int value = -1;
 };
 
+class HTTP2MaxContinuationFramesPerMinute : public ActionItem
+{
+public:
+  HTTP2MaxContinuationFramesPerMinute(int value) : value(value) {}
+  ~HTTP2MaxContinuationFramesPerMinute() override {}
+
+  int
+  SNIAction(TLSSNISupport *snis, const Context ) const override
+  {
+snis->hints_from_sni.http2_max_continuation_frames_per_minute = value;
+return SSL_TLSEXT_ERR_OK;
+  }
+
+private:
+  int value = -1;
+};
+
 class TunnelDestination : public ActionItem
 {
 public:
diff --git a/iocore/net/SSLSNIConfig.cc b/iocore/net/SSLSNIConfig.cc
index a7071013f6..942e6c420f 100644
--- a/iocore/net/SSLSNIConfig.cc
+++ b/iocore/net/SSLSNIConfig.cc
@@ -151,6 +151,10 @@ SNIConfigParams::load_sni_config()
   ai->actions.push_back(
 
std::make_

(trafficserver) branch master updated: Work around a GCC bug for __sync_val_compare_and_swap on ARMv8.1+ (#11147)

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

bcall 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 60d038cd80 Work around a GCC bug for __sync_val_compare_and_swap on 
ARMv8.1+ (#11147)
60d038cd80 is described below

commit 60d038cd8038b3bc33e4765c44c17e8df3e7b0e6
Author: Phong Nguyen 
AuthorDate: Fri Mar 22 08:42:19 2024 -0700

Work around a GCC bug for __sync_val_compare_and_swap on ARMv8.1+ (#11147)
---
 include/tscore/ink_queue.h | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/include/tscore/ink_queue.h b/include/tscore/ink_queue.h
index 3b4b9ce204..dace11e091 100644
--- a/include/tscore/ink_queue.h
+++ b/include/tscore/ink_queue.h
@@ -57,10 +57,12 @@ void ink_queue_load_64(void *dst, void *src);
 #define INK_QUEUE_LD64(dst, src) (ink_queue_load_64((void *)&(dst), (void 
*)&(src)))
 #endif
 
+// passing a const volatile value of 0 works around a gcc bug
 #if TS_HAS_128BIT_CAS
-#define INK_QUEUE_LD(dst, src) 
  \
-  do { 
  \
-*(__int128_t *)&(dst) = __sync_val_compare_and_swap((__int128_t *)&(src), 
0, 0); \
+#define INK_QUEUE_LD(dst, src) 
\
+  do { 
\
+const volatile __int128_t iqld0 = 0;   
\
+*(__int128_t *)&(dst)   = __sync_val_compare_and_swap((__int128_t 
*)&(src), 0, iqld0); \
   } while (0)
 #else
 #define INK_QUEUE_LD(dst, src) INK_QUEUE_LD64(dst, src)



(trafficserver) branch master updated: Fixed asan issue for test_AIO when an argument wasn't set on the command line (#11139)

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

bcall 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 b7e33af35f Fixed asan issue for test_AIO when an argument wasn't set 
on the command line (#11139)
b7e33af35f is described below

commit b7e33af35f65322100fffc07f7152b0514573c9f
Author: Bryan Call 
AuthorDate: Wed Mar 13 08:44:18 2024 -0700

Fixed asan issue for test_AIO when an argument wasn't set on the command 
line (#11139)
---
 src/iocore/aio/test_AIO.cc | 24 ++--
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/iocore/aio/test_AIO.cc b/src/iocore/aio/test_AIO.cc
index 3daa770d52..d08eb4b62d 100644
--- a/src/iocore/aio/test_AIO.cc
+++ b/src/iocore/aio/test_AIO.cc
@@ -361,16 +361,13 @@ int
 read_config(const char *config_filename)
 {
   std::ifstream fin(config_filename);
+  if (!fin.rdbuf()->is_open()) {
+return (0);
+  }
+
   char field_name[256];
   char field_value[256];
 
-  if (!fin.rdbuf()->is_open()) {
-fin.open("sample.cfg");
-if (!fin.rdbuf()->is_open()) {
-  cout << "cannot open config files " << config_filename << endl;
-  return (0);
-}
-  }
   while (!fin.eof()) {
 field_name[0] = '\0';
 fin >> field_name;
@@ -459,13 +456,20 @@ public:
 #endif
 
 int
-main(int /* argc ATS_UNUSED */, char *argv[])
+main(int argc, char *argv[])
 {
   int i;
-  printf("input file %s\n", argv[1]);
-  if (!read_config(argv[1])) {
+
+  // Read the configuration file
+  const char *config_filename = "sample.cfg";
+  if (argc == 2) {
+config_filename = argv[1];
+  }
+  printf("configuration file: %s\n", config_filename);
+  if (!read_config(config_filename)) {
 exit(1);
   }
+
   if (num_processors == 0) {
 num_processors = ink_number_of_processors();
   }



(trafficserver) branch master updated: Fix asan and valgrind issue with libswoc unit test (#11138)

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

bcall 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 0bde81a7fa Fix asan and valgrind issue with libswoc unit test (#11138)
0bde81a7fa is described below

commit 0bde81a7fac7513ee19e0b6ce4f3c42cf27bc7ea
Author: Bryan Call 
AuthorDate: Wed Mar 13 08:42:46 2024 -0700

Fix asan and valgrind issue with libswoc unit test (#11138)
---
 lib/swoc/unit_tests/ex_IntrusiveDList.cc |  6 +
 lib/swoc/unit_tests/ex_MemArena.cc   |  3 +++
 lib/swoc/unit_tests/test_IntrusiveDList.cc   | 37 
 lib/swoc/unit_tests/test_IntrusiveHashMap.cc | 13 +-
 lib/swoc/unit_tests/test_ip.cc   |  2 +-
 5 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/lib/swoc/unit_tests/ex_IntrusiveDList.cc 
b/lib/swoc/unit_tests/ex_IntrusiveDList.cc
index 3c59a9ed47..a26f386662 100644
--- a/lib/swoc/unit_tests/ex_IntrusiveDList.cc
+++ b/lib/swoc/unit_tests/ex_IntrusiveDList.cc
@@ -212,4 +212,10 @@ TEST_CASE("IntrusiveDList Inheritance", 
"[libswoc][IntrusiveDList][example]") {
   }
   REQUIRE(priv2_list.head()->payload() == "Item 1");
   REQUIRE(priv2_list.tail()->payload() == "Item 23");
+
+  // Delete everything in priv_list.
+  priv_list.apply([](PrivateThing *thing) { delete thing; });
+
+  // Delete everything in priv2_list.
+  priv2_list.apply([](PrivateThing2 *thing) { delete thing; });
 }
diff --git a/lib/swoc/unit_tests/ex_MemArena.cc 
b/lib/swoc/unit_tests/ex_MemArena.cc
index a6f7098e57..e0e9a038f9 100644
--- a/lib/swoc/unit_tests/ex_MemArena.cc
+++ b/lib/swoc/unit_tests/ex_MemArena.cc
@@ -221,4 +221,7 @@ TEST_CASE("MemArena example", 
"[libswoc][MemArena][example]") {
   REQUIRE(arena.contains(ihm));
   REQUIRE(arena.contains(thing));
   REQUIRE(arena.contains(thing->name.data()));
+
+  // Call the destructor for the IntrusiveHashMap to free anything it 
allocated.
+  ihm->~Map();
 };
diff --git a/lib/swoc/unit_tests/test_IntrusiveDList.cc 
b/lib/swoc/unit_tests/test_IntrusiveDList.cc
index 51f57a09e8..96c3e6f61e 100644
--- a/lib/swoc/unit_tests/test_IntrusiveDList.cc
+++ b/lib/swoc/unit_tests/test_IntrusiveDList.cc
@@ -118,6 +118,7 @@ TEST_CASE("IntrusiveDList", "[libswoc][IntrusiveDList]") {
 
   list.append(thing);
   list.erase(list.tail());
+  delete thing; // this deletes "two"
   REQUIRE(list.count() == 3);
   REQUIRE(list.tail() != nullptr);
   REQUIRE(list.tail()->_payload == "muddle");
@@ -126,6 +127,9 @@ TEST_CASE("IntrusiveDList", "[libswoc][IntrusiveDList]") {
   list.insert_before(list.end(), new Thing("trailer"));
   REQUIRE(list.count() == 4);
   REQUIRE(list.tail()->_payload == "trailer");
+
+  // Delete everything in list.
+  list.apply([](Thing *thing) { delete thing; });
 }
 
 TEST_CASE("IntrusiveDList list prefix", "[libswoc][IntrusiveDList]") {
@@ -174,6 +178,21 @@ TEST_CASE("IntrusiveDList list prefix", 
"[libswoc][IntrusiveDList]") {
   REQUIRE(list_rest.head()->_payload == "16");
   REQUIRE(list.count() == 0);
   REQUIRE(list.head() == nullptr);
+
+  // Delete everything in list.
+  list.apply([](Thing *thing) { delete thing; });
+
+  // Delete everything in list_1.
+  list_1.apply([](Thing *thing) { delete thing; });
+
+  // Delete everything in list_5.
+  list_5.apply([](Thing *thing) { delete thing; });
+
+  // Delete everything in list_most.
+  list_most.apply([](Thing *thing) { delete thing; });
+
+  // Delete everything in list_rest.
+  list_rest.apply([](Thing *thing) { delete thing; });
 }
 
 TEST_CASE("IntrusiveDList list suffix", "[libswoc][IntrusiveDList]") {
@@ -230,6 +249,21 @@ TEST_CASE("IntrusiveDList list suffix", 
"[libswoc][IntrusiveDList]") {
   REQUIRE(list.tail()->_payload == "20");
   REQUIRE(list.nth(7)->_payload == "8");
   REQUIRE(list.nth(17)->_payload == "18");
+
+  // Delete everything in list.
+  list.apply([](Thing *thing) { delete thing; });
+
+  // Delete everything in list_1.
+  list_1.apply([](Thing *thing) { delete thing; });
+
+  // Delete everything in list_5.
+  list_5.apply([](Thing *thing) { delete thing; });
+
+  // Delete everything in list_most.
+  list_most.apply([](Thing *thing) { delete thing; });
+
+  // Delete everything in list_rest.
+  list_rest.apply([](Thing *thing) { delete thing; });
 }
 
 TEST_CASE("IntrusiveDList Extra", "[libswoc][IntrusiveDList]") {
@@ -269,4 +303,7 @@ TEST_CASE("IntrusiveDList Extra", 
"[libswoc][IntrusiveDList]") {
 bwprint(tmp, "{}", idx);
 REQUIRE(spot->_payload == tmp);
   }
+
+  // Delete everything in list.
+  

(trafficserver) branch master updated: Fix a couple misspellings (#11137)

2024-03-11 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 5d6f2f6c05 Fix a couple misspellings (#11137)
5d6f2f6c05 is described below

commit 5d6f2f6c05582a0342e1034f9719df3715e9f679
Author: Brian Neradt 
AuthorDate: Mon Mar 11 17:38:43 2024 -0400

Fix a couple misspellings (#11137)
---
 doc/admin-guide/files/records.yaml.en.rst | 2 +-
 plugins/experimental/stale_response/stale_response.cc | 2 +-
 tests/gold_tests/tls/tls_sni_ip_allow.test.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/admin-guide/files/records.yaml.en.rst 
b/doc/admin-guide/files/records.yaml.en.rst
index 93da31b31d..34c6b91448 100644
--- a/doc/admin-guide/files/records.yaml.en.rst
+++ b/doc/admin-guide/files/records.yaml.en.rst
@@ -4596,7 +4596,7 @@ HTTP/2 Configuration
:reloadable:
:units: bytes
 
-   Specifies the high water mark for all HTTP/2 frames on an outoging 
connection.
+   Specifies the high water mark for all HTTP/2 frames on an outgoing 
connection.
Default is -1 to preserve existing water marking behavior.
 
You can override this global setting on a per domain basis in the 
:file:`sni.yaml` file using the :ref:`http2_buffer_water_mark 
` attribute.
diff --git a/plugins/experimental/stale_response/stale_response.cc 
b/plugins/experimental/stale_response/stale_response.cc
index 4ef7626879..a4c81649d4 100644
--- a/plugins/experimental/stale_response/stale_response.cc
+++ b/plugins/experimental/stale_response/stale_response.cc
@@ -340,7 +340,7 @@ get_cached_header_info(StateInfo *state)
   chi->date= 0;
   chi->max_age = 0;
 
-  // -1 is used as a placeholder for teh following two meaning that their
+  // -1 is used as a placeholder for the following two meaning that their
   // respective directives were not in the Cache-Control header.
   chi->stale_while_revalidate = -1;
   chi->stale_if_error = -1;
diff --git a/tests/gold_tests/tls/tls_sni_ip_allow.test.py 
b/tests/gold_tests/tls/tls_sni_ip_allow.test.py
index c567689c25..739bbf00cc 100644
--- a/tests/gold_tests/tls/tls_sni_ip_allow.test.py
+++ b/tests/gold_tests/tls/tls_sni_ip_allow.test.py
@@ -144,7 +144,7 @@ class TestSniIpAllow:
 # non-zero return code.
 p.ReturnCode = 1
 
-p.Streams.All += Testers.ContainsExpression('allowed-response', 'The 
response to teh allowed request should be recieved.')
+p.Streams.All += Testers.ContainsExpression('allowed-response', 'The 
response to the allowed request should be recieved.')
 p.Streams.All += Testers.ExcludesExpression(
 'blocked-response', 'The response to the blocked request should 
not have been recieved.')
 



(trafficserver) branch master updated: Added namespace fmt to function call format_to in Cripts (#11116)

2024-02-29 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 4c933c730e Added namespace fmt to function call format_to in Cripts 
(#6)
4c933c730e is described below

commit 4c933c730ecfa1f8ed918b279162e7e93fc6642b
Author: Bryan Call 
AuthorDate: Thu Feb 29 16:10:44 2024 -0800

Added namespace fmt to function call format_to in Cripts (#6)
---
 include/cripts/Crypto.hpp  |  6 +++---
 include/cripts/Headers.hpp |  6 +++---
 include/cripts/Lulu.hpp| 12 ++--
 include/cripts/Time.hpp|  2 +-
 include/cripts/Urls.hpp| 14 +++---
 5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/cripts/Crypto.hpp b/include/cripts/Crypto.hpp
index 25dcf145c5..f7e856787c 100644
--- a/include/cripts/Crypto.hpp
+++ b/include/cripts/Crypto.hpp
@@ -264,7 +264,7 @@ template <> struct formatter {
   auto
   format(Crypto::SHA256 , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", sha.hex());
+return fmt::format_to(ctx.out(), "{}", sha.hex());
   }
 };
 
@@ -279,7 +279,7 @@ template <> struct formatter {
   auto
   format(Crypto::SHA512 , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", sha.hex());
+return fmt::format_to(ctx.out(), "{}", sha.hex());
   }
 };
 
@@ -294,7 +294,7 @@ template <> struct formatter {
   auto
   format(Crypto::AES256 , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", Crypto::Base64::encode(sha.message()));
+return fmt::format_to(ctx.out(), "{}", 
Crypto::Base64::encode(sha.message()));
   }
 };
 
diff --git a/include/cripts/Headers.hpp b/include/cripts/Headers.hpp
index 560e00deec..d9b90b1d26 100644
--- a/include/cripts/Headers.hpp
+++ b/include/cripts/Headers.hpp
@@ -571,7 +571,7 @@ template <> struct formatter {
   auto
   format(Header::Method , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", method.getSV());
+return fmt::format_to(ctx.out(), "{}", method.getSV());
   }
 };
 
@@ -586,7 +586,7 @@ template <> struct formatter {
   auto
   format(Header::String , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", str.getSV());
+return fmt::format_to(ctx.out(), "{}", str.getSV());
   }
 };
 
@@ -601,7 +601,7 @@ template <> struct formatter {
   auto
   format(Header::Name , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", name.getSV());
+return fmt::format_to(ctx.out(), "{}", name.getSV());
   }
 };
 
diff --git a/include/cripts/Lulu.hpp b/include/cripts/Lulu.hpp
index 8dcc7caa1b..02ed324a84 100644
--- a/include/cripts/Lulu.hpp
+++ b/include/cripts/Lulu.hpp
@@ -574,7 +574,7 @@ template <> struct formatter {
   auto
   format(Versions , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", version.getSV());
+return fmt::format_to(ctx.out(), "{}", version.getSV());
   }
 };
 
@@ -589,7 +589,7 @@ template <> struct formatter {
   auto
   format(Versions::Major , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", integer(major));
+return fmt::format_to(ctx.out(), "{}", integer(major));
   }
 };
 
@@ -604,7 +604,7 @@ template <> struct formatter {
   auto
   format(Versions::Minor , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", integer(minor));
+return fmt::format_to(ctx.out(), "{}", integer(minor));
   }
 };
 
@@ -619,7 +619,7 @@ template <> struct formatter {
   auto
   format(Versions::Patch , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", integer(patch));
+return fmt::format_to(ctx.out(), "{}", integer(patch));
   }
 };
 
@@ -634,7 +634,7 @@ template <> struct formatter {
   auto
   format(const TSHttpStatus , FormatContext ) -> decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", static_cast(stat));
+return fmt::format_to(ctx.out(), "{}", static_cast(stat));
   }
 };
 
@@ -649,7 +649,7 @@ template <> struct formatter {
   auto
   format(const Cript::StringViewWrapper , FormatContext ) -> 
decltype(ctx.out())
   {
-return format_to(ctx.out(), "{}", sv.getSV());
+return fmt::format_to(ctx.out(), "{}", sv.getSV());
   }
 };
 
diff --git a/include/cripts/Time.hpp b/include/cripts/Time.hpp
index e01e71efe9..d30d90481a 100644
--- a/include/cripts/Time.hpp
+++ b/include/cripts/Time.hpp
@@ -138,7 +138,7 @@ template <> struct form

(trafficserver) branch master updated: Change Regex class to use PCRE2 (#11014)

2024-02-29 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 8e1c1b9faf Change Regex class to use PCRE2 (#11014)
8e1c1b9faf is described below

commit 8e1c1b9fafb13df87ca431a1e855f64223b06ffb
Author: Bryan Call 
AuthorDate: Thu Feb 29 12:06:24 2024 -0800

Change Regex class to use PCRE2 (#11014)
---
 CMakeLists.txt |   2 +-
 include/proxy/http/remap/UrlRewrite.h  |   2 +-
 include/tsutil/Regex.h | 106 +---
 plugins/experimental/tls_bridge/CMakeLists.txt |   2 +-
 src/proxy/http/remap/UrlRewrite.cc |  14 +-
 src/tsutil/CMakeLists.txt  |   3 +-
 src/tsutil/Regex.cc| 329 +
 src/tsutil/unit_tests/test_Regex.cc| 138 ++-
 8 files changed, 440 insertions(+), 156 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63ec25723a..a276d827cc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -253,7 +253,7 @@ if(LibLZMA_FOUND)
 endif()
 
 find_package(PCRE REQUIRED)
-find_package(PCRE2 COMPONENTS 8BIT)
+pkg_check_modules(PCRE2 REQUIRED IMPORTED_TARGET libpcre2-8)
 
 include(CheckOpenSSLIsBoringSSL)
 include(CheckOpenSSLIsQuictls)
diff --git a/include/proxy/http/remap/UrlRewrite.h 
b/include/proxy/http/remap/UrlRewrite.h
index 86dcb50a07..797ad94c47 100644
--- a/include/proxy/http/remap/UrlRewrite.h
+++ b/include/proxy/http/remap/UrlRewrite.h
@@ -232,7 +232,7 @@ private:
 int request_host_len);
   bool _regexMappingLookup(RegexMappingList _mappings, URL *request_url, 
int request_port, const char *request_host,
int request_host_len, int rank_ceiling, 
UrlMappingContainer _container);
-  int _expandSubstitutions(int *matches_info, const RegexMapping *reg_map, 
const char *matched_string, char *dest_buf,
+  int _expandSubstitutions(size_t *matches_info, const RegexMapping *reg_map, 
const char *matched_string, char *dest_buf,
int dest_buf_size);
   void _destroyTable(std::unique_ptr _table);
   void _destroyList(RegexMappingList );
diff --git a/include/tsutil/Regex.h b/include/tsutil/Regex.h
index a1c51e3661..c4ca8feb03 100644
--- a/include/tsutil/Regex.h
+++ b/include/tsutil/Regex.h
@@ -28,24 +28,60 @@
 #include 
 #include 
 
-#include "swoc/MemSpan.h"
+#define PCRE2_CODE_UNIT_WIDTH 8
+#include 
 
-/// Match flags for regular expression evaluation.
+/// @brief Match flags for regular expression evaluation.
 enum REFlags {
-  RE_CASE_INSENSITIVE = 0x0001, ///< Ignore case (default: case sensitive).
-  RE_UNANCHORED   = 0x0002, ///< Unanchored (DFA defaults to anchored).
-  RE_ANCHORED = 0x0004, ///< Anchored (Regex defaults to unanchored).
+  RE_CASE_INSENSITIVE = PCRE2_CASELESS,  ///< Ignore case (default: case 
sensitive).
+  RE_UNANCHORED   = PCRE2_MULTILINE, ///< Unanchored (DFA defaults to 
anchored).
+  RE_ANCHORED = PCRE2_ANCHORED,  ///< Anchored (Regex defaults to 
unanchored).
 };
 
-/** Wrapper for PCRE evaluation.
- *
- */
-class Regex
+/// @brief Wrapper for PCRE2 match data.
+class RegexMatches
 {
+  friend class Regex;
+
 public:
-  /// Default number of capture groups.
-  static constexpr size_t DEFAULT_GROUP_COUNT = 10;
+  /** Construct a new RegexMatches object.
+   *
+   * @param size The number of matches to allocate space for.
+   */
+  RegexMatches(uint32_t size = DEFAULT_MATCHES);
+  ~RegexMatches();
+
+  /** Get the match at the given index.
+   *
+   * @return The match at the given index.
+   */
+  std::string_view operator[](size_t index) const;
+  /** Get the ovector pointer for the capture groups.  Don't use this unless 
you know what you are doing.
+   *
+   * @return ovector pointer.
+   */
+  size_t *get_ovector_pointer();
+  int32_t size() const;
+
+protected:
+  pcre2_match_data *get_match_data();
+  void set_subject(std::string_view subject);
+  void set_size(int32_t size);
+
+private:
+  constexpr static uint32_t DEFAULT_MATCHES = 10;
+  static void *malloc(size_t size, void *caller);
+  pcre2_match_data *_match_data = nullptr;
+  std::string_view _subject;
+  char _buffer[24 + 96 + 16 * DEFAULT_MATCHES]; // 24 bytes for the general 
context, 96 bytes overhead, 16 bytes per match.
+  size_t _buffer_bytes_used = 0;
+  int32_t _size = 0;
+};
 
+/// @brief Wrapper for PCRE2 regular expression.
+class Regex
+{
+public:
   Regex()  = default;
   Regex(Regex const &) = delete; // No copying.
   Regex(Regex &) noexcept;
@@ -59,46 +95,43 @@ public:
*
* @a flags should be the bitwise @c or of @c REFlags values.
*/
-  bool compile(const char *pattern, unsigned flags = 0);
+  bool compile(std::string_view pattern, uint32_t flags = 0);
 
-

(trafficserver) branch cmake_asan deleted (was 12e9d24756)

2024-02-28 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

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


 was 12e9d24756 cmake: asan support

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(trafficserver) branch regex_interface deleted (was 3c4890d212)

2024-02-28 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

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


 was 3c4890d212 Added more edge case tests Checking against nullptr in 
conditionals Moved cmake pkgconfig test to top level CMakeLists.txt

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(trafficserver) branch regex_interface created (now 3c4890d212)

2024-02-28 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

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


  at 3c4890d212 Added more edge case tests Checking against nullptr in 
conditionals Moved cmake pkgconfig test to top level CMakeLists.txt

This branch includes the following new commits:

 new 3c4890d212 Added more edge case tests Checking against nullptr in 
conditionals Moved cmake pkgconfig test to top level CMakeLists.txt

The 1 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.




(trafficserver) 01/01: Added more edge case tests Checking against nullptr in conditionals Moved cmake pkgconfig test to top level CMakeLists.txt

2024-02-28 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

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

commit 3c4890d21230530d5ec5a99934f15710f27e5c86
Author: Bryan Call 
AuthorDate: Wed Feb 28 14:07:27 2024 -0800

Added more edge case tests
Checking against nullptr in conditionals
Moved cmake pkgconfig test to top level CMakeLists.txt
---
 CMakeLists.txt  |  2 +-
 include/tsutil/Regex.h  |  4 
 src/tsutil/CMakeLists.txt   |  2 --
 src/tsutil/Regex.cc | 18 +-
 src/tsutil/unit_tests/test_Regex.cc | 29 +++--
 5 files changed, 33 insertions(+), 22 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 920d15835e..3a8f031fc2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -258,7 +258,7 @@ if(LibLZMA_FOUND)
 endif()
 
 find_package(PCRE REQUIRED)
-find_package(PCRE2 COMPONENTS 8BIT)
+pkg_check_modules(PCRE2 REQUIRED IMPORTED_TARGET libpcre2-8)
 
 include(CheckOpenSSLIsBoringSSL)
 include(CheckOpenSSLIsQuictls)
diff --git a/include/tsutil/Regex.h b/include/tsutil/Regex.h
index 75a27c142e..c4ca8feb03 100644
--- a/include/tsutil/Regex.h
+++ b/include/tsutil/Regex.h
@@ -29,11 +29,7 @@
 #include 
 
 #define PCRE2_CODE_UNIT_WIDTH 8
-#if __has_include()
-#include 
-#else
 #include 
-#endif
 
 /// @brief Match flags for regular expression evaluation.
 enum REFlags {
diff --git a/src/tsutil/CMakeLists.txt b/src/tsutil/CMakeLists.txt
index c2538fabfb..a747431daa 100644
--- a/src/tsutil/CMakeLists.txt
+++ b/src/tsutil/CMakeLists.txt
@@ -51,8 +51,6 @@ add_library(
   Regex.cc
 )
 
-pkg_check_modules(PCRE2 REQUIRED IMPORTED_TARGET libpcre2-8)
-
 add_library(ts::tsutil ALIAS tsutil)
 set_target_properties(tsutil PROPERTIES POSITION_INDEPENDENT_CODE TRUE 
PUBLIC_HEADER "${TSUTIL_PUBLIC_HEADERS}")
 target_link_libraries(tsutil PUBLIC libswoc::libswoc yaml-cpp::yaml-cpp 
PkgConfig::PCRE2)
diff --git a/src/tsutil/Regex.cc b/src/tsutil/Regex.cc
index e077e30886..7ad756fac4 100644
--- a/src/tsutil/Regex.cc
+++ b/src/tsutil/Regex.cc
@@ -57,16 +57,16 @@ public:
   }
   ~RegexContext()
   {
-if (_general_context) {
+if (_general_context != nullptr) {
   pcre2_general_context_free(_general_context);
 }
-if (_compile_context) {
+if (_compile_context != nullptr) {
   pcre2_compile_context_free(_compile_context);
 }
-if (_match_context) {
+if (_match_context != nullptr) {
   pcre2_match_context_free(_match_context);
 }
-if (_jit_stack) {
+if (_jit_stack != nullptr) {
   pcre2_jit_stack_free(_jit_stack);
 }
   }
@@ -143,7 +143,7 @@ RegexMatches::malloc(size_t size, void *caller)
 //
 RegexMatches::~RegexMatches()
 {
-  if (_match_data) {
+  if (_match_data == nullptr) {
 pcre2_match_data_free(_match_data);
   }
 }
@@ -206,7 +206,7 @@ Regex::Regex(Regex &) noexcept
 //
 Regex::~Regex()
 {
-  if (_code) {
+  if (_code == nullptr) {
 pcre2_code_free(_code);
   }
 }
@@ -225,7 +225,7 @@ Regex::compile(std::string_view pattern, uint32_t flags)
 bool
 Regex::compile(std::string_view pattern, std::string , int , 
uint32_t flags)
 {
-  if (_code) {
+  if (_code != nullptr) {
 pcre2_code_free(_code);
   }
   PCRE2_SIZE error_offset;
@@ -252,7 +252,7 @@ Regex::compile(std::string_view pattern, std::string 
, int , u
 bool
 Regex::exec(std::string_view subject) const
 {
-  if (!_code) {
+  if (_code == nullptr) {
 return false;
   }
   RegexMatches matches;
@@ -265,7 +265,7 @@ Regex::exec(std::string_view subject) const
 int32_t
 Regex::exec(std::string_view subject, RegexMatches ) const
 {
-  if (!_code) {
+  if (_code == nullptr) {
 return 0;
   }
   int count = pcre2_match(_code, reinterpret_cast(subject.data()), 
subject.size(), 0, 0, matches.get_match_data(),
diff --git a/src/tsutil/unit_tests/test_Regex.cc 
b/src/tsutil/unit_tests/test_Regex.cc
index e2332272f6..f17d2b17c8 100644
--- a/src/tsutil/unit_tests/test_Regex.cc
+++ b/src/tsutil/unit_tests/test_Regex.cc
@@ -122,12 +122,6 @@ TEST_CASE("Regex", "[libts][Regex]")
 }
   }
 
-  // test for invalid regular expression
-  {
-Regex r;
-REQUIRE(r.compile(R"((\d+)", RE_CASE_INSENSITIVE) == false);
-  }
-
   // test getting submatches with operator[]
   for (auto  : submatch_test_data) {
 Regex r;
@@ -162,4 +156,27 @@ TEST_CASE("Regex", "[libts][Regex]")
   }
 }
   }
+
+  // test for invalid regular expression
+  {
+Regex r;
+REQUIRE(r.compile(R"((\d+)", RE_CASE_INSENSITIVE) == false);
+  }
+
+  // test for not compiling regular expression
+  {
+Regex r;
+RegexMatches matches;
+REQUIRE(r.exec("foo") == false);
+REQUIRE(r.

(trafficserver) branch master updated: Fix MacOS linking warning for xcode 15 (#11062)

2024-02-26 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 72f7898642 Fix MacOS linking warning for xcode 15 (#11062)
72f7898642 is described below

commit 72f789864292ac28ec1c6c1126709a057299cfb4
Author: Bryan Call 
AuthorDate: Mon Feb 26 15:15:43 2024 -0800

Fix MacOS linking warning for xcode 15 (#11062)
---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 947625d237..d5bb5f1fb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -522,6 +522,7 @@ endif(HOST_OS STREQUAL "linux")
 
 if(HOST_OS STREQUAL "darwin")
   set(CMAKE_MACOSX_RPATH 1)
+  link_libraries("-ld_classic")
 endif(HOST_OS STREQUAL "darwin")
 
 if(HOST_OS STREQUAL "freebsd")



(trafficserver) branch master updated: Remove dependency between tscore and iocore/eventsystem (#11092)

2024-02-26 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 822ffefc73 Remove dependency between tscore and iocore/eventsystem 
(#11092)
822ffefc73 is described below

commit 822ffefc73199b52b92db8786b46669b0fa9719d
Author: Bryan Call 
AuthorDate: Mon Feb 26 12:02:39 2024 -0800

Remove dependency between tscore and iocore/eventsystem (#11092)
---
 include/tscore/FrequencyCounter.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/tscore/FrequencyCounter.h 
b/include/tscore/FrequencyCounter.h
index e0c76fbb96..cbdc7d10de 100644
--- a/include/tscore/FrequencyCounter.h
+++ b/include/tscore/FrequencyCounter.h
@@ -24,7 +24,7 @@
 #pragma once
 
 #include 
-#include "iocore/eventsystem/EventSystem.h"
+#include 
 
 class FrequencyCounter
 {



(trafficserver) branch master updated: Building webp_transform plugin with cmake (#11048)

2024-02-14 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 d281c5964e Building webp_transform plugin with cmake (#11048)
d281c5964e is described below

commit d281c5964e1a28a8292951a719516678f53fb427
Author: Bryan Call 
AuthorDate: Wed Feb 14 11:04:32 2024 -0800

Building webp_transform plugin with cmake (#11048)
---
 plugins/CMakeLists.txt|  6 --
 plugins/webp_transform/CMakeLists.txt | 21 +
 2 files changed, 25 insertions(+), 2 deletions(-)

diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
index d1ba82eebf..4d0e24419b 100644
--- a/plugins/CMakeLists.txt
+++ b/plugins/CMakeLists.txt
@@ -45,8 +45,6 @@ add_subdirectory(tcpinfo)
 add_subdirectory(traffic_dump)
 add_subdirectory(xdebug)
 
-# add_subdirectory(webp_transform)
-
 if(NOT OPENSSL_IS_BORINGSSL)
   add_subdirectory(ja3_fingerprint)
 endif()
@@ -62,3 +60,7 @@ endif()
 if(HOST_OS STREQUAL "linux")
   add_subdirectory(healthchecks)
 endif()
+
+if(USE_MAGICK)
+  add_subdirectory(webp_transform)
+endif()
diff --git a/plugins/webp_transform/CMakeLists.txt 
b/plugins/webp_transform/CMakeLists.txt
new file mode 100644
index 00..86eb796b26
--- /dev/null
+++ b/plugins/webp_transform/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.
+#
+###
+
+add_atsplugin(webp_transform ImageTransform.cc)
+target_link_libraries(webp_transform PRIVATE ImageMagick::Magick++ tscppapi)
+
+verify_global_plugin(webp_transform)



(trafficserver) branch master updated: Change the constructor for LocalBufferWriter to be noexcept (#11059)

2024-02-14 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 bd2c5c274e Change the constructor for LocalBufferWriter to be noexcept 
(#11059)
bd2c5c274e is described below

commit bd2c5c274e2d39b55494d3e693b5d8e5faeec352
Author: Bryan Call 
AuthorDate: Wed Feb 14 11:04:10 2024 -0800

Change the constructor for LocalBufferWriter to be noexcept (#11059)
---
 lib/swoc/include/swoc/BufferWriter.h | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/swoc/include/swoc/BufferWriter.h 
b/lib/swoc/include/swoc/BufferWriter.h
index 154da3772b..32dfc99089 100644
--- a/lib/swoc/include/swoc/BufferWriter.h
+++ b/lib/swoc/include/swoc/BufferWriter.h
@@ -406,6 +406,9 @@ public:
   /// @endcond
 
 protected:
+  // Used for derived classes where we don't want to throw exceptions.
+  FixedBufferWriter(char *buffer, size_t capacity, bool noexcept_flag) 
noexcept;
+
   char *const _buffer;   ///< Output buffer.
   size_t _capacity;  ///< Size of output buffer.
   size_t _attempted = 0; ///< Number of characters written, including those 
discarded due error condition.
@@ -440,7 +443,7 @@ template  class LocalBufferWriter : public 
FixedBufferWriter {
 
 public:
   /// Construct an empty writer.
-  LocalBufferWriter();
+  LocalBufferWriter() noexcept;
 
   LocalBufferWriter(const LocalBufferWriter ) = delete;
 
@@ -498,6 +501,9 @@ inline FixedBufferWriter::FixedBufferWriter(char *buffer, 
size_t capacity) : _bu
   };
 }
 
+inline FixedBufferWriter::FixedBufferWriter(char *buffer, size_t capacity, 
bool /* noexcept_flag */) noexcept : _buffer(buffer), _capacity(capacity) {
+}
+
 inline FixedBufferWriter::FixedBufferWriter(MemSpan const )
   : _buffer{static_cast(span.data())}, _capacity{span.size()} {}
 
@@ -646,7 +652,7 @@ inline FixedBufferWriter::operator swoc::TextView() const {
 }
 
 // --- LocalBufferWriter ---
-template  LocalBufferWriter::LocalBufferWriter() : 
super_type(_arr, N) {}
+template  LocalBufferWriter::LocalBufferWriter() noexcept : 
super_type(_arr, N, true) {}
 
 }} // namespace swoc::SWOC_VERSION_NS
 



(trafficserver) branch webp_transform_build deleted (was c409bd215b)

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

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


 was c409bd215b Remove include path and add verify global plugin

The revisions that were on this branch are still contained in
other references; therefore, this change does not discard any commits
from the repository.



(trafficserver) 01/01: Remove include path and add verify global plugin

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

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

commit c409bd215b5f74c192c60717277907ad9c83a2d6
Author: Bryan Call 
AuthorDate: Thu Feb 8 11:57:37 2024 -0800

Remove include path and add verify global plugin
---
 plugins/webp_transform/CMakeLists.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/plugins/webp_transform/CMakeLists.txt 
b/plugins/webp_transform/CMakeLists.txt
index 75290b19d1..86eb796b26 100644
--- a/plugins/webp_transform/CMakeLists.txt
+++ b/plugins/webp_transform/CMakeLists.txt
@@ -17,4 +17,5 @@
 
 add_atsplugin(webp_transform ImageTransform.cc)
 target_link_libraries(webp_transform PRIVATE ImageMagick::Magick++ tscppapi)
-target_include_directories(webp_transform PRIVATE 
${ImageMagick_Magick++_INCLUDE_DIRS})
+
+verify_global_plugin(webp_transform)



(trafficserver) branch webp_transform_build created (now c409bd215b)

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

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


  at c409bd215b Remove include path and add verify global plugin

This branch includes the following new commits:

 new c409bd215b Remove include path and add verify global plugin

The 1 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.




(trafficserver) branch master updated: Updated the vscode launch and tasks files to work with cmake (#11016)

2024-02-07 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall 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 06ff161e88 Updated the vscode launch and tasks files to work with 
cmake (#11016)
06ff161e88 is described below

commit 06ff161e88d1fa8c2575bb8d2599c28ead962ae6
Author: Bryan Call 
AuthorDate: Wed Feb 7 11:22:12 2024 -0800

Updated the vscode launch and tasks files to work with cmake (#11016)
---
 .vscode/launch.json |  2 +-
 .vscode/tasks.json  | 17 +
 2 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/.vscode/launch.json b/.vscode/launch.json
index 8117283bbd..0e30cf0e7a 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -5,7 +5,7 @@
 "name": "(gdb) traffic_server",
 "type": "cppdbg",
 "request": "launch",
-"program": 
"${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}/src/traffic_server/.libs/traffic_server",
+"program": 
"${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}/src/traffic_server/traffic_server",
 "args": [],
 "stopAtEntry": false,
 "cwd": "${workspaceFolder}",
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index 0dc52a2ae6..d1c7fb878d 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -1,24 +1,17 @@
 {
 "version": "2.0.0",
 "tasks": [
-{
-"label": "Autoreconf",
-"type": "shell",
-"command": "autoreconf -if",
-"problemMatcher": []
-},
 {
 "label": "Configure",
 "type": "shell",
-"command": "mkdir ${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}; 
cd ${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}; ${workspaceFolder}/configure 
--prefix=${workspaceFolder}/target --enable-ccache 
--enable-experimental-plugins --enable-example-plugins --enable-test-tools 
--enable-debug --enable-werror ${env:ATS_VSCODE_CONFIGURE}",
+"command": "cmake --preset ${env:ATS_VSCODE_PRESET}",
 "dependsOrder": "sequence",
-"dependsOn": ["Autoreconf"],
 "problemMatcher": []
 },
 {
 "label": "Build",
 "type": "shell",
-"command": "make -j 16 -C 
${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}",
+"command": "cmake --build --preset ${env:ATS_VSCODE_PRESET}",
 "problemMatcher": [
 "$gcc"
 ],
@@ -30,7 +23,7 @@
 {
 "label": "Install",
 "type": "shell",
-"command": "make -j 16 install -C 
${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}",
+"command": "cmake --install 
${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}",
 "problemMatcher": [
 "$gcc"
 ],
@@ -38,7 +31,7 @@
 {
 "label": "Test",
 "type": "shell",
-"command": "make -j 8 test -C 
${workspaceFolder}/${env:ATS_VSCODE_BUILDDIR}",
+"command": "cmake --build --preset ${env:ATS_VSCODE_PRESET} 
--target test",
 "problemMatcher": [
 "$gcc"
 ],
@@ -50,7 +43,7 @@
 {
 "label": "Full Build",
 "dependsOrder": "sequence",
-"dependsOn": ["Configure", "Build", "Install"],
+"dependsOn": ["Configure", "Build", "Test", "Install"],
 "problemMatcher": [
 "$gcc"
 ]



(trafficserver) branch 9.2.x updated: header_freq: Fix msg lock issues (#10988)

2024-01-29 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new 75328aa8f4 header_freq: Fix msg lock issues (#10988)
75328aa8f4 is described below

commit 75328aa8f47a744c0bb3c4d43795736fa0b11ba4
Author: Chris McFarlen 
AuthorDate: Mon Jan 29 16:39:40 2024 -0600

header_freq: Fix msg lock issues (#10988)

* header_freq: Fix msg lock issues

* fix docs


Co-authored-by: Chris McFarlen 
(cherry picked from commit 78ccc61c9c803c39b3a874588fe2b3b2d52e9a0d)
---
 doc/admin-guide/plugins/header_freq.en.rst  |  20 ++-
 plugins/experimental/header_freq/header_freq.cc | 186 +---
 2 files changed, 144 insertions(+), 62 deletions(-)

diff --git a/doc/admin-guide/plugins/header_freq.en.rst 
b/doc/admin-guide/plugins/header_freq.en.rst
index a5214b5ef2..398b7357cf 100644
--- a/doc/admin-guide/plugins/header_freq.en.rst
+++ b/doc/admin-guide/plugins/header_freq.en.rst
@@ -20,21 +20,29 @@ Header Frequency Plugin
   specific language governing permissions and limitations
   under the License.
 
-The Header Frequency plugin keeps track of the number of times headers
-have been seen in transactions. Two separate counteres are kept for
-the origin and the client. This information is accessible via ::
+The Header Frequency plugin keeps track of the number of times headers have 
been
+seen in transactions. Two separate counteres are kept for the origin and the
+client. This information is accessible via the ``log`` plugin message.  By
+default the data is sent to traffic.out but it can alternatively be appended to
+an arbitrary file. The following logs the stats to ``traffic.out``::
 
 traffic_ctl plugin msg header_freq log
 
+The following appends the stats to ``/tmp/log.txt``. Note that this file must 
be
+writeable by the traffic_server process's user::
+
+traffic_ctl plugin msg header_freq log:/tmp/log.txt
+
+
 Installation
 
 
-This plugin is only built if the configure option ::
+Since Header Frequency plugin is an expiremental plugin, traffic_server must 
be configured
+to build experimental plugins in order to use it::
 
 --enable-experimental-plugins
 
-is given at build time.
 
-Add the following line to :file:`plugin.config`::
+Once built, add the following line to :file:`plugin.config` and restart 
traffic_server to use it::
 
 header_freq.so
diff --git a/plugins/experimental/header_freq/header_freq.cc 
b/plugins/experimental/header_freq/header_freq.cc
index e498b3769f..3422d097f0 100644
--- a/plugins/experimental/header_freq/header_freq.cc
+++ b/plugins/experimental/header_freq/header_freq.cc
@@ -22,12 +22,19 @@
   limitations under the License.
  */
 
-#include 
-#include 
-#include 
+#include 
+#include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
+#include 
+#include 
+
+#include "ts/apidefs.h"
 #include 
 
 namespace
@@ -43,31 +50,47 @@ const char DEBUG_TAG_INIT[] = "header_freq.init";
 // debug messages in continuation callbacks
 const char DEBUG_TAG_HOOK[] = "header_freq.hook";
 
-// maps from header name to # of times encountered
-std::map client_freq;
-std::map origin_freq;
+// A map from header name to the number of times the header was encountered.
+using CountMap_t = std::unordered_map>;
+CountMap_t client_freq;
+CountMap_t origin_freq;
+std::shared_mutex map_mutex;
+
+// A vector for when we want to sort the map.
+using CountVector_t = std::vector>;
 
 // for traffic_ctl, name is a convenient identifier
 const char *ctl_tag  = PLUGIN_NAME;
 const char CONTROL_MSG_LOG[] = "log"; // log all data
 const size_t CONTROL_MSG_LOG_LEN = sizeof(CONTROL_MSG_LOG) - 1;
 
+void
+Log_Sorted_Map(CountMap_t const , std::ostream )
+{
+  CountVector_t sorted_vector;
+  {
+std::shared_lock lock(map_mutex);
+sorted_vector = CountVector_t(map.begin(), map.end());
+  }
+  std::sort(sorted_vector.begin(), sorted_vector.end(), [](const auto , 
const auto ) -> bool { return a.second > b.second; });
+
+  for (auto const &[header_name, count] : sorted_vector) {
+ss << header_name << ": " << count << std::endl;
+  }
+}
+
 void
 Log_Data(std::ostream )
 {
   ss << std::endl << std::string(100, '+') << std::endl;
 
   ss << "CLIENT HEADERS" << std::endl;
-  for (auto  : client_freq) {
-ss << elem.first << ": " << elem.second << std::endl;
-  }
+  Log_Sorted_Map(client_freq, ss);
 
   ss << std::endl;
 
   ss << "ORIGIN HEADERS" << std::endl;
-  for (auto  : origin_freq) {
-ss << elem.first << ": " << elem.second << std::endl;
-  }
+  Log_Sorted_Map(origin_freq, 

(trafficserver) branch 9.2.x updated: Update accept thread configuration changes from #10687 applied to 9.2.x (#10744)

2024-01-29 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new 5dee9ece5f Update accept thread configuration changes from #10687 
applied to 9.2.x (#10744)
5dee9ece5f is described below

commit 5dee9ece5f69e57c347d425be26789d50eba6fc8
Author: Nathan Wang 
AuthorDate: Mon Jan 29 15:31:27 2024 -0700

Update accept thread configuration changes from #10687 applied to 9.2.x 
(#10744)

* cherry pick changes from #10687 to 9.2.x

* removed an unused nethandler instance

* another unused variable

-

Co-authored-by: Nathan Wang 
---
 iocore/net/P_UnixNet.h  | 12 ++--
 iocore/net/UnixNet.cc   | 15 +++
 iocore/net/UnixNetAccept.cc |  9 +++--
 3 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/iocore/net/P_UnixNet.h b/iocore/net/P_UnixNet.h
index d5b68bf787..bf8acd4031 100644
--- a/iocore/net/P_UnixNet.h
+++ b/iocore/net/P_UnixNet.h
@@ -23,6 +23,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 
 #include "tscore/ink_platform.h"
@@ -281,7 +283,6 @@ public:
 uint32_t transaction_no_activity_timeout_in = 0;
 uint32_t keep_alive_no_activity_timeout_in  = 0;
 uint32_t default_inactivity_timeout = 0;
-uint32_t additional_accepts = 0;
 
 /** Return the address of the first value in this struct.
 
@@ -328,7 +329,7 @@ public:
   void remove_from_keep_alive_queue(NetEvent *ne);
   bool add_to_active_queue(NetEvent *ne);
   void remove_from_active_queue(NetEvent *ne);
-  int get_additional_accepts();
+  static int get_additional_accepts();
 
   /// Per process initialization logic.
   static void init_for_process();
@@ -386,6 +387,13 @@ public:
   NetHandler();
 
 private:
+  // The following settings are used potentially by accept threads. These are
+  // shared across threads via std::atomic rather than being pulled through a
+  // TS_EVENT_MGMT_UPDATE event like with the Config settings above because
+  // accept threads are not always on a standard NET thread with a NetHandler
+  // that has TS_EVENT_MGMT_UPDATE handling logic.
+  static std::atomic additional_accepts;
+
   void _close_ne(NetEvent *ne, ink_hrtime now, int _event, int , 
int _idle_time, int _idle_count);
 
   /// Static method used as the callback for runtime configuration updates.
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index e1dca3ce39..b5688d5356 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -25,6 +25,8 @@
 
 using namespace std::literals;
 
+std::atomic NetHandler::additional_accepts{0};
+
 ink_hrtime last_throttle_warning;
 ink_hrtime last_shedding_warning;
 int net_connections_throttle;
@@ -295,7 +297,7 @@ NetHandler::update_nethandler_config(const char *str, 
RecDataT, RecData data, vo
 updated_member = ::global_config.default_inactivity_timeout;
 Debug("net_queue", "proxy.config.net.default_inactivity_timeout updated to 
%" PRId64, data.rec_int);
   } else if (name == "proxy.config.net.additional_accepts"sv) {
-updated_member = ::global_config.additional_accepts;
+NetHandler::additional_accepts.store(data.rec_int, 
std::memory_order_relaxed);
 Debug("net_queue", "proxy.config.net.additional_accepts updated to %" 
PRId64, data.rec_int);
   }
 
@@ -332,7 +334,12 @@ NetHandler::init_for_process()
   REC_ReadConfigInt32(global_config.transaction_no_activity_timeout_in, 
"proxy.config.net.transaction_no_activity_timeout_in");
   REC_ReadConfigInt32(global_config.keep_alive_no_activity_timeout_in, 
"proxy.config.net.keep_alive_no_activity_timeout_in");
   REC_ReadConfigInt32(global_config.default_inactivity_timeout, 
"proxy.config.net.default_inactivity_timeout");
-  REC_ReadConfigInt32(global_config.additional_accepts, 
"proxy.config.net.additional_accepts");
+
+  // Atomic configurations.
+  uint32_t val = 0;
+
+  REC_ReadConfigInt32(val, "proxy.config.net.additional_accepts");
+  additional_accepts.store(val, std::memory_order_relaxed);
 
   RecRegisterConfigUpdateCb("proxy.config.net.max_connections_in", 
update_nethandler_config, nullptr);
   RecRegisterConfigUpdateCb("proxy.config.net.max_requests_in", 
update_nethandler_config, nullptr);
@@ -350,7 +357,7 @@ NetHandler::init_for_process()
   Debug("net_queue", "proxy.config.net.keep_alive_no_activity_timeout_in 
updated to %d",
 global_config.keep_alive_no_activity_timeout_in);
   Debug("net_queue", "proxy.config.net.default_inactivity_timeout updated to 
%d", global_config.default_inactivity_timeout);
-  Debug("net_queue", "proxy.config.net.additional_accepts updated to %d", 
global_config.additional_accepts);
+  D

(trafficserver) branch 9.2.x updated: Use slice req method type in Data obj (#10925)

2024-01-02 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new 54d44fc863 Use slice req method type in Data obj (#10925)
54d44fc863 is described below

commit 54d44fc86367ba3fbb0a0e5de75d498fb15aa3fe
Author: Serris Lew 
AuthorDate: Mon Dec 18 09:24:10 2023 -0800

Use slice req method type in Data obj (#10925)

* Save slice req method type in Data obj

* refactor request_block code

* bypass vio logic for PURGE

-

Co-authored-by: Serris Lew 
(cherry picked from commit db7e10542a3bc928c26e4ed1cdf81e7a01ccbb7d)
---
 plugins/experimental/slice/Config.h  | 12 ++--
 plugins/experimental/slice/Data.h|  9 +
 plugins/experimental/slice/server.cc | 25 ++---
 plugins/experimental/slice/slice.cc  |  6 ++
 plugins/experimental/slice/util.cc   |  2 +-
 5 files changed, 28 insertions(+), 26 deletions(-)

diff --git a/plugins/experimental/slice/Config.h 
b/plugins/experimental/slice/Config.h
index 430495333a..fe409e6866 100644
--- a/plugins/experimental/slice/Config.h
+++ b/plugins/experimental/slice/Config.h
@@ -45,9 +45,8 @@ struct Config {
   int m_paceerrsecs{0};   // -1 disable logging, 0 no pacing, max 60s
   int m_prefetchcount{0}; // 0 disables prefetching
   enum RefType { First, Relative };
-  RefType m_reftype{First};   // reference slice is relative to request
-  const char *m_method_type{nullptr}; // type of header request
-  bool m_head_strip_range{false}; // strip range header for head requests
+  RefType m_reftype{First};   // reference slice is relative to request
+  bool m_head_strip_range{false}; // strip range header for head requests
 
   std::string m_skip_header;
   std::string m_crr_ims_header;
@@ -71,13 +70,6 @@ struct Config {
 return None != m_regex_type;
   }
 
-  // Check if response only expects header
-  bool
-  onlyHeader() const
-  {
-return (m_method_type == TS_HTTP_METHOD_HEAD || m_method_type == 
TS_HTTP_METHOD_PURGE);
-  }
-
   // If no null reg, true, otherwise check against regex
   bool matchesRegex(char const *const url, int const urllen) const;
 
diff --git a/plugins/experimental/slice/Data.h 
b/plugins/experimental/slice/Data.h
index 8e654a69bc..5cd7e8538f 100644
--- a/plugins/experimental/slice/Data.h
+++ b/plugins/experimental/slice/Data.h
@@ -71,6 +71,8 @@ struct Data {
 
   TSHttpStatus m_statustype{TS_HTTP_STATUS_NONE}; // 200 or 206
 
+  const char *m_method_type{nullptr}; // type of header request
+
   Range m_req_range; // converted to half open interval
 
   int64_t m_blocknum{-1}; // block number to work on, -1 bad/stop
@@ -108,6 +110,13 @@ struct Data {
 m_lastmodified[0] = '\0';
   }
 
+  // Check if response only expects header
+  bool
+  onlyHeader() const
+  {
+return (m_method_type == TS_HTTP_METHOD_HEAD || m_method_type == 
TS_HTTP_METHOD_PURGE);
+  }
+
   ~Data()
   {
 if (nullptr != m_urlbuf) {
diff --git a/plugins/experimental/slice/server.cc 
b/plugins/experimental/slice/server.cc
index ba342d862e..3df401240e 100644
--- a/plugins/experimental/slice/server.cc
+++ b/plugins/experimental/slice/server.cc
@@ -111,7 +111,7 @@ handleFirstServerHeader(Data *const data, TSCont const 
contp)
 // Should run TSVIONSetBytes(output_io, hlen + bodybytes);
 int64_t const hlen = TSHttpHdrLengthGet(header.m_buffer, header.m_lochdr);
 int64_t const clen = contentLengthFrom(header);
-if (TS_HTTP_STATUS_OK == header.status() && data->m_config->onlyHeader()) {
+if (TS_HTTP_STATUS_OK == header.status() && data->onlyHeader()) {
   DEBUG_LOG("HEAD/PURGE request stripped Range header: expects 200");
   data->m_bytestosend   = hlen;
   data->m_blockexpected = 0;
@@ -220,7 +220,7 @@ handleFirstServerHeader(Data *const data, TSCont const 
contp)
   int const hbytes = TSHttpHdrLengthGet(header.m_buffer, header.m_lochdr);
 
   // HEAD request only sends header
-  if (data->m_config->onlyHeader()) {
+  if (data->onlyHeader()) {
 data->m_bytestosend   = hbytes;
 data->m_blockexpected = 0;
   } else {
@@ -364,7 +364,7 @@ handleNextServerHeader(Data *const data, TSCont const contp)
 
   switch (header.status()) {
   case TS_HTTP_STATUS_NOT_FOUND:
-if (data->m_config->onlyHeader()) {
+if (data->onlyHeader()) {
   return false;
 }
 // need to reissue reference slice
@@ -374,7 +374,7 @@ handleNextServerHeader(Data *const data, TSCont const contp)
   case TS_HTTP_STATUS_PARTIAL_CONTENT:
 break;
   default:
-if (data->m_config->onlyHeader() && header.status() == TS_HTTP_STATUS_OK) {
+if (data->onlyHeader() && header.status() == TS_HTTP_STATUS_OK) {
   return true;
 }
 DEBUG_LOG("Non 206/404 inte

(trafficserver) branch master updated (950f4d70b5 -> beaffa92f1)

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

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


from 950f4d70b5 Coverity 1497388: Dereference after null check (#10915)
 add beaffa92f1 Coverity 1497456: Time of check time of use in 
LogFile::trim_rolled (#10882)

No new revisions were added by this update.

Summary of changes:
 src/proxy/logging/LogFile.cc | 30 +++---
 1 file changed, 19 insertions(+), 11 deletions(-)



(trafficserver) branch master updated: Coverity 1528674: Uncaught exception in test_MIOBufferWriter's _ink_assert (#10912)

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

bcall 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 a1c0e7d3a5 Coverity 1528674: Uncaught exception in 
test_MIOBufferWriter's _ink_assert (#10912)
a1c0e7d3a5 is described below

commit a1c0e7d3a53fb1f974fdc3b4f8f02f3afdd70ff9
Author: Bryan Call 
AuthorDate: Fri Dec 8 10:19:25 2023 -0800

Coverity 1528674: Uncaught exception in test_MIOBufferWriter's _ink_assert 
(#10912)
---
 src/iocore/eventsystem/unit_tests/test_MIOBufferWriter.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/iocore/eventsystem/unit_tests/test_MIOBufferWriter.cc 
b/src/iocore/eventsystem/unit_tests/test_MIOBufferWriter.cc
index 0e480d885d..9da47c3ff5 100644
--- a/src/iocore/eventsystem/unit_tests/test_MIOBufferWriter.cc
+++ b/src/iocore/eventsystem/unit_tests/test_MIOBufferWriter.cc
@@ -196,5 +196,7 @@ TEST_CASE("MIOBufferWriter", "[MIOBW]")
 void
 _ink_assert(const char *a, const char *f, int l)
 {
+  // Coverity is confused and thinks this _ink_assert is the one used in 
traffic_server
+  // coverity[UNCAUGHT_EXCEPT:FALSE]
   throw InkAssertExcept();
 }



(trafficserver) branch master updated (cdd67dd45a -> ff71760d4a)

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

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


from cdd67dd45a Coverity 1497364: Side effect in assertion (#10907)
 add ff71760d4a Coverity 1529710: Resource leak in object in CacheScan 
(#10911)

No new revisions were added by this update.

Summary of changes:
 src/traffic_cache_tool/CacheScan.h | 1 +
 1 file changed, 1 insertion(+)



(trafficserver) branch master updated (70d5c4e1a5 -> d13e3a7c3c)

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

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


from 70d5c4e1a5 Coverity 1508836: Uninitialized pointer field in 
JsonRPCManager (#10898)
 add d13e3a7c3c Fix for building on Rocky Linux 8 (#10901)

No new revisions were added by this update.

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



(trafficserver) branch master updated: Coverity 1508836: Uninitialized pointer field in JsonRPCManager (#10898)

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

bcall 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 70d5c4e1a5 Coverity 1508836: Uninitialized pointer field in 
JsonRPCManager (#10898)
70d5c4e1a5 is described below

commit 70d5c4e1a523a9b693474dbc673941b62e7f9783
Author: Bryan Call 
AuthorDate: Tue Dec 5 19:39:18 2023 -0800

Coverity 1508836: Uninitialized pointer field in JsonRPCManager (#10898)
---
 include/mgmt/rpc/jsonrpc/JsonRPCManager.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/mgmt/rpc/jsonrpc/JsonRPCManager.h 
b/include/mgmt/rpc/jsonrpc/JsonRPCManager.h
index 58bc667ad2..56b2d71e80 100644
--- a/include/mgmt/rpc/jsonrpc/JsonRPCManager.h
+++ b/include/mgmt/rpc/jsonrpc/JsonRPCManager.h
@@ -272,8 +272,9 @@ private:
   // We support these three for now. This can easily be extended to 
support other signatures.
   // that's one of the main points of the InternalHandler
   std::variant _func;
-  const RPCRegistryInfo *_regInfo; ///< Can hold internal information 
about the handler, this could be null as it is optional.
-   ///< This pointer can eventually holds 
important information about the call.
+  const RPCRegistryInfo *_regInfo =
+nullptr; ///< Can hold internal information about the handler, this 
could be null as it is optional.
+ ///< This pointer can eventually holds important information 
about the call.
   TSRPCHandlerOptions _options;
 };
 // We will keep all the handlers wrapped inside the InternalHandler class, 
this will help us



(trafficserver) branch master updated: Coverity 1497350: Wrapper object use after free in GzipDeflateTransformation (#10879)

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

bcall 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 6c9e23d7a1 Coverity 1497350: Wrapper object use after free in 
GzipDeflateTransformation (#10879)
6c9e23d7a1 is described below

commit 6c9e23d7a1f90e6814ce501794e6ec32dd75a389
Author: Bryan Call 
AuthorDate: Mon Dec 4 15:59:13 2023 -0800

Coverity 1497350: Wrapper object use after free in 
GzipDeflateTransformation (#10879)

Ignore false positive
---
 src/tscpp/api/GzipDeflateTransformation.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/tscpp/api/GzipDeflateTransformation.cc 
b/src/tscpp/api/GzipDeflateTransformation.cc
index 772d0b9145..c540aacf97 100644
--- a/src/tscpp/api/GzipDeflateTransformation.cc
+++ b/src/tscpp/api/GzipDeflateTransformation.cc
@@ -104,12 +104,14 @@ GzipDeflateTransformation::consume(std::string_view data)
   do {
 LOG_DEBUG("Iteration %d: Deflate will compress %ld bytes", ++iteration, 
data.size());
 state_->z_stream_.avail_out = buffer_size;
-state_->z_stream_.next_out  = [0];
+// next_out needs to be set to nullptr before we return since it points to 
a local buffer
+// coverity[WRAPPER_ESCAPE: FALSE]
+state_->z_stream_.next_out = [0];
 
 int err = deflate(_->z_stream_, Z_SYNC_FLUSH);
 if (Z_OK != err) {
-  state_->z_stream_.next_out = nullptr;
   LOG_ERROR("Iteration %d: Deflate failed to compress %ld bytes with error 
code '%d'", iteration, data.size(), err);
+  state_->z_stream_.next_out = nullptr;
   return;
 }
 



(trafficserver) branch master updated: Update records.yaml.default.in (#10865)

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

bcall 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 55724b3304 Update records.yaml.default.in (#10865)
55724b3304 is described below

commit 55724b3304a62986f411cdc2629de70df70bc157
Author: Jasmine Emanouel <40879549+jasmine-nahr...@users.noreply.github.com>
AuthorDate: Tue Dec 5 10:11:46 2023 +1100

Update records.yaml.default.in (#10865)
---
 configs/records.yaml.default.in | 56 -
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/configs/records.yaml.default.in b/configs/records.yaml.default.in
index 6acb384e1c..e0efa124a8 100644
--- a/configs/records.yaml.default.in
+++ b/configs/records.yaml.default.in
@@ -1,7 +1,7 @@
 ##
 # *NOTE*: All options covered in this file should be documented in the docs:
 #
-#https://docs.trafficserver.apache.org/records.yaml
+#
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html
 ##
 
 ts:
@@ -10,21 +10,21 @@ ts:
 limits:
   http:
 
-# 
https://docs.trafficserver.apache.org/records.yaml#proxy-config-cache-limits-http-max-alts
+# 
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#proxy-config-cache-limits-http-max-alts
 max_alts: 5
 log:
   alternate:
 
-# 
https://docs.trafficserver.apache.org/records.yaml#proxy-config-cache-log-alternate-eviction
+# 
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#proxy-config-cache-log-alternate-eviction
 eviction: 0
 
-# 
https://docs.trafficserver.apache.org/records.yaml#proxy-config-cache-max-doc-size
+# 
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#proxy-config-cache-max-doc-size
 max_doc_size: 0
 min_average_object_size: 8000
 
 ##
 # RAM and disk cache configurations. Docs:
-#https://docs.trafficserver.apache.org/records.yaml#ram-cache
+#
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#ram-cache
 #
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/storage.config.en.html
 ##
 ram_cache:
@@ -33,19 +33,19 @@ ts:
 threads_per_disk: 8
 ##
 # Debugging. Docs:
-#
https://docs.trafficserver.apache.org/records.yaml#diagnostic-logging-configuration
+#
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#diagnostic-logging-configuration
 ##
   diags:
 debug:
   enabled: 0
   tags: http|dns
 
-#
https://docs.trafficserver.apache.org/records.yaml#proxy-config-dump-mem-info-frequency
+#
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#proxy-config-dump-mem-info-frequency
   dump_mem_info_frequency: 0
 
 ##
 # Thread configurations. Docs:
-#https://docs.trafficserver.apache.org/records.yaml#thread-variables
+#
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#thread-variables
 ##
   exec_thread:
 affinity: 1
@@ -61,7 +61,7 @@ ts:
 
 ##
 # Heuristic cache expiration. Docs:
-#https://docs.trafficserver.apache.org/records.yaml#heuristic-expiration
+#
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#heuristic-expiration
 ##
   heuristic_lm_factor: 0.1
   heuristic_max_lifetime: 86400
@@ -75,20 +75,20 @@ ts:
 
 ##
 # Cache control. Docs:
-#https://docs.trafficserver.apache.org/records.yaml#cache-control
+#
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.en.html#cache-control
 #
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/cache.config.en.html
 ##
   ignore_client_cc_max_age: 1
 
-# 
https://docs.trafficserver.apache.org/records.yaml#proxy-config-http-cache-required-headers
+# 
https://docs.trafficserver.apache.org/en/latest/admin-guide/files/records.yaml.e

(trafficserver) branch master updated: Coverity 1523673: Resource leak in test_MMH (#10890)

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

bcall 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 07020b1a5e Coverity 1523673: Resource leak in test_MMH (#10890)
07020b1a5e is described below

commit 07020b1a5e3d378af2e6160664c49a382b19e2c5
Author: Bryan Call 
AuthorDate: Fri Dec 1 08:31:50 2023 -0800

Coverity 1523673: Resource leak in test_MMH (#10890)
---
 src/tscore/unit_tests/test_MMH.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/tscore/unit_tests/test_MMH.cc 
b/src/tscore/unit_tests/test_MMH.cc
index 72781ec64e..d7756e3eff 100644
--- a/src/tscore/unit_tests/test_MMH.cc
+++ b/src/tscore/unit_tests/test_MMH.cc
@@ -152,4 +152,6 @@ TEST_CASE("MMH", "[libts][MMH]")
   ats_free(free_s1);
   ats_free(free_s2);
   ats_free(free_s3);
+
+  fclose(fp);
 }



(trafficserver) branch master updated: Coverity 1497333: Resource leak in object in LogConfig (#10891)

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

bcall 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 84f3efe8cf Coverity 1497333: Resource leak in object in LogConfig 
(#10891)
84f3efe8cf is described below

commit 84f3efe8cf8f33434f4769e976b5bda09273a706
Author: Bryan Call 
AuthorDate: Fri Dec 1 08:31:29 2023 -0800

Coverity 1497333: Resource leak in object in LogConfig (#10891)

hostname wasn't freed and minor cleanup
---
 include/proxy/logging/LogConfig.h | 46 ++-
 include/proxy/logging/LogLimits.h |  4 ++--
 src/proxy/logging/LogConfig.cc| 40 --
 3 files changed, 27 insertions(+), 63 deletions(-)

diff --git a/include/proxy/logging/LogConfig.h 
b/include/proxy/logging/LogConfig.h
index 8a02bb1e49..3561fa5ade 100644
--- a/include/proxy/logging/LogConfig.h
+++ b/include/proxy/logging/LogConfig.h
@@ -158,7 +158,6 @@ public:
*/
   void register_rolled_log_auto_delete(std::string_view logname, int 
rolling_min_count);
 
-public:
   bool initialized = false;
   bool reconfiguration_needed  = false;
   bool logging_space_exhausted = false;
@@ -171,31 +170,31 @@ public:
   LogFilterList filter_list;
   LogFormatList format_list;
 
-  int log_buffer_size;
-  bool log_fast_buffer;
-  int max_secs_per_buffer;
-  int max_space_mb_for_logs;
-  int max_space_mb_headroom;
-  int logfile_perm;
+  uint32_t log_buffer_size  = 10 * LOG_KILOBYTE;
+  bool log_fast_buffer  = false;
+  int max_secs_per_buffer   = 5;
+  int max_space_mb_for_logs = 100;
+  int max_space_mb_headroom = 10;
+  int logfile_perm  = 0644;
 
-  int preproc_threads;
+  int preproc_threads = 1;
 
-  Log::RollingEnabledValues rolling_enabled;
-  int rolling_interval_sec;
-  int rolling_offset_hr;
-  int rolling_size_mb;
-  int rolling_min_count;
-  int rolling_max_count;
-  bool rolling_allow_empty;
-  bool auto_delete_rolled_files;
+  Log::RollingEnabledValues rolling_enabled = Log::NO_ROLLING;
+  int rolling_interval_sec  = 86400;
+  int rolling_offset_hr = 0;
+  int rolling_size_mb   = 10;
+  int rolling_min_count = 0;
+  int rolling_max_count = 0;
+  bool rolling_allow_empty  = false;
+  bool auto_delete_rolled_files = false;
 
-  int sampling_frequency;
-  int file_stat_frequency;
-  int space_used_frequency;
+  int sampling_frequency   = 1;
+  int file_stat_frequency  = 16;
+  int space_used_frequency = 900;
 
-  int ascii_buffer_size;
-  int max_line_size;
-  int logbuffer_max_iobuf_index;
+  int ascii_buffer_size = 4 * 9216;
+  int max_line_size = 9216;
+  int logbuffer_max_iobuf_index = BUFFER_SIZE_INDEX_32K;
 
   char *hostname   = nullptr;
   char *logfile_dir= nullptr;
@@ -204,9 +203,6 @@ public:
 private:
   bool evaluate_config();
 
-  void setup_default_values();
-
-private:
   bool m_disk_full  = false;
   bool m_disk_low   = false;
   bool m_partition_full = false;
diff --git a/include/proxy/logging/LogLimits.h 
b/include/proxy/logging/LogLimits.h
index d5e7505b94..568f19386c 100644
--- a/include/proxy/logging/LogLimits.h
+++ b/include/proxy/logging/LogLimits.h
@@ -34,5 +34,5 @@ enum {
   LOG_MAX_FORMATTED_LINE   = 10240
 };
 
-#define LOG_KILOBYTE ((int64_t)1024)
-#define LOG_MEGABYTE ((int64_t)1048576)
+constexpr int64_t LOG_KILOBYTE = 1024;
+constexpr int64_t LOG_MEGABYTE = 1048576;
diff --git a/src/proxy/logging/LogConfig.cc b/src/proxy/logging/LogConfig.cc
index 4ef25ef8cf..bd80f6b91c 100644
--- a/src/proxy/logging/LogConfig.cc
+++ b/src/proxy/logging/LogConfig.cc
@@ -66,40 +66,6 @@
 #define DIAGS_LOG_FILENAME"diags.log"
 #define MANAGER_LOG_FILENAME  "manager.log"
 
-void
-LogConfig::setup_default_values()
-{
-  hostname  = ats_strdup(Machine::instance()->host_name.c_str());
-  log_buffer_size   = static_cast(10 * LOG_KILOBYTE);
-  log_fast_buffer   = false;
-  max_secs_per_buffer   = 5;
-  max_space_mb_for_logs = 100;
-  max_space_mb_headroom = 10;
-  error_log_filename= ats_strdup("error.log");
-  logfile_perm  = 0644;
-  logfile_dir   = ats_strdup(".");
-
-  preproc_threads = 1;
-
-  rolling_enabled  = Log::NO_ROLLING;
-  rolling_interval_sec = 86400; // 24 hours
-  rolling_offset_hr= 0;
-  rolling_size_mb  = 10;
-  rolling_min_count= 0;
-  rolling_max_count= 0;
-  rolling_allow_empty  = false;
-  auto_delete_rolled_files = true;
-  roll_log_files_now   = false;
-
-  sampling_frequency   = 1;
-  file_stat_frequency  = 16;
-  space_used_frequency = 900;
-
-  ascii_buffer_size = 4 * 9216;
-  max_line_size =

(trafficserver) branch master updated: Coverity 1497378: Use of 32-bit time_t in CacheVC (#10857)

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

bcall 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 6b896f43be Coverity 1497378: Use of 32-bit time_t in CacheVC (#10857)
6b896f43be is described below

commit 6b896f43bef38c42d574d8bc89293766e0dbc94f
Author: Bryan Call 
AuthorDate: Thu Nov 30 08:26:22 2023 -0800

Coverity 1497378: Use of 32-bit time_t in CacheVC (#10857)

And removed unneeded casting
---
 include/iocore/cache/CacheVC.h | 2 +-
 src/iocore/cache/CacheWrite.cc | 6 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/iocore/cache/CacheVC.h b/include/iocore/cache/CacheVC.h
index 84a07609ae..35bc895f3e 100644
--- a/include/iocore/cache/CacheVC.h
+++ b/include/iocore/cache/CacheVC.h
@@ -270,7 +270,7 @@ struct CacheVC : public CacheVConnection {
   Event *trigger;
   CacheKey *read_key;
   ContinuationHandler save_handler;
-  uint32_t pin_in_cache;
+  time_t pin_in_cache;
   ink_hrtime start_time;
   int op_type; // Index into the metrics array for this operation, rather than 
a CacheOpType (fewer casts)
   int recursive;
diff --git a/src/iocore/cache/CacheWrite.cc b/src/iocore/cache/CacheWrite.cc
index 536070bdfd..069c0c690c 100644
--- a/src/iocore/cache/CacheWrite.cc
+++ b/src/iocore/cache/CacheWrite.cc
@@ -1591,8 +1591,7 @@ Cache::open_write(Continuation *cont, const CacheKey 
*key, CacheFragType frag_ty
   c->f.overwrite  = (options & CACHE_WRITE_OPT_OVERWRITE) != 0;
   c->f.close_complete = (options & CACHE_WRITE_OPT_CLOSE_COMPLETE) != 0;
   c->f.sync   = (options & CACHE_WRITE_OPT_SYNC) == 
CACHE_WRITE_OPT_SYNC;
-  // coverity[Y2K38_SAFETY:FALSE]
-  c->pin_in_cache = static_cast(apin_in_cache);
+  c->pin_in_cache = apin_in_cache;
 
   if ((res = c->stripe->open_write_lock(c, false, 1)) > 0) {
 // document currently being written, abort
@@ -1693,8 +1692,7 @@ Cache::open_write(Continuation *cont, const CacheKey 
*key, CacheHTTPInfo *info,
 
   Metrics::Gauge::increment(cache_rsb.status[c->op_type].active);
   
Metrics::Gauge::increment(stripe->cache_vol->vol_rsb.status[c->op_type].active);
-  // coverity[Y2K38_SAFETY:FALSE]
-  c->pin_in_cache = static_cast(apin_in_cache);
+  c->pin_in_cache = apin_in_cache;
 
   {
 CACHE_TRY_LOCK(lock, c->stripe->mutex, cont->mutex->thread_holding);



(trafficserver) branch master updated: Coverity 1528709: Pointer to local outside scope in PreWarmSM::state_dns_lookup (#10876)

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

bcall 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 6097d93f29 Coverity 1528709: Pointer to local outside scope in 
PreWarmSM::state_dns_lookup (#10876)
6097d93f29 is described below

commit 6097d93f2976b729af7781e96526dd952923227f
Author: Bryan Call 
AuthorDate: Thu Nov 30 08:24:51 2023 -0800

Coverity 1528709: Pointer to local outside scope in 
PreWarmSM::state_dns_lookup (#10876)
---
 src/proxy/http/PreWarmManager.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/proxy/http/PreWarmManager.cc b/src/proxy/http/PreWarmManager.cc
index 82ce2411dc..527de32020 100644
--- a/src/proxy/http/PreWarmManager.cc
+++ b/src/proxy/http/PreWarmManager.cc
@@ -312,15 +312,14 @@ PreWarmSM::state_dns_lookup(int event, void *data)
 break;
   }
   case EVENT_SRV_LOOKUP: {
-_pending_action = nullptr;
+_pending_action = nullptr;
+char srv_hostname[MAXDNAME] = {}; // Needs to have the same scope as 
hostname
 std::string_view hostname;
 
 if (record == nullptr || !record->is_srv()) {
   // no SRV record, fallback to default lookup
   hostname = _dst->host;
 } else {
-  char srv_hostname[MAXDNAME] = {0};
-
   hostname = std::string_view(srv_hostname);
 
   HostDBInfo *info =



(trafficserver) branch master updated: Coverity 1497446: Wrapper object use after free in GzipInflateTransformation (#10877)

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

bcall 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 8ab65ab151 Coverity 1497446: Wrapper object use after free in 
GzipInflateTransformation (#10877)
8ab65ab151 is described below

commit 8ab65ab1514b9dee0ec776d1bb72f5970941f2c7
Author: Bryan Call 
AuthorDate: Thu Nov 30 08:24:08 2023 -0800

Coverity 1497446: Wrapper object use after free in 
GzipInflateTransformation (#10877)

Ignore false positive
---
 src/tscpp/api/GzipInflateTransformation.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/tscpp/api/GzipInflateTransformation.cc 
b/src/tscpp/api/GzipInflateTransformation.cc
index 04c389205e..9b2077f80e 100644
--- a/src/tscpp/api/GzipInflateTransformation.cc
+++ b/src/tscpp/api/GzipInflateTransformation.cc
@@ -107,11 +107,13 @@ GzipInflateTransformation::consume(std::string_view data)
   while (state_->z_stream_.avail_in > 0 && err != Z_STREAM_END) {
 LOG_DEBUG("Iteration %d: Gzip has %d bytes to inflate", ++iteration, 
state_->z_stream_.avail_in);
 
-// Setup where the decompressed output will go.
+// Setup where the decompressed output will go
+// next_out needs to be set to nullptr before we return since it points to 
a local buffer
+// coverity[WRAPPER_ESCAPE: FALSE]
 state_->z_stream_.next_out  = reinterpret_cast([0]);
 state_->z_stream_.avail_out = inflate_block_size;
 
-/* Uncompress */
+// Uncompress the data
 err = inflate(_->z_stream_, Z_SYNC_FLUSH);
 
 if (err != Z_OK && err != Z_STREAM_END) {



(trafficserver) branch master updated: Coverity 1523692: Calling risky function in test_AcidPtr (#10880)

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

bcall 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 aff23cd266 Coverity 1523692: Calling risky function in test_AcidPtr 
(#10880)
aff23cd266 is described below

commit aff23cd266fafc4af3e66ee22547b5f66af05c5e
Author: Bryan Call 
AuthorDate: Thu Nov 30 08:23:33 2023 -0800

Coverity 1523692: Calling risky function in test_AcidPtr (#10880)

Switching to use random() instead of rand()
---
 src/tscore/unit_tests/test_AcidPtr.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/tscore/unit_tests/test_AcidPtr.cc 
b/src/tscore/unit_tests/test_AcidPtr.cc
index bca36f3ace..b9b29c97c7 100644
--- a/src/tscore/unit_tests/test_AcidPtr.cc
+++ b/src/tscore/unit_tests/test_AcidPtr.cc
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 
 using namespace std;
 
@@ -47,7 +48,7 @@ TEST_CASE("AcidPtr Atomicity")
   unique_lock gate_lock(gate_mutex);
   gate.wait(gate_lock);
 }
-int r = rand();
+int r = random();
 AcidCommitPtr> cptr(ptr);
 int old = (*cptr)[0];
 for (int  : *cptr) {



(trafficserver) branch master updated (d3b49b352d -> da1f392084)

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

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


from d3b49b352d Coverity 1528667: Use of 32-bit time_t in 
mime_days_since_epoch_to_mdy_slowcase (#10854)
 add da1f392084 Coverity 1523685: Use of 32-bit time_t in test_mime (#10855)

No new revisions were added by this update.

Summary of changes:
 src/proxy/hdrs/unit_tests/test_mime.cc | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)



(trafficserver) branch master updated: Coverity 1528667: Use of 32-bit time_t in mime_days_since_epoch_to_mdy_slowcase (#10854)

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

bcall 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 d3b49b352d Coverity 1528667: Use of 32-bit time_t in 
mime_days_since_epoch_to_mdy_slowcase (#10854)
d3b49b352d is described below

commit d3b49b352d479e55f9fe6c3c594dcf77d1b7a8f1
Author: Bryan Call 
AuthorDate: Wed Nov 29 10:41:06 2023 -0800

Coverity 1528667: Use of 32-bit time_t in 
mime_days_since_epoch_to_mdy_slowcase (#10854)

Ignore false positives
---
 src/proxy/hdrs/MIME.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/proxy/hdrs/MIME.cc b/src/proxy/hdrs/MIME.cc
index 86101d314c..4090a99da2 100644
--- a/src/proxy/hdrs/MIME.cc
+++ b/src/proxy/hdrs/MIME.cc
@@ -2971,8 +2971,11 @@ mime_days_since_epoch_to_mdy_slowcase(time_t 
days_since_jan_1_1970, int *m_retur
 mday  = d - days[month] - 1;
 year += 1900;
 
+// coverity[Y2K38_SAFETY:FALSE]
 *m_return = month;
+// coverity[Y2K38_SAFETY:FALSE]
 *d_return = mday;
+// coverity[Y2K38_SAFETY:FALSE]
 *y_return = year;
   }
 }



(trafficserver) branch master updated (a8fead3d2f -> be98953895)

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

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


from a8fead3d2f Coverity 1497314: Uninitialized scalar variable in ESI 
plugin (#10835)
 add be98953895 Coverity 1523683: Uninitialized scalar variable in s3_auth 
unit test (#10833)

No new revisions were added by this update.

Summary of changes:
 plugins/s3_auth/unit_tests/test_aws_auth_v4.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(trafficserver) branch master updated: Coverity 1497314: Uninitialized scalar variable in ESI plugin (#10835)

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

bcall 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 a8fead3d2f Coverity 1497314: Uninitialized scalar variable in ESI 
plugin (#10835)
a8fead3d2f is described below

commit a8fead3d2f763cef8c2a6ff9bc02b5fcf47b61d3
Author: Bryan Call 
AuthorDate: Mon Nov 27 12:51:44 2023 -0800

Coverity 1497314: Uninitialized scalar variable in ESI plugin (#10835)
---
 plugins/esi/common/gzip.cc | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/plugins/esi/common/gzip.cc b/plugins/esi/common/gzip.cc
index 57ec5d9652..09ded8f957 100644
--- a/plugins/esi/common/gzip.cc
+++ b/plugins/esi/common/gzip.cc
@@ -140,11 +140,14 @@ EsiLib::gunzip(const char *data, int data_len, BufferList 
_list)
   data_len -= (GZIP_HEADER_SIZE + GZIP_TRAILER_SIZE);
   buf_list.clear();
   z_stream zstrm;
-  zstrm.zalloc   = Z_NULL;
-  zstrm.zfree= Z_NULL;
-  zstrm.opaque   = Z_NULL;
-  zstrm.next_in  = nullptr;
-  zstrm.avail_in = 0;
+  zstrm.zalloc= Z_NULL;
+  zstrm.zfree = Z_NULL;
+  zstrm.opaque= Z_NULL;
+  zstrm.next_in   = nullptr;
+  zstrm.avail_in  = 0;
+  zstrm.total_in  = 0;
+  zstrm.total_out = 0;
+
   if (inflateInit2(, -MAX_WBITS) != Z_OK) {
 TSError("[%s] inflateInit2 failed!", __FUNCTION__);
 return false;



(trafficserver) branch master updated (0fcfb27be0 -> b2470179f4)

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

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


from 0fcfb27be0 Coverity 1497238: Uninitialized scalar variable in 
DiagsConfigState class (#10837)
 add b2470179f4 Coverity 1497273: Uninitialized scalar variable in Machine 
class (#10836)

No new revisions were added by this update.

Summary of changes:
 src/iocore/utils/Machine.cc | 5 +
 1 file changed, 5 insertions(+)



(trafficserver) branch master updated: Coverity 1497238: Uninitialized scalar variable in DiagsConfigState class (#10837)

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

bcall 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 0fcfb27be0 Coverity 1497238: Uninitialized scalar variable in 
DiagsConfigState class (#10837)
0fcfb27be0 is described below

commit 0fcfb27be095254e55a6993444a74ac3ae7171cd
Author: Bryan Call 
AuthorDate: Mon Nov 27 12:50:43 2023 -0800

Coverity 1497238: Uninitialized scalar variable in DiagsConfigState class 
(#10837)
---
 src/proxy/shared/DiagsConfig.cc | 10 +++---
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/proxy/shared/DiagsConfig.cc b/src/proxy/shared/DiagsConfig.cc
index 2adf3d83a8..da6ca53446 100644
--- a/src/proxy/shared/DiagsConfig.cc
+++ b/src/proxy/shared/DiagsConfig.cc
@@ -143,14 +143,10 @@ DiagsConfig::reconfigure_diags()
 _diags->activate_taglist((_diags->base_debug_tags ? 
_diags->base_debug_tags : dt), DiagsTagType_Debug);
 _diags->activate_taglist((_diags->base_action_tags ? 
_diags->base_action_tags : at), DiagsTagType_Action);
 
-
-// change the diags config values //
-
-#if !defined(__GNUC__)
+
+// change the diags config values //
+
 _diags->config = c;
-#else
-memcpy(((void *)&_diags->config), ((void *)), sizeof(DiagsConfigState));
-#endif
 Note("updated diags config");
   }
 



(trafficserver) branch master updated (9a9172e6a7 -> 417b4cdf76)

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

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


from 9a9172e6a7 Coverity 1518587: Buffer not null terminated in 
healthchecks plugin (#10842)
 add 417b4cdf76 Coverity 1521594: Uninitialized pointer read for 
InterceptIO::vc (#10838)

No new revisions were added by this update.

Summary of changes:
 example/plugins/c-api/intercept/intercept.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



(trafficserver) branch master updated: Coverity 1518587: Buffer not null terminated in healthchecks plugin (#10842)

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

bcall 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 9a9172e6a7 Coverity 1518587: Buffer not null terminated in 
healthchecks plugin (#10842)
9a9172e6a7 is described below

commit 9a9172e6a7b73d5ea6640db0c105ffda1b4a44e3
Author: Bryan Call 
AuthorDate: Mon Nov 27 12:49:51 2023 -0800

Coverity 1518587: Buffer not null terminated in healthchecks plugin (#10842)
---
 plugins/healthchecks/healthchecks.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/healthchecks/healthchecks.cc 
b/plugins/healthchecks/healthchecks.cc
index e7f0764056..b64cb250ca 100644
--- a/plugins/healthchecks/healthchecks.cc
+++ b/plugins/healthchecks/healthchecks.cc
@@ -139,7 +139,7 @@ setup_watchers(int fd)
   while (conf) {
 conf->wd = inotify_add_watch(fd, conf->fname, IN_DELETE_SELF | 
IN_CLOSE_WRITE | IN_ATTRIB);
 Dbg(dbg_ctl, "Setting up a watcher for %s", conf->fname);
-strncpy(fname, conf->fname, MAX_PATH_LEN);
+TSstrlcpy(fname, conf->fname, MAX_PATH_LEN);
 
 char *dname = dirname(fname);
 /* Make sure to only watch each directory once */



(trafficserver) branch cid_1497421 created (now 14b56cf305)

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

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


  at 14b56cf305 Coverity 1497421: Uninitialized scalar variable

This branch includes the following new commits:

 new 14b56cf305 Coverity 1497421: Uninitialized scalar variable

The 1 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.




(trafficserver) 01/01: Coverity 1497421: Uninitialized scalar variable

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

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

commit 14b56cf30541349f46cc44fea5dc9e05bee11961
Author: Bryan Call 
AuthorDate: Wed Nov 22 09:37:52 2023 -0800

Coverity 1497421: Uninitialized scalar variable
---
 plugins/esi/common/gzip.cc | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/plugins/esi/common/gzip.cc b/plugins/esi/common/gzip.cc
index 57ec5d9652..1d7c3a26cf 100644
--- a/plugins/esi/common/gzip.cc
+++ b/plugins/esi/common/gzip.cc
@@ -79,9 +79,12 @@ EsiLib::gzip(const ByteBlockList , std::string )
 {
   cdata.assign(GZIP_HEADER_SIZE, 0); // reserving space for the header
   z_stream zstrm;
-  zstrm.zalloc = Z_NULL;
-  zstrm.zfree  = Z_NULL;
-  zstrm.opaque = Z_NULL;
+  zstrm.zalloc= Z_NULL;
+  zstrm.zfree = Z_NULL;
+  zstrm.opaque= Z_NULL;
+  zstrm.total_in  = 0;
+  zstrm.total_out = 0;
+
   if (deflateInit2(, COMPRESSION_LEVEL, Z_DEFLATED, -MAX_WBITS, 
ZLIB_MEM_LEVEL, Z_DEFAULT_STRATEGY) != Z_OK) {
 TSError("[%s] deflateInit2 failed!", __FUNCTION__);
 return false;
@@ -104,10 +107,7 @@ EsiLib::gzip(const ByteBlockList , std::string 
)
   total_data_len += block.data_len;
 }
   }
-  if (!in_data_size) {
-zstrm.avail_in  = 0; // required for the "finish" loop as no data has been 
given so far
-zstrm.total_out = 0; // required for the "finish" loop
-  }
+
   if (deflate_result == Z_OK) {
 deflate_result = runDeflateLoop(zstrm, Z_FINISH, cdata);
   }



(trafficserver) branch cid_1497421 deleted (was 14b56cf305)

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

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


 was 14b56cf305 Coverity 1497421: Uninitialized scalar variable

This change permanently discards the following revisions:

 discard 14b56cf305 Coverity 1497421: Uninitialized scalar variable



(trafficserver) branch master updated: Coverity 1523685: Use of 32-bit time_t in test_Hdrs.cc (#10788)

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

bcall 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 bda9cc436a Coverity 1523685: Use of 32-bit time_t in test_Hdrs.cc 
(#10788)
bda9cc436a is described below

commit bda9cc436a14628b8f0cbf38e13418f729c7eb21
Author: Bryan Call 
AuthorDate: Fri Nov 17 06:42:39 2023 -0800

Coverity 1523685: Use of 32-bit time_t in test_Hdrs.cc (#10788)
---
 src/proxy/hdrs/unit_tests/test_Hdrs.cc | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/proxy/hdrs/unit_tests/test_Hdrs.cc 
b/src/proxy/hdrs/unit_tests/test_Hdrs.cc
index f36c4dac07..dadcfbf1d3 100644
--- a/src/proxy/hdrs/unit_tests/test_Hdrs.cc
+++ b/src/proxy/hdrs/unit_tests/test_Hdrs.cc
@@ -679,13 +679,13 @@ TEST_CASE("HdrTest", "[proxy][hdrtest]")
 
 // (2) test a few times per day from 1/1/1970 to past 2010
 
-for (t = 0; t < 40 * 366 * (24 * 60 * 60); t += 
static_cast(ts::Random::drandom() * (24 * 60 * 60))) {
+for (t = 0; t < 40 * 366 * (24 * 60 * 60); t += 
static_cast(ts::Random::drandom() * (24 * 60 * 60))) {
   cftime_replacement(buffer, sizeof(buffer), "%a, %d %b %Y %T %Z", );
   t2 = mime_parse_date(buffer, buffer + static_cast(strlen(buffer)));
   if (t2 != t) {
 std::printf("FAILED: parsed time_t doesn't match original time_t\n");
-std::printf("  input time_t:  %d (%s)\n", static_cast(t), buffer);
-std::printf("  parsed time_t: %d\n", static_cast(t2));
+std::printf("  input time_t:  %" PRIdMAX " (%s)\n", t, buffer);
+std::printf("  parsed time_t: %" PRIdMAX "\n", t2);
 CHECK(false);
   }
   mime_format_date(buffer2, t);
@@ -698,8 +698,8 @@ TEST_CASE("HdrTest", "[proxy][hdrtest]")
   t3 = mime_parse_date(buffer2, buffer2 + 
static_cast(strlen(buffer2)));
   if (t != t3) {
 std::printf("FAILED: parsed time_t doesn't match original time_t\n");
-std::printf("  input time_t:  %d (%s)\n", static_cast(t), 
buffer2);
-std::printf("  parsed time_t: %d\n", static_cast(t3));
+std::printf("  input time_t:  %" PRIdMAX " (%s)\n", t, buffer2);
+std::printf("  parsed time_t: %" PRIdMAX "\n", t3);
 CHECK(false);
   }
 }



(trafficserver) branch master updated: Fix compiler warning on m1 macs printing time_t (#10804)

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

bcall 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 d15152ea12 Fix compiler warning on m1 macs printing time_t (#10804)
d15152ea12 is described below

commit d15152ea12364fab4dd67e8923d9373584494587
Author: Bryan Call 
AuthorDate: Thu Nov 16 16:33:19 2023 -0800

Fix compiler warning on m1 macs printing time_t (#10804)
---
 src/iocore/hostdb/P_RefCountCache.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/iocore/hostdb/P_RefCountCache.h 
b/src/iocore/hostdb/P_RefCountCache.h
index 079f316359..cad9ad6cf9 100644
--- a/src/iocore/hostdb/P_RefCountCache.h
+++ b/src/iocore/hostdb/P_RefCountCache.h
@@ -236,7 +236,7 @@ RefCountCachePartition::put(uint64_t key, C *item, int 
size, time_t expire_ti
 
   // add expiry_entry to expiry queue, if the expire time is positive 
(otherwise it means don't expire)
   if (expire_time >= 0) {
-Dbg(dbg_ctl, "partition %d adding entry with expire_time=%" PRId64, 
this->part_num, expire_time);
+Dbg(dbg_ctl, "partition %d adding entry with expire_time=%" PRIdMAX, 
this->part_num, expire_time);
 PriorityQueueEntry *expiry_entry = 
expiryQueueEntry.alloc();
 new ((void *)expiry_entry) PriorityQueueEntry(val);
 expiry_queue.push(expiry_entry);



(trafficserver) branch master updated: Coverity 1497253: Use of 32-bit time_t in RefCountCachePartition (#10791)

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

bcall 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 960af020df Coverity 1497253: Use of 32-bit time_t in 
RefCountCachePartition (#10791)
960af020df is described below

commit 960af020dfcf9b3dae157ae55ae8385a4f3a38d7
Author: Bryan Call 
AuthorDate: Thu Nov 16 09:49:51 2023 -0800

Coverity 1497253: Use of 32-bit time_t in RefCountCachePartition (#10791)

Change RefCountCachePartition methods to accept time_t instead of an int
---
 src/iocore/hostdb/P_RefCountCache.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/iocore/hostdb/P_RefCountCache.h 
b/src/iocore/hostdb/P_RefCountCache.h
index d72e939ebb..079f316359 100644
--- a/src/iocore/hostdb/P_RefCountCache.h
+++ b/src/iocore/hostdb/P_RefCountCache.h
@@ -86,7 +86,7 @@ public:
   // Need a no-argument constructor to use the classAllocator
   RefCountCacheHashEntry() : item(Ptr()), meta(0, 0) {}
   void
-  set(RefCountObj *i, uint64_t key, unsigned int size, int expire_time)
+  set(RefCountObj *i, uint64_t key, unsigned int size, time_t expire_time)
   {
 this->item = make_ptr(i);
 this->meta = RefCountCacheItemMeta(key, size, expire_time);
@@ -165,7 +165,7 @@ public:
 
   RefCountCachePartition(unsigned int part_num, uint64_t max_size, unsigned 
int max_items, RefCountCacheBlock *rsb = nullptr);
   Ptr get(uint64_t key);
-  void put(uint64_t key, C *item, int size = 0, int expire_time = 0);
+  void put(uint64_t key, C *item, int size = 0, time_t expire_time = 0);
   void erase(uint64_t key, ink_time_t expiry_time = -1);
 
   void clear();
@@ -216,7 +216,7 @@ RefCountCachePartition::get(uint64_t key)
 
 template 
 void
-RefCountCachePartition::put(uint64_t key, C *item, int size, int 
expire_time)
+RefCountCachePartition::put(uint64_t key, C *item, int size, time_t 
expire_time)
 {
   Metrics::Counter::increment(this->rsb->refcountcache_total_inserts);
   size += sizeof(C);
@@ -236,7 +236,7 @@ RefCountCachePartition::put(uint64_t key, C *item, int 
size, int expire_time)
 
   // add expiry_entry to expiry queue, if the expire time is positive 
(otherwise it means don't expire)
   if (expire_time >= 0) {
-Dbg(dbg_ctl, "partition %d adding entry with expire_time=%d\n", 
this->part_num, expire_time);
+Dbg(dbg_ctl, "partition %d adding entry with expire_time=%" PRId64, 
this->part_num, expire_time);
 PriorityQueueEntry *expiry_entry = 
expiryQueueEntry.alloc();
 new ((void *)expiry_entry) PriorityQueueEntry(val);
 expiry_queue.push(expiry_entry);



(trafficserver) branch master updated: Coverity 1497291: Use of 32-bit time_t (#10789)

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

bcall 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 187dcba2b3 Coverity 1497291: Use of 32-bit time_t (#10789)
187dcba2b3 is described below

commit 187dcba2b3ed24bf99361bf9133326c39c73a8a9
Author: Bryan Call 
AuthorDate: Thu Nov 16 09:49:27 2023 -0800

Coverity 1497291: Use of 32-bit time_t (#10789)
---
 include/proxy/hdrs/MIME.h |  4 ++--
 src/proxy/hdrs/MIME.cc| 16 
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/proxy/hdrs/MIME.h b/include/proxy/hdrs/MIME.h
index 674905f60e..bf0e0ef80d 100644
--- a/include/proxy/hdrs/MIME.h
+++ b/include/proxy/hdrs/MIME.h
@@ -919,8 +919,8 @@ int mime_format_uint(char *buf, uint32_t val, size_t 
buf_len);
 int mime_format_int64(char *buf, int64_t val, size_t buf_len);
 int mime_format_uint64(char *buf, uint64_t val, size_t buf_len);
 
-void mime_days_since_epoch_to_mdy_slowcase(unsigned int days_since_jan_1_1970, 
int *m_return, int *d_return, int *y_return);
-void mime_days_since_epoch_to_mdy(unsigned int days_since_jan_1_1970, int 
*m_return, int *d_return, int *y_return);
+void mime_days_since_epoch_to_mdy_slowcase(time_t days_since_jan_1_1970, int 
*m_return, int *d_return, int *y_return);
+void mime_days_since_epoch_to_mdy(time_t days_since_jan_1_1970, int *m_return, 
int *d_return, int *y_return);
 int mime_format_date(char *buffer, time_t value);
 
 int32_t mime_parse_int(const char *buf, const char *end = nullptr);
diff --git a/src/proxy/hdrs/MIME.cc b/src/proxy/hdrs/MIME.cc
index 7778955d67..86101d314c 100644
--- a/src/proxy/hdrs/MIME.cc
+++ b/src/proxy/hdrs/MIME.cc
@@ -69,8 +69,8 @@ struct MDY {
 };
 
 static MDY *_days_to_mdy_fast_lookup_table = nullptr;
-static unsigned int _days_to_mdy_fast_lookup_table_first_day;
-static unsigned int _days_to_mdy_fast_lookup_table_last_day;
+static time_t _days_to_mdy_fast_lookup_table_first_day;
+static time_t _days_to_mdy_fast_lookup_table_last_day;
 
 /***
  * *
@@ -985,11 +985,11 @@ mime_init_date_format_table()
   
 
   time_t now_secs;
-  int i, now_days, first_days, last_days, num_days;
+  time_t i, now_days, first_days, last_days, num_days;
   int m = 0, d = 0, y = 0;
 
   time(_secs);
-  now_days   = static_cast(now_secs / (60 * 60 * 24));
+  now_days   = static_cast(now_secs / (60 * 60 * 24));
   first_days = now_days - 366;
   last_days  = now_days + 366;
   num_days   = last_days - first_days + 1;
@@ -2924,7 +2924,7 @@ mime_format_int64(char *buf, int64_t val, size_t buf_len)
 }
 
 void
-mime_days_since_epoch_to_mdy_slowcase(unsigned int days_since_jan_1_1970, int 
*m_return, int *d_return, int *y_return)
+mime_days_since_epoch_to_mdy_slowcase(time_t days_since_jan_1_1970, int 
*m_return, int *d_return, int *y_return)
 {
   static const int DAYS_OFFSET = 25508;
 
@@ -2944,7 +2944,7 @@ mime_days_since_epoch_to_mdy_slowcase(unsigned int 
days_since_jan_1_1970, int *m
 
   static const int days[12] = {305, 336, -1, 30, 60, 91, 121, 152, 183, 213, 
244, 274};
 
-  int mday, year, month, d, dp;
+  time_t mday, year, month, d, dp;
 
   mday = days_since_jan_1_1970;
 
@@ -2978,7 +2978,7 @@ mime_days_since_epoch_to_mdy_slowcase(unsigned int 
days_since_jan_1_1970, int *m
 }
 
 void
-mime_days_since_epoch_to_mdy(unsigned int days_since_jan_1_1970, int 
*m_return, int *d_return, int *y_return)
+mime_days_since_epoch_to_mdy(time_t days_since_jan_1_1970, int *m_return, int 
*d_return, int *y_return)
 {
   ink_assert(_days_to_mdy_fast_lookup_table != nullptr);
 
@@ -2994,7 +2994,7 @@ mime_days_since_epoch_to_mdy(unsigned int 
days_since_jan_1_1970, int *m_return,
 // of dates that are +/- one year from today. //
 
 
-int i = days_since_jan_1_1970 - 
_days_to_mdy_fast_lookup_table_first_day;
+time_t i  = days_since_jan_1_1970 - 
_days_to_mdy_fast_lookup_table_first_day;
 *m_return = _days_to_mdy_fast_lookup_table[i].m;
 *d_return = _days_to_mdy_fast_lookup_table[i].d;
 *y_return = _days_to_mdy_fast_lookup_table[i].y;



(trafficserver) branch 9.2.x updated: applying additional accepts PR to 9.2.x (#10590)

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new e18d359ee7 applying additional accepts PR to 9.2.x (#10590)
e18d359ee7 is described below

commit e18d359ee7d891eb654bb7f5724166ffa6d4c7de
Author: Nathan Wang 
AuthorDate: Mon Nov 6 13:09:56 2023 -0800

applying additional accepts PR to 9.2.x (#10590)

Co-authored-by: Nathan Wang 
---
 doc/admin-guide/files/records.config.en.rst   | 12 +++
 doc/appendices/command-line/traffic_server.en.rst |  2 --
 iocore/net/P_UnixNet.h|  2 ++
 iocore/net/UnixNet.cc | 13 
 iocore/net/UnixNetAccept.cc   | 39 ++-
 mgmt/RecordsConfig.cc |  2 ++
 proxy/Main.h  |  2 --
 src/traffic_server/traffic_server.cc  |  1 -
 8 files changed, 60 insertions(+), 13 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index e6865b8c80..65f454ac00 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -430,6 +430,18 @@ Thread Variables
 Network
 ===
 
+.. ts:cv:: CONFIG proxy.config.net.additional_accepts INT -1
+   :reloadable:
+
+   This config addresses an issue that can sometimes happen if threads are 
caught in
+   a net accept while loop, become busy exclusviely accepting connections, and 
are prevented
+   from doing other work. This can cause an increase in latency and average 
event
+   loop time. When set to 0, a thread accepts only 1 connection per event loop.
+   When set to any other positive integer x, a thread will accept up to x+1 
connections
+   per event loop. When set to -1 (default), a thread will accept connections 
as long
+   as there are connections waiting in its listening queue.is equivalent to 
"accept all",
+   and setting to 0 is equivalent to "accept one".
+
 .. ts:cv:: CONFIG proxy.config.net.connections_throttle INT 3
 
The total number of client and origin server connections that the server
diff --git a/doc/appendices/command-line/traffic_server.en.rst 
b/doc/appendices/command-line/traffic_server.en.rst
index edcd51d57c..7818e78c46 100644
--- a/doc/appendices/command-line/traffic_server.en.rst
+++ b/doc/appendices/command-line/traffic_server.en.rst
@@ -32,8 +32,6 @@ Options
 
 .. option:: -a, --accepts_thread
 
-.. option:: -b, --accept_till_done
-
 .. option:: -B TAGS, --action_tags TAGS
 
 .. option:: --bind_stdout FILE
diff --git a/iocore/net/P_UnixNet.h b/iocore/net/P_UnixNet.h
index fa58aa4ffc..d5b68bf787 100644
--- a/iocore/net/P_UnixNet.h
+++ b/iocore/net/P_UnixNet.h
@@ -281,6 +281,7 @@ public:
 uint32_t transaction_no_activity_timeout_in = 0;
 uint32_t keep_alive_no_activity_timeout_in  = 0;
 uint32_t default_inactivity_timeout = 0;
+uint32_t additional_accepts = 0;
 
 /** Return the address of the first value in this struct.
 
@@ -327,6 +328,7 @@ public:
   void remove_from_keep_alive_queue(NetEvent *ne);
   bool add_to_active_queue(NetEvent *ne);
   void remove_from_active_queue(NetEvent *ne);
+  int get_additional_accepts();
 
   /// Per process initialization logic.
   static void init_for_process();
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index c0f1052dbb..e1dca3ce39 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -294,6 +294,9 @@ NetHandler::update_nethandler_config(const char *str, 
RecDataT, RecData data, vo
   } else if (name == "proxy.config.net.default_inactivity_timeout"sv) {
 updated_member = ::global_config.default_inactivity_timeout;
 Debug("net_queue", "proxy.config.net.default_inactivity_timeout updated to 
%" PRId64, data.rec_int);
+  } else if (name == "proxy.config.net.additional_accepts"sv) {
+updated_member = ::global_config.additional_accepts;
+Debug("net_queue", "proxy.config.net.additional_accepts updated to %" 
PRId64, data.rec_int);
   }
 
   if (updated_member) {
@@ -329,6 +332,7 @@ NetHandler::init_for_process()
   REC_ReadConfigInt32(global_config.transaction_no_activity_timeout_in, 
"proxy.config.net.transaction_no_activity_timeout_in");
   REC_ReadConfigInt32(global_config.keep_alive_no_activity_timeout_in, 
"proxy.config.net.keep_alive_no_activity_timeout_in");
   REC_ReadConfigInt32(global_config.default_inactivity_timeout, 
"proxy.config.net.default_inactivity_timeout");
+  REC_ReadConfigInt32(global_config.additional_accepts, 
"proxy.config.net.additional_accepts");
 
   RecRegisterConfigUpdateCb("proxy.config.net.max_connections_in", 
update_nethandler_config

(trafficserver) branch master updated: cmake: adding a release preset (#10717)

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

bcall 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 31ae41d480 cmake: adding a release preset (#10717)
31ae41d480 is described below

commit 31ae41d4802d918b54fdf1914eb72d3df83205f7
Author: Bryan Call 
AuthorDate: Fri Nov 3 08:36:37 2023 -0700

cmake: adding a release preset (#10717)

Used for benchmarking and users can use it
---
 CMakePresets.json | 13 +
 1 file changed, 13 insertions(+)

diff --git a/CMakePresets.json b/CMakePresets.json
index 2474514675..9bf85a738b 100644
--- a/CMakePresets.json
+++ b/CMakePresets.json
@@ -36,6 +36,19 @@
 "CMAKE_INSTALL_CACHEDIR": "var/trafficserver"
   }
 },
+{
+  "name": "release",
+  "displayName": "Release build",
+  "description": "Release build with Ninja generator",
+  "generator": "Ninja",
+  "binaryDir": "${sourceDir}/build-release",
+  "cacheVariables": {
+"CMAKE_BUILD_TYPE": "Release",
+"CMAKE_COMPILE_WARNING_AS_ERROR": "OFF",
+"CMAKE_INSTALL_PREFIX": "/opt/ats",
+"BUILD_EXPERIMENTAL_PLUGINS": "ON"
+  }
+},
 {
   "name": "autest",
   "inherits": ["default"],



(trafficserver) branch master updated (7308e2fb2f -> 5678f98164)

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

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


from 7308e2fb2f List all includes explicitly in dns headers (#10655)
 add 5678f98164 cmake: install traffic_logstats (#10690)

No new revisions were added by this update.

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



[trafficserver] branch 8.1.x updated: Fix typo in block_errors documentation (#10591) (#10618)

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

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new 3b638fff65 Fix typo in block_errors documentation (#10591) (#10618)
3b638fff65 is described below

commit 3b638fff65d3a384b3ecd5f7728106d8c4f8b99a
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 17 00:59:48 2023 +0900

Fix typo in block_errors documentation (#10591) (#10618)

(cherry picked from commit 641704b5c078edaba5b8082de6262a40bcd2d4fa)

 Conflicts:
doc/admin-guide/plugins/block_errors.en.rst
---
 doc/admin-guide/plugins/block_errors.en.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/admin-guide/plugins/block_errors.en.rst 
b/doc/admin-guide/plugins/block_errors.en.rst
index 36b51c451f..521b44dfeb 100644
--- a/doc/admin-guide/plugins/block_errors.en.rst
+++ b/doc/admin-guide/plugins/block_errors.en.rst
@@ -57,7 +57,7 @@ The plugin can be configured at run time using the 
`traffic_ctl` command.  The f
 
 - ``block_errors.error_limit``: Set the error limit.  Takes a single argument, 
the number of errors allowed before blocking the client.
 - ``block_errors.timeout``: Set the block timeout.  Takes a single argument, 
the number of minutes to block the client.
-- ``block_errors.enable``: Enable or disable the plugin.  Takes a single 
argument, 0 to disable, 1 to enable.
+- ``block_errors.enabled``: Enable or disable the plugin.  Takes a single 
argument, 0 to disable, 1 to enable.
 
 Example Run Time Configuration
 ==
@@ -66,4 +66,4 @@ Example Run Time Configuration
 
 traffic_ctl plugin msg block_errors.timeout 10
 
-traffic_ctl plugin msg block_errors.enable 1
+traffic_ctl plugin msg block_errors.enabled 1



[trafficserver] branch 9.2.x updated: Fix typo in block_errors documentation (#10591)

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new 3c01c31d8a Fix typo in block_errors documentation (#10591)
3c01c31d8a is described below

commit 3c01c31d8aa3e7e9725843125eadf3ca0aaa5a47
Author: Masakazu Kitajo 
AuthorDate: Fri Oct 13 04:36:20 2023 +0900

Fix typo in block_errors documentation (#10591)

(cherry picked from commit 641704b5c078edaba5b8082de6262a40bcd2d4fa)
---
 doc/admin-guide/plugins/block_errors.en.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/admin-guide/plugins/block_errors.en.rst 
b/doc/admin-guide/plugins/block_errors.en.rst
index c08d597726..dcffaa835a 100644
--- a/doc/admin-guide/plugins/block_errors.en.rst
+++ b/doc/admin-guide/plugins/block_errors.en.rst
@@ -59,7 +59,7 @@ The plugin can be configured at run time using the 
`traffic_ctl` command.  The f
 - ``block_errors.error_limit``: Set the error limit.  Takes a single argument, 
the number of errors allowed before blocking the client.
 - ``block_errors.timeout``: Set the block timeout.  Takes a single argument, 
the number of minutes to block the client.
 - ``block_errors.shutdown``: Set the shutdown mode.  Takes a single argument, 
0 to downgrade to HTTP/1.1, 1 to close the connection.
-- ``block_errors.enable``: Enable or disable the plugin.  Takes a single 
argument, 0 to disable, 1 to enable.
+- ``block_errors.enabled``: Enable or disable the plugin.  Takes a single 
argument, 0 to disable, 1 to enable.
 
 Example Run Time Configuration
 ==
@@ -70,4 +70,4 @@ Example Run Time Configuration
 
 traffic_ctl plugin msg block_errors.shutdown 1
 
-traffic_ctl plugin msg block_errors.enable 1
+traffic_ctl plugin msg block_errors.enabled 1



[trafficserver] branch master updated: Fixed h2spec 6.4.3 test (#10584)

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

bcall 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 bb951e905e Fixed h2spec 6.4.3 test (#10584)
bb951e905e is described below

commit bb951e905e7844f304e6635a84acbd0734aed251
Author: Bryan Call 
AuthorDate: Wed Oct 11 07:28:11 2023 -0700

Fixed h2spec 6.4.3 test (#10584)

Should respond with FRAME_SIZE_ERROR when receiving reset frame of
incorrect size before looking to see if the stream exists.
---
 proxy/http2/Http2ConnectionState.cc | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/proxy/http2/Http2ConnectionState.cc 
b/proxy/http2/Http2ConnectionState.cc
index 9cff228851..398a520841 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -606,6 +606,13 @@ Http2ConnectionState::rcv_rst_stream_frame(const 
Http2Frame )
   "reset access stream with invalid id");
   }
 
+  // A RST_STREAM frame with a length other than 4 octets MUST be treated
+  // as a connection error (Section 5.4.1) of type FRAME_SIZE_ERROR.
+  if (frame.header().length != HTTP2_RST_STREAM_LEN) {
+return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, 
Http2ErrorCode::HTTP2_ERROR_FRAME_SIZE_ERROR,
+  "reset frame wrong length");
+  }
+
   Http2Stream *stream = this->find_stream(stream_id);
   if (stream == nullptr) {
 if (this->is_valid_streamid(stream_id)) {
@@ -616,13 +623,6 @@ Http2ConnectionState::rcv_rst_stream_frame(const 
Http2Frame )
 }
   }
 
-  // A RST_STREAM frame with a length other than 4 octets MUST be treated
-  // as a connection error (Section 5.4.1) of type FRAME_SIZE_ERROR.
-  if (frame.header().length != HTTP2_RST_STREAM_LEN) {
-return Http2Error(Http2ErrorClass::HTTP2_ERROR_CLASS_CONNECTION, 
Http2ErrorCode::HTTP2_ERROR_FRAME_SIZE_ERROR,
-  "reset frame wrong length");
-  }
-
   // Update RST_STREAM frame count per minute
   this->increment_received_rst_stream_frame_count();
   // Close this connection if its RST_STREAM frame count exceeds a limit



[trafficserver] annotated tag 9.2.3 updated (b4e3c73354 -> 8c3f081ad1)

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

bcall pushed a change to annotated tag 9.2.3
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


*** WARNING: tag 9.2.3 was modified! ***

from b4e3c73354 (commit)
  to 8c3f081ad1 (tag)
 tagging b4e3c73354d2a104ed6f00379eeb9f121a85e8bb (commit)
 replaces 9.2.2
  by Bryan Call
  on Tue Oct 10 10:39:47 2023 -0700

- Log -
Release 9.2.3
-BEGIN PGP SIGNATURE-

iQIzBAABCAAdFiEEsoAf+ddX58RtiQxsTRVBELhFCOwFAmUljGMACgkQTRVBELhF
COw00w/7Bg8aHaTpiH9m2p5BIBS/Y4JbQ7UPRrDTvGwKLlC2s/XtWG73egK5Zvrs
pi8KwpSUahd9KfHLYuDws10GH85yl7keaGqzSbyvAlYSPTbbFThFwVlAcIOWWUdS
JEYb6aHYe+exzxSMx55Ynsbo4fQNm/OgBtuAm7LHZ99+apIPJMdlwUyZDrYfZTnG
IlPD57b5Fys3X/jTn2souWjdqBYEo9zVV3UcQS8QRu5DFe7XD6PWob3dValNhL9R
p9rynZXKFhrGB9AChv7jaK8kqehqymkbmcTbnLRWp3QQHW2jNCMotT2lMbUfslIp
pvOJfUXgmbK2tziD1ByFj+85dYaJmwHEGF/orH+ljiUZNdh7Kt43cUz2WmfjCdii
EcO2KR2zbdoLOkkpKkl2QAT7n42IY8ehF3iMkFVkhFm0iClXo9CoIK4soOCXFh4k
WCIzfM6b4+hXZWoLs8bKW4gQnCMlI2hXXY0l27FXrrvKFTaV5+43o3XOy7EQ5mN7
+cHTcafa89Ak6s+h5U1leqUE7PMT60Y54kgJPAWQ8SuomxgugeMB6JsT7wwxamb0
oLKSNRM9FKtTAZfO6dlCXonIlRSPloEWX7/FxrctIEzTzL0JuiKNIw8/WnbG2IZx
VNL52dEku2M0Cru5oNHp4dfg9tJ6PYcM1MADBvfMhC+UtfzeTGs=
=rRdi
-END PGP SIGNATURE-
---


No new revisions were added by this update.

Summary of changes:



[trafficserver-site] branch asf-site updated: Updated index with 9.2.3 release

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

bcall pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/trafficserver-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
 new de5e5d3  Updated index with 9.2.3 release
de5e5d3 is described below

commit de5e5d3322c526469228d7a51802a40575bc6e62
Author: Bryan Call 
AuthorDate: Mon Oct 9 16:27:16 2023 -0700

Updated index with 9.2.3 release
---
 source/markdown/downloads.mdtext | 24 
 source/markdown/index.html   |  5 ++---
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/source/markdown/downloads.mdtext b/source/markdown/downloads.mdtext
index 8e0960d..8d1bda8 100644
--- a/source/markdown/downloads.mdtext
+++ b/source/markdown/downloads.mdtext
@@ -19,9 +19,9 @@ RSS:   /rss/releases.rss
 
 
 
-The latest stable release of Apache Traffic Server is v9.2.0, released on 
2023-01-23.
-In addition, we continue to support the v8.1.x LTS release train, currently 
v8.1.6,
-which was released on 2022-12-15. We follow the [Semantic 
Versioning](http://semver.org)
+The latest stable release of Apache Traffic Server is v9.2.3, released on 
2023-10-9.
+In addition, we continue to support the v8.1.x LTS release train, currently 
v8.1.8,
+which was released on 2023-08-03. We follow the [Semantic 
Versioning](http://semver.org)
 scheme. The goal is to release patch releases frequently, and minor releases 
as needed.
 Within the major versions, all such patch and minor releases are all 
compatible.
 
@@ -32,18 +32,18 @@ will be needed.  You can also
 [browse through all releases](https://archive.apache.org/dist/trafficserver/)
 and hash signatures.
 
-# Current v9.x Release -- 9.2.2 # {#9.2.2}
+# Current v9.x Release -- 9.2.3 # {#9.2.3}
 
- Apache Traffic Server v9.2.2 was released on August 3rd, 2023.
- 
[[`PGP`](https://www.apache.org/dist/trafficserver/trafficserver-9.2.2.tar.bz2.asc)]
- 
[[`SHA512`](https://www.apache.org/dist/trafficserver/trafficserver-9.2.2.tar.bz2.sha512)]
+ Apache Traffic Server v9.2.3 was released on August 3rd, 2023.
+ 
[[`PGP`](https://www.apache.org/dist/trafficserver/trafficserver-9.2.3.tar.bz2.asc)]
+ 
[[`SHA512`](https://www.apache.org/dist/trafficserver/trafficserver-9.2.3.tar.bz2.sha512)]
 
- https://www.apache.org/dyn/closer.cgi/trafficserver/trafficserver-9.2.2.tar.bz2;
- class="download_ts">Traffic Server 9.2.2
+ https://www.apache.org/dyn/closer.cgi/trafficserver/trafficserver-9.2.3.tar.bz2;
+ class="download_ts">Traffic Server 9.2.3
 
-v9.2.2 is our latest stable release. Additional details for this release are 
in the
-[CHANGELOG](https://raw.githubusercontent.com/apache/trafficserver/9.2.x/CHANGELOG-9.2.2)
-and the the related [Github Issues and 
PRs](https://github.com/apache/trafficserver/pulls?q=is:closed+is:pr+milestone:9.2.2).
+v9.2.3 is our latest stable release. Additional details for this release are 
in the
+[CHANGELOG](https://raw.githubusercontent.com/apache/trafficserver/9.2.x/CHANGELOG-9.2.3)
+and the the related [Github Issues and 
PRs](https://github.com/apache/trafficserver/pulls?q=is:closed+is:pr+milestone:9.2.3).
 
 For details on the v9.x release, please see
 [9.2.x 
News](https://docs.trafficserver.apache.org/en/9.2.x/release-notes/whats-new.en.html)
diff --git a/source/markdown/index.html b/source/markdown/index.html
index a68c7c4..9b37eb2 100644
--- a/source/markdown/index.html
+++ b/source/markdown/index.html
@@ -287,7 +287,8 @@
 
   
 
-   August 3, 2023: We are releasing both v9.2.2 and 
v8.1.8. We recommend everyone to upgrade to one of these versions of ATS.
+  October 9, 2023:We are releasing v9.2.3. We recommend 
everyone to upgrade to one of these versions of ATS.
+  August 3, 2023: We are releasing both v9.2.2 and v8.1.8 
which include security fixes. We recommend everyone to upgrade to one of these 
versions of ATS.
June 12, 2023: We are releasing both v9.2.1 and 
v8.1.7 which include security fixes. We recommend everyone to upgrade to one of 
these versions of ATS.
   January 23, 2023:The first version of the stable v9.2.x 
ATS branch is now available for download. This version, \
 v9.2.0, is a feature and bug fix release over previous v9.1.x releases.
@@ -301,8 +302,6 @@ v9.2.0, is a feature and bug fix release over previous 
v9.1.x releases.
   August 17, 2021:We are releasing both v9.1.0, which is 
our next current release.
   June 24, 2021:We are releasing both v9.0.2 and v8.1.2 
which include security fixes. We recommend everyone to upgrade to one of these 
versions of ATS.
   April 16, 2021:We are pleased to announce v9.0.1, which 
is bug-fix release on the v9.x LTS train.
-  December 14, 2020:We are pleased to announce the first 
release of ATS v9.0.0, which is our new LTS release cycle. It's available for 
immediate downloads from 

svn commit: r64439 - in /release/trafficserver: trafficserver-9.2.3.tar.bz2 trafficserver-9.2.3.tar.bz2.asc trafficserver-9.2.3.tar.bz2.sha512

2023-10-09 Thread bcall
Author: bcall
Date: Mon Oct  9 23:19:16 2023
New Revision: 64439

Log:
Release 9.2.3

Added:
release/trafficserver/trafficserver-9.2.3.tar.bz2   (with props)
release/trafficserver/trafficserver-9.2.3.tar.bz2.asc   (with props)
release/trafficserver/trafficserver-9.2.3.tar.bz2.sha512

Added: release/trafficserver/trafficserver-9.2.3.tar.bz2
==
Binary file - no diff available.

Propchange: release/trafficserver/trafficserver-9.2.3.tar.bz2
--
svn:mime-type = application/x-bzip2

Added: release/trafficserver/trafficserver-9.2.3.tar.bz2.asc
==
Binary file - no diff available.

Propchange: release/trafficserver/trafficserver-9.2.3.tar.bz2.asc
--
svn:mime-type = application/pgp-signature

Added: release/trafficserver/trafficserver-9.2.3.tar.bz2.sha512
==
--- release/trafficserver/trafficserver-9.2.3.tar.bz2.sha512 (added)
+++ release/trafficserver/trafficserver-9.2.3.tar.bz2.sha512 Mon Oct  9 
23:19:16 2023
@@ -0,0 +1 @@
+acb511873a051c2cdfddccabf420be79cba01ae241470738658a89bcf636074bf41cda62552e01f41b9549295f817c566a1696aec057509a8c93f3b22ae9e90e
 *trafficserver-9.2.3.tar.bz2




[trafficserver] branch master updated: make sure open() and read() succeeded (#10273)

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

bcall 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 26affdad94 make sure open() and read() succeeded (#10273)
26affdad94 is described below

commit 26affdad9451da19782cdb3ff6ac881a54277410
Author: Fei Deng 
AuthorDate: Mon Oct 9 18:33:33 2023 -0400

make sure open() and read() succeeded (#10273)
---
 plugins/experimental/ssl_session_reuse/src/config.cc   |  3 +--
 plugins/experimental/ssl_session_reuse/src/ssl_init.cc | 11 +++
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/plugins/experimental/ssl_session_reuse/src/config.cc 
b/plugins/experimental/ssl_session_reuse/src/config.cc
index b2a9814c7b..d83c60d783 100644
--- a/plugins/experimental/ssl_session_reuse/src/config.cc
+++ b/plugins/experimental/ssl_session_reuse/src/config.cc
@@ -82,12 +82,11 @@ Config::loadConfig(const std::string )
   }
 }
 
-close(fd);
-
 m_noConfig  = false;
 success = true;
 m_alreadyLoaded = true;
   }
+  close(fd);
 
   return success;
 }
diff --git a/plugins/experimental/ssl_session_reuse/src/ssl_init.cc 
b/plugins/experimental/ssl_session_reuse/src/ssl_init.cc
index 961a017cfb..acfd2ea2a3 100644
--- a/plugins/experimental/ssl_session_reuse/src/ssl_init.cc
+++ b/plugins/experimental/ssl_session_reuse/src/ssl_init.cc
@@ -105,7 +105,7 @@ get_redis_auth_key(char *retKeyBuff, int buffSize)
   if (ssl_param.redis_auth_key_file.length()) {
 int fd = open(ssl_param.redis_auth_key_file.c_str(), O_RDONLY);
 struct stat info;
-if (0 == fstat(fd, )) {
+if (fd >= 0 && 0 == fstat(fd, )) {
   size_t n = info.st_size;
   std::string key_data;
   key_data.resize(n);
@@ -114,10 +114,13 @@ get_redis_auth_key(char *retKeyBuff, int buffSize)
   while (read_len > 1 && key_data[read_len - 1] == '\n') {
 --read_len;
   }
-  memset(retKeyBuff, 0, buffSize);
-  strncpy(retKeyBuff, key_data.c_str(), read_len);
-  retval = key_data.length();
+  if (read_len > 0 && read_len <= buffSize && 
static_cast(read_len) <= key_data.length()) {
+memset(retKeyBuff, 0, buffSize);
+strncpy(retKeyBuff, key_data.c_str(), read_len);
+retval = read_len;
+  }
 }
+close(fd);
   } else {
 TSError("Can not get redis auth key.");
   }



[trafficserver] branch master updated (9e4f4418ef -> b3d0f7182e)

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

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


from 9e4f4418ef fix(http): do reverse dns resolution only for IP addresses 
(#10234)
 add b3d0f7182e replace time_t (#10268)

No new revisions were added by this update.

Summary of changes:
 .../ssl_session_reuse/src/ssl_key_utils.cc | 45 ++
 1 file changed, 30 insertions(+), 15 deletions(-)



[trafficserver] branch master updated (cbb4f35ea9 -> 9e4f4418ef)

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

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


from cbb4f35ea9 Build unit tests only with BUILD_TESTING (#10548)
 add 9e4f4418ef fix(http): do reverse dns resolution only for IP addresses 
(#10234)

No new revisions were added by this update.

Summary of changes:
 proxy/http/HttpTransact.cc | 16 ++--
 proxy/http/HttpTransact.h  |  5 +++--
 2 files changed, 9 insertions(+), 12 deletions(-)



[trafficserver] branch master updated (7f86ef2a73 -> cbb4f35ea9)

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

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


from 7f86ef2a73 Ran clang-tidy over the experimental plugins (#10550)
 add cbb4f35ea9 Build unit tests only with BUILD_TESTING (#10548)

No new revisions were added by this update.

Summary of changes:
 CMakeLists.txt|  7 ++-
 mgmt/rpc/CMakeLists.txt   | 46 +
 plugins/esi/CMakeLists.txt|  4 +-
 plugins/header_rewrite/CMakeLists.txt |  2 +-
 plugins/prefetch/CMakeLists.txt   |  4 +-
 plugins/s3_auth/CMakeLists.txt|  4 +-
 proxy/hdrs/CMakeLists.txt | 20 
 proxy/http/CMakeLists.txt | 23 +
 proxy/http2/CMakeLists.txt| 88 
 proxy/logging/CMakeLists.txt  | 26 +-
 src/api/CMakeLists.txt| 14 +++---
 src/records/CMakeLists.txt| 22 
 src/traffic_logstats/CMakeLists.txt   | 22 
 src/traffic_via/CMakeLists.txt| 12 +++--
 src/tscore/CMakeLists.txt | 94 ++-
 src/tscpp/util/CMakeLists.txt | 24 +
 16 files changed, 219 insertions(+), 193 deletions(-)



[trafficserver] branch master updated: Ran clang-tidy over the experimental plugins (#10550)

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

bcall 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 7f86ef2a73 Ran clang-tidy over the experimental plugins (#10550)
7f86ef2a73 is described below

commit 7f86ef2a734775d4dc76c64d4b6048d0b1fea348
Author: Bryan Call 
AuthorDate: Mon Oct 9 15:01:12 2023 -0700

Ran clang-tidy over the experimental plugins (#10550)
---
 .../cache_range_requests/cache_range_requests.cc   |   2 +-
 .../cache_key_genid/cache_key_genid.cc |   8 +-
 plugins/experimental/cookie_remap/hash.cc  |   6 +-
 plugins/experimental/fastcgi/src/Profiler.h|   6 +-
 plugins/experimental/fastcgi/src/ats_fastcgi.cc|   7 +-
 .../experimental/fastcgi/src/ats_fcgi_client.cc|  55 
 plugins/experimental/fastcgi/src/ats_fcgi_client.h |   6 +-
 plugins/experimental/fastcgi/src/fcgi_config.cc|   2 +-
 plugins/experimental/fastcgi/src/fcgi_config.h |   8 +-
 plugins/experimental/fastcgi/src/fcgi_protocol.h   |  14 +--
 plugins/experimental/fastcgi/src/server.cc |  10 +-
 .../experimental/fastcgi/src/server_connection.cc  |   5 +-
 plugins/experimental/fq_pacing/fq_pacing.cc|  30 ++---
 plugins/experimental/http_stats/http_stats.cc  |   8 +-
 plugins/experimental/maxmind_acl/mmdb.h|   6 +-
 plugins/experimental/memcache/protocol_binary.h| 138 ++---
 plugins/experimental/memcache/tsmemcache.cc|   2 +-
 plugins/experimental/memcache/tsmemcache.h |  10 +-
 plugins/experimental/money_trace/money_trace.cc|   2 +-
 plugins/experimental/mp4/mp4_meta.h|  87 ++---
 plugins/experimental/otel_tracer/otel_tracer.cc|   8 +-
 plugins/experimental/otel_tracer/tracer_common.h   |   4 +-
 plugins/experimental/rate_limit/iprep_simu.cc  |  19 +--
 plugins/experimental/rate_limit/limiter.h  |   2 +-
 plugins/experimental/rate_limit/txn_limiter.h  |   2 +-
 .../experimental/ssl_session_reuse/src/Config.h|   6 +-
 .../experimental/ssl_session_reuse/src/message.h   |  10 +-
 .../ssl_session_reuse/src/redis_endpoint.cc|   2 +-
 .../ssl_session_reuse/src/redis_endpoint.h |   8 +-
 plugins/experimental/system_stats/system_stats.cc  |  20 +--
 plugins/experimental/tls_bridge/tls_bridge.cc  |  12 +-
 plugins/experimental/uri_signing/config.cc |   6 +-
 plugins/experimental/uri_signing/cookie.cc |   2 +-
 plugins/experimental/uri_signing/jwt.cc|  18 +--
 plugins/experimental/uri_signing/match.cc  |  12 +-
 plugins/experimental/uri_signing/normalize.cc  |  10 +-
 plugins/experimental/uri_signing/parse.cc  |   6 +-
 plugins/experimental/uri_signing/timing.h  |   3 +-
 .../uri_signing/unit_tests/uri_signing_test.cc |  14 +--
 plugins/experimental/uri_signing/uri_signing.cc|  24 ++--
 plugins/experimental/url_sig/url_sig.cc|  39 +++---
 plugins/experimental/wasm/ats_context.cc   |   4 +-
 plugins/experimental/wasm/ats_context.h|   4 +-
 plugins/experimental/wasm/wasm_main.cc |   4 +-
 proxy/Plugin.h |   2 +-
 45 files changed, 337 insertions(+), 316 deletions(-)

diff --git a/plugins/cache_range_requests/cache_range_requests.cc 
b/plugins/cache_range_requests/cache_range_requests.cc
index a5e2883ab3..aaf3ceed2f 100644
--- a/plugins/cache_range_requests/cache_range_requests.cc
+++ b/plugins/cache_range_requests/cache_range_requests.cc
@@ -45,7 +45,7 @@ namespace
 {
 DbgCtl dbg_ctl{PLUGIN_NAME};
 
-using parent_select_mode_t = enum parent_select_mode {
+enum parent_select_mode_t {
   PS_DEFAULT,  // Default ATS parent selection mode
   PS_CACHEKEY_URL, // Set parent selection url to cache_key url
 };
diff --git a/plugins/experimental/cache_key_genid/cache_key_genid.cc 
b/plugins/experimental/cache_key_genid/cache_key_genid.cc
index 8191168345..e4083190bc 100644
--- a/plugins/experimental/cache_key_genid/cache_key_genid.cc
+++ b/plugins/experimental/cache_key_genid/cache_key_genid.cc
@@ -18,8 +18,8 @@
  */
 
 #include 
-#include 
-#include 
+#include 
+#include 
 #include 
 
 #define PLUGIN_NAME "cache-key-genid"
@@ -95,7 +95,7 @@ get_genid(char *host)
 static int
 handle_hook(TSCont *contp, TSEvent event, void *edata)
 {
-  TSHttpTxn txnp = (TSHttpTxn)edata;
+  TSHttpTxn txnp = static_cast(edata);
   char *url = nullptr, *host = nullptr;
   int url_length;
   int gen_id;
@@ -172,5 +172,5 @@ TSPluginInit(int argc, const char *argv[])
 return;
   }
 
-  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, 
TSContCreate((TSEventFunc)handle_hook, nullptr));
+  TSHttpHookAdd(TS_HTTP_READ_REQUEST_HDR_HOOK, 
TSContCreate(reinterpret_cast(handle_hook), nullptr));
 }
diff --git a/plugins/experimental/cookie_remap/hash.cc 
b/plugins/experimental/co

[trafficserver] branch 9.2.x updated: Updated ChangeLog

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new b4e3c73354 Updated ChangeLog
b4e3c73354 is described below

commit b4e3c73354d2a104ed6f00379eeb9f121a85e8bb
Author: Bryan Call 
AuthorDate: Mon Oct 9 13:38:12 2023 -0700

Updated ChangeLog
---
 CHANGELOG-9.2.3 | 9 +
 1 file changed, 9 insertions(+)

diff --git a/CHANGELOG-9.2.3 b/CHANGELOG-9.2.3
index 692e518268..dfbcfa0467 100644
--- a/CHANGELOG-9.2.3
+++ b/CHANGELOG-9.2.3
@@ -11,8 +11,17 @@ Changes with Apache Traffic Server 9.2.3
   #10257 - Python 3.12: Make autest regex strings raw strings
   #10266 - Python 3.12: add charset-nomalizer to tests/Pipfile
   #10285 - Fix slice head request memory issue
+  #10286 - Abort a read when the disk is known to be bad
   #10287 - Fix a crash due to bad disks
   #10304 - Preserve unmapped url regardless of need for remapping
+  #10324 - Add TSVConnFdGet api
   #10386 - Don't set port number as part of hostname
   #10389 - 9.2.x: Proxy Verfier Upgrade to v2.10.1
   #10391 - tls_verify4: Use traffic_manager for config reload
+  #10399 - Fix use-after-free issue
+  #10480 - Fix the SNI and HOST parsing properly
+  #10564 - Add an HTTP/2 related rate limiting
+  #10566 - s3_auth: Fix hash calculation
+  #10568 - Reallocate a buffer for H2 header block only if needed
+  #10571 - APIs to get the h2 error codes and a plugin to use them
+  #10573 - Add support for vconn start handler in lua plugin



[trafficserver] branch 8.1.x updated: APIs to get the h2 error codes and a plugin to use them (#10572)

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

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new c4cb0526d6 APIs to get the h2 error codes and a plugin to use them 
(#10572)
c4cb0526d6 is described below

commit c4cb0526d65460d1db0f5e01f48411766652928b
Author: Bryan Call 
AuthorDate: Mon Oct 9 10:29:03 2023 -0700

APIs to get the h2 error codes and a plugin to use them (#10572)
---
 doc/admin-guide/plugins/block_errors.en.rst   |  69 +
 doc/admin-guide/plugins/index.en.rst  |   4 +
 include/ts/ts.h   |  36 +++
 include/tscore/ink_inet.h |  26 ++
 plugins/Makefile.am   |   1 +
 plugins/experimental/block_errors/Makefile.inc|  20 ++
 plugins/experimental/block_errors/block_errors.cc | 318 ++
 src/traffic_server/InkAPI.cc  |  50 
 8 files changed, 524 insertions(+)

diff --git a/doc/admin-guide/plugins/block_errors.en.rst 
b/doc/admin-guide/plugins/block_errors.en.rst
new file mode 100644
index 00..36b51c451f
--- /dev/null
+++ b/doc/admin-guide/plugins/block_errors.en.rst
@@ -0,0 +1,69 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+
+
+   .. include:: ../../common.defs
+
+.. _admin-plugins-block_errors:
+
+Block Errors Plugin
+***
+
+Description
+===
+The `block_errors` plugin blocks connections for clients that have too many 
HTTP/2 errors on the server.
+
+The plugin tracks users based on their IP address and blocks them for a 
configurable amount of time.
+The existing connection that experience errors and is over the error limit 
will be closed.  The plugin also supports on the fly configuration changes 
using the `traffic_ctl` command.
+
+
+Configuration
+=
+
+To enable the `block_errors` plugin, insert the following line in 
:file:`plugin.config`:
+
+block_errors.so
+
+Additional configuration options are available and can be set in 
:file:`plugin.config`:
+
+block_errors.so   
+
+- ``error limit``: The number of errors allowed before blocking the client. 
Default: 1000 (per minute)
+- ``timeout``: The time in minutes to block the client. Default: 4 (minutes)
+- ``enable``: Enable (1) or disable (0) the plugin. Default: 1 (enabled)
+
+Example Configuration
+=
+
+block_errors.so 1000 4 0 1
+
+Run Time Configuration
+==
+The plugin can be configured at run time using the `traffic_ctl` command.  The 
following commands are available:
+
+- ``block_errors.error_limit``: Set the error limit.  Takes a single argument, 
the number of errors allowed before blocking the client.
+- ``block_errors.timeout``: Set the block timeout.  Takes a single argument, 
the number of minutes to block the client.
+- ``block_errors.enable``: Enable or disable the plugin.  Takes a single 
argument, 0 to disable, 1 to enable.
+
+Example Run Time Configuration
+==
+
+traffic_ctl plugin msg block_errors.error_limit 1
+
+traffic_ctl plugin msg block_errors.timeout 10
+
+traffic_ctl plugin msg block_errors.enable 1
diff --git a/doc/admin-guide/plugins/index.en.rst 
b/doc/admin-guide/plugins/index.en.rst
index 7c408387a2..73a1e56f0c 100644
--- a/doc/admin-guide/plugins/index.en.rst
+++ b/doc/admin-guide/plugins/index.en.rst
@@ -150,6 +150,7 @@ directory of the |TS| source tree. Experimental plugins can 
be compiled by passi
Access Control 
Balancer 
Buffer Upload 
+   Block Errors 
Cache Fill 
Certifier 
Collapsed-Forwarding 
@@ -181,6 +182,9 @@ directory of the |TS| source tree. Experimental plugins can 
be compiled by passi
 :doc:`Buffer Upload `
Buffers POST data before connecting to the Origin server.
 
+:doc:`Block Errors `
+   Blocks or downgrades new connections when the server receives too many 
errors from an IP address.
+
 :doc:`Certifier `
Manages and/or generates certificates for incoming HTTPS requests.
 
diff --git a/include/ts/ts.h b/include/ts/ts.h
index 6b39abf92

[trafficserver] branch master updated (83161881b1 -> 0dfb832ff6)

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

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


from 83161881b1 Add an HTTP/2 related rate limiting (#10563)
 add 0dfb832ff6 APIs to get the h2 error codes and a plugin to use them 
(#10570)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/plugins/block_errors.en.rst|  73 +
 doc/admin-guide/plugins/index.en.rst   |   4 +
 include/ts/ts.h|  36 +++
 plugins/Makefile.am|   1 +
 plugins/experimental/CMakeLists.txt|   1 +
 .../block_errors}/CMakeLists.txt   |   8 +-
 .../{fq_pacing => block_errors}/Makefile.inc   |   6 +-
 plugins/experimental/block_errors/block_errors.cc  | 306 +
 proxy/http2/Http2Stream.cc |   5 +-
 src/api/InkAPI.cc  |  50 
 10 files changed, 483 insertions(+), 7 deletions(-)
 create mode 100644 doc/admin-guide/plugins/block_errors.en.rst
 copy plugins/{conf_remap => experimental/block_errors}/CMakeLists.txt (87%)
 copy plugins/experimental/{fq_pacing => block_errors}/Makefile.inc (83%)
 create mode 100644 plugins/experimental/block_errors/block_errors.cc



[trafficserver] branch 9.2.x updated: Reallocate a buffer for H2 header block only if needed (#10568)

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new 4ca137b59b Reallocate a buffer for H2 header block only if needed 
(#10568)
4ca137b59b is described below

commit 4ca137b59bc6aaa25f8b14db2bdd2e72c43502e5
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 10 00:33:06 2023 +0900

Reallocate a buffer for H2 header block only if needed (#10568)

Co-authored-by: Bryan Call 
(cherry picked from commit 65dd18632648e5441df115c4ed666af02e61d2d9)
---
 proxy/http2/Http2ConnectionState.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/proxy/http2/Http2ConnectionState.cc 
b/proxy/http2/Http2ConnectionState.cc
index 888fdc39b5..dcfab9b674 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -937,8 +937,10 @@ rcv_continuation_frame(Http2ConnectionState , const 
Http2Frame )
   "header blocks too large");
   }
 
-  stream->header_blocks = static_cast(ats_realloc(stream->header_blocks, stream->header_blocks_length));
-  frame.reader()->memcpy(stream->header_blocks + header_blocks_offset, 
payload_length);
+  if (payload_length > 0) {
+stream->header_blocks = static_cast(ats_realloc(stream->header_blocks, stream->header_blocks_length));
+frame.reader()->memcpy(stream->header_blocks + header_blocks_offset, 
payload_length);
+  }
 
   if (frame.header().flags & HTTP2_FLAGS_HEADERS_END_HEADERS) {
 // NOTE: If there are END_HEADERS flag, decode stored Header Blocks.



[trafficserver] branch 9.2.x updated: APIs to get the h2 error codes and a plugin to use them (#10571)

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new a49e575340 APIs to get the h2 error codes and a plugin to use them 
(#10571)
a49e575340 is described below

commit a49e5753405e20b553f16d976db99a5ccce4ffbb
Author: Bryan Call 
AuthorDate: Mon Oct 9 09:23:56 2023 -0700

APIs to get the h2 error codes and a plugin to use them (#10571)
---
 doc/admin-guide/plugins/block_errors.en.rst   |  73 +
 doc/admin-guide/plugins/index.en.rst  |   4 +
 include/ts/ts.h   |  36 +++
 include/tscore/ink_inet.h |  26 ++
 plugins/Makefile.am   |   1 +
 plugins/experimental/block_errors/CMakeLists.txt  |  22 ++
 plugins/experimental/block_errors/Makefile.inc|  20 ++
 plugins/experimental/block_errors/block_errors.cc | 309 ++
 proxy/ProxyTransaction.cc |   5 +-
 src/traffic_server/InkAPI.cc  |  50 
 10 files changed, 545 insertions(+), 1 deletion(-)

diff --git a/doc/admin-guide/plugins/block_errors.en.rst 
b/doc/admin-guide/plugins/block_errors.en.rst
new file mode 100644
index 00..c08d597726
--- /dev/null
+++ b/doc/admin-guide/plugins/block_errors.en.rst
@@ -0,0 +1,73 @@
+.. Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you under the Apache License, Version 2.0 (the
+   "License"); you may not use this file except in compliance
+   with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing,
+   software distributed under the License is distributed on an
+   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+   KIND, either express or implied.  See the License for the
+   specific language governing permissions and limitations
+   under the License.
+
+
+   .. include:: ../../common.defs
+
+.. _admin-plugins-block_errors:
+
+Block Errors Plugin
+***
+
+Description
+===
+The `block_errors` plugin blocks connections or downgrades the protocol from 
HTTP/2 to HTTP/1.1 for clients that have too many HTTP/2 errors on the server.
+
+The plugin tracks users based on their IP address and blocks them for a 
configurable amount of time.  `block_errors` can be configured to either block 
or downgrade the protocol, only use HTTP/1.1, for any new connections.
+The existing connection that experience errors and is over the error limit 
will be closed.  The plugin also supports on the fly configuration changes 
using the `traffic_ctl` command.
+
+
+Configuration
+=
+
+To enable the `block_errors` plugin, insert the following line in 
:file:`plugin.config`:
+
+block_errors.so
+
+Additional configuration options are available and can be set in 
:file:`plugin.config`:
+
+block_errors.so
+
+- ``error limit``: The number of errors allowed before blocking the client. 
Default: 1000 (per minute)
+- ``timeout``: The time in minutes to block the client. Default: 4 (minutes)
+- ``shutdown``: Shutdown (1) or downgrade (0) the protocol for new 
connections. Default: 0 (downgrade to HTTP/1.1)
+- ``enable``: Enable (1) or disable (0) the plugin. Default: 1 (enabled)
+
+Example Configuration
+=
+
+block_errors.so 1000 4 0 1
+
+Run Time Configuration
+==
+The plugin can be configured at run time using the `traffic_ctl` command.  The 
following commands are available:
+
+- ``block_errors.error_limit``: Set the error limit.  Takes a single argument, 
the number of errors allowed before blocking the client.
+- ``block_errors.timeout``: Set the block timeout.  Takes a single argument, 
the number of minutes to block the client.
+- ``block_errors.shutdown``: Set the shutdown mode.  Takes a single argument, 
0 to downgrade to HTTP/1.1, 1 to close the connection.
+- ``block_errors.enable``: Enable or disable the plugin.  Takes a single 
argument, 0 to disable, 1 to enable.
+
+Example Run Time Configuration
+==
+
+traffic_ctl plugin msg block_errors.error_limit 1
+
+traffic_ctl plugin msg block_errors.timeout 10
+
+traffic_ctl plugin msg block_errors.shutdown 1
+
+traffic_ctl plugin msg block_errors.enable 1
diff --git a/doc/admin-guide/plugins/index.en.rst 
b/doc/admin-guide/plugins/index.en.rst
index 986a956913..b0218bab9d 100644
--- a/doc/admin-guide/plugins/index.en.rst
+++ b/doc/admin-guide/plugins/index.en.rst
@@ -151,6 +151,7 @@ directory of the |TS| source tree. Experimental plugins can 

[trafficserver] branch 9.2.x updated: s3_auth: Fix hash calculation (#10566)

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new de7c8a78ed s3_auth: Fix hash calculation (#10566)
de7c8a78ed is described below

commit de7c8a78edd5b75e311561dfaa133e9d71ea8a5e
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 10 00:31:12 2023 +0900

s3_auth: Fix hash calculation (#10566)

(cherry picked from commit 4c62a113b48fd76d06e0a896ce8c21d749944339)
---
 plugins/s3_auth/aws_auth_v4.cc | 4 
 plugins/s3_auth/unit_tests/test_aws_auth_v4.cc | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc
index d21ae814b4..968cfae2c7 100644
--- a/plugins/s3_auth/aws_auth_v4.cc
+++ b/plugins/s3_auth/aws_auth_v4.cc
@@ -93,6 +93,10 @@ uriEncode(const String , bool isObjectName)
 } else if (isObjectName && i == '/') {
   /* Encode the forward slash character, '/', everywhere except in the 
object key name. */
   result << "/";
+} else if (i == '+') {
+  /* Only written in the example code, but a plus sign is treated as a 
space regardless of the position and it must be encoded
+   * as "%20" instead of "%2B" */
+  result << "%20";
 } else {
   /* Letters in the hexadecimal value must be upper-case, for example 
"%1A". */
   result << "%" << std::uppercase << std::setfill('0') << std::setw(2) << 
std::hex << static_cast(i);
diff --git a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc 
b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
index 506fef4387..ca2c6bbff6 100644
--- a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
+++ b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
@@ -57,7 +57,7 @@ TEST_CASE("uriEncode(): encode reserved chars in a name which 
is not object name
   String encoded  = uriEncode(in, /* isObjectName */ false);
 
   CHECK(3 * in.length() == encoded.length()); /* size of "%NN" = 3 */
-  
CHECK_FALSE(encoded.compare("%20%2F%21%22%23%24%25%26%27%28%29%2A%2B%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
+  
CHECK_FALSE(encoded.compare("%20%2F%21%22%23%24%25%26%27%28%29%2A%20%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
 }
 
 TEST_CASE("uriEncode(): encode reserved chars in an object name", 
"[AWS][auth][utility]")
@@ -66,7 +66,7 @@ TEST_CASE("uriEncode(): encode reserved chars in an object 
name", "[AWS][auth][u
   String encoded  = uriEncode(in, /* isObjectName */ true);
 
   CHECK(3 * in.length() - 2 == encoded.length()); /* size of "%NN" = 3, '/' is 
not encoded */
-  
CHECK_FALSE(encoded.compare("%20/%21%22%23%24%25%26%27%28%29%2A%2B%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
+  
CHECK_FALSE(encoded.compare("%20/%21%22%23%24%25%26%27%28%29%2A%20%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
 }
 
 TEST_CASE("isUriEncoded(): check an empty input", "[AWS][auth][utility]")



[trafficserver] branch 8.1.x updated: Add an HTTP/2 related rate limiting (#10565)

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

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new d742d74039 Add an HTTP/2 related rate limiting (#10565)
d742d74039 is described below

commit d742d74039aaa548dda0148ab4ba207906abc620
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 10 01:02:37 2023 +0900

Add an HTTP/2 related rate limiting (#10565)
---
 doc/admin-guide/files/records.config.en.rst|  7 +++
 .../statistics/core/http-connection.en.rst |  7 +++
 mgmt/RecordsConfig.cc  |  2 +
 proxy/http2/HTTP2.cc   | 54 --
 proxy/http2/HTTP2.h|  2 +
 proxy/http2/Http2ConnectionState.cc| 23 +
 proxy/http2/Http2ConnectionState.h |  3 ++
 7 files changed, 74 insertions(+), 24 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index 98b2565490..fc9aae122f 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -3686,6 +3686,13 @@ HTTP/2 Configuration
This limit only will be enforced if 
:ts:cv:`proxy.config.http2.stream_priority_enabled`
is set to 1.
 
+.. ts:cv:: CONFIG proxy.config.http2.max_rst_stream_frames_per_minute INT 14
+   :reloadable:
+
+   Specifies how many RST_STREAM frames |TS| receives for a minute at maximum.
+   Clients exceeded this limit will be immediately disconnected with an error
+   code of ENHANCE_YOUR_CALM.
+
 .. ts:cv:: CONFIG proxy.config.http2.min_avg_window_update FLOAT 2560.0
:reloadable:
 
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 d2e9014ffd..b14e72bd75 100644
--- a/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
+++ b/doc/admin-guide/monitoring/statistics/core/http-connection.en.rst
@@ -238,6 +238,13 @@ HTTP/2
maximum allowed number of priority frames per minute limit which is 
configured by
:ts:cv:`proxy.config.http2.max_priority_frames_per_minute`.
 
+.. ts:stat:: global 
proxy.process.http2.max_rst_stream_frames_per_minute_exceeded integer
+   :type: counter
+
+   Represents the total number of closed HTTP/2 connections for exceeding the
+   maximum allowed number of rst_stream frames per minute limit which is 
configured by
+   :ts:cv:`proxy.config.http2.max_rst_stream_frames_per_minute`.
+
 .. ts:stat:: global proxy.process.http2.insufficient_avg_window_update integer
:type: counter
 
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 79b025b64f..c2d84dc0e8 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1346,6 +1346,8 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.http2.max_priority_frames_per_minute", RECD_INT, 
"120", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.http2.max_rst_stream_frames_per_minute", 
RECD_INT, "200", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
+  ,
   {RECT_CONFIG, "proxy.config.http2.min_avg_window_update", RECD_FLOAT, 
"2560.0", RECU_DYNAMIC, RR_NULL, RECC_NULL, nullptr, RECA_NULL}
   ,
   {RECT_CONFIG, "proxy.config.http2.header_table_size_limit", RECD_INT, 
"65536", RECU_DYNAMIC, RR_NULL, RECC_STR, "^[0-9]+$", RECA_NULL}
diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc
index f928ea33a5..cc07c9a018 100644
--- a/proxy/http2/HTTP2.cc
+++ b/proxy/http2/HTTP2.cc
@@ -71,6 +71,8 @@ static const char *const 
HTTP2_STAT_MAX_PING_FRAMES_PER_MINUTE_EXCEEDED_NAME =
   "proxy.process.http2.max_ping_frames_per_minute_exceeded";
 static const char *const 
HTTP2_STAT_MAX_PRIORITY_FRAMES_PER_MINUTE_EXCEEDED_NAME =
   "proxy.process.http2.max_priority_frames_per_minute_exceeded";
+static const char *const 
HTTP2_STAT_MAX_RST_STREAM_FRAMES_PER_MINUTE_EXCEEDED_NAME =
+  "proxy.process.http2.max_rst_stream_frames_per_minute_exceeded";
 static const char *const HTTP2_STAT_INSUFFICIENT_AVG_WINDOW_UPDATE_NAME = 
"proxy.process.http2.insufficient_avg_window_update";
 
 union byte_pointer {
@@ -726,30 +728,31 @@ http2_decode_header_blocks(HTTPHdr *hdr, const uint8_t 
*buf_start, const uint32_
 }
 
 // Initialize this subsystem with librecords configs (for now)
-uint32_t Http2::max_concurrent_streams_in  = 100;
-uint32_t Http2::min_concurrent_streams_in  = 10;
-uint32_t Http2::max_active_streams_in  = 0;
-bool Http2::throttling = false;
-uint32_t Http2::stream_priority_enabled= 0;
-uint32_t Http2::initial_window_size= 65535;
-uint32_t Http2::max_fr

[trafficserver] branch 8.1.x updated: s3_auth: Fix hash calculation (#10567)

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

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new 334839cb7a s3_auth: Fix hash calculation (#10567)
334839cb7a is described below

commit 334839cb7a6724c71a5542e924251a8d931774b0
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 10 00:33:39 2023 +0900

s3_auth: Fix hash calculation (#10567)
---
 plugins/s3_auth/aws_auth_v4.cc | 4 
 plugins/s3_auth/unit_tests/test_aws_auth_v4.cc | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc
index 5df57151c6..8adccc8779 100644
--- a/plugins/s3_auth/aws_auth_v4.cc
+++ b/plugins/s3_auth/aws_auth_v4.cc
@@ -93,6 +93,10 @@ uriEncode(const String , bool isObjectName)
 } else if (isObjectName && i == '/') {
   /* Encode the forward slash character, '/', everywhere except in the 
object key name. */
   result << "/";
+} else if (i == '+') {
+  /* Only written in the example code, but a plus sign is treated as a 
space regardless of the position and it must be encoded
+   * as "%20" instead of "%2B" */
+  result << "%20";
 } else {
   /* Letters in the hexadecimal value must be upper-case, for example 
"%1A". */
   result << "%" << std::uppercase << std::setfill('0') << std::setw(2) << 
std::hex << (int)i;
diff --git a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc 
b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
index 8cf9b2948e..d9974b5c7f 100644
--- a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
+++ b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
@@ -57,7 +57,7 @@ TEST_CASE("uriEncode(): encode reserved chars in a name which 
is not object name
   String encoded  = uriEncode(in, /* isObjectName */ false);
 
   CHECK(3 * in.length() == encoded.length()); /* size of "%NN" = 3 */
-  
CHECK_FALSE(encoded.compare("%20%2F%21%22%23%24%25%26%27%28%29%2A%2B%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
+  
CHECK_FALSE(encoded.compare("%20%2F%21%22%23%24%25%26%27%28%29%2A%20%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
 }
 
 TEST_CASE("uriEncode(): encode reserved chars in an object name", 
"[AWS][auth][utility]")
@@ -66,7 +66,7 @@ TEST_CASE("uriEncode(): encode reserved chars in an object 
name", "[AWS][auth][u
   String encoded  = uriEncode(in, /* isObjectName */ true);
 
   CHECK(3 * in.length() - 2 == encoded.length()); /* size of "%NN" = 3, '/' is 
not encoded */
-  
CHECK_FALSE(encoded.compare("%20/%21%22%23%24%25%26%27%28%29%2A%2B%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
+  
CHECK_FALSE(encoded.compare("%20/%21%22%23%24%25%26%27%28%29%2A%20%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
 }
 
 TEST_CASE("isUriEncoded(): check an empty input", "[AWS][auth][utility]")



[trafficserver] branch master updated: Reallocate a buffer for H2 header block only if needed (#10568)

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

bcall 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 65dd186326 Reallocate a buffer for H2 header block only if needed 
(#10568)
65dd186326 is described below

commit 65dd18632648e5441df115c4ed666af02e61d2d9
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 10 00:33:06 2023 +0900

Reallocate a buffer for H2 header block only if needed (#10568)

Co-authored-by: Bryan Call 
---
 proxy/http2/Http2ConnectionState.cc | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/proxy/http2/Http2ConnectionState.cc 
b/proxy/http2/Http2ConnectionState.cc
index 05ac31dcb2..7c9db663a8 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -1007,8 +1007,10 @@ Http2ConnectionState::rcv_continuation_frame(const 
Http2Frame )
   "header blocks too large");
   }
 
-  stream->header_blocks = static_cast(ats_realloc(stream->header_blocks, stream->header_blocks_length));
-  frame.reader()->memcpy(stream->header_blocks + header_blocks_offset, 
payload_length);
+  if (payload_length > 0) {
+stream->header_blocks = static_cast(ats_realloc(stream->header_blocks, stream->header_blocks_length));
+frame.reader()->memcpy(stream->header_blocks + header_blocks_offset, 
payload_length);
+  }
 
   if (frame.header().flags & HTTP2_FLAGS_HEADERS_END_HEADERS) {
 // NOTE: If there are END_HEADERS flag, decode stored Header Blocks.



[trafficserver] branch master updated: s3_auth: Fix hash calculation (#10566)

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

bcall 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 4c62a113b4 s3_auth: Fix hash calculation (#10566)
4c62a113b4 is described below

commit 4c62a113b48fd76d06e0a896ce8c21d749944339
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 10 00:31:12 2023 +0900

s3_auth: Fix hash calculation (#10566)
---
 plugins/s3_auth/aws_auth_v4.cc | 4 
 plugins/s3_auth/unit_tests/test_aws_auth_v4.cc | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc
index 1544add501..2a5ff550d7 100644
--- a/plugins/s3_auth/aws_auth_v4.cc
+++ b/plugins/s3_auth/aws_auth_v4.cc
@@ -93,6 +93,10 @@ uriEncode(const String , bool isObjectName)
 } else if (isObjectName && i == '/') {
   /* Encode the forward slash character, '/', everywhere except in the 
object key name. */
   result << "/";
+} else if (i == '+') {
+  /* Only written in the example code, but a plus sign is treated as a 
space regardless of the position and it must be encoded
+   * as "%20" instead of "%2B" */
+  result << "%20";
 } else {
   /* Letters in the hexadecimal value must be upper-case, for example 
"%1A". */
   result << "%" << std::uppercase << std::setfill('0') << std::setw(2) << 
std::hex << static_cast(i);
diff --git a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc 
b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
index e483075005..2b33c055a6 100644
--- a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
+++ b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
@@ -57,7 +57,7 @@ TEST_CASE("uriEncode(): encode reserved chars in a name which 
is not object name
   String encoded  = uriEncode(in, /* isObjectName */ false);
 
   CHECK(3 * in.length() == encoded.length()); /* size of "%NN" = 3 */
-  
CHECK_FALSE(encoded.compare("%20%2F%21%22%23%24%25%26%27%28%29%2A%2B%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
+  
CHECK_FALSE(encoded.compare("%20%2F%21%22%23%24%25%26%27%28%29%2A%20%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
 }
 
 TEST_CASE("uriEncode(): encode reserved chars in an object name", 
"[AWS][auth][utility]")
@@ -66,7 +66,7 @@ TEST_CASE("uriEncode(): encode reserved chars in an object 
name", "[AWS][auth][u
   String encoded  = uriEncode(in, /* isObjectName */ true);
 
   CHECK(3 * in.length() - 2 == encoded.length()); /* size of "%NN" = 3, '/' is 
not encoded */
-  
CHECK_FALSE(encoded.compare("%20/%21%22%23%24%25%26%27%28%29%2A%2B%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
+  
CHECK_FALSE(encoded.compare("%20/%21%22%23%24%25%26%27%28%29%2A%20%2C%3A%3B%3C%3D%3E%3F%40%5B%5C%5D%5E%60%7B%7C%7D"));
 }
 
 TEST_CASE("isUriEncoded(): check an empty input", "[AWS][auth][utility]")



[trafficserver] branch 8.1.x updated: clang-format (#10569)

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

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new ece783b9d0 clang-format (#10569)
ece783b9d0 is described below

commit ece783b9d0b5c73cd4e5552ff94725b31cf52f42
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 10 00:05:46 2023 +0900

clang-format (#10569)
---
 proxy/hdrs/unit_tests/test_URL.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/hdrs/unit_tests/test_URL.cc 
b/proxy/hdrs/unit_tests/test_URL.cc
index d5fc7f471c..a293740285 100644
--- a/proxy/hdrs/unit_tests/test_URL.cc
+++ b/proxy/hdrs/unit_tests/test_URL.cc
@@ -505,7 +505,7 @@ test_parse(url_parse_test_case const _case, bool 
parse_function)
   } else {
 heap->destroy();
 return;
-//result = url.parse_no_host_check(test_case.input_uri.c_str(), 
test_case.input_uri.size());
+// result = url.parse_no_host_check(test_case.input_uri.c_str(), 
test_case.input_uri.size());
   }
   bool expected_is_valid = test_case.is_valid;
 



[trafficserver] branch 9.2.x updated: Add an HTTP/2 related rate limiting (#10564)

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new b28ad74f11 Add an HTTP/2 related rate limiting (#10564)
b28ad74f11 is described below

commit b28ad74f117307e8de206f1de70c3fa716f90682
Author: Masakazu Kitajo 
AuthorDate: Tue Oct 10 00:02:18 2023 +0900

Add an HTTP/2 related rate limiting (#10564)
---
 doc/admin-guide/files/records.config.en.rst|   7 +
 doc/admin-guide/files/sni.yaml.en.rst  | 190 +++--
 .../statistics/core/http-connection.en.rst |   7 +
 iocore/net/P_SNIActionPerformer.h  |  68 
 iocore/net/SSLSNIConfig.cc |  13 ++
 iocore/net/TLSSNISupport.h |   4 +
 iocore/net/YamlSNIConfig.cc|  16 ++
 iocore/net/YamlSNIConfig.h |   8 +
 mgmt/RecordsConfig.cc  |   2 +
 proxy/http2/HTTP2.cc   |  64 +++
 proxy/http2/HTTP2.h|   2 +
 proxy/http2/Http2ConnectionState.cc|  54 +-
 proxy/http2/Http2ConnectionState.h |   8 +
 13 files changed, 323 insertions(+), 120 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index 50d0dfd941..e6865b8c80 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -4272,6 +4272,13 @@ HTTP/2 Configuration
This limit only will be enforced if 
:ts:cv:`proxy.config.http2.stream_priority_enabled`
is set to 1.
 
+.. ts:cv:: CONFIG proxy.config.http2.max_rst_stream_frames_per_minute INT 14
+   :reloadable:
+
+   Specifies how many RST_STREAM frames |TS| receives for a minute at maximum.
+   Clients exceeded this limit will be immediately disconnected with an error
+   code of ENHANCE_YOUR_CALM.
+
 .. ts:cv:: CONFIG proxy.config.http2.min_avg_window_update FLOAT 2560.0
:reloadable:
 
diff --git a/doc/admin-guide/files/sni.yaml.en.rst 
b/doc/admin-guide/files/sni.yaml.en.rst
index 5c11420142..8dc078eacb 100644
--- a/doc/admin-guide/files/sni.yaml.en.rst
+++ b/doc/admin-guide/files/sni.yaml.en.rst
@@ -52,122 +52,138 @@ for a more detailed description of HTTP/2 connection 
coalescing.
 .. _override-host-sni-policy:
 .. _override-h2-properties:
 
-= = 

-Key   Direction Meaning
-= = 

-fqdn  Both  Fully Qualified Domain Name. This item is 
used if the SNI value matches this.
+== = 

+KeyDirection Meaning
+== = 

+fqdn   Both  Fully Qualified Domain Name. 
This item is used if the SNI value matches this.
+
+ip_allow   Inbound   Specify a list of client IP 
address, subnets, or ranges what are allowed to complete
+ the connection. This list is 
comma separated. IPv4 and IPv6 addresses can be specified.
+ Here is an example list: 
192.168.1.0/24,192.168.10.1-4. This would allow connections
+ from clients in the 
19.168.1.0 network or in the range from 192.168.10.1 to 192.168.1.4.
+
+verify_server_policy   Outbound  One of the values 
:code:`DISABLED`, :code:`PERMISSIVE`, or :code:`ENFORCED`.
+
+ By default this is 
:ts:cv:`proxy.config.ssl.client.verify.server.policy`.
+ This controls how |TS| 
evaluated the origin certificate.
 
-ip_allow  Inbound   Specify a list of client IP address, 
subnets, or ranges what are allowed to complete
-the connection. This list is comma 
separated. IPv4 and IPv6 addresses can be specified.
-Here is an example list: 
192.168.1.0/24,192.168.10.1-4. This would allow connections
-from clients in the 19.168.1.0 network or 
in the range from 192.168.10.1 to 192.168.1.4.
+verify_server_properties   Outbound  One of the values 
:code:`NONE`, :code:`SIGNATURE`, :code:`NAME`, and :code:`ALL`
 
-verify_server_policy

[trafficserver] 01/01: Add TSVConnFdGet api (#10324)

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

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

commit 791ab96864875d9e017571e04a9fa2cf5dcf7a09
Author: Susan Hinrichs 
AuthorDate: Mon Sep 11 17:51:33 2023 -0500

Add TSVConnFdGet api (#10324)

(cherry picked from commit 7ddb721c4ff4e1943a3d92b889b346d398fe8756)

 Conflicts:
include/ts/ts.h
src/traffic_server/InkAPI.cc
---
 .../api/functions/TSVConnFdGet.en.rst  | 34 ++
 include/ts/ts.h|  2 ++
 src/traffic_server/InkAPI.cc   |  8 +
 3 files changed, 44 insertions(+)

diff --git a/doc/developer-guide/api/functions/TSVConnFdGet.en.rst 
b/doc/developer-guide/api/functions/TSVConnFdGet.en.rst
new file mode 100644
index 00..7e5a808115
--- /dev/null
+++ b/doc/developer-guide/api/functions/TSVConnFdGet.en.rst
@@ -0,0 +1,34 @@
+.. 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.
+
+
+TSVConnFdGet
+
+
+Synopsis
+
+
+.. code-block:: cpp
+
+#include 
+
+.. c:function:: int TSVConnFdGet(TSVConn vconnp)
+
+
+Description
+---
+Returns the file descriptor associated with the network connection :arg:`sslp`.
+It returns -1 on error.
diff --git a/include/ts/ts.h b/include/ts/ts.h
index 226b3c6f1e..6b39abf925 100644
--- a/include/ts/ts.h
+++ b/include/ts/ts.h
@@ -1219,6 +1219,8 @@ tsapi void TSVConnReenable(TSVConn sslvcp);
 tsapi TSReturnCode TSVConnTunnel(TSVConn sslp);
 /*  Return the SSL object associated with the connection */
 tsapi TSSslConnection TSVConnSSLConnectionGet(TSVConn sslp);
+/* Return the file descriptoer associated with the connection */
+tsapi int TSVConnFdGet(TSVConn sslp);
 /*  Fetch a SSL context from the global lookup table */
 tsapi TSSslContext TSSslContextFindByName(const char *name);
 tsapi TSSslContext TSSslContextFindByAddr(struct sockaddr const *);
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 56d135107d..2d878123ea 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9199,6 +9199,14 @@ TSVConnSSLConnectionGet(TSVConn sslp)
   return ssl;
 }
 
+tsapi int
+TSVConnFdGet(TSVConn vconnp)
+{
+  sdk_assert(sdk_sanity_check_null_ptr(vconnp) == TS_SUCCESS);
+  NetVConnection *vc = reinterpret_cast(vconnp);
+  return vc->get_socket();
+}
+
 tsapi TSSslContext
 TSSslContextFindByName(const char *name)
 {



[trafficserver] branch 8.1.x updated (5347c81e1c -> 791ab96864)

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

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


 discard 5347c81e1c Add TSVConnFdGet api (#10324)
 new 791ab96864 Add TSVConnFdGet api (#10324)

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   (5347c81e1c)
\
 N -- N -- N   refs/heads/8.1.x (791ab96864)

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 1 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:
 src/traffic_server/InkAPI.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



[trafficserver] branch 8.1.x updated: Add TSVConnFdGet api (#10324)

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

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


The following commit(s) were added to refs/heads/8.1.x by this push:
 new 5347c81e1c Add TSVConnFdGet api (#10324)
5347c81e1c is described below

commit 5347c81e1c5349ebee9495d5d92a8e209de8b40e
Author: Susan Hinrichs 
AuthorDate: Mon Sep 11 17:51:33 2023 -0500

Add TSVConnFdGet api (#10324)

(cherry picked from commit 7ddb721c4ff4e1943a3d92b889b346d398fe8756)

 Conflicts:
include/ts/ts.h
src/traffic_server/InkAPI.cc
---
 .../api/functions/TSVConnFdGet.en.rst  | 34 ++
 include/ts/ts.h|  2 ++
 src/traffic_server/InkAPI.cc   |  8 +
 3 files changed, 44 insertions(+)

diff --git a/doc/developer-guide/api/functions/TSVConnFdGet.en.rst 
b/doc/developer-guide/api/functions/TSVConnFdGet.en.rst
new file mode 100644
index 00..7e5a808115
--- /dev/null
+++ b/doc/developer-guide/api/functions/TSVConnFdGet.en.rst
@@ -0,0 +1,34 @@
+.. 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.
+
+
+TSVConnFdGet
+
+
+Synopsis
+
+
+.. code-block:: cpp
+
+#include 
+
+.. c:function:: int TSVConnFdGet(TSVConn vconnp)
+
+
+Description
+---
+Returns the file descriptor associated with the network connection :arg:`sslp`.
+It returns -1 on error.
diff --git a/include/ts/ts.h b/include/ts/ts.h
index 226b3c6f1e..6b39abf925 100644
--- a/include/ts/ts.h
+++ b/include/ts/ts.h
@@ -1219,6 +1219,8 @@ tsapi void TSVConnReenable(TSVConn sslvcp);
 tsapi TSReturnCode TSVConnTunnel(TSVConn sslp);
 /*  Return the SSL object associated with the connection */
 tsapi TSSslConnection TSVConnSSLConnectionGet(TSVConn sslp);
+/* Return the file descriptoer associated with the connection */
+tsapi int TSVConnFdGet(TSVConn sslp);
 /*  Fetch a SSL context from the global lookup table */
 tsapi TSSslContext TSSslContextFindByName(const char *name);
 tsapi TSSslContext TSSslContextFindByAddr(struct sockaddr const *);
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index 56d135107d..4c7a221a82 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9199,6 +9199,14 @@ TSVConnSSLConnectionGet(TSVConn sslp)
   return ssl;
 }
 
+tsapi int
+SVConnFdGet(TSVConn vconnp)
+{
+  sdk_assert(sdk_sanity_check_null_ptr(vconnp) == TS_SUCCESS);
+  NetVConnection *vc = reinterpret_cast(vconnp);
+  return vc->get_socket();
+}
+
 tsapi TSSslContext
 TSSslContextFindByName(const char *name)
 {



[trafficserver] branch master updated: Change unable to bind or listen to a fatal error (#10549)

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

bcall 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 04b8c5acd6 Change unable to bind or listen to a fatal error (#10549)
04b8c5acd6 is described below

commit 04b8c5acd6fb1ac34a2e076bcd98667bc8f2af16
Author: Bryan Call 
AuthorDate: Tue Oct 3 06:27:46 2023 -0700

Change unable to bind or listen to a fatal error (#10549)
---
 iocore/net/Connection.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/iocore/net/Connection.cc b/iocore/net/Connection.cc
index 671e155f2f..60d47a785d 100644
--- a/iocore/net/Connection.cc
+++ b/iocore/net/Connection.cc
@@ -388,6 +388,6 @@ Lerror:
 fd = NO_FD;
   }
 
-  Error("Could not bind or listen to port %d (error: %d)", 
ats_ip_port_host_order(), res);
+  Fatal("Could not bind or listen to port %d (error: %d)", 
ats_ip_port_host_order(), res);
   return res;
 }



[trafficserver] branch 9.2.x updated: Add TSVConnFdGet api (#10324)

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

bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/9.2.x by this push:
 new cbbd973362 Add TSVConnFdGet api (#10324)
cbbd973362 is described below

commit cbbd97336224cabe140cf209222c7dabc8fa50a8
Author: Susan Hinrichs 
AuthorDate: Mon Sep 11 17:51:33 2023 -0500

Add TSVConnFdGet api (#10324)

(cherry picked from commit 7ddb721c4ff4e1943a3d92b889b346d398fe8756)

 Conflicts:
include/ts/ts.h
---
 .../api/functions/TSVConnFdGet.en.rst  | 34 ++
 include/ts/ts.h|  2 ++
 src/traffic_server/InkAPI.cc   |  8 +
 3 files changed, 44 insertions(+)

diff --git a/doc/developer-guide/api/functions/TSVConnFdGet.en.rst 
b/doc/developer-guide/api/functions/TSVConnFdGet.en.rst
new file mode 100644
index 00..7e5a808115
--- /dev/null
+++ b/doc/developer-guide/api/functions/TSVConnFdGet.en.rst
@@ -0,0 +1,34 @@
+.. 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.
+
+
+TSVConnFdGet
+
+
+Synopsis
+
+
+.. code-block:: cpp
+
+#include 
+
+.. c:function:: int TSVConnFdGet(TSVConn vconnp)
+
+
+Description
+---
+Returns the file descriptor associated with the network connection :arg:`sslp`.
+It returns -1 on error.
diff --git a/include/ts/ts.h b/include/ts/ts.h
index ea28eabf63..7c56b57d9d 100644
--- a/include/ts/ts.h
+++ b/include/ts/ts.h
@@ -1289,6 +1289,8 @@ tsapi void TSVConnReenableEx(TSVConn sslvcp, TSEvent 
event);
 tsapi TSReturnCode TSVConnTunnel(TSVConn sslp);
 /*  Return the SSL object associated with the connection */
 tsapi TSSslConnection TSVConnSslConnectionGet(TSVConn sslp);
+/* Return the file descriptoer associated with the connection */
+int TSVConnFdGet(TSVConn sslp);
 /* Return the intermediate X509StoreCTX object that references the certificate 
being validated */
 tsapi TSSslVerifyCTX TSVConnSslVerifyCTXGet(TSVConn sslp);
 /*  Fetch a SSL context from the global lookup table */
diff --git a/src/traffic_server/InkAPI.cc b/src/traffic_server/InkAPI.cc
index ba4b870343..7cd59605f3 100644
--- a/src/traffic_server/InkAPI.cc
+++ b/src/traffic_server/InkAPI.cc
@@ -9570,6 +9570,14 @@ TSVConnSslConnectionGet(TSVConn sslp)
   return ssl;
 }
 
+int
+TSVConnFdGet(TSVConn vconnp)
+{
+  sdk_assert(sdk_sanity_check_null_ptr(vconnp) == TS_SUCCESS);
+  NetVConnection *vc = reinterpret_cast(vconnp);
+  return vc->get_socket();
+}
+
 const char *
 TSVConnSslSniGet(TSVConn sslp, int *length)
 {



[trafficserver] branch master updated: Fix build issue with Ubuntu 20.04 using clang (#10545)

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

bcall 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 210d17e032 Fix build issue with Ubuntu 20.04 using clang (#10545)
210d17e032 is described below

commit 210d17e032f73617e962f1568d14a07b8c1d4c0d
Author: Bryan Call 
AuthorDate: Thu Sep 28 11:28:45 2023 -0700

Fix build issue with Ubuntu 20.04 using clang (#10545)
---
 src/traffic_ctl/CtrlCommands.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/traffic_ctl/CtrlCommands.cc b/src/traffic_ctl/CtrlCommands.cc
index 1120ba1ba0..18a8d410ff 100644
--- a/src/traffic_ctl/CtrlCommands.cc
+++ b/src/traffic_ctl/CtrlCommands.cc
@@ -56,7 +56,7 @@ parse_format(ts::Arguments *args)
   BasePrinter::Options::OutputFormat 
val{BasePrinter::Options::OutputFormat::NOT_SET};
 
   if (auto data = args->get("format"); data) {
-StringToOutputFormatMap::const_iterator search = 
_Fmt_str_to_enum.find({data.value()});
+StringToOutputFormatMap::const_iterator search = 
_Fmt_str_to_enum.find(data.value());
 if (search != std::end(_Fmt_str_to_enum)) {
   val = search->second;
 }



[trafficserver] branch master updated: Ran clang-tidy over tscore (#10535)

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

bcall 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 13a27d7a45 Ran clang-tidy over tscore (#10535)
13a27d7a45 is described below

commit 13a27d7a45a7330cb1b64d291216ae5ec15916a2
Author: Bryan Call 
AuthorDate: Thu Sep 28 06:15:17 2023 -0700

Ran clang-tidy over tscore (#10535)
---
 include/tscore/Allocator.h   |   2 +-
 include/tscore/Arena.h   |  10 +-
 include/tscore/BaseLogFile.h |   4 +-
 include/tscore/ContFlags.h   |   5 +-
 include/tscore/Extendible.h  |   4 +-
 include/tscore/History.h |   4 +-
 include/tscore/IntrusivePtr.h|   8 +-
 include/tscore/List.h|  83 +++--
 include/tscore/MD5.h |   2 +-
 include/tscore/MatcherUtils.h|   3 +-
 include/tscore/ParseRules.h  | 155 ++-
 include/tscore/Ptr.h |   3 +-
 include/tscore/SHA256.h  |   2 +-
 include/tscore/SimpleTokenizer.h |  10 +-
 include/tscore/TextBuffer.h  |   2 +-
 include/tscore/ink_args.h|   2 +-
 include/tscore/ink_hrtime.h  |  22 ++---
 include/tscore/ink_inet.h|  12 ++-
 include/tscore/ink_llqueue.h |  10 +-
 include/tscore/ink_memory.h  |  13 ++-
 include/tscore/ink_platform.h|   2 +-
 include/tscore/ink_queue.h   |   8 +-
 include/tscore/ink_rand.h|   2 +-
 include/tscore/ink_rwlock.h  |   2 +-
 include/tscore/ink_string++.h|   2 +-
 include/tscore/ink_string.h  |   8 +-
 include/tscore/ink_thread.h  |  13 +--
 include/tscore/signals.h |   2 +-
 include/tscpp/util/Histogram.h   |  10 +-
 src/tscore/HKDF_openssl3.cc  |  12 +--
 src/tscore/MMH.cc|   8 +-
 src/tscore/Regex.cc  |   2 +-
 src/tscore/ink_stack_trace.cc|   3 +-
 src/tscore/unit_tests/test_ArgParser.cc  |  10 +-
 src/tscore/unit_tests/test_Encoding.cc   |   4 +-
 src/tscore/unit_tests/test_Extendible.cc |  32 ---
 src/tscore/unit_tests/test_MMH.cc|  24 ++---
 src/tscore/unit_tests/test_Random.cc |   4 +-
 src/tscore/unit_tests/test_arena.cc  |   2 +-
 39 files changed, 287 insertions(+), 219 deletions(-)

diff --git a/include/tscore/Allocator.h b/include/tscore/Allocator.h
index 309dd57127..124bbf9fcb 100644
--- a/include/tscore/Allocator.h
+++ b/include/tscore/Allocator.h
@@ -327,7 +327,7 @@ public:
 ink_mutex_acquire();
 std::map::iterator it = reverse_lookup.find(ptr);
 if (it != reverse_lookup.end()) {
-  tracker.increment((const void *)it->second, (int64_t)sizeof(C) * -1, 
nullptr);
+  tracker.increment(static_cast(it->second), 
(int64_t)sizeof(C) * -1, nullptr);
   reverse_lookup.erase(it);
 }
 ink_mutex_release();
diff --git a/include/tscore/Arena.h b/include/tscore/Arena.h
index 4db4808a3b..f206b40ad8 100644
--- a/include/tscore/Arena.h
+++ b/include/tscore/Arena.h
@@ -108,19 +108,19 @@ Arena::str_alloc(size_t len)
 tmp  /= 128;
   }
 
-  mem = (unsigned char *)alloc(size, 1);
+  mem = static_cast(alloc(size, 1));
 
   mem += (size - len - 1);
   p= mem - 1;
   tmp  = len;
 
   while (tmp >= 128) {
-*p--  = (unsigned char)(255 - (tmp % 128));
+*p--  = static_cast(255 - (tmp % 128));
 tmp  /= 128;
   }
-  *p = (unsigned char)tmp;
+  *p = static_cast(tmp);
 
-  return (char *)mem;
+  return reinterpret_cast(mem);
 }
 
 /*-
@@ -132,7 +132,7 @@ Arena::str_free(char *str)
   unsigned char *p, *s, *e;
   size_t len;
 
-  e = (unsigned char *)str;
+  e = reinterpret_cast(str);
   s = e - 1;
 
   while (*s >= 128) {
diff --git a/include/tscore/BaseLogFile.h b/include/tscore/BaseLogFile.h
index ed325fbec6..eca920a1fd 100644
--- a/include/tscore/BaseLogFile.h
+++ b/include/tscore/BaseLogFile.h
@@ -47,13 +47,13 @@
   0 // change this to 1 to enable debug messages
 // TODO find a way to enable this from autotools
 
-typedef enum {
+enum LogLogPriorityLevel {
   LL_Debug = 0, // process does not die
   LL_Note,  // process does not die
   LL_Warning,   // process does not die
   LL_Error, // process does not die
   LL_Fatal, // causes process termination
-} LogLogPriorityLevel;
+};
 
 #define log_log_trace(...) \
   do { \
diff --git a/include/tscore/ContFlags.h b/include/tscore/ContFlags.h
index f23822ebd8..33b7b5a23c 100644
--- a/include/tscore/ContFlags.h
+++ b/include/tscore/ContFlags.h
@@ -65,10 +65,11 @@ public:
   set_flag(enum flags flag_bit

[trafficserver] branch master updated: Stat names changed, updates needed for traffic_top (#10538)

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

bcall 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 e2b72edafc Stat names changed, updates needed for traffic_top (#10538)
e2b72edafc is described below

commit e2b72edafcce2eedcbed2672a15917f30aa6cfff
Author: Bryan Call 
AuthorDate: Thu Sep 28 06:14:49 2023 -0700

Stat names changed, updates needed for traffic_top (#10538)
---
 src/traffic_top/stats.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/traffic_top/stats.h b/src/traffic_top/stats.h
index 0cb12e411f..c94482bfd9 100644
--- a/src/traffic_top/stats.h
+++ b/src/traffic_top/stats.h
@@ -180,8 +180,8 @@ public:
 lookup_table.insert(make_pair("ka_total", LookupItem("KA Total", 
"proxy.process.net.dynamic_keep_alive_timeout_in_total", 2)));
 lookup_table.insert(make_pair("ka_count", LookupItem("KA Count", 
"proxy.process.net.dynamic_keep_alive_timeout_in_count", 2)));
 
-lookup_table.insert(make_pair("client_abort", LookupItem("Clnt Abort", 
"proxy.process.http.err_client_abort_count_stat", 2)));
-lookup_table.insert(make_pair("conn_fail", LookupItem("Conn Fail", 
"proxy.process.http.err_connect_fail_count_stat", 2)));
+lookup_table.insert(make_pair("client_abort", LookupItem("Clnt Abort", 
"proxy.process.http.err_client_abort_count", 2)));
+lookup_table.insert(make_pair("conn_fail", LookupItem("Conn Fail", 
"proxy.process.http.err_connect_fail_count", 2)));
 lookup_table.insert(make_pair("abort", LookupItem("Abort", 
"proxy.process.http.transaction_counts.errors.aborts", 2)));
 lookup_table.insert(
   make_pair("t_conn_fail", LookupItem("Conn Fail", 
"proxy.process.http.transaction_counts.errors.connect_failed", 2)));



[trafficserver] branch master updated: Ran clang-tidy over the example plugins (#10532)

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

bcall 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 60672a746c Ran clang-tidy over the example plugins (#10532)
60672a746c is described below

commit 60672a746ce4eec3201681b3f704a331914f3411
Author: Bryan Call 
AuthorDate: Wed Sep 27 09:23:59 2023 -0700

Ran clang-tidy over the example plugins (#10532)
---
 example/plugins/c-api/add_header/add_header.cc | 10 ++---
 .../c-api/append_transform/append_transform.cc | 14 +++---
 example/plugins/c-api/basic_auth/basic_auth.cc | 12 ++---
 .../c-api/bnull_transform/bnull_transform.cc   | 14 +++---
 example/plugins/c-api/denylist_0/denylist_0.cc |  8 ++--
 example/plugins/c-api/denylist_1/denylist_1.cc | 27 ++-
 example/plugins/c-api/file_1/file_1.cc |  2 +-
 example/plugins/c-api/hello/hello.cc   |  2 +-
 .../c-api/lifecycle_plugin/lifecycle_plugin.cc |  6 +--
 .../plugins/c-api/null_transform/null_transform.cc | 12 ++---
 .../plugins/c-api/output_header/output_header.cc   |  8 ++--
 example/plugins/c-api/protocol/Protocol.cc |  4 +-
 example/plugins/c-api/protocol/TxnSM.cc| 52 +++---
 example/plugins/c-api/protocol/TxnSM.h |  7 ++-
 example/plugins/c-api/query_remap/query_remap.cc   | 28 ++--
 example/plugins/c-api/redirect_1/redirect_1.cc |  8 ++--
 .../plugins/c-api/replace_header/replace_header.cc |  8 ++--
 .../plugins/c-api/request_buffer/request_buffer.cc | 16 +++
 .../c-api/response_header_1/response_header_1.cc   | 10 ++---
 example/plugins/c-api/secure_link/secure_link.cc   | 18 
 example/plugins/c-api/server_push/server_push.cc   | 12 ++---
 .../c-api/server_transform/server_transform.cc | 28 ++--
 .../plugins/c-api/session_hooks/session_hooks.cc   |  6 +--
 example/plugins/c-api/thread_1/thread_1.cc |  6 +--
 example/plugins/c-api/thread_pool/psi.cc   | 34 +++---
 example/plugins/c-api/thread_pool/thread.cc|  2 +-
 example/plugins/c-api/thread_pool/thread.h | 17 ---
 example/plugins/c-api/version/version.cc   |  2 +-
 28 files changed, 185 insertions(+), 188 deletions(-)

diff --git a/example/plugins/c-api/add_header/add_header.cc 
b/example/plugins/c-api/add_header/add_header.cc
index 993a856afc..151a6ce161 100644
--- a/example/plugins/c-api/add_header/add_header.cc
+++ b/example/plugins/c-api/add_header/add_header.cc
@@ -32,9 +32,9 @@
  *  ith MIME header to be added to the client request
  */
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include "ts/ts.h"
 #include "tscore/ink_defs.h"
@@ -108,7 +108,7 @@ done:
 static int
 add_header_plugin(TSCont contp, TSEvent event, void *edata)
 {
-  TSHttpTxn txnp = (TSHttpTxn)edata;
+  TSHttpTxn txnp = static_cast(edata);
 
   switch (event) {
   case TS_EVENT_HTTP_READ_REQUEST_HDR:
@@ -138,7 +138,7 @@ TSPluginInit(int argc, const char *argv[])
   }
 
   if (argc < 2) {
-TSError("[%s] Usage: %s \"name1: value1\" \"name2: value2\" ...>", 
PLUGIN_NAME, argv[0]);
+TSError(R"([%s] Usage: %s "name1: value1" "name2: value2" ...>)", 
PLUGIN_NAME, argv[0]);
 goto error;
   }
 
diff --git a/example/plugins/c-api/append_transform/append_transform.cc 
b/example/plugins/c-api/append_transform/append_transform.cc
index 90c772d91d..929cbad3ad 100644
--- a/example/plugins/c-api/append_transform/append_transform.cc
+++ b/example/plugins/c-api/append_transform/append_transform.cc
@@ -36,9 +36,9 @@
  *
  */
 
-#include 
-#include 
-#include 
+#include 
+#include 
+#include 
 
 #include "ts/ts.h"
 #include "tscore/ink_defs.h"
@@ -47,12 +47,12 @@
 
 #define ASSERT_SUCCESS(_x) TSAssert((_x) == TS_SUCCESS)
 
-typedef struct {
+struct MyData {
   TSVIO output_vio;
   TSIOBuffer output_buffer;
   TSIOBufferReader output_reader;
   int append_needed;
-} MyData;
+};
 
 static TSIOBuffer append_buffer;
 static TSIOBufferReader append_buffer_reader;
@@ -63,7 +63,7 @@ my_data_alloc()
 {
   MyData *data;
 
-  data = (MyData *)TSmalloc(sizeof(MyData));
+  data = static_cast(TSmalloc(sizeof(MyData)));
   TSReleaseAssert(data);
 
   data->output_vio= nullptr;
@@ -291,7 +291,7 @@ transform_add(TSHttpTxn txnp)
 static int
 transform_plugin(TSCont contp ATS_UNUSED, TSEvent event, void *edata)
 {
-  TSHttpTxn txnp = (TSHttpTxn)edata;
+  TSHttpTxn txnp = static_cast(edata);
 
   switch (event) {
   case TS_EVENT_HTTP_READ_RESPONSE_HDR:
diff --git a/example/plugins/c-api/basic_auth/basic_auth.cc 
b/example/plugins/c-api/basic_auth/basic_auth.cc
index 581cf5d0e5..2cb92eb86c 100644
--- a/example/plugins/c-api/basic_auth/basic_auth.cc
+++ b/example/plugins/c-api/basic_auth/basic_auth.cc
@@

[trafficserver] branch master updated: macOS compiler error with clang (#10527)

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

bcall 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 e05f6d4a05 macOS compiler error with clang (#10527)
e05f6d4a05 is described below

commit e05f6d4a0587ffd1004a27a3bbf505e7aa71da2f
Author: Bryan Call 
AuthorDate: Tue Sep 26 13:11:45 2023 -0700

macOS compiler error with clang (#10527)

error: braces around scalar initializer
---
 src/tscore/unit_tests/test_ink_string.cc | 152 +++
 1 file changed, 76 insertions(+), 76 deletions(-)

diff --git a/src/tscore/unit_tests/test_ink_string.cc 
b/src/tscore/unit_tests/test_ink_string.cc
index d298389f8c..2e226edfd8 100644
--- a/src/tscore/unit_tests/test_ink_string.cc
+++ b/src/tscore/unit_tests/test_ink_string.cc
@@ -35,47 +35,47 @@ struct int64_item {
 };
 
 constexpr int64_item int64_tests[] = {
-  {{0},{"0"}   },
-  {{1},{"1"}   },
-  {{10},   {"10"}  },
-  {{100},  {"100"} },
-  {{1000}, {"1000"}},
-  {{1},{"1"}   },
-  {{10},   {"10"}  },
-  {{100},  {"100"} },
-  {{1000}, {"1000"}},
-  {{1},{"1"}   },
-  {{10},   {"10"}  },
-  {{100},  {"100"} },
-  {{1000}, {"1000"}},
-  {{1},{"1"}   },
-  {{10},   {"10"}  },
-  {{100},  {"100"} },
-  {{1000}, {"1000"}},
-  {{1},{"1"}   },
-  {{10},   {"10"}  },
-  {{100},  {"100"} },
-  {{-1},   "-1"},
-  {{-10},  "-10"   },
-  {{-100}, "-100"  },
-  {{-1000},"-1000" },
-  {{-1},   "-1"},
-  {{-10},  "-10"   },
-  {{-100}, "-100"  },
-  {{-1000},"-1000" },
-  {{-1},   "-1"},
-  {{-10},  "-10"   },
-  {{-100}, "-100"  },
-  {{-1000},"-1000" },
-  {{-1},   "-1"},
-  {{-10},  "-10"   },
-  {{-100}, "-100"  },
-  {{-1000},"-1000" },
-  {{-1},   "-1"},
-  {{-10},  "-10"   },
-  {{-100}, "-100"  },
-  {{INT64_MAX},{"9223372036854775807"} },
-  {{INT64_MIN},{"-9223372036854775808"}},
+  {0,"0"   },
+  {1,"1"   },
+  {10,   "10"  },
+  {100,  "100" },
+  {1000, "1000"},
+  {1,"1"   },
+  {10,   "10"  },
+  {100,  "100" },
+  {1000, "1000"},
+  {1,"1"   },
+  {10,   "10"  },
+  {100,  "100" },
+  {1000, "1000"},
+  {1,"1"   },
+  {10,   "10"  },
+  {100,  "100" },
+  {1000, "1000"},
+  {1,"1"   },
+  {10,   "10"  },
+  {100,  "100" },
+  {-1,   "-1"  },
+  {-10,  "-1

[trafficserver] branch master updated: Coverity 1508901: Use of 32-bit time_t in access_control plugin (#10506)

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

bcall 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 ffed68edb6 Coverity 1508901: Use of 32-bit time_t in access_control 
plugin (#10506)
ffed68edb6 is described below

commit ffed68edb690c4819dac10b4305ef61add0bcb2d
Author: Bryan Call 
AuthorDate: Mon Sep 25 14:48:20 2023 -0700

Coverity 1508901: Use of 32-bit time_t in access_control plugin (#10506)
---
 plugins/experimental/access_control/access_control.cc |  6 +++---
 plugins/experimental/access_control/access_control.h  |  6 +++---
 plugins/experimental/access_control/common.cc | 15 ++-
 plugins/experimental/access_control/common.h  |  1 +
 4 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/plugins/experimental/access_control/access_control.cc 
b/plugins/experimental/access_control/access_control.cc
index 5ed48f7212..5ed93e0ca5 100644
--- a/plugins/experimental/access_control/access_control.cc
+++ b/plugins/experimental/access_control/access_control.cc
@@ -143,7 +143,7 @@ AccessToken::validateTiming(time_t time)
 
   /* Validate and check not before timestamp */
   if (!_notBefore.empty()) {
-if (0 == (t = string2int(_notBefore))) {
+if (0 == (t = string2time(_notBefore))) {
   return _state = INVALID_FIELD_VALUE;
 } else {
   if (time <= t) {
@@ -154,7 +154,7 @@ AccessToken::validateTiming(time_t time)
 
   /* Validate and check expiration timestamp */
   if (!_expiration.empty()) {
-if (0 == (t = string2int(_expiration))) {
+if (0 == (t = string2time(_expiration))) {
   return _state = INVALID_FIELD_VALUE;
 } else {
   if (time > t) {
@@ -164,7 +164,7 @@ AccessToken::validateTiming(time_t time)
   }
 
   /* "issued at" time-stamp is currently only for info, so check if the 
time-stamp is valid only */
-  if (!_issuedAt.empty() && 0 == string2int(_issuedAt)) {
+  if (!_issuedAt.empty() && 0 == string2time(_issuedAt)) {
 return _state = INVALID_FIELD_VALUE;
   }
 
diff --git a/plugins/experimental/access_control/access_control.h 
b/plugins/experimental/access_control/access_control.h
index 7aefefc5bd..079a201da6 100644
--- a/plugins/experimental/access_control/access_control.h
+++ b/plugins/experimental/access_control/access_control.h
@@ -125,19 +125,19 @@ public:
   time_t
   getExpiration() const
   {
-return string2int(_expiration);
+return string2time(_expiration);
   }
 
   time_t
   getNotBefore() const
   {
-return string2int(_notBefore);
+return string2time(_notBefore);
   }
 
   time_t
   getIssuedAt() const
   {
-return string2int(_issuedAt);
+return string2time(_issuedAt);
   }
 
   StringView
diff --git a/plugins/experimental/access_control/common.cc 
b/plugins/experimental/access_control/common.cc
index dbbd17c2e6..4f71c1f7e5 100644
--- a/plugins/experimental/access_control/common.cc
+++ b/plugins/experimental/access_control/common.cc
@@ -45,10 +45,23 @@ DbgCtl dbg_ctl{PLUGIN_NAME};
 
 int
 string2int(const StringView )
+{
+  int t = 0;
+  try {
+t = std::stoi(String(s));
+  } catch (...) {
+/* Failed to convert return impossible value */
+return 0;
+  }
+  return t;
+}
+
+time_t
+string2time(const StringView )
 {
   time_t t = 0;
   try {
-t = static_cast(std::stoi(String(s)));
+t = static_cast(std::stol(String(s)));
   } catch (...) {
 /* Failed to convert return impossible value */
 return 0;
diff --git a/plugins/experimental/access_control/common.h 
b/plugins/experimental/access_control/common.h
index 0b7f922c41..82d92528fb 100644
--- a/plugins/experimental/access_control/common.h
+++ b/plugins/experimental/access_control/common.h
@@ -74,3 +74,4 @@ using namespace access_control_ns;
 #endif /* ACCESS_CONTROL_UNIT_TEST */
 
 int string2int(const StringView );
+time_t string2time(const StringView );



[trafficserver] branch master updated: Coverity 1508925: Uninitialized scalar field (#10512)

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

bcall 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 3299741278 Coverity 1508925: Uninitialized scalar field (#10512)
3299741278 is described below

commit 32997412786f87f1dcc27314f17772e064bcfbd7
Author: Bryan Call 
AuthorDate: Mon Sep 25 12:38:47 2023 -0700

Coverity 1508925: Uninitialized scalar field (#10512)

IPCSocketClient member _server wasn't initialized in the constructor
---
 include/shared/rpc/IPCSocketClient.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/shared/rpc/IPCSocketClient.h 
b/include/shared/rpc/IPCSocketClient.h
index 250dee0e18..d738734a2a 100644
--- a/include/shared/rpc/IPCSocketClient.h
+++ b/include/shared/rpc/IPCSocketClient.h
@@ -45,8 +45,7 @@ struct IPCSocketClient {
   enum class ReadStatus { NO_ERROR = 0, BUFFER_FULL, STREAM_ERROR, UNKNOWN };
   using self_reference = IPCSocketClient &;
 
-  IPCSocketClient(std::string path) : _path{std::move(path)} {}
-  IPCSocketClient() : _path{"/tmp/jsonrpc20.sock"} {}
+  IPCSocketClient(std::string path = "/tmp/jsonrpc20.sock") : 
_path{std::move(path)} { memset(&_server, 0, sizeof(_server)); }
 
   ~IPCSocketClient() { this->disconnect(); }
 



[trafficserver] branch master updated: Coverity 1497353: Use of 32-bit time_t (#10505)

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

bcall 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 daa13fc97a Coverity 1497353: Use of 32-bit time_t (#10505)
daa13fc97a is described below

commit daa13fc97ad89d7eb5ea58b0ec97382486a749e7
Author: Bryan Call 
AuthorDate: Mon Sep 25 12:35:07 2023 -0700

Coverity 1497353: Use of 32-bit time_t (#10505)

*Found a couple bugs when fixing the 32bit time_t issue:
1. ink_atoui was returning a max value of INT_MAX instead of UINT_MAX.
2. mime_field_value_set_uint64 had too short of a buffer.
---
 include/tscore/ParseRules.h  |   6 +-
 proxy/hdrs/MIME.cc   |   2 +-
 proxy/hdrs/MIME.h|   3 +
 src/tscore/CMakeLists.txt|   1 +
 src/tscore/unit_tests/test_ink_string.cc | 170 +++
 5 files changed, 178 insertions(+), 4 deletions(-)

diff --git a/include/tscore/ParseRules.h b/include/tscore/ParseRules.h
index ea7c783050..10c26df3f1 100644
--- a/include/tscore/ParseRules.h
+++ b/include/tscore/ParseRules.h
@@ -872,8 +872,8 @@ ink_atoui(const char *str)
 {
   uint64_t val = ink_atoui64(str);
 
-  if (val > INT_MAX)
-return INT_MAX;
+  if (val > UINT_MAX)
+return UINT_MAX;
   else
-return static_cast(val);
+return static_cast(val);
 }
diff --git a/proxy/hdrs/MIME.cc b/proxy/hdrs/MIME.cc
index 527bbda556..4062e1f96c 100644
--- a/proxy/hdrs/MIME.cc
+++ b/proxy/hdrs/MIME.cc
@@ -2187,7 +2187,7 @@ mime_field_value_set_uint(HdrHeap *heap, MIMEHdrImpl *mh, 
MIMEField *field, uint
 void
 mime_field_value_set_int64(HdrHeap *heap, MIMEHdrImpl *mh, MIMEField *field, 
int64_t value)
 {
-  char buf[20];
+  char buf[21];
   int len = mime_format_int64(buf, value, sizeof(buf));
   mime_field_value_set(heap, mh, field, buf, len, true);
 }
diff --git a/proxy/hdrs/MIME.h b/proxy/hdrs/MIME.h
index e91b412069..d215772c27 100644
--- a/proxy/hdrs/MIME.h
+++ b/proxy/hdrs/MIME.h
@@ -917,6 +917,7 @@ int mime_field_length_get(MIMEField *field);
 int mime_format_int(char *buf, int32_t val, size_t buf_len);
 int mime_format_uint(char *buf, uint32_t val, size_t buf_len);
 int mime_format_int64(char *buf, int64_t val, size_t buf_len);
+int mime_format_uint64(char *buf, uint64_t val, size_t buf_len);
 
 void mime_days_since_epoch_to_mdy_slowcase(unsigned int days_since_jan_1_1970, 
int *m_return, int *d_return, int *y_return);
 void mime_days_since_epoch_to_mdy(unsigned int days_since_jan_1_1970, int 
*m_return, int *d_return, int *y_return);
@@ -1856,6 +1857,8 @@ MIMEHdr::set_age(time_t value)
 if (sizeof(time_t) > 4) {
   value_set_int64(MIME_FIELD_AGE, MIME_LEN_AGE, value);
 } else {
+  // Only on systems where time_t is 32 bits
+  // coverity[Y2K38_SAFETY]
   value_set_uint(MIME_FIELD_AGE, MIME_LEN_AGE, value);
 }
   }
diff --git a/src/tscore/CMakeLists.txt b/src/tscore/CMakeLists.txt
index ebffeb7e6e..752b5171a5 100644
--- a/src/tscore/CMakeLists.txt
+++ b/src/tscore/CMakeLists.txt
@@ -161,6 +161,7 @@ add_executable(test_tscore
 unit_tests/test_arena.cc
 unit_tests/test_ink_inet.cc
 unit_tests/test_ink_memory.cc
+unit_tests/test_ink_string.cc
 unit_tests/test_layout.cc
 unit_tests/test_scoped_resource.cc
 unit_tests/unit_test_main.cc
diff --git a/src/tscore/unit_tests/test_ink_string.cc 
b/src/tscore/unit_tests/test_ink_string.cc
new file mode 100644
index 00..d298389f8c
--- /dev/null
+++ b/src/tscore/unit_tests/test_ink_string.cc
@@ -0,0 +1,170 @@
+/** @file
+
+test ink_string.h - string utility functions
+
+@section license License
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+#include 
+#include 
+#include 
+#include 
+
+//-
+// ink_fast_ltoa test
+//-
+struct int64_item {
+  int64_t n;
+  std::string_view s;
+};
+
+constexpr int64_item int64_tests[] = {
+ 

[trafficserver] branch master updated: Assigning variables in asserts in the example intercept plugin (#10516)

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

bcall 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 0303be8ea8 Assigning variables in asserts in the example intercept 
plugin (#10516)
0303be8ea8 is described below

commit 0303be8ea8157dc3fbb8d86156ff6fcdfd2f9626
Author: Bryan Call 
AuthorDate: Mon Sep 25 11:47:20 2023 -0700

Assigning variables in asserts in the example intercept plugin (#10516)

Coverity 1518611: Side effect in assertion
Coverity 1518597: Side effect in assertion
Coverity 1518596: Side effect in assertion
Coverity 1518595: Side effect in assertion
Coverity 1518570: Side effect in assertion
---
 example/plugins/c-api/intercept/intercept.cc | 17 +++--
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/example/plugins/c-api/intercept/intercept.cc 
b/example/plugins/c-api/intercept/intercept.cc
index c1bc1f93e9..e6b8aa98f2 100644
--- a/example/plugins/c-api/intercept/intercept.cc
+++ b/example/plugins/c-api/intercept/intercept.cc
@@ -91,8 +91,11 @@ struct InterceptIOChannel {
   read(TSVConn vc, TSCont contp)
   {
 TSReleaseAssert(this->vio == nullptr);
-TSReleaseAssert((this->iobuf = TSIOBufferCreate()));
-TSReleaseAssert((this->reader = TSIOBufferReaderAlloc(this->iobuf)));
+
+this->iobuf = TSIOBufferCreate();
+TSReleaseAssert(this->iobuf);
+this->reader = TSIOBufferReaderAlloc(this->iobuf);
+TSReleaseAssert(this->reader);
 
 this->vio = TSVConnRead(vc, contp, this->iobuf, INT64_MAX);
   }
@@ -101,8 +104,10 @@ struct InterceptIOChannel {
   write(TSVConn vc, TSCont contp)
   {
 TSReleaseAssert(this->vio == nullptr);
-TSReleaseAssert((this->iobuf = TSIOBufferCreate()));
-TSReleaseAssert((this->reader = TSIOBufferReaderAlloc(this->iobuf)));
+this->iobuf = TSIOBufferCreate();
+TSReleaseAssert(this->iobuf);
+this->reader = TSIOBufferReaderAlloc(this->iobuf);
+TSReleaseAssert(this->reader);
 
 this->vio = TSVConnWrite(vc, contp, this->reader, INT64_MAX);
   }
@@ -205,9 +210,9 @@ union argument_type {
 static TSCont
 InterceptContCreate(TSEventFunc hook, TSMutex mutexp, void *data)
 {
-  TSCont contp;
+  TSCont contp = TSContCreate(hook, mutexp);
+  TSReleaseAssert(contp);
 
-  TSReleaseAssert((contp = TSContCreate(hook, mutexp)));
   TSContDataSet(contp, data);
   return contp;
 }



[trafficserver] branch master updated: Coverity 1518607: Use of 32-bit time_t (#10502)

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

bcall 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 eda0bd72c0 Coverity 1518607: Use of 32-bit time_t (#10502)
eda0bd72c0 is described below

commit eda0bd72c0f2ea076d7132ce322c8f53de54dd09
Author: Bryan Call 
AuthorDate: Mon Sep 25 06:58:10 2023 -0700

Coverity 1518607: Use of 32-bit time_t (#10502)
---
 proxy/http/remap/NextHopConsistentHash.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/proxy/http/remap/NextHopConsistentHash.cc 
b/proxy/http/remap/NextHopConsistentHash.cc
index 6f06e1c267..36467a627b 100644
--- a/proxy/http/remap/NextHopConsistentHash.cc
+++ b/proxy/http/remap/NextHopConsistentHash.cc
@@ -406,7 +406,7 @@ NextHopConsistentHash::findNextHop(TSHttpTxn txnp, void 
*ih, time_t now)
 // for retry.
 if (!pRec->available.load() && host_stat == TS_HOST_STATUS_UP) {
   _now == 0 ? _now = time(nullptr) : _now = now;
-  if ((pRec->failedAt.load() + retry_time) < 
static_cast(_now)) {
+  if ((pRec->failedAt.load() + retry_time) < _now) {
 nextHopRetry   = true;
 result.last_parent = pRec->host_index;
 result.last_lookup = pRec->group_index;



[trafficserver] branch master updated: Coverity 1022028: Unchecked return value from library (#10508)

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

bcall 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 cac837ec3b Coverity 1022028: Unchecked return value from library 
(#10508)
cac837ec3b is described below

commit cac837ec3b26791c1fa631b9ffa8361a93246d96
Author: Bryan Call 
AuthorDate: Mon Sep 25 06:55:59 2023 -0700

Coverity 1022028: Unchecked return value from library (#10508)

logcat wasn't checking the return value on posix_fadvise()
---
 src/traffic_logcat/logcat.cc | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/traffic_logcat/logcat.cc b/src/traffic_logcat/logcat.cc
index c1b337e638..6a07a95b7b 100644
--- a/src/traffic_logcat/logcat.cc
+++ b/src/traffic_logcat/logcat.cc
@@ -309,11 +309,15 @@ main(int /* argc ATS_UNUSED */, const char *argv[])
 // that we plan on reading the entire file so the kernel can do
 // some fancy optimizations.
 if (!follow_flag) {
-  posix_fadvise(in_fd, 0, 0, POSIX_FADV_WILLNEED);
+  if (posix_fadvise(in_fd, 0, 0, POSIX_FADV_WILLNEED) != 0) {
+fprintf(stderr, "Error while trying to advise kernel about file 
access pattern: %s\n", strerror(errno));
+  }
 }
 
 // We're always reading the file sequentially so this will always help
-posix_fadvise(in_fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+if (posix_fadvise(in_fd, 0, 0, POSIX_FADV_SEQUENTIAL) != 0) {
+  fprintf(stderr, "Error while trying to advise kernel about file 
access pattern: %s\n", strerror(errno));
+}
 #endif
 if (auto_filenames) {
   // change .blog to .log
@@ -377,7 +381,9 @@ main(int /* argc ATS_UNUSED */, const char *argv[])
 #if HAVE_POSIX_FADVISE
   // Now that we're done reading a potentially large log file, we can tell 
the kernel that it's OK to evict
   // the associated log file pages from cache
-  posix_fadvise(in_fd, 0, 0, POSIX_FADV_DONTNEED);
+  if (posix_fadvise(in_fd, 0, 0, POSIX_FADV_DONTNEED) != 0) {
+fprintf(stderr, "Error while trying to advise kernel about file access 
pattern: %s\n", strerror(errno));
+  }
 #endif
 }
   } else {



[trafficserver] branch master updated: Coverity 1518610: Uninitialized scalar field (#10509)

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

bcall 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 dd0509387b Coverity 1518610: Uninitialized scalar field (#10509)
dd0509387b is described below

commit dd0509387b7ee7e4e6b9563af075eee741dcfc36
Author: Bryan Call 
AuthorDate: Mon Sep 25 06:55:11 2023 -0700

Coverity 1518610: Uninitialized scalar field (#10509)
---
 plugins/experimental/icap/icap_plugin.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/experimental/icap/icap_plugin.cc 
b/plugins/experimental/icap/icap_plugin.cc
index b1fee8dbf1..2ba11cff8d 100644
--- a/plugins/experimental/icap/icap_plugin.cc
+++ b/plugins/experimental/icap/icap_plugin.cc
@@ -60,7 +60,7 @@ struct TransformData {
   State state = State::BEGIN;
   const TSHttpTxn txn;
 
-  int64_t server_reply_content_length;
+  int64_t server_reply_content_length = 0;
 
   TSIOBuffer input_buf  = nullptr;
   TSIOBufferReader input_reader = nullptr;



[trafficserver] branch master updated: Coverity 1518592: Uninitialized pointer field (#10510)

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

bcall 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 ce3688a87e Coverity 1518592: Uninitialized pointer field (#10510)
ce3688a87e is described below

commit ce3688a87e8a38e3ea9945ecc92017cfe7d2639a
Author: Bryan Call 
AuthorDate: Mon Sep 25 06:53:54 2023 -0700

Coverity 1518592: Uninitialized pointer field (#10510)

Some uninitialized pointers in cachekey plugin class CacheKey
---
 plugins/cachekey/cachekey.h | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/plugins/cachekey/cachekey.h b/plugins/cachekey/cachekey.h
index 5dea72fecf..1f7331ad70 100644
--- a/plugins/cachekey/cachekey.h
+++ b/plugins/cachekey/cachekey.h
@@ -80,12 +80,12 @@ private:
  void (*fun)(const ConfigHeaders , const String 
_s, const String _s, T ));
 
   /* Information from the request */
-  TSHttpTxn _txn;  /**< @brief transaction handle */
-  TSMBuffer _buf;  /**< @brief marshal buffer */
-  TSMLoc _url; /**< @brief URI handle */
-  TSMLoc _hdrs;/**< @brief headers handle */
-  bool _valid = false; /**< @brief shows if the constructor discovered the 
input correctly */
-  bool _remap = false; /**< @brief shows if the input URI was from remap info 
*/
+  TSHttpTxn _txn = nullptr; /**< @brief transaction handle */
+  TSMBuffer _buf = nullptr; /**< @brief marshal buffer */
+  TSMLoc _url= nullptr; /**< @brief URI handle */
+  TSMLoc _hdrs   = nullptr; /**< @brief headers handle */
+  bool _valid= false;   /**< @brief shows if the constructor discovered 
the input correctly */
+  bool _remap= false;   /**< @brief shows if the input URI was from remap 
info */
 
   String _key;  /**< @brief cache key */
   String _separator;/**< @brief a separator used to 
separate the cache key elements extracted from the URI */



  1   2   3   4   5   6   7   8   9   10   >