[trafficserver] branch master updated: Force using C++17 as the default standard

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

zwoop 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 2210186  Force using C++17 as the default standard
2210186 is described below

commit 2210186acdf9250e04ee76dcf2ac7cc7b2fb317e
Author: Bryan Call 
AuthorDate: Tue May 15 10:02:00 2018 -0700

Force using C++17 as the default standard
---
 build/ax_cxx_compile_stdcxx.m4 | 980 -
 configure.ac   |   3 +-
 2 files changed, 1 insertion(+), 982 deletions(-)

diff --git a/build/ax_cxx_compile_stdcxx.m4 b/build/ax_cxx_compile_stdcxx.m4
deleted file mode 100644
index 4f9f3bb..000
--- a/build/ax_cxx_compile_stdcxx.m4
+++ /dev/null
@@ -1,980 +0,0 @@
-# ===
-#  https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html
-# ===
-#
-# SYNOPSIS
-#
-#   AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional])
-#
-# DESCRIPTION
-#
-#   Check for baseline language coverage in the compiler for the specified
-#   version of the C++ standard.  If necessary, add switches to CXX and
-#   CXXCPP to enable support.  VERSION may be '11' (for the C++11 standard)
-#   or '14' (for the C++14 standard).
-#
-#   The second argument, if specified, indicates whether you insist on an
-#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
-#   -std=c++11).  If neither is specified, you get whatever works, with
-#   preference for an extended mode.
-#
-#   The third argument, if specified 'mandatory' or if left unspecified,
-#   indicates that baseline support for the specified C++ standard is
-#   required and that the macro should error out if no mode with that
-#   support is found.  If specified 'optional', then configuration proceeds
-#   regardless, after defining HAVE_CXX${VERSION} if and only if a
-#   supporting mode is found.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Benjamin Kosnik 
-#   Copyright (c) 2012 Zack Weinberg 
-#   Copyright (c) 2013 Roy Stogner 
-#   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov 

