[trafficserver] 01/02: More changes

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

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

commit ad9f7bd444177b5ad6c7c975d28c341db50b6e5d
Author: Leif Hedstrom 
AuthorDate: Fri Nov 8 14:43:54 2019 -0700

More changes
---
 CHANGELOG-9.0.0 | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/CHANGELOG-9.0.0 b/CHANGELOG-9.0.0
index fa2dd59..a0f715a 100644
--- a/CHANGELOG-9.0.0
+++ b/CHANGELOG-9.0.0
@@ -599,6 +599,7 @@ Changes with Apache Traffic Server 9.0.0
   #5632 - Fix up remaining references to ssl_server_name.yaml
   #5633 - HTTP/2: increment write_vio.ndone by consumed size
   #5634 - HTTP/2: cancel reading buffer when ATS received GOAWAY
+  #5635 - Add AUTest using h2spec
   #5636 - HTTP/2: ignore unknown settings
   #5637 - TextView: Fix bug in rtrim_if when entire view is cleared.
   #5639 - update example directory structure and add examples for lua plugin
@@ -722,6 +723,7 @@ Changes with Apache Traffic Server 9.0.0
   #5889 - Provide stats for the recently introduced HTTP/2 rate limits
   #5892 - ProxySsn renaming member vars
   #5893 - Cleanup: Remove unused AllocType and unused functions
+  #5901 - Dechunk chunked contents on HttpTunnel if client protocol is HTTP/2 
or HTTP/3
   #5902 - Ran clang-format
   #5903 - Reduce unnecesary IOBufferBlock allocation
   #5905 - Update Server IP in Transaction when attaching a session from the 
pool
@@ -767,8 +769,10 @@ Changes with Apache Traffic Server 9.0.0
   #6066 - Fixing session sharing with IP matching.
   #6070 - Updated API header and ssl_session_reuse for new TSSslSessionInsert 
changes
   #6071 - Premature DSO unload with "suicidal" continuations
+  #6074 - Allow txn handler to be set from ssn on same hook
   #6076 - Issue 4635: Address pipe reuse after configuration reload issues
   #6078 - Cleanup: Ignore checkprograms of remap
+  #6085 - Only decrement log_stat_log_files_open_stat when the file is closed.
   #6089 - Make If-Range date compare to be exact match
   #6094 - Issue #4294: Handle return value of SSL_write() properly
   #6095 - For remap_stats, removes configure time dependency on search.h
@@ -778,10 +782,17 @@ Changes with Apache Traffic Server 9.0.0
   #6116 - Updated to clang-format v9.0.0
   #6120 - Fix null pointer dereference reported by clang-analyzer
   #6125 - Add Metrics to track SSL Handshake attempts
+  #6126 - Fix the thread ready check
   #6129 - Adding an autest for traffic_dump.
   #6131 - Remove never implemented 
HttpTransact::service_transaction_in_proxy_only_mode
+  #6132 - Normalize loopback usage in session_match autest
   #6134 - Removes the records.config.shadow alternative config file
+  #6138 - tests: Adds autest for WebSocket mappings
+  #6139 - tests: fixes various python code issues found by pyflakes
   #6140 - Remove using namespace std
   #6141 - Update docs for SSL Handshake stats
   #6145 - Remove including sys/sysctl.h for Linux
+  #6147 - Reverse debug specific check.
   #6148 - Disable the most expensive "make check" tests by default
+  #6156 - Fix building Catch on macOS
+  #6159 - Detect bogus jemalloc version



[trafficserver] branch 9.0.x updated (ffcc973 -> 52b04a0)

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

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


from ffcc973  Reduce doc build errors
 new ad9f7bd  More changes
 new 52b04a0  Updated ChangeLog

The 2 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:
 CHANGELOG-9.0.0 | 36 ++--
 1 file changed, 34 insertions(+), 2 deletions(-)