-#   Copyright (c) 2015 Paul Norman 
-#   Copyright (c) 2015 Moritz Klammler 
-#   Copyright (c) 2016 Krzesimir Nowak 
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved.  This file is offered as-is, without any
-#   warranty.
-
-#serial 8
-
-dnl  This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro
-dnl  (serial version number 13).
-
-AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl
-  m4_if([$1], [11], [ax_cxx_compile_alternatives="11"],
-[$1], [14], [ax_cxx_compile_alternatives="14"],
-[$1], [17], [ax_cxx_compile_alternatives="17"],
-[m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl
-  m4_if([$2], [], [],
-[$2], [ext], [],
-[$2], [noext], [],
-[m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl
-  m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true],
-[$3], [mandatory], [ax_cxx_compile_cxx$1_required=true],
-[$3], [optional], [ax_cxx_compile_cxx$1_required=false],
-[m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])])
-  AC_LANG_PUSH([C++])dnl
-  ac_success=no
-  AC_CACHE_CHECK(whether $CXX supports C++$1 features by default,
-  ax_cv_cxx_compile_cxx$1,
-  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
-[ax_cv_cxx_compile_cxx$1=yes],
-[ax_cv_cxx_compile_cxx$1=no])])
-  if test x$ax_cv_cxx_compile_cxx$1 = xyes; then
-ac_success=yes
-  fi
-
-  m4_if([$2], [noext], [], [dnl
-  if test x$ac_success = xno; then
-for alternative in ${ax_cxx_compile_alternatives}; do
-  switch="-std=gnu++${alternative}"
-  cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch])
-  AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch,
- $cachevar,
-[ac_save_CXX="$CXX"
- CXX="$CXX $switch"
- 
AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])],
-  [eval $cachevar=yes],
-  [eval $cachevar=no])
- CXX="$ac_save_CXX"])
-  if eval test x\$$cachevar = xyes; then
-CXX="$CXX $switch"
-if test -n "$CXXCPP" ; then
-  CXXCPP="$CXXCPP $switch"
-fi
-ac_success=yes
-break
-  fi
-done
-  fi])
-
-  m4_if([$2], [ext], [], [dnl
-  if test x$ac_success = xno; then
-dnl HP's aCC needs +std=c++11 according to:
-

[trafficserver] branch master updated: Remove some more traffic_cop remenants

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

zwoop 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 5902b03  Remove some more traffic_cop remenants
5902b03 is described below

commit 5902b03cef1ff120b497fe2cbcf57f8eae34cf06
Author: Susan Hinrichs 
AuthorDate: Mon May 14 14:56:26 2018 +

Remove some more traffic_cop remenants
---
 rc/trafficserver.in | 1 -
 rc/trafficserver.service.in | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/rc/trafficserver.in b/rc/trafficserver.in
index 0c04e03..347d366 100644
--- a/rc/trafficserver.in
+++ b/rc/trafficserver.in
@@ -21,7 +21,6 @@
 # processname: traffic_manager traffic_server
 # config: /etc/trafficserver
 # config: /etc/sysconfig/trafficserver
-# pidfile: /var/run/trafficserver/cop.pid
 #
 # Template from /etc/init.d/skeleton on Ubuntu
 #
diff --git a/rc/trafficserver.service.in b/rc/trafficserver.service.in
index 2bcdcb1..b133966 100644
--- a/rc/trafficserver.service.in
+++ b/rc/trafficserver.service.in
@@ -22,8 +22,8 @@ After=syslog.target network.target
 [Service]
 Type=simple
 EnvironmentFile=-/etc/sysconfig/trafficserver
-PIDFile=@exp_runtimedir@/cop.pid
-ExecStart=@exp_bindir@/traffic_manager $TC_DAEMON_ARGS
+PIDFile=@exp_runtimedir@/manager.pid
+ExecStart=@exp_bindir@/traffic_manager $TM_DAEMON_ARGS
 ExecReload=@exp_bindir@/traffic_ctl config reload
 
 [Install]

-- 
To stop receiving notification emails like this one, please contact
zw...@apache.org.


[trafficserver] branch master updated: Sets things up to find appropriate compilers for C++17

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

zwoop 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 c615903  Sets things up to find appropriate compilers for C++17
c615903 is described below

commit c6159035433f319fddf097f8256babb50379c1f7
Author: Leif Hedstrom 
AuthorDate: Tue May 15 16:14:17 2018 -0600

Sets things up to find appropriate compilers for C++17
---
 ci/jenkins/bin/autest.sh  | 10 
 ci/jenkins/bin/environment.sh | 55 ++-
 ci/jenkins/bin/github.sh  | 10 
 3 files changed, 38 insertions(+), 37 deletions(-)

diff --git a/ci/jenkins/bin/autest.sh b/ci/jenkins/bin/autest.sh
index 22c506d..1df5fa4 100755
--- a/ci/jenkins/bin/autest.sh
+++ b/ci/jenkins/bin/autest.sh
@@ -34,14 +34,6 @@ WCCP=""
 [ "1" == "$enable_debug" ] && DEBUG="--enable-debug"
 [ "1" == "$enable_wccp" ] && WCCP="--enable-wccp"
 
-# Check for clang
-if [ "1" == "$enable_clang" ]; then
-   export CC="clang"
-   export CXX="clang++"
-   export CXXFLAGS="-Qunused-arguments"
-   export WITH_LIBCPLUSPLUS="yes"
-fi
-
 mkdir -p ${INSTALL}
 cd src
 
@@ -49,8 +41,6 @@ echo "CCACHE: $CCACHE"
 echo "WERROR: $WERROR"
 echo "DEBUG: $DEBUG"
 echo "WCCP: $WCCP"
-echo "CC: $CC"
-echo "CXX: $CXX"
 
 # Restore verbose shell output
 set -x
diff --git a/ci/jenkins/bin/environment.sh b/ci/jenkins/bin/environment.sh
index 48596e6..8aa0c97 100755
--- a/ci/jenkins/bin/environment.sh
+++ b/ci/jenkins/bin/environment.sh
@@ -55,28 +55,49 @@ test "${JOB_NAME#*-9.2.x}" != "${JOB_NAME}" && 
ATS_BRANCH=9.1.x
 export ATS_BRANCH
 echo "Branch is $ATS_BRANCH"
 
-# Decide on compilers, gcc is the default
-if test "${JOB_NAME#*compiler=clang}" != "${JOB_NAME}"; then
-   export CC="clang"
-   export CXX="clang++"
-   #export CXXFLAGS="-Qunused-arguments -std=c++11"
+# If the job name includes the string "clang", force clang. This can also be 
set
+# explicitly for specific jobs.
+test "${JOB_NAME#*compiler=clang}" != "${JOB_NAME}" && enable_clang=1
+
+if [ "1" == "$enable_clang" ]; then
+   if [ -x "/usr/local/bin/clang++50" ]; then
+   export CC="/usr/local/bin/clang50"
+   export CXX="/usr/local/bin/clang++50"
+   else
+   export CC="clang"
+   export CXX="clang++"
+   fi
export CXXFLAGS="-Qunused-arguments"
export WITH_LIBCPLUSPLUS="yes"
-fi
-
-# Check for devtoolset-7, but only for ATS 7.x and later
-if test "$ATS_IS_7" == "yes"; then
-   if test -f "/opt/rh/devtoolset-7/enable"; then
-   source /opt/rh/devtoolset-7/enable
-   echo "Enabling devtoolset-7"
-   elif test -x "/usr/bin/gcc-4.9"; then
-   export CC="/usr/bin/gcc-4.9"
-   export CXX="/usr/bin/g++-4.9"
-   echo "CC: $CC"
-   echo "CXX: $CXX"
+elif [ "1" == "$enable_icc" ]; then
+   source /opt/intel/bin/iccvars.sh intel64
+   export CC=icc
+   export CXX=icpc
+else
+   # Default is gcc / g++
+   export CC=gcc
+   export CXX=g++
+   # Only test for non standard compilers on ATS v7.x and later. ToDo: 
Remove this when 6.x is EOLifed.
+   if test "$ATS_IS_7" == "yes"; then
+   if test -f "/opt/rh/devtoolset-7/enable"; then
+   # This changes the path such that gcc / g++ is the 
right version. This is for CentOS 6 / 7.
+   source /opt/rh/devtoolset-7/enable
+   echo "Enabling devtoolset-7"
+   elif test -x "/usr/bin/g++-7"; then
+   # This is for Debian platforms
+   export CC=/usr/bin/gcc-7
+   export CXX=/usr/bin/g++-7
+   fi
fi
 fi
 
+# Echo out compiler information
+echo "Compiler information:"
+echo "CC: ${CC}"
+$CC -v
+echo "CXX: $CXX"
+$CXX -v
+
 # Figure out parallelism for regular builds / bots
 ATS_MAKE_FLAGS="-j4"
 
diff --git a/ci/jenkins/bin/github.sh b/ci/jenkins/bin/github.sh
index 79fa4ae..9c7ad5f 100755
--- a/ci/jenkins/bin/github.sh
+++ b/ci/jenkins/bin/github.sh
@@ -30,14 +30,6 @@ WCCP=""
 [ "1" == "$enable_debug" ] && DEBUG="--enable-debug"
 [ "1" == "$enable_wccp" ] && WCCP="--enable-wccp"
 
-# Check for clang
-if [ "1" == "$enable_clang" ]; then
-   export CC="clang"
-   export CXX="clang++"
-   export CXXFLAGS="-Qunused-arguments"
-   export WITH_LIBCPLUSPLUS="yes"
-fi
-
 mkdir -p ${INSTALL}
 cd src
 
@@ -45,8 +37,6 @@ echo "CCACHE: $CCACHE"
 echo "WERROR: $WERROR"
 echo "DEBUG: $DEBUG"
 echo "WCCP: $WCCP"
-echo "CC: $CC"
-echo "CXX: $CXX"
 
 # Restore verbose shell output
 set -x

-- 
To stop receiving notification emails like this one, please contact
zw...@apache.org.


[trafficserver] branch master updated: Fix issue with test_MemArena.cc which wasn't caught by the PR builds.

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

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


The following commit(s) were added to refs/heads/master by this push:
 new 5886b86  Fix issue with test_MemArena.cc which wasn't caught by the PR 
builds.
5886b86 is described below

commit 5886b8610dbea06565f23d43eaa84917fb5f8153
Author: Alan M. Carroll 
AuthorDate: Tue May 15 15:12:35 2018 -0500

Fix issue with test_MemArena.cc which wasn't caught by the PR builds.
---
 lib/ts/unit-tests/test_MemArena.cc | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/ts/unit-tests/test_MemArena.cc 
b/lib/ts/unit-tests/test_MemArena.cc
index 69bb2f1..a99c202 100644
--- a/lib/ts/unit-tests/test_MemArena.cc
+++ b/lib/ts/unit-tests/test_MemArena.cc
@@ -132,9 +132,6 @@ TEST_CASE("MemArena helper", "[libts][MemArena]")
 TEST_CASE("MemArena large alloc", "[libts][MemArena]")
 {
   ts::MemArena arena;
-
-  size_t arena_size = arena.size(); // little bit less than 1 << 15
-
   ts::MemSpan s = arena.alloc(4000);
   REQUIRE(s.size() == 4000);
 

-- 
To stop receiving notification emails like this one, please contact
a...@apache.org.


[trafficserver] branch master updated: Makes the output less debuggy, and other updates

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

zwoop 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 56118f7  Makes the output less debuggy, and other updates
56118f7 is described below

commit 56118f7007359d42947b935a482e4e12004c5351
Author: Leif Hedstrom 
AuthorDate: Tue May 15 10:04:51 2018 -0600

Makes the output less debuggy, and other updates
---
 ci/jenkins/bin/autest.sh | 83 +---
 ci/jenkins/bin/build.sh  | 32 +---
 ci/jenkins/bin/clang-analyzer.sh | 45 +++---
 ci/jenkins/bin/clang-format.sh   |  0
 ci/jenkins/bin/docs.sh   |  0
 ci/jenkins/bin/environment.sh| 50 +---
 ci/jenkins/bin/extract.sh|  8 
 ci/jenkins/bin/gh-mirror.sh  | 44 ++---
 ci/jenkins/bin/github.sh | 41 ++--
 ci/jenkins/bin/in_tree.sh| 12 +++---
 ci/jenkins/bin/out_of_tree.sh| 12 +++---
 ci/jenkins/bin/rat.sh|  2 +-
 ci/jenkins/bin/snapshot.sh   | 12 +++---
 13 files changed, 206 insertions(+), 135 deletions(-)

diff --git a/ci/jenkins/bin/autest.sh b/ci/jenkins/bin/autest.sh
old mode 100644
new mode 100755
index 2a3932c..22c506d
--- a/ci/jenkins/bin/autest.sh
+++ b/ci/jenkins/bin/autest.sh
@@ -16,50 +16,89 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
+set +x
 [ -d tests ] || exit 0
 
-# Setup autoconf
 INSTALL="${WORKSPACE}/${BUILD_NUMBER}/install"
-mkdir -p $INSTALL
-cd src
-autoreconf -if
-
 URL="https://ci.trafficserver.apache.org/autest;
 AUSB="ausb-${ghprbPullId}.${BUILD_NUMBER}"
 SANDBOX="/var/tmp/${AUSB}"
 
+# Optional settings
+CCACHE=""
+WERROR=""
+DEBUG=""
+WCCP=""
+[ "1" == "$enable_ccache" ] && CCACHE="--enable-ccache"
+[ "1" == "$enable_werror" ] && WERROR="--enable-werror"
+[ "1" == "$enable_debug" ] && DEBUG="--enable-debug"
+[ "1" == "$enable_wccp" ] && WCCP="--enable-wccp"
+
+# Check for clang
+if [ "1" == "$enable_clang" ]; then
+   export CC="clang"
+   export CXX="clang++"
+   export CXXFLAGS="-Qunused-arguments"
+   export WITH_LIBCPLUSPLUS="yes"
+fi
+
+mkdir -p ${INSTALL}
+cd src
+
+echo "CCACHE: $CCACHE"
+echo "WERROR: $WERROR"
+echo "DEBUG: $DEBUG"
+echo "WCCP: $WCCP"
+echo "CC: $CC"
+echo "CXX: $CXX"
+
+# Restore verbose shell output
+set -x
+
+# Configure
+autoreconf -if
 ./configure --prefix="${INSTALL}" \
---with-user=jenkins \
---enable-experimental-plugins \
---enable-example-plugins \
---enable-ccache \
---enable-debug \
-   --enable-wccp \
---enable-werror
+   --with-user=jenkins \
+   --enable-experimental-plugins \
+   --enable-example-plugins \
+   ${CCACHE} \
+   ${WCCP} \
+   ${WERROR} \
+   ${DEBUG}
 
 # Build and run regressions
 ${ATS_MAKE} -j4 && ${ATS_MAKE} install
-${INSTALL}/bin/traffic_server -K -k -R 1
-[ "0" != "$?" ] && exit -1
+[ -x ${INSTALL}/bin/traffic_server ] || exit -1
 
 # Now run autest
+set +x
+echo -n "===  Started on "
+date
+
 AUTEST="/usr/bin/autest"
 [ ! -x ${AUTEST} ] && AUTEST="/usr/local/bin/autest"
+set -x
 
 ${AUTEST} -D ./tests/gold_tests --sandbox "$SANDBOX" --ats-bin "${INSTALL}/bin"
 status=$?
 
+set +x
+echo -n "===  Finished on "
+date
+
 # Cleanup
 cd /var/tmp # To be safer
 chmod -R a+r ${SANDBOX}
 if [ "0" != "$status" ]; then
-if [ -d "$SANDBOX" ]; then
-find "$SANDBOX" -name \*.db  -exec rm {} \;
-mv "$SANDBOX" /CA/autest
-echo "Sandbox is available at ${URL}/${AUSB}/"
-fi
-exit -1
+   if [ -d "$SANDBOX" ]; then
+   find "$SANDBOX" -name \*.db -exec rm {} \;
+   mv "$SANDBOX" /CA/autest
+   echo "Sandbox is available at ${URL}/${AUSB}/"
+   fi
+   exit -1
 else
-[ -d "$SANDBOX" ] && rmdir "$SANDBOX"
-exit 0
+   [ -d "$SANDBOX" ] && rmdir "$SANDBOX"
+   exit 0
 fi
+
+set -x
diff --git a/ci/jenkins/bin/build.sh b/ci/jenkins/bin/build.sh
index 7c0f79b..4f56eb5 100755
--- a/ci/jenkins/bin/build.sh
+++ b/ci/jenkins/bin/build.sh
@@ -16,32 +16,36 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
+set +x
+
 # Check if it's a debug or release build
 DEBUG=""
 test "${JOB_NAME#*type=debug}" != "${JOB_NAME}" && DEBUG="--enable-debug"
 
 # When to turn on ccache, disabled for some builds
 CCACHE="--enable-ccache"
-#test "${JOB_NAME#*debian_8}" != "${JOB_NAME}" && CCACHE=""
-#test "${JOB_NAME#*ubuntu_12_04}" != "${JOB_NAME}" && CCACHE=""
-#test "${JOB_NAME#*ubuntu_14_04}" != "${JOB_NAME}" && CCACHE=""
-#test "${JOB_NAME#*compiler=clang,label=ubuntu_16_04}" != "${JOB_NAME}" && 
CCACHE=""
 
-# When to enable -Werror, turned off for RHEL5 

[trafficserver] branch master updated: Changes to compile on Fedora 28 with gcc 8.1.1

2018-05-15 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 1e801bf  Changes to compile on Fedora 28 with gcc 8.1.1
1e801bf is described below

commit 1e801bfe6bf0fc07d16d84afb9f9d6a1d8845493
Author: Bryan Call 
AuthorDate: Mon May 14 13:51:19 2018 -0700

Changes to compile on Fedora 28 with gcc 8.1.1
---
 cmd/traffic_via/traffic_via.cc |  3 +-
 configure.ac   |  2 +-
 lib/ts/mkdfa.c |  4 +-
 plugins/experimental/url_sig/url_sig.c | 17 +
 plugins/healthchecks/healthchecks.c|  2 +-
 proxy/InkAPITest.cc|  2 +-
 proxy/ParentSelection.cc   |  4 +-
 proxy/shared/DiagsConfig.cc|  1 +
 tools/jtest/jtest.cc   | 67 +-
 9 files changed, 53 insertions(+), 49 deletions(-)

diff --git a/cmd/traffic_via/traffic_via.cc b/cmd/traffic_via/traffic_via.cc
index 79157d9..632e524 100644
--- a/cmd/traffic_via/traffic_via.cc
+++ b/cmd/traffic_via/traffic_via.cc
@@ -222,7 +222,8 @@ decodeViaHeader(const char *str)
   char tmp[viaHdrLength + 2];
   char *Via = tmp;
 
-  strncpy(Via, str, viaHdrLength + 1); // Safe to call strcpy.
+  memcpy(Via, str, viaHdrLength);
+  Via[viaHdrLength] = '\0'; // null terminate
   printf("Via header is %s, Length is %zu\n", Via, viaHdrLength);
 
   // Via header inside square brackets
diff --git a/configure.ac b/configure.ac
index 07bc06e..253d455 100644
--- a/configure.ac
+++ b/configure.ac
@@ -858,7 +858,7 @@ case $host_os_def in
 AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [
   # This is useful for finding odd conversions
   #common_opt="-pipe -Wall -Wconversion -Wno-sign-conversion 
-Wno-format-truncation"
-  common_opt="-pipe -Wall -Wextra -Wno-ignored-qualifiers 
-Wno-unused-parameter -Wno-format-truncation"
+  common_opt="-pipe -Wall -Wextra -Wno-ignored-qualifiers 
-Wno-unused-parameter -Wno-format-truncation -Wno-cast-function-type 
-Wno-stringop-overflow"
   debug_opt="-ggdb3 $common_opt"
   release_opt="-g $common_opt $optimizing_flags 
-feliminate-unused-debug-symbols -fno-strict-aliasing"
   cxx_opt="-Wno-invalid-offsetof -Wno-noexcept-type"
diff --git a/lib/ts/mkdfa.c b/lib/ts/mkdfa.c
index 5a43d5e..2e30929 100644
--- a/lib/ts/mkdfa.c
+++ b/lib/ts/mkdfa.c
@@ -381,7 +381,9 @@ mkprefix(state_t *state, char *prefix, int length)
   transition_t *transitions;
 
   prefixtbl[state->num] = (char *)malloc(sizeof(char) * (length + 1));
-  strncpy(prefixtbl[state->num], prefix, length);
+  if (length > 0) {
+strncpy(prefixtbl[state->num], prefix, length);
+  }
   prefixtbl[state->num][length] = '\0';
 
   transitions = state->transitions;
diff --git a/plugins/experimental/url_sig/url_sig.c 
b/plugins/experimental/url_sig/url_sig.c
index 299d279..beeb16b 100644
--- a/plugins/experimental/url_sig/url_sig.c
+++ b/plugins/experimental/url_sig/url_sig.c
@@ -291,7 +291,7 @@ getAppQueryString(const char *query_string, int 
query_length)
 return NULL;
   }
   memset(buf, 0, sizeof(buf));
-  strncpy(buf, query_string, query_length);
+  memcpy(buf, query_string, query_length);
   p = buf;
 
   TSDebug(PLUGIN_NAME, "query_string: %s, query_length: %d", query_string, 
query_length);
@@ -392,7 +392,8 @@ urlParse(char *url, char *anchor, char *new_path_seg, int 
new_path_seg_len, char
   TSError("insuficient space to copy into new_path_seg buffer.");
   return NULL;
 } else {
-  strncat(new_path_seg, segment[i], l);
+  memcpy(new_path_seg, segment[i], l);
+  new_path_seg[l] = '\0';
   if (i != numtoks - 1) {
 strncat(new_path_seg, "/", 1);
   }
@@ -404,13 +405,13 @@ urlParse(char *url, char *anchor, char *new_path_seg, int 
new_path_seg_len, char
   // save the encoded signing parameter data
   if (sig_anchor != NULL) { // a signature anchor string was found.
 if (strlen(sig_anchor) < signed_seg_len) {
-  strncpy(signed_seg, sig_anchor, strlen(sig_anchor));
+  memcpy(signed_seg, sig_anchor, strlen(sig_anchor));
 } else {
   TSError("insuficient space to copy into new_path_seg buffer.");
 }
   } else { // no signature anchor string was found, assum it is in the last 
path segment.
 if (strlen(segment[numtoks - 2]) < signed_seg_len) {
-  strncpy(signed_seg, segment[numtoks - 2], strlen(segment[numtoks - 2]));
+  memcpy(signed_seg, segment[numtoks - 2], strlen(segment[numtoks - 2]));
 } else {
   TSError("insuficient space to copy into new_path_seg buffer.");
   return NULL;
@@ -436,16 +437,16 @@ urlParse(char *url, char *anchor, char *new_path_seg, int 
new_path_seg_len, char
   for (i = 0; i < numtoks; i++) {
 // cp the base64 decoded string.
 if (i == sig_anchor_seg && sig_anchor != NULL) {

[trafficserver] branch master updated: MemArena: overhaul internals and clean up API.

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

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


The following commit(s) were added to refs/heads/master by this push:
 new ad7a339  MemArena: overhaul internals and clean up API.
ad7a339 is described below

commit ad7a3398416ef1406250df50c8a0c49870378d9e
Author: Alan M. Carroll 
AuthorDate: Fri May 4 07:55:31 2018 -0500

MemArena: overhaul internals and clean up API.

This adjusts the internals to be simpler and more in line with the original 
design. In particular there are at most two
generations and that only during a freeze. Added the ability to defer 
internal allocation until first external request.
Added ability to set a minimum size for the next internal allocation block.
---
 CMakeLists.txt  |   4 +
 cmd/traffic_cache_tool/CacheDefs.cc |   2 +-
 lib/ts/BufferWriterFormat.cc|   4 +-
 lib/ts/MemArena.cc  | 172 --
 lib/ts/MemArena.h   | 192 +
 lib/ts/MemSpan.h|  86 ++---
 lib/ts/unit-tests/test_MemArena.cc  | 233 +---
 7 files changed, 407 insertions(+), 286 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 537fe03..523b643 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1269,6 +1269,8 @@ add_library(libtsutil SHARED
 lib/ts/Map.h
 lib/ts/MatcherUtils.cc
 lib/ts/MatcherUtils.h
+lib/ts/MemArena.h
+lib/ts/MemArena.cc
 lib/ts/MemSpan.h
 lib/ts/mkdfa.c
 lib/ts/MMH.cc
@@ -1332,6 +1334,8 @@ add_executable(test_tslib
lib/ts/unit-tests/test_ink_inet.cc
lib/ts/unit-tests/test_IpMap.cc
lib/ts/unit-tests/test_layout.cc
+   lib/ts/unit-tests/test_MemArena.cc
+   lib/ts/unit-tests/test_MemSpan.cc
lib/ts/unit-tests/test_MT_hashtable.cc
lib/ts/unit-tests/test_Scalar.cc
lib/ts/unit-tests/test_string_view.cc
diff --git a/cmd/traffic_cache_tool/CacheDefs.cc 
b/cmd/traffic_cache_tool/CacheDefs.cc
index 5e267cb..32a3c20 100644
--- a/cmd/traffic_cache_tool/CacheDefs.cc
+++ b/cmd/traffic_cache_tool/CacheDefs.cc
@@ -270,7 +270,7 @@ Stripe::validateMeta(StripeMeta const *meta)
 bool
 Stripe::probeMeta(MemSpan , StripeMeta const *base_meta)
 {
-  while (mem.usize() >= sizeof(StripeMeta)) {
+  while (mem.size() >= sizeof(StripeMeta)) {
 StripeMeta const *meta = mem.ptr(0);
 if (this->validateMeta(meta) && (base_meta == nullptr ||   // 
no base version to check against.
  (meta->version == base_meta->version) // 
need more checks here I think.
diff --git a/lib/ts/BufferWriterFormat.cc b/lib/ts/BufferWriterFormat.cc
index 8adb5ff..463f98b 100644
--- a/lib/ts/BufferWriterFormat.cc
+++ b/lib/ts/BufferWriterFormat.cc
@@ -591,14 +591,14 @@ bwformat(BufferWriter , BWFSpec const , 
string_view sv)
 BufferWriter &
 bwformat(BufferWriter , BWFSpec const , MemSpan const )
 {
-  static const BWFormat default_fmt{"{:#x}@{}"};
+  static const BWFormat default_fmt{"{:#x}@{:p}"};
   if (spec._ext.size() && 'd' == spec._ext.front()) {
 const char *digits = 'X' == spec._type ? bw_fmt::UPPER_DIGITS : 
bw_fmt::LOWER_DIGITS;
 if (spec._radix_lead_p) {
   w.write('0');
   w.write(digits[33]);
 }
-bw_fmt::Hex_Dump(w, string_view{static_cast(span.data()), 
span.usize()}, digits);
+bw_fmt::Hex_Dump(w, span.view(), digits);
   } else {
 w.print(default_fmt, span.size(), span.data());
   }
diff --git a/lib/ts/MemArena.cc b/lib/ts/MemArena.cc
index d4af156..22e18cb 100644
--- a/lib/ts/MemArena.cc
+++ b/lib/ts/MemArena.cc
@@ -28,14 +28,6 @@
 
 using namespace ts;
 
-inline MemArena::Block::Block(size_t n) : size(n), allocated(0), next(nullptr) 
{}
-
-inline char *
-MemArena::Block::data()
-{
-  return reinterpret_cast(this + 1);
-}
-
 /**
 Allocates a new internal block of memory. If there are no existing blocks, 
this becomes the head of the
  ll. If there are existing allocations, the new block is inserted in the 
current list.
@@ -45,37 +37,38 @@ MemArena::Block::data()
 inline MemArena::Block *
 MemArena::newInternalBlock(size_t n, bool custom)
 {
-  // Adjust to the nearest power of two. Works for 64 bit values. Allocate 
Block header and
-  //  actual underlying memory together for locality. ALLOC_HEADER_SIZE to 
account for malloc/free headers.
-  static constexpr size_t free_space_per_page = DEFAULT_PAGE_SIZE - 
sizeof(Block) - ALLOC_HEADER_SIZE;
-
-  void *tmp;
-  if (n <= free_space_per_page) { // will fit within one page, just allocate.
-tmp = ats_malloc(n + sizeof(Block));
+  // Allocate Block header and actual underlying memory together for locality 
and fewer calls.
+  // ALLOC_HEADER_SIZE to account for malloc/free headers to try to minimize 
pages required.
+  static 

[trafficserver] branch master updated: Fixes some markdown for the CIDR condition

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

zwoop 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 3591a2f  Fixes some markdown for the CIDR condition
3591a2f is described below

commit 3591a2fa0f58d37bed98924dab7bb392a90f33ca
Author: Leif Hedstrom 
AuthorDate: Sat May 12 10:59:21 2018 +0100

Fixes some markdown for the CIDR condition
---
 doc/admin-guide/plugins/header_rewrite.en.rst | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/admin-guide/plugins/header_rewrite.en.rst 
b/doc/admin-guide/plugins/header_rewrite.en.rst
index ee93bf6..7f3d7d6 100644
--- a/doc/admin-guide/plugins/header_rewrite.en.rst
+++ b/doc/admin-guide/plugins/header_rewrite.en.rst
@@ -289,7 +289,7 @@ arguments to another operator. For example::
 set-header ATS-Req-UUID %{ID:UNIQUE}
 
 CIDR
-~~
+
 ::
 
set-header @Client-CIDR %{CIDR:24,48}
@@ -299,12 +299,12 @@ to the IP, before producing a string. The typical use of 
this conditions is as
 above, producing a header that contains a IP representation which has some
 privacy properties. It can of course also be used as a regular condition, and
 the output is a string that can be compared against. The two optional
-arguments are as follows:
+arguments are as follows::
 
 IPv4-MaskLength, in bits, of the IPv4 address to preserve. Default: 24
 IPv6-MaskLength, in bits, of the IPv6 address to preserve. Default: 48
 
-The two arguments, if provided, are comma separated. Valid syntax includes
+The two arguments, if provided, are comma separated. Valid syntax includes::
 
 %{CIDR} Defaults to 24,48 (as above)
 %{CIDR:16}  IPv4 CIDR mask is 16 bits, IPv6 mask is 48
@@ -313,7 +313,7 @@ The two arguments, if provided, are comma separated. Valid 
syntax includes
 A typical use case is to insert the @-prefixed header as above, and then use
 this header in a custom log format, rather than logging the full client
 IP. Another use case could be to make a special condition on a sub-net,
-e.g. ::
+e.g.::
 
 cond %{CIDR:8} ="8.0.0.0"
 set-header X-Is-Eight "Yes"

-- 
To stop receiving notification emails like this one, please contact
zw...@apache.org.


[trafficserver] branch master updated: Get rid of small memory leak in compress plugin.

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

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


The following commit(s) were added to refs/heads/master by this push:
 new a3ef3b0  Get rid of small memory leak in compress plugin.
a3ef3b0 is described below

commit a3ef3b0383d387adf185ca1fd775b03e99bcee8a
Author: Walt Karas 
AuthorDate: Mon May 14 22:50:05 2018 +

Get rid of small memory leak in compress plugin.
---
 plugins/compress/compress.cc | 9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/plugins/compress/compress.cc b/plugins/compress/compress.cc
index 34c1909..612714e 100644
--- a/plugins/compress/compress.cc
+++ b/plugins/compress/compress.cc
@@ -1009,7 +1009,10 @@ TSPluginInit(int argc, const char *argv[])
   }
 
   info("TSPluginInit %s", argv[0]);
-  global_hidden_header_name = init_hidden_header_name();
+
+  if (!global_hidden_header_name) {
+global_hidden_header_name = init_hidden_header_name();
+  }
 
   TSCont management_contp = TSContCreate(management_update, nullptr);
 
@@ -1059,7 +1062,9 @@ TSRemapNewInstance(int argc, char *argv[], void 
**instance, char *errbuf, int er
   } else {
 config_path = TSstrdup(3 == argc ? argv[2] : "");
   }
-  global_hidden_header_name = init_hidden_header_name();
+  if (!global_hidden_header_name) {
+global_hidden_header_name = init_hidden_header_name();
+  }
 
   Configuration *config = Configuration::Parse(config_path);
   *instance = config;

-- 
To stop receiving notification emails like this one, please contact
a...@apache.org.


[trafficserver] branch quic-latest updated (b64517c -> 7cb18b3)

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

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


from b64517c  Fix assertion in quic_client
 new 7e738b0  Fix a compile issue
 new 7cb18b3  Capsulate how to read QUIC packets from UDP packets

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:
 iocore/net/P_QUICNetVConnection.h  |  6 +-
 iocore/net/QUICNetVConnection.cc   | 64 ++
 iocore/net/quic/Makefile.am|  1 +
 iocore/net/quic/Mock.h |  6 --
 iocore/net/quic/QUICConnection.h   |  1 -
 iocore/net/quic/QUICPacketReceiveQueue.cc  | 61 +
 ...ketRetransmitter.h => QUICPacketReceiveQueue.h} | 22 +---
 iocore/net/quic/test/test_QUICKeyGenerator.cc  |  1 +
 8 files changed, 94 insertions(+), 68 deletions(-)
 create mode 100644 iocore/net/quic/QUICPacketReceiveQueue.cc
 copy iocore/net/quic/{QUICPacketRetransmitter.h => QUICPacketReceiveQueue.h} 
(68%)

-- 
To stop receiving notification emails like this one, please contact
mas...@apache.org.


[trafficserver] 01/02: Fix a compile issue

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

maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 7e738b00efd8e3ac73cd87a6461c2560c237d681
Author: Masakazu Kitajo 
AuthorDate: Tue May 15 16:38:04 2018 +0900

Fix a compile issue
---
 iocore/net/quic/test/test_QUICKeyGenerator.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/iocore/net/quic/test/test_QUICKeyGenerator.cc 
b/iocore/net/quic/test/test_QUICKeyGenerator.cc
index bf40970..7112390 100644
--- a/iocore/net/quic/test/test_QUICKeyGenerator.cc
+++ b/iocore/net/quic/test/test_QUICKeyGenerator.cc
@@ -24,6 +24,7 @@
 #include "catch.hpp"
 
 #include 
+#include 
 
 #ifdef OPENSSL_IS_BORINGSSL
 #include 

-- 
To stop receiving notification emails like this one, please contact
mas...@apache.org.


[trafficserver] 02/02: Capsulate how to read QUIC packets from UDP packets

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

maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit 7cb18b38d88fd6af13eed65867701117cbc890ae
Author: Masakazu Kitajo 
AuthorDate: Tue May 15 16:40:57 2018 +0900

Capsulate how to read QUIC packets from UDP packets

To prepare for coalescing packets
---
 iocore/net/P_QUICNetVConnection.h |  6 +--
 iocore/net/QUICNetVConnection.cc  | 64 ---
 iocore/net/quic/Makefile.am   |  1 +
 iocore/net/quic/Mock.h|  6 ---
 iocore/net/quic/QUICConnection.h  |  1 -
 iocore/net/quic/QUICPacketReceiveQueue.cc | 61 +
 iocore/net/quic/QUICPacketReceiveQueue.h  | 46 ++
 7 files changed, 126 insertions(+), 59 deletions(-)

diff --git a/iocore/net/P_QUICNetVConnection.h 
b/iocore/net/P_QUICNetVConnection.h
index 745d7c5..a327772 100644
--- a/iocore/net/P_QUICNetVConnection.h
+++ b/iocore/net/P_QUICNetVConnection.h
@@ -59,6 +59,7 @@
 #include "quic/QUICAltConnectionManager.h"
 #include "quic/QUICPathValidator.h"
 #include "quic/QUICApplicationMap.h"
+#include "quic/QUICPacketReceiveQueue.h"
 
 // These are included here because older OpenQUIC libraries don't have them.
 // Don't copy these defines, or use their values directly, they are merely
@@ -197,7 +198,6 @@ public:
   NetVConnectionContext_t direction() override;
   SSLNextProtocolSet *next_protocol_set() override;
   void close(QUICConnectionErrorUPtr error) override;
-  QUICPacketNumber largest_received_packet_number() override;
   QUICPacketNumber largest_acked_packet_number() override;
   void handle_received_packet(UDPPacket *packet) override;
   bool is_closed() override;
@@ -231,7 +231,6 @@ private:
   QUICConnectionId _quic_connection_id;
   QUICFiveTuple _five_tuple;
 
-  QUICPacketNumber _largest_received_packet_number = 0;
   UDPConnection *_udp_con  = nullptr;
   QUICPacketHandler *_packet_handler   = nullptr;
   QUICPacketFactory _packet_factory;
@@ -258,9 +257,8 @@ private:
   QUICAltConnectionManager *_alt_con_manager= nullptr;
   QUICPathValidator *_path_validator= nullptr;
 
-  CountQueue _packet_recv_queue;
+  QUICPacketReceiveQueue _packet_recv_queue = {this->_packet_factory};
   CountQueue _packet_send_queue;
-  std::queue _quic_packet_recv_queue;
 
   QUICConnectionErrorUPtr _connection_error  = nullptr;
   uint32_t _state_closing_recv_packet_count  = 0;
diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index 2557e25..a924e74 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -789,12 +789,6 @@ QUICNetVConnection::next_protocol_set()
 }
 
 QUICPacketNumber
-QUICNetVConnection::largest_received_packet_number()
-{
-  return this->_largest_received_packet_number;
-}
-
-QUICPacketNumber
 QUICNetVConnection::largest_acked_packet_number()
 {
   return this->_loss_detector->largest_acked_packet_number();
@@ -885,7 +879,7 @@ 
QUICNetVConnection::_state_handshake_process_retry_packet(QUICPacketUPtr packet)
   QUICErrorUPtr error = this->_recv_and_ack(std::move(packet));
 
   // Packet number of RETRY packet is echo of INITIAL packet
-  this->_largest_received_packet_number = 0;
+  this->_packet_recv_queue.reset();
   this->_stream_manager->reset_recv_offset();
 
   // Generate new Connection ID
@@ -982,7 +976,7 @@ QUICNetVConnection::_state_common_receive_packet()
 QUICErrorUPtr
 QUICNetVConnection::_state_closing_receive_packet()
 {
-  while (this->_packet_recv_queue.size > 0) {
+  while (this->_packet_recv_queue.size() > 0) {
 QUICPacketCreationResult result;
 QUICPacketUPtr packet = this->_dequeue_recv_packet(result);
 if (result == QUICPacketCreationResult::SUCCESS) {
@@ -1006,7 +1000,7 @@ QUICNetVConnection::_state_closing_receive_packet()
 QUICErrorUPtr
 QUICNetVConnection::_state_draining_receive_packet()
 {
-  while (this->_packet_recv_queue.size > 0) {
+  while (this->_packet_recv_queue.size() > 0) {
 QUICPacketCreationResult result;
 QUICPacketUPtr packet = this->_dequeue_recv_packet(result);
 if (result == QUICPacketCreationResult::SUCCESS) {
@@ -1277,10 +1271,6 @@ QUICNetVConnection::_recv_and_ack(QUICPacketUPtr packet)
   uint16_t size   = packet->payload_length();
   QUICPacketNumber packet_num = packet->packet_number();
 
-  if (packet_num > this->_largest_received_packet_number) {
-this->_largest_received_packet_number = packet_num;
-  }
-
   bool should_send_ack;
 
   QUICErrorUPtr error = QUICErrorUPtr(new QUICNoError());
@@ -1338,7 +1328,7 @@ QUICNetVConnection::_build_packet(ats_unique_buf buf, 
size_t len, bool retransmi
   case QUICPacketType::RETRY:
 // Echo "_largest_received_packet_number" as packet number. Probably this 
is the packet number from triggering client packet.