[trafficserver] branch 8.0.x updated: Replaces Python -> Python3 in a few utilities (#6187)

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

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


The following commit(s) were added to refs/heads/8.0.x by this push:
 new 3d2c4e6  Replaces Python -> Python3 in a few utilities (#6187)
3d2c4e6 is described below

commit 3d2c4e6f65b0b0dee8f50e01dcf90626c4303e0a
Author: Leif Hedstrom 
AuthorDate: Mon Nov 18 14:56:49 2019 +0800

Replaces Python -> Python3 in a few utilities (#6187)


(cherry picked from commit ae62e8a120eb4ea6d5925917fe9db11b8d5d0bf0)
---
 contrib/python/compare_RecordsConfigcc.py | 36 +++
 contrib/python/compare_records_config.py  |  4 ++--
 tools/check-unused-dependencies   |  2 +-
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/contrib/python/compare_RecordsConfigcc.py 
b/contrib/python/compare_RecordsConfigcc.py
old mode 100644
new mode 100755
index 41992aa..802c718
--- a/contrib/python/compare_RecordsConfigcc.py
+++ b/contrib/python/compare_RecordsConfigcc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -23,8 +23,8 @@ import string
 try:
 src_dir = sys.argv[1]
 except IndexError:
-print "Usage: %s [trafficserver_source_dir]" % sys.argv[0]
-print "Compares values in RecordsConfig.cc with the default records.config 
file"
+print("Usage: %s [trafficserver_source_dir]" % sys.argv[0])
+print("Compares values in RecordsConfig.cc with the default records.config 
file")
 sys.exit(1)
 
 # We expect these keys to differ between files, so ignore them
@@ -56,12 +56,12 @@ with open("%s/mgmt/RecordsConfig.cc" % src_dir) as fh:
 m = cc_re.search(line)
 if m:
 value = m.group(3)
-value = string.lstrip(value, '"')
-value = string.rstrip(value, '"')
+value = value.lstrip('"')
+value = value.rstrip('"')
 rc_cc[m.group(1)] = (m.group(2), value)
 
 # Process records.config.default.in
-with open("%s/proxy/config/records.config.default.in" % src_dir) as fh:
+with open("%s/configs/records.config.default.in" % src_dir) as fh:
 in_re = re.compile(r'(?:CONFIG|LOCAL) (\S+)\s+(\S+)\s+(\S+)')
 for line in fh:
 m = in_re.match(line)
@@ -81,37 +81,37 @@ with open("%s/doc/admin-guide/files/records.config.en.rst" 
% src_dir) as fh:
 # Compare the two
 # If a value is in RecordsConfig.cc  and not records.config.default.in, it is
 # ignored right now.
-print "# Comparing RecordsConfig.cc -> records.config.default.in"
+print("# Comparing RecordsConfig.cc -> records.config.default.in")
 for key in rc_in:
 if key in ignore_keys:
 continue
 if key not in rc_cc:
-print "%s missing -> %s" % (key, "%s %s" % rc_in[key])
+print("%s missing -> %s" % (key, "%s %s" % rc_in[key]))
 continue
 if rc_cc[key] != rc_in[key]:
-print "%s : %s -> %s" % (key, "%s %s" % rc_cc[key], "%s %s" % 
rc_in[key])
+print("%s : %s -> %s" % (key, "%s %s" % rc_cc[key], "%s %s" % 
rc_in[key]))
 
 # Search for undocumented variables ...
 missing = [k for k in rc_cc if k not in rc_doc]
 if len(missing) > 0:
-print
-print "Undocumented configuration variables:"
+print()
+print("Undocumented configuration variables:")
 for m in sorted(missing):
-print "\t%s %s" % (m, "%s %s" % rc_cc[m])
+print("\t%s %s" % (m, "%s %s" % rc_cc[m]))
 
 # Search for incorrectly documented default values ...
 defaults = [k for k in rc_cc if k in rc_doc and rc_cc[k] != rc_doc[k]]
 if len(defaults) > 0:
-print
-print "Incorrectly documented defaults:"
+print()
+print("Incorrectly documented defaults:")
 for d in sorted(defaults):
-print "\t%s %s -> %s" % (d, "%s %s" % rc_cc[d], "%s %s" % rc_doc[d])
+print("\t%s %s -> %s" % (d, "%s %s" % rc_cc[d], "%s %s" % rc_doc[d]))
 
 
 # Search for stale documentation ...
 stale = [k for k in rc_doc if k not in rc_cc]
 if (len(stale) > 0):
-print
-print "Stale documentation:"
+print()
+print("Stale documentation:")
 for s in sorted(stale):
-print "\t%s" % (s)
+print("\t%s" % (s))
diff --git a/contrib/python/compare_records_config.py 
b/contrib/python/compare_records_config.py
old mode 100644
new mode 100755
index acde26a..bd610a9
--- a/contrib/python/compare_records_config.py
+++ b/contrib/python/compare_records_config.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -61,7 +61,7 @@ def compare_settings(old, new):
 # Skip predefined values
 continue
 if old[key] != new[key]:
-print "%s %s -> %s" % (key, old[key], new[key])

[trafficserver] 02/02: Reduce doc build errors

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

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

commit ffcc9737e55728def769fea46c2f49031291db89
Author: Miles Libbey 
AuthorDate: Wed Nov 6 17:54:27 2019 -0800

Reduce doc build errors

Had these build errors
trafficserver/doc/admin-guide/plugins/slice.en.rst:141: WARNING: Literal 
block expected; none found.
trafficserver/doc/developer-guide/debugging/debug-builds.en.rst:47: 
WARNING: Inline emphasis start-string without end-string.
trafficserver/doc/release-notes/whats-new.en.rst:36: WARNING: Title 
underline too short.

Fixes were
- Added indentation to slice code block
- The * in *BSD needed escaping
- Added and extra underline

(cherry picked from commit ca01eac678e99c7639f151a0d6c6969bfd749ccf)

 Conflicts:
doc/release-notes/whats-new.en.rst
---
 doc/admin-guide/plugins/slice.en.rst  | 4 ++--
 doc/developer-guide/debugging/debug-builds.en.rst | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/admin-guide/plugins/slice.en.rst 
b/doc/admin-guide/plugins/slice.en.rst
index f928fa1..e848312 100644
--- a/doc/admin-guide/plugins/slice.en.rst
+++ b/doc/admin-guide/plugins/slice.en.rst
@@ -138,9 +138,9 @@ Under normal logging these slice block errors tend to show 
up as::
 By default more detailed stitching errors are written to ``diags.log``.
 Examples are as follows::
 
-ERROR: [slice.cc: 288] logSliceError(): 1555705573.639 reason="Non 206 
internal block response" uri="http://ats_ep/someasset.mp4; uas="curl" 
req_range="bytes=100-" norm_range="bytes 100-52428799/52428800" 
etag_exp="%221603934496%22" lm_exp="Fri, 19 Apr 2019 18:53:20 GMT" 
blk_range="2100-2199" status_got="206" cr_got="" 
etag_got="%221603934496%22" lm_got="" cc="no-store" via=""
+ERROR: [slice.cc: 288] logSliceError(): 1555705573.639 reason="Non 206 
internal block response" uri="http://ats_ep/someasset.mp4; uas="curl" 
req_range="bytes=100-" norm_range="bytes 100-52428799/52428800" 
etag_exp="%221603934496%22" lm_exp="Fri, 19 Apr 2019 18:53:20 GMT" 
blk_range="2100-2199" status_got="206" cr_got="" 
etag_got="%221603934496%22" lm_got="" cc="no-store" via=""
 
-ERROR: [server.cc: 288] logSliceError(): 157237.219 reason="Mismatch block 
Etag" uri="http://ats_ep/someasset.mp4; uas="curl" 
req_range="bytes=1092779033-1096299354" norm_range="bytes 
1092779033-1096299354/2147483648" etag_exp="%223719843648%22" lm_exp="Tue, 29 
Oct 2019 14:40:00 GMT" blk_range="109500-109599" status_got="206" 
cr_got="bytes 109500-109599/2147483648" etag_got="%223719853648%22" 
lm_got="Tue, 29 Oct 2019 17:26:40 GMT" cc="max-age=1" via=""
+ERROR: [server.cc: 288] logSliceError(): 157237.219 reason="Mismatch 
block Etag" uri="http://ats_ep/someasset.mp4; uas="curl" 
req_range="bytes=1092779033-1096299354" norm_range="bytes 
1092779033-1096299354/2147483648" etag_exp="%223719843648%22" lm_exp="Tue, 29 
Oct 2019 14:40:00 GMT" blk_range="109500-109599" status_got="206" 
cr_got="bytes 109500-109599/2147483648" etag_got="%223719853648%22" 
lm_got="Tue, 29 Oct 2019 17:26:40 GMT" cc="max-age=1" via=""
 
 Whether or how often these detailed log entries are written are
 configurable plugin options.
diff --git a/doc/developer-guide/debugging/debug-builds.en.rst 
b/doc/developer-guide/debugging/debug-builds.en.rst
index d1e823f..099312b 100644
--- a/doc/developer-guide/debugging/debug-builds.en.rst
+++ b/doc/developer-guide/debugging/debug-builds.en.rst
@@ -45,7 +45,7 @@ SystemTap and DTrace support
 
 
 Traffic Server can be instrumented with **SystemTap** on Linux systems, or
-**DTrace** on *BSDs and macOS. In order to use such tools, Traffic Server needs
+**DTrace** on \*BSDs and macOS. In order to use such tools, Traffic Server 
needs
 to be built with ``-g``, or the debug symbols need to be installed. On Debian
 systems, install the ``trafficserver-dbgsym`` package to install the debug
 symbols.



[trafficserver] branch 9.0.x updated (5841e56 -> ffcc973)

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

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


from 5841e56  Add test to catch regressions in sni and override configs 
(#6170)
 new c7e32a8  Add basic SystemTap markers support
 new ffcc973  Reduce doc build errors

The 2 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:
 configure.ac| 19 +++
 doc/admin-guide/plugins/slice.en.rst|  4 ++--
 doc/developer-guide/debugging/debug-builds.en.rst   | 19 +++
 doc/release-notes/whats-new.en.rst  |  1 +
 .../background_fetch/headers.h => include/ts/sdt.h  | 21 -
 proxy/http/HttpSM.cc|  3 +++
 6 files changed, 60 insertions(+), 7 deletions(-)
 copy plugins/background_fetch/headers.h => include/ts/sdt.h (68%)



[trafficserver] 01/02: Add basic SystemTap markers support

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

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

commit c7e32a84eb724e45a6ef18e55aa9a41e4b71a644
Author: Emanuele Rocca 
AuthorDate: Thu Oct 10 13:48:43 2019 -0700

Add basic SystemTap markers support

Introduce a new ./configure flag, --enable-systemtap, to build
traffic_server with SystemTap markers support. Also include a marker
called "new_origin_server_connection" under the "trafficserver"
provider.

See https://sourceware.org/systemtap/wiki/AddingUserSpaceProbingToApps

(cherry picked from commit dd27599720cfccbfd77fa20e47f529fa972d0469)
---
 configure.ac  | 19 +++
 doc/developer-guide/debugging/debug-builds.en.rst | 19 +++
 doc/release-notes/whats-new.en.rst|  1 +
 include/ts/sdt.h  | 40 +++
 proxy/http/HttpSM.cc  |  3 ++
 5 files changed, 82 insertions(+)

diff --git a/configure.ac b/configure.ac
index 8a9bb93..c03c6df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2085,6 +2085,25 @@ AC_CHECK_TYPE([struct tcp_info],
   ]]
 )
 
+AC_MSG_CHECKING([whether to include systemtap tracing support])
+AC_ARG_ENABLE([systemtap],
+  [AS_HELP_STRING([--enable-systemtap],
+  [Enable inclusion of systemtap trace support])],
+  [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no'])
+AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes])
+AC_MSG_RESULT(${ENABLE_SYSTEMTAP})
+
+if test "x${ENABLE_SYSTEMTAP}" = xyes; then
+  AC_CHECK_PROGS(DTRACE, dtrace)
+  if test -z "$DTRACE"; then
+AC_MSG_ERROR([dtrace not found])
+  fi
+  AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'],
+  [SDT_H_FOUND='no';
+ AC_MSG_ERROR([systemtap support needs sys/sdt.h header])])
+  AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using probes.])
+fi
+
 # See if we can build the remap_stats plugin
 AS_IF([test "x$enable_experimental_plugins" = "xyes"],
   [
diff --git a/doc/developer-guide/debugging/debug-builds.en.rst 
b/doc/developer-guide/debugging/debug-builds.en.rst
index 53ad22c..d1e823f 100644
--- a/doc/developer-guide/debugging/debug-builds.en.rst
+++ b/doc/developer-guide/debugging/debug-builds.en.rst
@@ -41,3 +41,22 @@ Debugging Tips:
 -  Use assertions in your plugin (:c:func:`TSAssert` and 
:c:func:`TSReleaseAssert`).
 
 
+SystemTap and DTrace support
+
+
+Traffic Server can be instrumented with **SystemTap** on Linux systems, or
+**DTrace** on *BSDs and macOS. In order to use such tools, Traffic Server needs
+to be built with ``-g``, or the debug symbols need to be installed. On Debian
+systems, install the ``trafficserver-dbgsym`` package to install the debug
+symbols.
+
+In addition to the normal probe points that can be used with SystemTap and
+DTrace, such as function calls and specific statements, Traffic Server does
+provide SDT markers at various interesting code paths.
+
+Pass the ``--enable-systemtap`` flag to ``./configure`` in order to build
+Traffic Server with dtrace style markers (SDT). On Traffic Server builds with
+SDT markers enabled, you can list the available markers with ``stap -L
+'process("/path/to/traffic_server").mark("*")``.
+
+See the `SystemTap documentation 
`_ and the 
`DTrace guide `_ for more information.
diff --git a/doc/release-notes/whats-new.en.rst 
b/doc/release-notes/whats-new.en.rst
index 93486a0..4ddf378 100644
--- a/doc/release-notes/whats-new.en.rst
+++ b/doc/release-notes/whats-new.en.rst
@@ -29,6 +29,7 @@ of  contributors have participated in this development 
cycle.
 
 New Features
 
+- Add support for dtrace style markers (SDT) and include a few markers at 
locations of interest to users of SystemTap, dtrace, and gdb. See 
:ref:`developer-debug-builds`.
 
 This version of ATS has a number of new features (details below), but we're
 particularly excited about the following features:
diff --git a/include/ts/sdt.h b/include/ts/sdt.h
new file mode 100644
index 000..68f8d92
--- /dev/null
+++ b/include/ts/sdt.h
@@ -0,0 +1,40 @@
+/** @file
+
+A brief file description
+
+@section license License
+
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law 

[trafficserver] branch 8.0.x updated (37c74b4 -> 0ba786d)

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

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


from 37c74b4  Fixes a segfault that may occur when the debug and a lookup 
fails to find an entry in the hoststatus hash table.
 new 22c76f0  Fix building Catch on macOS
 new 0ba786d  Fixed issue with macOS Catalina and pcre 8.43 enabling 
pcre-jit (#6189)

The 2 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/tscore/Regex.cc | 8 
 tests/include/catch.hpp | 5 -
 2 files changed, 8 insertions(+), 5 deletions(-)



[trafficserver] 01/02: Fix building Catch on macOS

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

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

commit 22c76f0549f7a69015e6904f66ed7bf96073aec9
Author: Masaori Koshiba 
AuthorDate: Fri Nov 8 14:16:22 2019 +0900

Fix building Catch on macOS

(cherry picked from commit 98b0aeaa122ac4c2711e955003c474071c8f2086)
---
 tests/include/catch.hpp | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/include/catch.hpp b/tests/include/catch.hpp
index d7bb037..bc24a42 100644
--- a/tests/include/catch.hpp
+++ b/tests/include/catch.hpp
@@ -7093,6 +7093,10 @@ namespace Catch {
 #  include 
 #  include 
 #  include 
+
+// ink_autoconf.h is required to use HAVE_SYS_SYSCTL_H
+#include "ink_autoconf.h"
+
 #if defined(darwin) || defined(freebsd)
 #ifdef HAVE_SYS_SYSCTL_H
 #  include 
@@ -13051,4 +13055,3 @@ using Catch::Detail::Approx;
 // end catch_reenable_warnings.h
 // end catch.hpp
 #endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-



[trafficserver] 02/02: Fixed issue with macOS Catalina and pcre 8.43 enabling pcre-jit (#6189)

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

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

commit 0ba786d7ae44b313c3f9c03e744c47ac971b0120
Author: Bryan Call 
AuthorDate: Mon Nov 18 18:38:34 2019 +0800

Fixed issue with macOS Catalina and pcre 8.43 enabling pcre-jit (#6189)


(cherry picked from commit 093317c808b01304abf0a6b4aaf9c34791e3e08e)
---
 src/tscore/Regex.cc | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/tscore/Regex.cc b/src/tscore/Regex.cc
index 1a6cbed..cdb5651 100644
--- a/src/tscore/Regex.cc
+++ b/src/tscore/Regex.cc
@@ -26,7 +26,7 @@
 #include "tscore/ink_memory.h"
 #include "tscore/Regex.h"
 
-#ifdef PCRE_CONFIG_JIT
+#if defined(PCRE_CONFIG_JIT) && !defined(darwin) // issue with macOS Catalina 
and pcre 8.43
 struct RegexThreadKey {
   RegexThreadKey() { ink_thread_key_create(>key, (void (*)(void *)) & 
pcre_jit_stack_free); }
   ink_thread_key key;
@@ -74,13 +74,13 @@ Regex::compile(const char *pattern, const unsigned flags)
 return false;
   }
 
-#ifdef PCRE_CONFIG_JIT
+#if defined(PCRE_CONFIG_JIT) && !defined(darwin) // issue with macOS Catalina 
and pcre 8.43
   study_opts |= PCRE_STUDY_JIT_COMPILE;
 #endif
 
   regex_extra = pcre_study(regex, study_opts, );
 
-#ifdef PCRE_CONFIG_JIT
+#if defined(PCRE_CONFIG_JIT) && !defined(darwin) // issue with macOS Catalina 
and pcre 8.43
   if (regex_extra) {
 pcre_assign_jit_stack(regex_extra, _jit_stack, nullptr);
   }
@@ -125,7 +125,7 @@ Regex::exec(const char *str, int length, int *ovector, int 
ovecsize)
 Regex::~Regex()
 {
   if (regex_extra) {
-#ifdef PCRE_CONFIG_JIT
+#if defined(PCRE_CONFIG_JIT) && !defined(darwin) // issue with macOS Catalina 
and pcre 8.43
 pcre_free_study(regex_extra);
 #else
 pcre_free(regex_extra);



[trafficserver] branch 9.0.x updated: Add test to catch regressions in sni and override configs (#6170)

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 5841e56  Add test to catch regressions in sni and override configs 
(#6170)
5841e56 is described below

commit 5841e566fbe9b349c30a20f53627c8ecf35b2acb
Author: Susan Hinrichs 
AuthorDate: Mon Nov 18 20:53:59 2019 -0700

Add test to catch regressions in sni and override configs (#6170)

(cherry picked from commit a083b7ac359157a08bf1da2f2bf6d197f5c92e4c)
---
 .../gold_tests/tls/tls_verify_override_sni.test.py | 135 +
 1 file changed, 135 insertions(+)

diff --git a/tests/gold_tests/tls/tls_verify_override_sni.test.py 
b/tests/gold_tests/tls/tls_verify_override_sni.test.py
new file mode 100644
index 000..38ceeb3
--- /dev/null
+++ b/tests/gold_tests/tls/tls_verify_override_sni.test.py
@@ -0,0 +1,135 @@
+'''
+'''
+#  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.
+
+import os
+Test.Summary = '''
+Test tls server certificate verification options. Exercise conf_remap
+'''
+
+# Define default ATS
+ts = Test.MakeATSProcess("ts", select_ports=True)
+cafile = "{0}/signer.pem".format(Test.RunDirectory)
+
+server_foo = Test.MakeOriginServer("server_foo", ssl=True, options = {"--key": 
"{0}/signed-foo.key".format(Test.RunDirectory), "--cert": 
"{0}/signed-foo.pem".format(Test.RunDirectory), "--clientCA": cafile, 
"--clientverify": ""}, 
clientcert="{0}/signed-bar.pem".format(Test.RunDirectory), 
clientkey="{0}/signed-bar.key".format(Test.RunDirectory))
+server_bar = Test.MakeOriginServer("server_bar", ssl=True, options = {"--key": 
"{0}/signed-foo.key".format(Test.RunDirectory), "--cert": 
"{0}/signed-foo.pem".format(Test.RunDirectory), "--clientCA": cafile, 
"--clientverify": ""}, 
clientcert="{0}/signed-bar.pem".format(Test.RunDirectory), 
clientkey="{0}/signed-bar.key".format(Test.RunDirectory))
+
+dns = Test.MakeDNServer("dns")
+
+request_foo_header = {"headers": "GET / HTTP/1.1\r\nHost: foo.com\r\n\r\n", 
"timestamp": "1469733493.993", "body": ""}
+request_bad_foo_header = {"headers": "GET / HTTP/1.1\r\nHost: 
bad_foo.com\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
+request_bar_header = {"headers": "GET / HTTP/1.1\r\nHost: bar.com\r\n\r\n", 
"timestamp": "1469733493.993", "body": ""}
+request_bad_bar_header = {"headers": "GET / HTTP/1.1\r\nHost: 
bad_bar.com\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
+response_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", 
"timestamp": "1469733493.993", "body": ""}
+server_foo.addResponse("sessionlog.json", request_foo_header, response_header)
+server_foo.addResponse("sessionlog.json", request_bad_foo_header, 
response_header)
+server_bar.addResponse("sessionlog.json", request_bar_header, response_header)
+server_bar.addResponse("sessionlog.json", request_bad_bar_header, 
response_header)
+
+server_bar.Setup.Copy("ssl/signer.pem")
+server_bar.Setup.Copy("ssl/signer2.pem")
+server_foo.Setup.Copy("ssl/signer.pem")
+server_foo.Setup.Copy("ssl/signer2.pem")
+
+# add ssl materials like key, certificates for the server
+ts.addSSLfile("ssl/signed-foo.pem")
+ts.addSSLfile("ssl/signed-foo.key")
+ts.addSSLfile("ssl/signed-bar.pem")
+ts.addSSLfile("ssl/signed-bar.key")
+ts.addSSLfile("ssl/server.pem")
+ts.addSSLfile("ssl/server.key")
+ts.addSSLfile("ssl/signer.pem")
+ts.addSSLfile("ssl/signer.key")
+
+ts.Disk.remap_config.AddLine(
+'map http://foo.com/defaultbar 
https://bar.com:{0}'.format(server_bar.Variables.SSL_Port))
+ts.Disk.remap_config.AddLine(
+'map http://foo.com/default 
https://foo.com:{0}'.format(server_foo.Variables.SSL_Port))
+ts.Disk.remap_config.AddLine(
+'map http://foo.com/overridepolicy https://bar.com:{0} 
@plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.policy=ENFORCED'.format(server_foo.Variables.SSL_Port))
+ts.Disk.remap_config.AddLine(
+'map http://foo.com/overrideproperties https://bar.com:{0} 
@plugin=conf_remap.so 
@pparam=proxy.config.ssl.client.verify.server.properties=SIGNATURE'.format(server_foo.Variables.SSL_Port))
+

[trafficserver] branch master updated (7dd4a6f -> 95601e9)

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

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


from 7dd4a6f  Fix ssl_session_reuse to compile on macOS and FreeBSD
 add 95601e9  Upgrade Catch.hpp to v2.11 (#6185)

No new revisions were added by this update.

Summary of changes:
 tests/include/catch.hpp | 10300 +-
 1 file changed, 7420 insertions(+), 2880 deletions(-)



[trafficserver] branch 9.0.x updated: remap_stats: Fix BufferWriter usage error.

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 226d254  remap_stats: Fix BufferWriter usage error.
226d254 is described below

commit 226d2544643a9b44d22d997ce0fb725ed245049e
Author: Alan M. Carroll 
AuthorDate: Sat Nov 16 15:05:58 2019 -0600

remap_stats: Fix BufferWriter usage error.

(cherry picked from commit fa47dfc118378e359a506e4f60f911673ed7e05b)
---
 plugins/experimental/remap_stats/remap_stats.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plugins/experimental/remap_stats/remap_stats.cc 
b/plugins/experimental/remap_stats/remap_stats.cc
index 43df970..6b4751f 100644
--- a/plugins/experimental/remap_stats/remap_stats.cc
+++ b/plugins/experimental/remap_stats/remap_stats.cc
@@ -143,9 +143,9 @@ handle_post_remap(TSCont cont, TSEvent event ATS_UNUSED, 
void *edata)
 }
 
 static void
-create_stat_name(ts::LocalBufferWriter _name, 
std::string_view h, std::string_view b)
+create_stat_name(ts::FixedBufferWriter _name, std::string_view h, 
std::string_view b)
 {
-  stat_name.reset().reduce(1);
+  stat_name.reset().clip(1);
   stat_name.print("plugin.{}.{}.{}", PLUGIN_NAME, h, b);
   stat_name.extend(1).write('\0');
 }



[trafficserver] branch 9.0.x updated (d490b5a -> 1f029cd)

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

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


from d490b5a  Removes the ssn_close hook, it can never work (#6175)
 new 386d33e  Add base64 encoding/decoding to encryption/decryption, and 
general code cleanup.
 new 1f029cd  Fix ssl_session_reuse to compile on macOS and FreeBSD

The 2 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:
 .../experimental/ssl_session_reuse/Makefile.inc|  26 +--
 .../ssl_session_reuse/example_config.config|   2 +-
 .../ssl_session_reuse/src/ats_ssl_plugin.cc|  10 +-
 .../experimental/ssl_session_reuse/src/common.cc   | 182 +
 .../experimental/ssl_session_reuse/src/common.h|  55 ++
 .../experimental/ssl_session_reuse/src/config.cc   |  10 +-
 .../experimental/ssl_session_reuse/src/message.h   |   1 +
 .../ssl_session_reuse/src/openssl_utils.cc |  22 +--
 .../experimental/ssl_session_reuse/src/publish.cc  |  97 +
 .../experimental/ssl_session_reuse/src/publisher.h |   1 +
 .../ssl_session_reuse/src/redis_endpoint.h |   1 +
 .../ssl_session_reuse/src/session_process.cc   | 218 -
 .../ssl_session_reuse/src/session_process.h|   9 +-
 .../ssl_session_reuse/src/simple_pool.h|   3 +-
 .../experimental/ssl_session_reuse/src/ssl_init.cc |  38 ++--
 .../ssl_session_reuse/src/ssl_key_utils.cc | 141 +
 .../experimental/ssl_session_reuse/src/ssl_utils.h |  39 +---
 .../ssl_session_reuse/src/subscriber.cc|  53 ++---
 .../ssl_session_reuse/src/subscriber.h |   1 +
 19 files changed, 508 insertions(+), 401 deletions(-)
 create mode 100644 plugins/experimental/ssl_session_reuse/src/common.cc



[trafficserver] 01/02: Add base64 encoding/decoding to encryption/decryption, and general code cleanup.

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

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

commit 386d33ea11ef95ee33654dcf651a8c20c36bf7d2
Author: Fei Deng 
AuthorDate: Fri Sep 20 11:44:43 2019 -0500

Add base64 encoding/decoding to encryption/decryption, and general code 
cleanup.

(cherry picked from commit af2988b468f26d76fde118c6fb6d7b1e38b27ae4)
---
 .../experimental/ssl_session_reuse/Makefile.inc|  26 +--
 .../ssl_session_reuse/example_config.config|   2 +-
 .../ssl_session_reuse/src/ats_ssl_plugin.cc|  10 +-
 .../experimental/ssl_session_reuse/src/common.cc   | 182 +
 .../experimental/ssl_session_reuse/src/common.h|  55 ++
 .../experimental/ssl_session_reuse/src/config.cc   |   6 +-
 .../experimental/ssl_session_reuse/src/message.h   |   1 +
 .../ssl_session_reuse/src/openssl_utils.cc |  22 +--
 .../experimental/ssl_session_reuse/src/publish.cc  |  89 -
 .../experimental/ssl_session_reuse/src/publisher.h |   1 +
 .../ssl_session_reuse/src/redis_endpoint.h |   1 +
 .../ssl_session_reuse/src/session_process.cc   | 218 -
 .../ssl_session_reuse/src/session_process.h|   9 +-
 .../ssl_session_reuse/src/simple_pool.h|   3 +-
 .../experimental/ssl_session_reuse/src/ssl_init.cc |  38 ++--
 .../ssl_session_reuse/src/ssl_key_utils.cc | 141 +
 .../experimental/ssl_session_reuse/src/ssl_utils.h |  39 +---
 .../ssl_session_reuse/src/subscriber.cc|  53 ++---
 .../ssl_session_reuse/src/subscriber.h |   1 +
 19 files changed, 501 insertions(+), 396 deletions(-)

diff --git a/plugins/experimental/ssl_session_reuse/Makefile.inc 
b/plugins/experimental/ssl_session_reuse/Makefile.inc
index 5e5a956..8984463 100644
--- a/plugins/experimental/ssl_session_reuse/Makefile.inc
+++ b/plugins/experimental/ssl_session_reuse/Makefile.inc
@@ -18,17 +18,17 @@
 pkglib_LTLIBRARIES += experimental/ssl_session_reuse/ssl_session_reuse.la
 
 experimental_ssl_session_reuse_ssl_session_reuse_la_SOURCES = \
- experimental/ssl_session_reuse/src/openssl_utils.cc \
- experimental/ssl_session_reuse/src/session_process.cc  \
- experimental/ssl_session_reuse/src/ssl_init.cc \
- experimental/ssl_session_reuse/src/config.cc \
- experimental/ssl_session_reuse/src/redis_endpoint.cc  \
- experimental/ssl_session_reuse/src/simple_pool.cc \
- experimental/ssl_session_reuse/src/ssl_key_utils.cc \
- experimental/ssl_session_reuse/src/connection.cc  \
- experimental/ssl_session_reuse/src/publish.cc \
- experimental/ssl_session_reuse/src/subscriber.cc \
-experimental/ssl_session_reuse/src/ats_ssl_plugin.cc
-
-experimental_ssl_session_reuse_ssl_session_reuse_la_LIBADD = @LIB_HIREDIS@ 
+experimental/ssl_session_reuse/src/ats_ssl_plugin.cc \
+experimental/ssl_session_reuse/src/common.cc \
+experimental/ssl_session_reuse/src/config.cc \
+experimental/ssl_session_reuse/src/connection.cc \
+experimental/ssl_session_reuse/src/openssl_utils.cc \
+experimental/ssl_session_reuse/src/publish.cc \
+experimental/ssl_session_reuse/src/redis_endpoint.cc \
+experimental/ssl_session_reuse/src/session_process.cc \
+experimental/ssl_session_reuse/src/simple_pool.cc \
+experimental/ssl_session_reuse/src/ssl_init.cc \
+experimental/ssl_session_reuse/src/ssl_key_utils.cc \
+experimental/ssl_session_reuse/src/subscriber.cc
 
+experimental_ssl_session_reuse_ssl_session_reuse_la_LIBADD = @LIB_HIREDIS@
diff --git a/plugins/experimental/ssl_session_reuse/example_config.config 
b/plugins/experimental/ssl_session_reuse/example_config.config
index e74ab02..55d96a5 100644
--- a/plugins/experimental/ssl_session_reuse/example_config.config
+++ b/plugins/experimental/ssl_session_reuse/example_config.config
@@ -21,7 +21,7 @@ redis.RedisEndpoints=host1.com:6379,host2.com:6379
 # in milliseconds
 redis.RedisConnectTimeout=2
 # in milliseconds
-resis.RedisRetryDelay=500
+redis.RedisRetryDelay=500
 ## end generic redis config parameters
 
 ## start pub config settings
diff --git a/plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc 
b/plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc
index 81be94a..64b03df 100644
--- a/plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc
+++ b/plugins/experimental/ssl_session_reuse/src/ats_ssl_plugin.cc
@@ -23,16 +23,15 @@
  */
 
 #include 
+#include 
 #include 
 #include 
-#include 
 
+#include "common.h"
 #include "ssl_utils.h"
 
 PluginThreads plugin_threads;
 
-int SSL_session_callback(TSCont contp, TSEvent event, void *edata);
-
 static int
 shutdown_handler(TSCont contp, TSEvent event, void *edata)
 {
@@ -49,7 +48,7 @@ TSPluginInit(int argc, const char *argv[])
 
   info.plugin_name   = (char *)("ats_session_reuse");
   

[trafficserver] 02/02: Fix ssl_session_reuse to compile on macOS and FreeBSD

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

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

commit 1f029cd57e31e3ca95183957d75ef161efb9045c
Author: Bryan Call 
AuthorDate: Mon Nov 18 16:50:02 2019 +0800

Fix ssl_session_reuse to compile on macOS and FreeBSD

(cherry picked from commit 7dd4a6f60743147d9d46c4f8d2ecc2e99034221e)
---
 .../experimental/ssl_session_reuse/src/config.cc   |  4 +--
 .../experimental/ssl_session_reuse/src/publish.cc  | 30 --
 2 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/plugins/experimental/ssl_session_reuse/src/config.cc 
b/plugins/experimental/ssl_session_reuse/src/config.cc
index 65f81a5..6501048 100644
--- a/plugins/experimental/ssl_session_reuse/src/config.cc
+++ b/plugins/experimental/ssl_session_reuse/src/config.cc
@@ -101,9 +101,9 @@ Config::setLastConfigChange()
   memset(, 0, sizeof(s));
   stat(m_filename.c_str(), );
 
-  m_lastmtime = s.st_mtim.tv_sec;
+  m_lastmtime = s.st_mtime;
 
-  if (s.st_mtim.tv_sec > oldLastmtime) {
+  if (s.st_mtime > oldLastmtime) {
 return true;
   }
   return false;
diff --git a/plugins/experimental/ssl_session_reuse/src/publish.cc 
b/plugins/experimental/ssl_session_reuse/src/publish.cc
index 0877155..98bab37 100644
--- a/plugins/experimental/ssl_session_reuse/src/publish.cc
+++ b/plugins/experimental/ssl_session_reuse/src/publish.cc
@@ -117,8 +117,8 @@ RedisPublisher::is_good()
 ::redisContext *
 RedisPublisher::setup_connection(const RedisEndpoint )
 {
-  ::pthread_t my_id = ::pthread_self();
-  TSDebug(PLUGIN, "RedisPublisher::setup_connection: Called by threadId: %lx", 
my_id);
+  auto my_id = (unsigned long long)::pthread_self();
+  TSDebug(PLUGIN, "RedisPublisher::setup_connection: Called by threadId: 
%llx", my_id);
 
   RedisContextPtr my_context;
   struct ::timeval timeout;
@@ -128,14 +128,14 @@ RedisPublisher::setup_connection(const RedisEndpoint )
   for (int i = 0; i < static_cast(m_redisConnectTries); ++i) {
 my_context.reset(::redisConnectWithTimeout(re.m_hostname.c_str(), 
re.m_port, timeout));
 if (!my_context) {
-  TSError("RedisPublisher::setup_connection: Connect to host: %s port: %d 
fail count: %d threadId: %lx", re.m_hostname.c_str(),
+  TSError("RedisPublisher::setup_connection: Connect to host: %s port: %d 
fail count: %d threadId: %llx", re.m_hostname.c_str(),
   re.m_port, i + 1, my_id);
 } else if (my_context->err) {
-  TSError("RedisPublisher::setup_connection: Connect to host: %s port: %d 
fail count: %d threadId: %lx", re.m_hostname.c_str(),
+  TSError("RedisPublisher::setup_connection: Connect to host: %s port: %d 
fail count: %d threadId: %llx", re.m_hostname.c_str(),
   re.m_port, i + 1, my_id);
   my_context.reset(nullptr);
 } else {
-  TSDebug(PLUGIN, "RedisPublisher::setup_connection: threadId: %lx 
Successfully connected to the redis instance.", my_id);
+  TSDebug(PLUGIN, "RedisPublisher::setup_connection: threadId: %llx 
Successfully connected to the redis instance.", my_id);
 
   redisReply *reply = static_cast(redisCommand(my_context.get(), "AUTH %s", redis_passwd.c_str()));
 
@@ -163,8 +163,8 @@ RedisPublisher::setup_connection(const RedisEndpoint )
 ::redisReply *
 RedisPublisher::send_publish(RedisContextPtr , const RedisEndpoint , 
const Message )
 {
-  ::pthread_t my_id = ::pthread_self();
-  TSDebug(PLUGIN, "RedisPublisher::send_publish: Called by threadId: %lx", 
my_id);
+  auto my_id = (unsigned long long)::pthread_self();
+  TSDebug(PLUGIN, "RedisPublisher::send_publish: Called by threadId: %llx", 
my_id);
 
   ::redisReply *current_reply(nullptr);
 
@@ -173,7 +173,7 @@ RedisPublisher::send_publish(RedisContextPtr , const 
RedisEndpoint , cons
   ctx.reset(setup_connection(re));
 
   if (!ctx) {
-TSError("RedisPublisher::send_publish: Unable to setup a connection to 
the redis server: %s:%d threadId: %lx try: %d",
+TSError("RedisPublisher::send_publish: Unable to setup a connection to 
the redis server: %s:%d threadId: %llx try: %d",
 re.m_hostname.c_str(), re.m_port, my_id, (i + 1));
 continue;
   }
@@ -181,12 +181,12 @@ RedisPublisher::send_publish(RedisContextPtr , const 
RedisEndpoint , cons
 
 current_reply = static_cast(::redisCommand(ctx.get(), 
"PUBLISH %s %s", msg.channel.c_str(), msg.data.c_str()));
 if (!current_reply) {
-  TSError("RedisPublisher::send_publish: Unable to get a reply from the 
server for publish. threadId: %lx try: %d", my_id,
+  TSError("RedisPublisher::send_publish: Unable to get a reply from the 
server for publish. threadId: %llx try: %d", my_id,
   (i + 1));
   ctx.reset(nullptr); // Clean up previous attempt
 
 } else if (REDIS_REPLY_ERROR == current_reply->type) {
-  TSError("RedisPublisher::send_publish: Server responded with error for 
publish. threadId: 

[trafficserver] branch master updated (c36464e -> 7dd4a6f)

2019-11-18 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 c36464e  Remove header conversion functions for HTTP/0.9
 add 7dd4a6f  Fix ssl_session_reuse to compile on macOS and FreeBSD

No new revisions were added by this update.

Summary of changes:
 .../experimental/ssl_session_reuse/src/config.cc   |  4 +--
 .../experimental/ssl_session_reuse/src/publish.cc  | 30 --
 2 files changed, 18 insertions(+), 16 deletions(-)



[trafficserver] branch master updated (fa47dfc -> c36464e)

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

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


from fa47dfc  remap_stats: Fix BufferWriter usage error.
 add c36464e  Remove header conversion functions for HTTP/0.9

No new revisions were added by this update.

Summary of changes:
 proxy/http/HttpTransact.cc| 15 --
 proxy/http/HttpTransact.h |  1 -
 proxy/http/HttpTransactHeaders.cc | 43 ---
 proxy/http/HttpTransactHeaders.h  |  2 --
 4 files changed, 61 deletions(-)



[trafficserver] branch master updated (4520de9 -> fa47dfc)

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

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


from 4520de9  Limit this check to Linux, where ldd always works (#6191)
 add fa47dfc  remap_stats: Fix BufferWriter usage error.

No new revisions were added by this update.

Summary of changes:
 plugins/experimental/remap_stats/remap_stats.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[trafficserver] 02/02: Removes the ssn_close hook, it can never work (#6175)

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

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

commit d490b5a68ff9e9ee190cf93dde0b200c53b013ca
Author: Leif Hedstrom 
AuthorDate: Sun Nov 17 13:49:03 2019 +0800

Removes the ssn_close hook, it can never work (#6175)

(cherry picked from commit a711c465c68243da290952512be704b715575d60)
---
 doc/admin-guide/plugins/tcpinfo.en.rst  |  1 -
 .../ja/LC_MESSAGES/admin-guide/plugins/tcpinfo.en.po|  4 
 plugins/tcpinfo/tcpinfo.cc  | 17 +
 3 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/doc/admin-guide/plugins/tcpinfo.en.rst 
b/doc/admin-guide/plugins/tcpinfo.en.rst
index 28ca987..6c806e8 100644
--- a/doc/admin-guide/plugins/tcpinfo.en.rst
+++ b/doc/admin-guide/plugins/tcpinfo.en.rst
@@ -45,7 +45,6 @@ The following options may be specified in 
:file:`plugin.config`:
Event Name Triggered when
   ==  ===
   send_resp_hdr   The server begins sending an HTTP response.
-  ssn_close   The TCP connection closes.
   ssn_start   A new TCP connection is accepted.
   txn_close   A HTTP transaction is completed.
   txn_start   A HTTP transaction is initiated.
diff --git a/doc/locale/ja/LC_MESSAGES/admin-guide/plugins/tcpinfo.en.po 
b/doc/locale/ja/LC_MESSAGES/admin-guide/plugins/tcpinfo.en.po
index 0b18003..88ae2c5 100644
--- a/doc/locale/ja/LC_MESSAGES/admin-guide/plugins/tcpinfo.en.po
+++ b/doc/locale/ja/LC_MESSAGES/admin-guide/plugins/tcpinfo.en.po
@@ -232,10 +232,6 @@ msgstr ""
 msgid "snd_ssthresh"
 msgstr ""
 
-#: ../../admin-guide/plugins/tcpinfo.en.rst:48
-msgid "ssn_close"
-msgstr ""
-
 #: ../../admin-guide/plugins/tcpinfo.en.rst:69
 #: ../../admin-guide/plugins/tcpinfo.en.rst:81
 msgid "timestamp"
diff --git a/plugins/tcpinfo/tcpinfo.cc b/plugins/tcpinfo/tcpinfo.cc
index cb8a820..0c9d07f 100644
--- a/plugins/tcpinfo/tcpinfo.cc
+++ b/plugins/tcpinfo/tcpinfo.cc
@@ -54,7 +54,6 @@
 #define TCPI_HOOK_SSN_START 0x01u
 #define TCPI_HOOK_TXN_START 0x02u
 #define TCPI_HOOK_SEND_RESPONSE 0x04u
-#define TCPI_HOOK_SSN_CLOSE 0x08u
 #define TCPI_HOOK_TXN_CLOSE 0x10u
 
 // Log format headers. These are emitted once at the start of a log file. Note 
that we
@@ -215,10 +214,6 @@ tcp_info_hook(TSCont contp, TSEvent event, void *edata)
 ssnp   = TSHttpTxnSsnGet(txnp);
 event_name = "send_resp_hdr";
 break;
-  case TS_EVENT_HTTP_SSN_CLOSE:
-ssnp   = static_cast(edata);
-event_name = "ssn_close";
-break;
   default:
 return 0;
   }
@@ -291,8 +286,11 @@ parse_hook_list(const char *hook_list)
   const struct hookmask {
 const char *name;
 unsigned mask;
-  } hooks[] = {{"ssn_start", TCPI_HOOK_SSN_START}, {"txn_start", 
TCPI_HOOK_TXN_START}, {"send_resp_hdr", TCPI_HOOK_SEND_RESPONSE},
-   {"ssn_close", TCPI_HOOK_SSN_CLOSE}, {"txn_close", 
TCPI_HOOK_TXN_CLOSE}, {nullptr, 0u}};
+  } hooks[] = {{"ssn_start", TCPI_HOOK_SSN_START},
+   {"txn_start", TCPI_HOOK_TXN_START},
+   {"send_resp_hdr", TCPI_HOOK_SEND_RESPONSE},
+   {"txn_close", TCPI_HOOK_TXN_CLOSE},
+   {nullptr, 0u}};
 
   str = TSstrdup(hook_list);
 
@@ -461,11 +459,6 @@ init:
 TSDebug("tcpinfo", "added hook to the sending of the headers");
   }
 
-  if (hooks & TCPI_HOOK_SSN_CLOSE) {
-TSHttpHookAdd(TS_HTTP_SSN_CLOSE_HOOK, cont);
-TSDebug("tcpinfo", "added hook to the close of the TCP connection");
-  }
-
   if (hooks & TCPI_HOOK_TXN_CLOSE) {
 TSHttpHookAdd(TS_HTTP_TXN_CLOSE_HOOK, cont);
 TSDebug("tcpinfo", "added hook to the close of the transaction");



[trafficserver] 01/02: Remove unimplement UDP function

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

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

commit 23592961db957861dfc91496753cedaef4ed5713
Author: scw00 
AuthorDate: Fri Nov 15 14:46:51 2019 +0800

Remove unimplement UDP function

(cherry picked from commit e93da34cb76c4a4c6b826ea9c257e6ca0eba094a)
---
 iocore/net/P_UDPPacket.h | 69 
 1 file changed, 69 deletions(-)

diff --git a/iocore/net/P_UDPPacket.h b/iocore/net/P_UDPPacket.h
index d6473aa..a9f015b 100644
--- a/iocore/net/P_UDPPacket.h
+++ b/iocore/net/P_UDPPacket.h
@@ -38,8 +38,6 @@ public:
   UDPPacketInternal();
   ~UDPPacketInternal() override;
 
-  void append_block_internal(IOBufferBlock *block);
-
   void free() override;
 
   SLINK(UDPPacketInternal, alink); // atomic link
@@ -164,47 +162,6 @@ UDPPacket::getConnection()
 }
 
 TS_INLINE UDPPacket *
-new_UDPPacket(struct sockaddr const *to, ink_hrtime when, char *buf, int len)
-{
-  UDPPacketInternal *p = udpPacketAllocator.alloc();
-
-  p->in_the_priority_queue = 0;
-  p->in_heap   = 0;
-  p->delivery_time = when;
-  ats_ip_copy(>to, to);
-
-  if (buf) {
-IOBufferBlock *body = new_IOBufferBlock();
-body->alloc(iobuffer_size_to_index(len));
-memcpy(body->end(), buf, len);
-body->fill(len);
-p->append_block(body);
-  }
-
-  return p;
-}
-
-TS_INLINE UDPPacket *
-new_UDPPacket(struct sockaddr const *to, ink_hrtime when, IOBufferBlock *buf, 
int len)
-{
-  (void)len;
-  UDPPacketInternal *p = udpPacketAllocator.alloc();
-
-  p->in_the_priority_queue = 0;
-  p->in_heap   = 0;
-  p->delivery_time = when;
-  ats_ip_copy(>to, to);
-
-  while (buf) {
-IOBufferBlock *body = buf->clone();
-p->append_block(body);
-buf = buf->next.get();
-  }
-
-  return p;
-}
-
-TS_INLINE UDPPacket *
 new_UDPPacket(struct sockaddr const *to, ink_hrtime when, Ptr 
)
 {
   UDPPacketInternal *p = udpPacketAllocator.alloc();
@@ -219,32 +176,6 @@ new_UDPPacket(struct sockaddr const *to, ink_hrtime when, 
Ptr 
 }
 
 TS_INLINE UDPPacket *
-new_UDPPacket(ink_hrtime when, Ptr buf)
-{
-  return new_UDPPacket(nullptr, when, buf);
-}
-
-TS_INLINE UDPPacket *
-new_incoming_UDPPacket(struct sockaddr *from, struct sockaddr *to, char *buf, 
int len)
-{
-  UDPPacketInternal *p = udpPacketAllocator.alloc();
-
-  p->in_the_priority_queue = 0;
-  p->in_heap   = 0;
-  p->delivery_time = 0;
-  ats_ip_copy(>from, from);
-  ats_ip_copy(>to, to);
-
-  IOBufferBlock *body = new_IOBufferBlock();
-  body->alloc(iobuffer_size_to_index(len));
-  memcpy(body->end(), buf, len);
-  body->fill(len);
-  p->append_block(body);
-
-  return p;
-}
-
-TS_INLINE UDPPacket *
 new_incoming_UDPPacket(struct sockaddr *from, struct sockaddr *to, 
Ptr )
 {
   UDPPacketInternal *p = udpPacketAllocator.alloc();



[trafficserver] branch 9.0.x updated (eaa23ac -> d490b5a)

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

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


from eaa23ac  Fixed issue with macOS Catalina and pcre 8.43 enabling 
pcre-jit (#6189)
 new 2359296  Remove unimplement UDP function
 new d490b5a  Removes the ssn_close hook, it can never work (#6175)

The 2 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:
 doc/admin-guide/plugins/tcpinfo.en.rst |  1 -
 .../LC_MESSAGES/admin-guide/plugins/tcpinfo.en.po  |  4 --
 iocore/net/P_UDPPacket.h   | 69 --
 plugins/tcpinfo/tcpinfo.cc | 17 ++
 4 files changed, 5 insertions(+), 86 deletions(-)



[trafficserver] branch 9.0.x updated: Fixed issue with macOS Catalina and pcre 8.43 enabling pcre-jit (#6189)

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new eaa23ac  Fixed issue with macOS Catalina and pcre 8.43 enabling 
pcre-jit (#6189)
eaa23ac is described below

commit eaa23ac8b0508f917ac2d432c8ce9c9006c8a929
Author: Bryan Call 
AuthorDate: Mon Nov 18 18:38:34 2019 +0800

Fixed issue with macOS Catalina and pcre 8.43 enabling pcre-jit (#6189)

(cherry picked from commit 093317c808b01304abf0a6b4aaf9c34791e3e08e)
---
 src/tscore/Regex.cc | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/tscore/Regex.cc b/src/tscore/Regex.cc
index 33487d1..9d93c8d 100644
--- a/src/tscore/Regex.cc
+++ b/src/tscore/Regex.cc
@@ -28,7 +28,7 @@
 #include "tscore/ink_memory.h"
 #include "tscore/Regex.h"
 
-#ifdef PCRE_CONFIG_JIT
+#if defined(PCRE_CONFIG_JIT) && !defined(darwin) // issue with macOS Catalina 
and pcre 8.43
 struct RegexThreadKey {
   RegexThreadKey() { ink_thread_key_create(>key, reinterpret_cast(_jit_stack_free)); }
   ink_thread_key key;
@@ -82,13 +82,13 @@ Regex::compile(const char *pattern, const unsigned flags)
 return false;
   }
 
-#ifdef PCRE_CONFIG_JIT
+#if defined(PCRE_CONFIG_JIT) && !defined(darwin) // issue with macOS Catalina 
and pcre 8.43
   study_opts |= PCRE_STUDY_JIT_COMPILE;
 #endif
 
   regex_extra = pcre_study(regex, study_opts, );
 
-#ifdef PCRE_CONFIG_JIT
+#if defined(PCRE_CONFIG_JIT) && !defined(darwin) // issue with macOS Catalina 
and pcre 8.43
   if (regex_extra) {
 pcre_assign_jit_stack(regex_extra, _jit_stack, nullptr);
   }
@@ -127,7 +127,7 @@ Regex::exec(std::string_view const , int *ovector, int 
ovecsize)
 Regex::~Regex()
 {
   if (regex_extra) {
-#ifdef PCRE_CONFIG_JIT
+#if defined(PCRE_CONFIG_JIT) && !defined(darwin) // issue with macOS Catalina 
and pcre 8.43
 pcre_free_study(regex_extra);
 #else
 pcre_free(regex_extra);



[trafficserver] branch 9.0.x updated: Limit this check to Linux, where ldd always works (#6191)

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new f88173e  Limit this check to Linux, where ldd always works (#6191)
f88173e is described below

commit f88173e670a3760618e35e519c233006b0d58dad
Author: Leif Hedstrom 
AuthorDate: Mon Nov 18 18:56:51 2019 +0800

Limit this check to Linux, where ldd always works (#6191)

(cherry picked from commit 4520de9091fd3427146d2ab319622e0387f7a2cf)
---
 Makefile.am  | 4 +++-
 configure.ac | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile.am b/Makefile.am
index 889be94..abcc971 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -104,7 +104,9 @@ if BUILD_DOCS
@cd doc && $(MAKE) $(AM_MAKEFLAGS) install-man
 endif
 
-TESTS = tools/check-unused-dependencies
+if OS_LINUX
+TESTS = tools/check-unused-dependencies
+endif
 
 rat:
java -jar $(top_srcdir)/ci/apache-rat-0.13-SNAPSHOT.jar -E 
$(top_srcdir)/ci/rat-regex.txt  -d $(top_srcdir)
diff --git a/configure.ac b/configure.ac
index ac20103..8a9bb93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -738,6 +738,7 @@ case $host_os in
 esac
 
 TS_ADDTO(AM_CPPFLAGS, [-D$host_os_def])
+AM_CONDITIONAL([OS_LINUX], [test "x$host_os_def" = "xlinux"])
 
 dnl AM_PROG_AR is not always available, but it doesn't seem to be needed in 
older versions.
 ifdef([AM_PROG_AR],



[trafficserver] branch master updated (093317c -> 4520de9)

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

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


from 093317c  Fixed issue with macOS Catalina and pcre 8.43 enabling 
pcre-jit (#6189)
 add 4520de9  Limit this check to Linux, where ldd always works (#6191)

No new revisions were added by this update.

Summary of changes:
 Makefile.am  | 4 +++-
 configure.ac | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)



[trafficserver] branch master updated (ae62e8a -> 093317c)

2019-11-18 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 ae62e8a  Replaces Python -> Python3 in a few utilities (#6187)
 add 093317c  Fixed issue with macOS Catalina and pcre 8.43 enabling 
pcre-jit (#6189)

No new revisions were added by this update.

Summary of changes:
 src/tscore/Regex.cc | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)



[trafficserver] branch 9.0.x updated: Replaces Python -> Python3 in a few utilities (#6187)

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 95ce78e  Replaces Python -> Python3 in a few utilities (#6187)
95ce78e is described below

commit 95ce78ee99781adc7edc236eaf70ba99217e1d64
Author: Leif Hedstrom 
AuthorDate: Mon Nov 18 14:56:49 2019 +0800

Replaces Python -> Python3 in a few utilities (#6187)

(cherry picked from commit ae62e8a120eb4ea6d5925917fe9db11b8d5d0bf0)
---
 contrib/python/compare_RecordsConfigcc.py | 36 +++
 contrib/python/compare_records_config.py  |  4 ++--
 tools/check-unused-dependencies   |  2 +-
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/contrib/python/compare_RecordsConfigcc.py 
b/contrib/python/compare_RecordsConfigcc.py
old mode 100644
new mode 100755
index 90835c9..a2d9b94
--- a/contrib/python/compare_RecordsConfigcc.py
+++ b/contrib/python/compare_RecordsConfigcc.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -23,8 +23,8 @@ import string
 try:
 src_dir = sys.argv[1]
 except IndexError:
-print "Usage: %s [trafficserver_source_dir]" % sys.argv[0]
-print "Compares values in RecordsConfig.cc with the default records.config 
file"
+print("Usage: %s [trafficserver_source_dir]" % sys.argv[0])
+print("Compares values in RecordsConfig.cc with the default records.config 
file")
 sys.exit(1)
 
 # We expect these keys to differ between files, so ignore them
@@ -52,12 +52,12 @@ with open("%s/mgmt/RecordsConfig.cc" % src_dir) as fh:
 m = cc_re.search(line)
 if m:
 value = m.group(3)
-value = string.lstrip(value, '"')
-value = string.rstrip(value, '"')
+value = value.lstrip('"')
+value = value.rstrip('"')
 rc_cc[m.group(1)] = (m.group(2), value)
 
 # Process records.config.default.in
-with open("%s/proxy/config/records.config.default.in" % src_dir) as fh:
+with open("%s/configs/records.config.default.in" % src_dir) as fh:
 in_re = re.compile(r'(?:CONFIG|LOCAL) (\S+)\s+(\S+)\s+(\S+)')
 for line in fh:
 m = in_re.match(line)
@@ -77,37 +77,37 @@ with open("%s/doc/admin-guide/files/records.config.en.rst" 
% src_dir) as fh:
 # Compare the two
 # If a value is in RecordsConfig.cc  and not records.config.default.in, it is
 # ignored right now.
-print "# Comparing RecordsConfig.cc -> records.config.default.in"
+print("# Comparing RecordsConfig.cc -> records.config.default.in")
 for key in rc_in:
 if key in ignore_keys:
 continue
 if key not in rc_cc:
-print "%s missing -> %s" % (key, "%s %s" % rc_in[key])
+print("%s missing -> %s" % (key, "%s %s" % rc_in[key]))
 continue
 if rc_cc[key] != rc_in[key]:
-print "%s : %s -> %s" % (key, "%s %s" % rc_cc[key], "%s %s" % 
rc_in[key])
+print("%s : %s -> %s" % (key, "%s %s" % rc_cc[key], "%s %s" % 
rc_in[key]))
 
 # Search for undocumented variables ...
 missing = [k for k in rc_cc if k not in rc_doc]
 if len(missing) > 0:
-print
-print "Undocumented configuration variables:"
+print()
+print("Undocumented configuration variables:")
 for m in sorted(missing):
-print "\t%s %s" % (m, "%s %s" % rc_cc[m])
+print("\t%s %s" % (m, "%s %s" % rc_cc[m]))
 
 # Search for incorrectly documented default values ...
 defaults = [k for k in rc_cc if k in rc_doc and rc_cc[k] != rc_doc[k]]
 if len(defaults) > 0:
-print
-print "Incorrectly documented defaults:"
+print()
+print("Incorrectly documented defaults:")
 for d in sorted(defaults):
-print "\t%s %s -> %s" % (d, "%s %s" % rc_cc[d], "%s %s" % rc_doc[d])
+print("\t%s %s -> %s" % (d, "%s %s" % rc_cc[d], "%s %s" % rc_doc[d]))
 
 
 # Search for stale documentation ...
 stale = [k for k in rc_doc if k not in rc_cc]
 if (len(stale) > 0):
-print
-print "Stale documentation:"
+print()
+print("Stale documentation:")
 for s in sorted(stale):
-print "\t%s" % (s)
+print("\t%s" % (s))
diff --git a/contrib/python/compare_records_config.py 
b/contrib/python/compare_records_config.py
old mode 100644
new mode 100755
index acde26a..bd610a9
--- a/contrib/python/compare_records_config.py
+++ b/contrib/python/compare_records_config.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
@@ -61,7 +61,7 @@ def compare_settings(old, new):
 # Skip predefined values
 continue
 if old[key] != new[key]:
-print "%s %s -> %s" % (key, old[key], new[key])
+