You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2014/01/27 21:41:31 UTC

[01/28] git commit: TS-2504: replace OpenSSL detection with AX_CHECK_OPENSSL

Updated Branches:
  refs/heads/5.0.x 2dc04540c -> a8cba7c78


TS-2504: replace OpenSSL detection with AX_CHECK_OPENSSL

Use the ax_check_openssl.m4 macro from the autoconf archive so that
we don't need to carry around custom OpenSSL detection logic.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6d3670be
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6d3670be
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6d3670be

Branch: refs/heads/5.0.x
Commit: 6d3670bef7b274e51738a07ba61205431bf0aad7
Parents: 4db27ec
Author: James Peach <jp...@apache.org>
Authored: Sat Jan 18 21:14:54 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Jan 21 15:45:33 2014 -0800

----------------------------------------------------------------------
 build/ax_check_openssl.m4     | 124 +++++++++++++++++++++++++++++++++++++
 build/crypto.m4               |  97 ++++-------------------------
 cmd/traffic_cop/Makefile.am   |   2 +-
 cmd/traffic_line/Makefile.am  |   2 +-
 cmd/traffic_shell/Makefile.am |   2 +-
 configure.ac                  |   3 -
 iocore/net/Makefile.am        |   2 +-
 lib/ts/Makefile.am            |   2 +-
 mgmt/Makefile.am              |   2 +-
 mgmt/api/Makefile.am          |   2 +-
 proxy/Makefile.am             |   8 +--
 tools/Makefile.am             |   2 +-
 12 files changed, 147 insertions(+), 101 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/build/ax_check_openssl.m4
----------------------------------------------------------------------
diff --git a/build/ax_check_openssl.m4 b/build/ax_check_openssl.m4
new file mode 100644
index 0000000..85605b1
--- /dev/null
+++ b/build/ax_check_openssl.m4
@@ -0,0 +1,124 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
+#
+# DESCRIPTION
+#
+#   Look for OpenSSL in a number of default spots, or in a user-selected
+#   spot (via --with-openssl).  Sets
+#
+#     OPENSSL_INCLUDES to the include directives required
+#     OPENSSL_LIBS to the -l directives required
+#     OPENSSL_LDFLAGS to the -L or -R flags required
+#
+#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
+#
+#   This macro sets OPENSSL_INCLUDES such that source files should use the
+#   openssl/ directory in include directives:
+#
+#     #include <openssl/hmac.h>
+#
+# LICENSE
+#
+#   Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
+#   Copyright (c) 2009,2010 Dustin J. Mitchell <du...@zmanda.com>
+#
+#   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
+
+AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
+AC_DEFUN([AX_CHECK_OPENSSL], [
+    found=false
+    AC_ARG_WITH([openssl],
+        [AS_HELP_STRING([--with-openssl=DIR],
+            [root of the OpenSSL directory])],
+        [
+            case "$withval" in
+            "" | y | ye | yes | n | no)
+            AC_MSG_ERROR([Invalid --with-openssl value])
+              ;;
+            *) ssldirs="$withval"
+              ;;
+            esac
+        ], [
+            # if pkg-config is installed and openssl has installed a .pc file,
+            # then use that information and don't search ssldirs
+            AC_PATH_PROG([PKG_CONFIG], [pkg-config])
+            if test x"$PKG_CONFIG" != x""; then
+                OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
+                if test $? = 0; then
+                    OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
+                    OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
+                    found=true
+                fi
+            fi
+
+            # no such luck; use some default ssldirs
+            if ! $found; then
+                ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/sfw /usr/local /opt/local /usr"
+            fi
+        ]
+        )
+
+
+    # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
+    # an 'openssl' subdirectory
+
+    if ! $found; then
+        OPENSSL_INCLUDES=
+        for ssldir in $ssldirs; do
+            AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
+            if test -f "$ssldir/include/openssl/ssl.h"; then
+                OPENSSL_INCLUDES="-I$ssldir/include"
+                OPENSSL_LDFLAGS="-L$ssldir/lib"
+                OPENSSL_LIBS="-lssl -lcrypto"
+                found=true
+                AC_MSG_RESULT([yes])
+                break
+            else
+                AC_MSG_RESULT([no])
+            fi
+        done
+
+        # if the file wasn't found, well, go ahead and try the link anyway -- maybe
+        # it will just work!
+    fi
+
+    # try the preprocessor and linker with our new flags,
+    # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
+
+    AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
+    echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
+        "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
+
+    save_LIBS="$LIBS"
+    save_LDFLAGS="$LDFLAGS"
+    save_CPPFLAGS="$CPPFLAGS"
+    LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
+    LIBS="$OPENSSL_LIBS $LIBS"
+    CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
+    AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
+        [
+            AC_MSG_RESULT([yes])
+            $1
+        ], [
+            AC_MSG_RESULT([no])
+            $2
+        ])
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+
+    AC_SUBST([OPENSSL_INCLUDES])
+    AC_SUBST([OPENSSL_LIBS])
+    AC_SUBST([OPENSSL_LDFLAGS])
+])

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/build/crypto.m4
----------------------------------------------------------------------
diff --git a/build/crypto.m4 b/build/crypto.m4
index 0b8db8f..94919dc 100644
--- a/build/crypto.m4
+++ b/build/crypto.m4
@@ -25,95 +25,20 @@ AC_DEFUN([TS_CHECK_CRYPTO], [
   enable_crypto=no
   AC_SEARCH_LIBS([crypt], [crypt], [AC_SUBST([LIBCRYPT],["-lcrypt"])])
 
-  TS_CHECK_CRYPTO_OPENSSL
-  dnl add checks for other varieties of ssl here
-])
-dnl
-
-AC_DEFUN([TS_CHECK_CRYPTO_OPENSSL], [
-enable_openssl=no
-AC_ARG_WITH(openssl, [AC_HELP_STRING([--with-openssl=DIR],[use a specific OpenSSL library])],
-[
-  if test "x$withval" != "xyes" && test "x$withval" != "x"; then
-    openssl_base_dir="$withval"
-    if test "$withval" != "no"; then
-      enable_openssl=yes
-      case "$withval" in
-      *":"*)
-        openssl_include="`echo $withval |sed -e 's/:.*$//'`"
-        openssl_ldflags="`echo $withval |sed -e 's/^.*://'`"
-        AC_MSG_CHECKING(checking for OpenSSL includes in $openssl_include libs in $openssl_ldflags )
-        ;;
-      *)
-        openssl_include="$withval/include"
-        openssl_ldflags="$withval/lib"
-        AC_MSG_CHECKING(checking for OpenSSL includes in $withval)
-        ;;
-      esac
-    fi
-  fi
-])
-
-if test "x$openssl_base_dir" = "x"; then
-  AC_MSG_CHECKING([for OpenSSL location])
-  AC_CACHE_VAL(ats_cv_openssl_dir,[
-  for dir in /usr/local/ssl /usr/pkg /usr/sfw /usr/local /usr; do
-    if test -d $dir && test -f $dir/include/openssl/x509.h; then
-      ats_cv_openssl_dir=$dir
-      break
-    fi
-  done
+  AX_CHECK_OPENSSL([
+    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
+    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
+  ], [
+   AC_ERROR(failed to find OpenSSL)
   ])
-  openssl_base_dir=$ats_cv_openssl_dir
-  if test "x$openssl_base_dir" = "x"; then
-    enable_openssl=no
-    AC_MSG_RESULT([not found])
-  else
-    enable_openssl=yes
-    openssl_include="$openssl_base_dir/include"
-    openssl_ldflags="$openssl_base_dir/lib"
-    AC_MSG_RESULT([${openssl_base_dir}])
-  fi
-else
-  if test -d $openssl_include/openssl && test -d $openssl_ldflags && test -f $openssl_include/openssl/x509.h; then
-    AC_MSG_RESULT([ok])
-  else
-    AC_MSG_RESULT([not found])
-  fi
-fi
-
-if test "$enable_openssl" != "no"; then
-  saved_ldflags=$LDFLAGS
-  saved_cppflags=$CPPFLAGS
-  openssl_have_headers=0
-  openssl_have_libs=0
-  if test "$openssl_base_dir" != "/usr"; then
-    TS_ADDTO(CPPFLAGS, [-I${openssl_include}])
-    TS_ADDTO(LDFLAGS, [-L${openssl_ldflags}])
-    TS_ADDTO(LIBTOOL_LINK_FLAGS, [-R${openssl_ldflags}])
-  fi
-  AC_SEARCH_LIBS([BN_init],[crypto],
-      AC_SEARCH_LIBS([SSL_accept], [ssl], [openssl_have_libs=1], [], [-lcrypto]))
-  if test "$openssl_have_libs" != "0"; then
-      AC_CHECK_HEADERS(openssl/x509.h, [openssl_have_headers=1])
-  fi
-  if test "$openssl_have_headers" != "0"; then
-    AC_CHECK_DECLS([EVP_PKEY_CTX_new], [], [],
-                   [#include <openssl/evp.h>])
-    enable_crypto=yes
-    AC_SUBST([LIBSSL],["-lssl -lcrypto"])
-  else
-    enable_openssl=no
-    CPPFLAGS=$saved_cppflags
-    LDFLAGS=$saved_ldflags
-  fi
-fi
 
+  dnl add checks for other varieties of ssl here
 ])
+dnl
 
 AC_DEFUN([TS_CHECK_CRYPTO_EC_KEYS], [
   _eckeys_saved_LIBS=$LIBS
-  TS_ADDTO(LIBS, [$LIBSSL])
+  TS_ADDTO(LIBS, [$OPENSSL_LIBS])
   AC_CHECK_HEADERS(openssl/ec.h)
   AC_CHECK_FUNCS(EC_KEY_new_by_curve_name, [enable_tls_eckey=yes], [enable_tls_eckey=no])
   LIBS=$_eckeys_saved_LIBS
@@ -127,7 +52,7 @@ AC_DEFUN([TS_CHECK_CRYPTO_EC_KEYS], [
 AC_DEFUN([TS_CHECK_CRYPTO_NEXTPROTONEG], [
   enable_tls_npn=yes
   _npn_saved_LIBS=$LIBS
-  TS_ADDTO(LIBS, [$LIBSSL])
+  TS_ADDTO(LIBS, [$OPENSSL_LIBS])
   AC_CHECK_FUNCS(SSL_CTX_set_next_protos_advertised_cb SSL_CTX_set_next_proto_select_cb SSL_select_next_proto SSL_get0_next_proto_negotiated,
     [], [enable_tls_npn=no]
   )
@@ -143,7 +68,7 @@ AC_DEFUN([TS_CHECK_CRYPTO_TICKETS], [
   _tickets_saved_LIBS=$LIBS
   enable_tls_tickets=yes
 
-  TS_ADDTO(LIBS, [$LIBSSL])
+  TS_ADDTO(LIBS, [$OPENSSL_LIBS])
   AC_CHECK_HEADERS(openssl/tls1.h openssl/ssl.h openssl/ts.h openssl/hmac.h openssl/evp.h)
   AC_MSG_CHECKING([for SSL_CTX_set_tlsext_ticket_key_cb])
   AC_COMPILE_IFELSE(
@@ -178,7 +103,7 @@ AC_DEFUN([TS_CHECK_CRYPTO_SNI], [
   _sni_saved_LIBS=$LIBS
   enable_tls_sni=yes
 
-  TS_ADDTO(LIBS, [$LIBSSL])
+  TS_ADDTO(LIBS, [$OPENSSL_LIBS])
   AC_CHECK_HEADERS(openssl/tls1.h openssl/ssl.h openssl/ts.h)
   # We are looking for SSL_CTX_set_tlsext_servername_callback, but it's a
   # macro, so AC_CHECK_FUNCS is not going to do the business.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/cmd/traffic_cop/Makefile.am
----------------------------------------------------------------------
diff --git a/cmd/traffic_cop/Makefile.am b/cmd/traffic_cop/Makefile.am
index f5a25a4..482075a 100644
--- a/cmd/traffic_cop/Makefile.am
+++ b/cmd/traffic_cop/Makefile.am
@@ -40,4 +40,4 @@ traffic_cop_LDADD = \
   $(top_builddir)/mgmt/api/libtsmgmt.la \
   $(top_builddir)/lib/ts/libtsutil.la \
   $(top_builddir)/lib/records/librec4cop.a \
-  @LIBRESOLV@ @LIBSSL@
+  @LIBRESOLV@ @OPENSSL_LIBS@

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/cmd/traffic_line/Makefile.am
----------------------------------------------------------------------
diff --git a/cmd/traffic_line/Makefile.am b/cmd/traffic_line/Makefile.am
index debf8bd..594a874 100644
--- a/cmd/traffic_line/Makefile.am
+++ b/cmd/traffic_line/Makefile.am
@@ -33,4 +33,4 @@ traffic_line_LDADD = \
   $(top_builddir)/mgmt/api/libtsmgmtshare.la \
   $(top_builddir)/mgmt/api/libtsmgmt.la \
   $(top_builddir)/lib/ts/libtsutil.la \
-  @LIBRESOLV@ @LIBTCL@ @LIBSSL@
+  @LIBRESOLV@ @LIBTCL@ @OPENSSL_LIBS@

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/cmd/traffic_shell/Makefile.am
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/Makefile.am b/cmd/traffic_shell/Makefile.am
index 09574cd..2a28086 100644
--- a/cmd/traffic_shell/Makefile.am
+++ b/cmd/traffic_shell/Makefile.am
@@ -72,6 +72,6 @@ traffic_shell_LDADD = \
   $(top_builddir)/mgmt/utils/libutils_lm.a \
   $(top_builddir)/lib/ts/libtsutil.la \
   $(LIBTCL) $(LIBREADLINE) \
-  @LIBRESOLV@ @LIBEXPAT@ @LIBSSL@ \
+  @LIBRESOLV@ @LIBEXPAT@ @OPENSSL_LIBS@ \
   @LIBPCRE@ @LIBREADLINE@ \
   -lm

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5552594..5823f2a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1107,9 +1107,6 @@ AX_BOOST_BASE([1.33],
 #
 # Check for SSL presence and usability
 TS_CHECK_CRYPTO
-if test "x${enable_crypto}" != "xyes"; then
-  AC_MSG_ERROR([Need at least one SSL library, --with-openssl is supported])
-fi
 
 #
 # Check for NextProtocolNegotiation TLS extension support.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/iocore/net/Makefile.am
----------------------------------------------------------------------
diff --git a/iocore/net/Makefile.am b/iocore/net/Makefile.am
index b3e1d52..4575e9e 100644
--- a/iocore/net/Makefile.am
+++ b/iocore/net/Makefile.am
@@ -40,7 +40,7 @@ test_certlookup_SOURCES = \
 test_certlookup_LDADD = \
   $(top_builddir)/lib/ts/libtsutil.la \
   $(top_builddir)/iocore/eventsystem/libinkevent.a \
-  @LIBSSL@
+  @OPENSSL_LIBS@
 
 libinknet_a_SOURCES = \
   Connection.cc \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/lib/ts/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/ts/Makefile.am b/lib/ts/Makefile.am
index 18461b0..b5b5fb5 100644
--- a/lib/ts/Makefile.am
+++ b/lib/ts/Makefile.am
@@ -29,7 +29,7 @@ libtsutil_la_LIBADD = \
   @hwloc_LIBS@ \
   @LIBOBJS@ \
   @LIBPCRE@ \
-  @LIBSSL@ \
+  @OPENSSL_LIBS@ \
   @LIBTCL@ \
   @LIBRESOLV@ \
   @LIBCAP@ \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/mgmt/Makefile.am
----------------------------------------------------------------------
diff --git a/mgmt/Makefile.am b/mgmt/Makefile.am
index 30c8609..db485c8 100644
--- a/mgmt/Makefile.am
+++ b/mgmt/Makefile.am
@@ -114,5 +114,5 @@ traffic_manager_LDADD += \
   $(top_builddir)/lib/tsconfig/libtsconfig.la
 endif
 
-traffic_manager_LDADD += @LIBSSL@
+traffic_manager_LDADD += @OPENSSL_LIBS@
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/mgmt/api/Makefile.am
----------------------------------------------------------------------
diff --git a/mgmt/api/Makefile.am b/mgmt/api/Makefile.am
index bb311a3..7d1bc31 100644
--- a/mgmt/api/Makefile.am
+++ b/mgmt/api/Makefile.am
@@ -88,4 +88,4 @@ traffic_api_cli_remote_LDADD = \
   libtsmgmtshare.la \
   libtsmgmt.la \
   $(top_builddir)/lib/ts/libtsutil.la \
-  @LIBTCL@ @LIBSSL@
+  @LIBTCL@ @OPENSSL_LIBS@

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/proxy/Makefile.am
----------------------------------------------------------------------
diff --git a/proxy/Makefile.am b/proxy/Makefile.am
index 04d72c8..88f8d54 100644
--- a/proxy/Makefile.am
+++ b/proxy/Makefile.am
@@ -148,7 +148,7 @@ traffic_server_LDADD = \
   $(which_libts) \
   @hwloc_LIBS@ \
   @LIBPCRE@ \
-  @LIBSSL@ \
+  @OPENSSL_LIBS@ \
   @LIBTCL@ \
   @LIBEXPAT@ \
   @LIBDEMANGLE@ \
@@ -176,7 +176,7 @@ traffic_logcat_LDADD = \
   $(top_builddir)/lib/records/librecprocess.a \
   $(top_builddir)/iocore/eventsystem/libinkevent.a \
   $(top_builddir)/lib/ts/libtsutil.la \
-  @LIBRESOLV@ @LIBPCRE@ @LIBSSL@ @LIBTCL@ \
+  @LIBRESOLV@ @LIBPCRE@ @OPENSSL_LIBS@ @LIBTCL@ \
   @LIBEXPAT@ @LIBDEMANGLE@ @LIBPROFILER@ -lm
 
 traffic_logstats_SOURCES = logstats.cc
@@ -192,7 +192,7 @@ traffic_logstats_LDADD = \
   $(top_builddir)/lib/records/librecprocess.a \
   $(top_builddir)/iocore/eventsystem/libinkevent.a \
   $(top_builddir)/lib/ts/libtsutil.la \
-  @LIBRESOLV@ @LIBPCRE@ @LIBSSL@ @LIBTCL@ \
+  @LIBRESOLV@ @LIBPCRE@ @OPENSSL_LIBS@ @LIBTCL@ \
   @LIBEXPAT@ @LIBDEMANGLE@ @LIBPROFILER@ -lm
 
 traffic_sac_SOURCES = \
@@ -246,7 +246,7 @@ traffic_sac_LDADD = \
   $(top_builddir)/iocore/eventsystem/libinkevent.a \
   $(top_builddir)/lib/records/librecprocess.a \
   $(top_builddir)/lib/ts/libtsutil.la \
-  @LIBRESOLV@ @LIBPCRE@ @LIBSSL@ @LIBTCL@ \
+  @LIBRESOLV@ @LIBPCRE@ @OPENSSL_LIBS@ @LIBTCL@ \
   @LIBEXPAT@ @LIBDEMANGLE@ @LIBZ@ @LIBLZMA@ @LIBPROFILER@ -lm
 
 if BUILD_TESTS

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6d3670be/tools/Makefile.am
----------------------------------------------------------------------
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 9038212..d18c0bf 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -31,7 +31,7 @@ jtest_jtest_LDADD = $(top_builddir)/lib/ts/libtsutil.la
 if BUILD_HTTP_LOAD
 noinst_PROGRAMS += http_load/http_load
 
-http_load_http_load_LDADD = @LIBSSL@
+http_load_http_load_LDADD = @OPENSSL_LIBS@
 http_load_http_load_SOURCES =  \
   http_load/http_load.c \
   http_load/timers.c \


[02/28] git commit: TS-2504: detect OpenSSL library in 64 bit library paths

Posted by zw...@apache.org.
TS-2504: detect OpenSSL library in 64 bit library paths


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/1ae99c02
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/1ae99c02
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/1ae99c02

Branch: refs/heads/5.0.x
Commit: 1ae99c020e2234152b735539fbb79509188b249c
Parents: 6d3670b
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Sat Jan 18 21:23:38 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Jan 21 15:46:47 2014 -0800

----------------------------------------------------------------------
 CHANGES                   | 2 ++
 build/ax_check_openssl.m4 | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1ae99c02/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index dbec535..5e1075e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2504] Support OpenSSL installations that use the lib64 directory.
+
   *) [TS-799] Have AdminClient.pm created from .in file.
 
   *) [TS-2509] Add the const qualifier to pure HttpTunnel member functions.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1ae99c02/build/ax_check_openssl.m4
----------------------------------------------------------------------
diff --git a/build/ax_check_openssl.m4 b/build/ax_check_openssl.m4
index 85605b1..b3f371b 100644
--- a/build/ax_check_openssl.m4
+++ b/build/ax_check_openssl.m4
@@ -78,7 +78,11 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
             AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
             if test -f "$ssldir/include/openssl/ssl.h"; then
                 OPENSSL_INCLUDES="-I$ssldir/include"
-                OPENSSL_LDFLAGS="-L$ssldir/lib"
+                if test -d "$withval/lib64"; then
+                  OPENSSL_LDFLAGS="-L$ssldir/lib64"
+                else
+                  OPENSSL_LDFLAGS="-L$ssldir/lib"
+                fi
                 OPENSSL_LIBS="-lssl -lcrypto"
                 found=true
                 AC_MSG_RESULT([yes])


[28/28] git commit: Merge branch 'master' into 5.0.x

Posted by zw...@apache.org.
Merge branch 'master' into 5.0.x

* master: (25 commits)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a8cba7c7
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a8cba7c7
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a8cba7c7

Branch: refs/heads/5.0.x
Commit: a8cba7c78b15175f4bc31d17d23216564e7fb758
Parents: 2dc0454 77e2776
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Jan 27 13:41:10 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Jan 27 13:41:10 2014 -0700

----------------------------------------------------------------------
 CHANGES                                         |  20 +
 Makefile.am                                     |   2 +-
 build/ax_check_openssl.m4                       | 128 ++++++
 build/crypto.m4                                 | 101 +----
 cmd/traffic_cop/Makefile.am                     |   2 +-
 cmd/traffic_line/Makefile.am                    |   2 +-
 cmd/traffic_line/traffic_line.cc                |   5 +
 cmd/traffic_shell/Makefile.am                   |   2 +-
 cmd/traffic_shell/ShowCmd.cc                    |   2 +-
 configure.ac                                    |   3 -
 doc/admin/configuring-traffic-server.en.rst     |  26 +-
 doc/arch/hacking/index.en.rst                   |  26 ++
 doc/arch/index.en.rst                           |   9 +-
 doc/reference/commands/traffic_line.en.rst      |  13 +-
 .../configuration/records.config.en.rst         |  30 +-
 iocore/aio/AIO.cc                               |   8 +-
 iocore/cache/Cache.cc                           | 153 ++++---
 iocore/cache/CacheTest.cc                       |  72 +++
 iocore/cache/I_Cache.h                          |  22 +
 iocore/cache/P_CacheDisk.h                      |   2 +-
 iocore/dns/DNS.cc                               |  14 +-
 iocore/hostdb/HostDB.cc                         |  12 +-
 iocore/net/Makefile.am                          |   2 +-
 iocore/net/Net.cc                               |  28 +-
 lib/records/I_RecCore.h                         |  19 +-
 lib/records/I_RecDefs.h                         |  25 ++
 lib/records/I_RecEvents.h                       |   3 +
 lib/records/I_RecProcess.h                      |   4 +-
 lib/records/P_RecCore.cc                        |  46 +-
 lib/records/P_RecCore.h                         |   3 -
 lib/records/RecCore.cc                          |  62 ++-
 lib/records/RecHttp.cc                          |  10 +-
 lib/records/RecProcess.cc                       |   2 +-
 lib/records/test_RecProcess.i                   |  12 +-
 lib/records/test_RecordsConfig.cc               |  10 +-
 lib/ts/Makefile.am                              |   2 +-
 lib/ts/ink_args.cc                              |   9 +-
 lib/ts/ink_args.h                               |   2 +-
 lib/ts/ink_file.cc                              |  11 +-
 mgmt/BaseManager.h                              |   9 +-
 mgmt/LocalManager.cc                            |  39 +-
 mgmt/Makefile.am                                |   2 +-
 mgmt/ProcessManager.cc                          |   5 +-
 mgmt/api/CoreAPI.cc                             |  14 +
 mgmt/api/CoreAPI.h                              |   1 +
 mgmt/api/CoreAPIRemote.cc                       |  12 +
 mgmt/api/INKMgmtAPI.cc                          |   6 +
 mgmt/api/Makefile.am                            |   2 +-
 mgmt/api/NetworkUtilsDefs.h                     |   1 +
 mgmt/api/TSControlMain.cc                       |  34 ++
 mgmt/api/TSControlMain.h                        |   1 +
 mgmt/api/include/mgmtapi.h                      |   6 +
 proxy/ICPStats.cc                               |  52 +--
 proxy/InkAPI.cc                                 |  12 +-
 proxy/Main.cc                                   |  39 +-
 proxy/Makefile.am                               |   8 +-
 proxy/Plugin.cc                                 |  34 +-
 proxy/SocksProxy.cc                             |   4 +-
 proxy/http/HttpConfig.cc                        | 440 +++++++++----------
 proxy/http/HttpSM.cc                            |   4 +-
 proxy/http/HttpTransact.cc                      |   3 +-
 proxy/http/remap/RemapConfig.cc                 |  85 ++--
 proxy/http/remap/UrlMapping.cc                  |   7 +-
 proxy/logging/Log.cc                            |  83 ++--
 proxy/logging/Log.h                             |   4 +-
 proxy/logging/LogConfig.cc                      |   4 +-
 proxy/logging/LogStandalone.cc                  |  19 +-
 tools/Makefile.am                               |   2 +-
 68 files changed, 1127 insertions(+), 709 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a8cba7c7/CHANGES
----------------------------------------------------------------------
diff --cc CHANGES
index 4fe8ff6,d2cce2d..8a00765
--- a/CHANGES
+++ b/CHANGES
@@@ -1,10 -1,26 +1,30 @@@
                                                           -*- coding: utf-8 -*-
 +Changes with Apache Traffic Server 5.0.0
 +
 +  *) [TS-2088] Change TSRecordType enum values to powers of two
 +
  Changes with Apache Traffic Server 4.2.0
  
+   *) [TS-2519] Make build version metrics non-persistent.
+ 
+   *) [TS-1606] Log buffers are not flushed periodically when TS is launched 
+    with NO_REMOTE_MANAGEMENT flag
+ 
+   *) [TS-2481] Incorrect origin server port used sometimes (with keep-alive).
+    Author: Dimitry Andric <di...@andric.com>
+ 
+   *) [TS-2526] Remove the g_stats_snap_fpath global variable.
+ 
+   *) [TS-2525] Remove restrictions on outbound transparency with SSL.
+ 
+   *) [TS-2425] Update to TS-2261 for loading plugins as root
+ 
+   *) [TS-2505] Add traffic_line --offline option.
+ 
+   *) [TS-2305] Fall back to ftruncate if posix_fallocate fails.
+ 
+   *) [TS-2504] Support OpenSSL installations that use the lib64 directory.
+ 
    *) [TS-799] Have AdminClient.pm created from .in file.
  
    *) [TS-2509] Add the const qualifier to pure HttpTunnel member functions.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a8cba7c7/lib/records/I_RecDefs.h
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a8cba7c7/lib/records/RecCore.cc
----------------------------------------------------------------------


[10/28] git commit: Reorder the build subdirs, such that all code compiles first

Posted by zw...@apache.org.
Reorder the build subdirs, such that all code compiles first


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/38f0f0c2
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/38f0f0c2
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/38f0f0c2

Branch: refs/heads/5.0.x
Commit: 38f0f0c2b9c3b4c1a74db9c2087046a8137169e8
Parents: a5c00b2
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jan 23 05:45:23 2014 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Thu Jan 23 14:19:21 2014 +0100

----------------------------------------------------------------------
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/38f0f0c2/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index 0ad9b06..398f300 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,7 +29,7 @@ export CCACHE_BASEDIR
 # proxy/api/ts has to be built first, since so much of libraries and "core
 # depends on the generates ts/ts.h include file.
 
-SUBDIRS =  proxy/api/ts iocore lib proxy/hdrs proxy/shared mgmt proxy rc doc plugins cmd tools example
+SUBDIRS =  proxy/api/ts iocore lib proxy/hdrs proxy/shared mgmt proxy cmd plugins tools example rc doc
 
 
 DIST_BUILD_USER=`id -nu`


[05/28] git commit: TS-2505 Add --offline to traffic_line

Posted by zw...@apache.org.
TS-2505 Add --offline to traffic_line


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/f8cb3361
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/f8cb3361
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/f8cb3361

Branch: refs/heads/5.0.x
Commit: f8cb33617947d6ca27208a57cff7758fc7529391
Parents: 813d3e1
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Tue Jan 21 18:36:48 2014 -0600
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Tue Jan 21 18:36:48 2014 -0600

----------------------------------------------------------------------
 CHANGES                                     |   2 +
 cmd/traffic_line/traffic_line.cc            |   5 +
 doc/admin/configuring-traffic-server.en.rst |  26 ++--
 doc/reference/commands/traffic_line.en.rst  |  13 +-
 iocore/cache/Cache.cc                       | 153 ++++++++++++++---------
 iocore/cache/CacheTest.cc                   |  72 +++++++++++
 iocore/cache/I_Cache.h                      |  22 ++++
 iocore/cache/P_CacheDisk.h                  |   2 +-
 lib/records/I_RecEvents.h                   |   3 +
 lib/ts/ink_args.cc                          |   9 +-
 lib/ts/ink_args.h                           |   2 +-
 mgmt/BaseManager.h                          |   7 +-
 mgmt/LocalManager.cc                        |   2 +-
 mgmt/ProcessManager.cc                      |   5 +-
 mgmt/api/CoreAPI.cc                         |  14 +++
 mgmt/api/CoreAPI.h                          |   1 +
 mgmt/api/CoreAPIRemote.cc                   |  12 ++
 mgmt/api/INKMgmtAPI.cc                      |   6 +
 mgmt/api/NetworkUtilsDefs.h                 |   1 +
 mgmt/api/TSControlMain.cc                   |  34 +++++
 mgmt/api/TSControlMain.h                    |   1 +
 mgmt/api/include/mgmtapi.h                  |   6 +
 proxy/Main.cc                               |  25 ++++
 23 files changed, 339 insertions(+), 84 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index c73e4c3..0140b40 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2505] Add traffic_line --offline option.
+
   *) [TS-2305] Fall back to ftruncate if posix_fallocate fails.
 
   *) [TS-2504] Support OpenSSL installations that use the lib64 directory.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/cmd/traffic_line/traffic_line.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_line/traffic_line.cc b/cmd/traffic_line/traffic_line.cc
index 7f99f5b..f25c95d 100644
--- a/cmd/traffic_line/traffic_line.cc
+++ b/cmd/traffic_line/traffic_line.cc
@@ -46,6 +46,7 @@ static int ClearCluster;
 static int ClearNode;
 static char ZeroCluster[1024];
 static char ZeroNode[1024];
+static char StorageCmdOffline[1024];
 static int VersionFlag;
 
 static TSError
@@ -84,6 +85,8 @@ handleArgInvocation()
     fprintf(stderr, "Query Deadhosts is not implemented, it requires support for congestion control.\n");
     fprintf(stderr, "For more details, examine the old code in cli/CLI.cc: QueryDeadhosts()\n");
     return TS_ERR_FAIL;
+  } else if (*StorageCmdOffline) {
+    return TSStorageDeviceCmdOffline(StorageCmdOffline);
   } else if (*ReadVar != '\0') {        // Handle a value read
     if (*SetVar != '\0' || *VarValue != '\0') {
       fprintf(stderr, "%s: Invalid Argument Combination: Can not read and set values at the same time\n", programName);
@@ -162,6 +165,7 @@ main(int /* argc ATS_UNUSED */, char **argv)
   ZeroCluster[0] = '\0';
   ZeroNode[0] = '\0';
   VersionFlag = 0;
+  *StorageCmdOffline = 0;
 
   // build the application information structure
   appVersionInfo.setup(PACKAGE_NAME,"traffic_line", PACKAGE_VERSION, __DATE__, __TIME__, BUILD_MACHINE, BUILD_PERSON, "");
@@ -185,6 +189,7 @@ main(int /* argc ATS_UNUSED */, char **argv)
     {"clear_node", 'c', "Clear Statistics (local node)", "F", &ClearNode, NULL, NULL},
     {"zero_cluster", 'Z', "Zero Specific Statistic (cluster wide)", "S1024", &ZeroCluster, NULL, NULL},
     {"zero_node", 'z', "Zero Specific Statistic (local node)", "S1024", &ZeroNode, NULL, NULL},
+    {"offline", '-', "Mark cache storage offline", "S1024", &StorageCmdOffline, NULL, NULL},
     {"version", 'V', "Print Version Id", "T", &VersionFlag, NULL, NULL},
   };
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/doc/admin/configuring-traffic-server.en.rst
----------------------------------------------------------------------
diff --git a/doc/admin/configuring-traffic-server.en.rst b/doc/admin/configuring-traffic-server.en.rst
index ca33e86..a06eaea 100644
--- a/doc/admin/configuring-traffic-server.en.rst
+++ b/doc/admin/configuring-traffic-server.en.rst
@@ -6,20 +6,20 @@ Configuring Traffic Server
 
 .. 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
- 
+   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.
+
+   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.
 
 Traffic Server provides several options for configuring the system.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/doc/reference/commands/traffic_line.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/commands/traffic_line.en.rst b/doc/reference/commands/traffic_line.en.rst
index 08683fb..213cd40 100644
--- a/doc/reference/commands/traffic_line.en.rst
+++ b/doc/reference/commands/traffic_line.en.rst
@@ -5,9 +5,9 @@
   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
@@ -113,6 +113,13 @@ Options
 
     Reset performance statistics to zero on the local node.
 
+.. option:: --offline PATH
+
+   Mark a cache storage device as offline. The storage is identified by a *path* which must match exactly a path
+   specified in :file:`storage.config`. This removes the storage from the cache and redirects requests that would have
+   used this storage to other storage. This has exactly the same effect as a disk failure for that storage. This does
+   not persist across restarts of the :program:`traffic_server` process.
+
 .. traffic-line-performance-statistics
 
 Performance Statistics
@@ -774,7 +781,7 @@ The :option:`traffic_line -r` option accepts the following variable names::
 Examples
 ========
 
-Configure Traffic Server to log in Squid format:: 
+Configure Traffic Server to log in Squid format::
 
     $ traffic_line -s proxy.config.log.squid_log_enabled -v 1
     $ traffic_line -s proxy.config.log.squid_log_is_ascii -v 1

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 16dbc37..a8013c0 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -2039,6 +2039,7 @@ build_vol_hash_table(CacheHostRecord *cp)
   unsigned int *gotvol = (unsigned int *) ats_malloc(sizeof(unsigned int) * num_vols);
   unsigned int *rnd = (unsigned int *) ats_malloc(sizeof(unsigned int) * num_vols);
   unsigned short *ttable = (unsigned short *)ats_malloc(sizeof(unsigned short) * VOL_HASH_TABLE_SIZE);
+  unsigned short *old_table;
   unsigned int *rtable_entries = (unsigned int *) ats_malloc(sizeof(unsigned int) * num_vols);
   unsigned int rtable_size = 0;
 
@@ -2088,8 +2089,8 @@ build_vol_hash_table(CacheHostRecord *cp)
     Debug("cache_init", "build_vol_hash_table index %d mapped to %d requested %d got %d", i, mapping[i], forvol[i], gotvol[i]);
   }
   // install new table
-  if (cp->vol_hash_table)
-    new_Freer(cp->vol_hash_table, CACHE_MEM_FREE_TIMEOUT);
+  if (0 != (old_table = ink_atomic_swap(&(cp->vol_hash_table), ttable)))
+    new_Freer(old_table, CACHE_MEM_FREE_TIMEOUT);
   ats_free(mapping);
   ats_free(p);
   ats_free(forvol);
@@ -2097,7 +2098,6 @@ build_vol_hash_table(CacheHostRecord *cp)
   ats_free(rnd);
   ats_free(rtable_entries);
   ats_free(rtable);
-  cp->vol_hash_table = ttable;
 }
 
 void
@@ -2108,29 +2108,94 @@ Cache::vol_initialized(bool result) {
     open_done();
 }
 
+/** Set the state of a disk programmatically.
+*/
+bool
+CacheProcessor::mark_storage_offline( CacheDisk* d ///< Target disk
+  ) {
+  bool zret; // indicates whether there's any online storage left.
+  int p;
+  uint64_t total_bytes_delete = 0;
+  uint64_t total_dir_delete = 0;
+  uint64_t used_dir_delete = 0;
+
+  if (!DISK_BAD(d)) SET_DISK_BAD(d);
+
+  for (p = 0; p < gnvol; p++) {
+    if (d->fd == gvol[p]->fd) {
+      total_dir_delete += gvol[p]->buckets * gvol[p]->segments * DIR_DEPTH;
+      used_dir_delete += dir_entries_used(gvol[p]);
+      total_bytes_delete += gvol[p]->len - vol_dirlen(gvol[p]);
+    }
+  }
+
+  RecIncrGlobalRawStat(cache_rsb, cache_bytes_total_stat, -total_bytes_delete);
+  RecIncrGlobalRawStat(cache_rsb, cache_direntries_total_stat, -total_dir_delete);
+  RecIncrGlobalRawStat(cache_rsb, cache_direntries_used_stat, -used_dir_delete);
+
+  if (theCache) {
+    rebuild_host_table(theCache);
+  }
+  if (theStreamCache) {
+    rebuild_host_table(theStreamCache);
+  }
+
+  zret = this->has_online_storage();
+  if (!zret) {
+    Warning("All storage devices offline, cache disabled");
+    CacheProcessor::cache_ready = 0;
+  } else { // check cache types specifically
+    if (theCache && !theCache->hosttable->gen_host_rec.vol_hash_table) {
+      unsigned int caches_ready = 0;
+      caches_ready = caches_ready | (1 << CACHE_FRAG_TYPE_HTTP);
+      caches_ready = caches_ready | (1 << CACHE_FRAG_TYPE_NONE);
+      caches_ready = ~caches_ready;
+      CacheProcessor::cache_ready &= caches_ready;
+      Warning("all volumes for http cache are corrupt, http cache disabled");
+    }
+    if (theStreamCache && !theStreamCache->hosttable->gen_host_rec.vol_hash_table) {
+      unsigned int caches_ready = 0;
+      caches_ready = caches_ready | (1 << CACHE_FRAG_TYPE_RTSP);
+      caches_ready = ~caches_ready;
+      CacheProcessor::cache_ready &= caches_ready;
+      Warning("all volumes for mixt cache are corrupt, mixt cache disabled");
+    }
+  }
+
+  return zret;
+}
+
+bool
+CacheProcessor::has_online_storage() const {
+  CacheDisk** dptr = gdisks;
+  for (int disk_no = 0 ; disk_no < gndisks ; ++disk_no, ++dptr) {
+    if (!DISK_BAD(*dptr)) return true;
+  }
+  return false;
+}
+
 int
 AIO_Callback_handler::handle_disk_failure(int /* event ATS_UNUSED */, void *data) {
   /* search for the matching file descriptor */
   if (!CacheProcessor::cache_ready)
     return EVENT_DONE;
   int disk_no = 0;
-  int good_disks = 0;
   AIOCallback *cb = (AIOCallback *) data;
 #if TS_USE_INTERIM_CACHE == 1
   for (; disk_no < gn_interim_disks; disk_no++) {
     CacheDisk *d = g_interim_disks[disk_no];
 
     if (d->fd == cb->aiocb.aio_fildes) {
+      char message[256];
+
       d->num_errors++;
       if (!DISK_BAD(d)) {
-        char message[128];
-        snprintf(message, sizeof(message), "Error accessing Disk %s", d->path);
+        snprintf(message, sizeof(message), "Error accessing Disk %s [%d/%d]", d->path, d->num_errors, cache_config_max_disk_errors);
         Warning("%s", message);
         REC_SignalManager(REC_SIGNAL_CACHE_WARNING, message);
       } else if (!DISK_BAD_SIGNALLED(d)) {
-        char message[128];
         snprintf(message, sizeof(message),
-            "too many errors accessing disk %s: declaring disk bad", d->path);
+                 "too many errors [%d] accessing disk %s: declaring disk bad", d->num_errors, d->path);
         Warning("%s", message);
         REC_SignalManager(REC_SIGNAL_CACHE_ERROR, message);
         good_interim_disks--;
@@ -2138,77 +2203,28 @@ AIO_Callback_handler::handle_disk_failure(int /* event ATS_UNUSED */, void *data
     }
   }
 #endif
+
   for (; disk_no < gndisks; disk_no++) {
     CacheDisk *d = gdisks[disk_no];
 
     if (d->fd == cb->aiocb.aio_fildes) {
+      char message[256];
       d->num_errors++;
 
       if (!DISK_BAD(d)) {
-        char message[128];
         snprintf(message, sizeof(message), "Error accessing Disk %s [%d/%d]", d->path, d->num_errors, cache_config_max_disk_errors);
         Warning("%s", message);
         REC_SignalManager(REC_SIGNAL_CACHE_WARNING, message);
       } else if (!DISK_BAD_SIGNALLED(d)) {
-
-        char message[128];
         snprintf(message, sizeof(message), "too many errors accessing disk %s [%d/%d]: declaring disk bad", d->path, d->num_errors, cache_config_max_disk_errors);
         Warning("%s", message);
         REC_SignalManager(REC_SIGNAL_CACHE_ERROR, message);
-        /* subtract the disk space that was being used from  the cache size stat */
-        // dir entries stat
-        int p;
-        uint64_t total_bytes_delete = 0;
-        uint64_t total_dir_delete = 0;
-        uint64_t used_dir_delete = 0;
-
-        for (p = 0; p < gnvol; p++) {
-          if (d->fd == gvol[p]->fd) {
-            total_dir_delete += gvol[p]->buckets * gvol[p]->segments * DIR_DEPTH;
-            used_dir_delete += dir_entries_used(gvol[p]);
-            total_bytes_delete += gvol[p]->len - vol_dirlen(gvol[p]);
-          }
-        }
-
-        RecIncrGlobalRawStat(cache_rsb, cache_bytes_total_stat, -total_bytes_delete);
-        RecIncrGlobalRawStat(cache_rsb, cache_direntries_total_stat, -total_dir_delete);
-        RecIncrGlobalRawStat(cache_rsb, cache_direntries_used_stat, -used_dir_delete);
-
-        if (theCache) {
-          rebuild_host_table(theCache);
-        }
-        if (theStreamCache) {
-          rebuild_host_table(theStreamCache);
-        }
+        cacheProcessor.mark_storage_offline(d); // take it out of service
       }
-      if (good_disks)
-        return EVENT_DONE;
+      break;
     }
-    if (!DISK_BAD(d))
-      good_disks++;
-  }
-  if (!good_disks) {
-    Warning("all disks are bad, cache disabled");
-    CacheProcessor::cache_ready = 0;
-    delete cb;
-    return EVENT_DONE;
   }
 
-  if (theCache && !theCache->hosttable->gen_host_rec.vol_hash_table) {
-    unsigned int caches_ready = 0;
-    caches_ready = caches_ready | (1 << CACHE_FRAG_TYPE_HTTP);
-    caches_ready = caches_ready | (1 << CACHE_FRAG_TYPE_NONE);
-    caches_ready = ~caches_ready;
-    CacheProcessor::cache_ready &= caches_ready;
-    Warning("all volumes for http cache are corrupt, http cache disabled");
-  }
-  if (theStreamCache && !theStreamCache->hosttable->gen_host_rec.vol_hash_table) {
-    unsigned int caches_ready = 0;
-    caches_ready = caches_ready | (1 << CACHE_FRAG_TYPE_RTSP);
-    caches_ready = ~caches_ready;
-    CacheProcessor::cache_ready &= caches_ready;
-    Warning("all volumes for mixt cache are corrupt, mixt cache disabled");
-  }
   delete cb;
   return EVENT_DONE;
 }
@@ -3475,3 +3491,18 @@ CacheProcessor::remove(Continuation *cont, URL *url, bool cluster_cache_local, C
   return caches[frag_type]->remove(cont, &md5, frag_type, true, false, const_cast<char*>(hostname), len);
 }
 
+CacheDisk*
+CacheProcessor::find_by_path(char const* path, int len)
+{
+  if (CACHE_INITIALIZED == initialized) {
+    // If no length is passed in, assume it's null terminated.
+    if (0 >= len && 0 != *path) len = strlen(path);
+
+    for ( int i = 0 ; i < gndisks ; ++i ) {
+      if (0 == strncmp(path, gdisks[i]->path, len))
+        return gdisks[i];
+    }
+  }
+
+  return 0;
+}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/iocore/cache/CacheTest.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/CacheTest.cc b/iocore/cache/CacheTest.cc
index ecc1a72..3c601ca 100644
--- a/iocore/cache/CacheTest.cc
+++ b/iocore/cache/CacheTest.cc
@@ -415,3 +415,75 @@ EXCLUSIVE_REGRESSION_TEST(cache)(RegressionTest *t, int /* atype ATS_UNUSED */,
 
 void force_link_CacheTest() {
 }
+
+// run -R 3 -r cache_disk_replacement_stability
+
+REGRESSION_TEST(cache_disk_replacement_stability)(RegressionTest *t, int level, int *pstatus) {
+  static int const MAX_VOLS = 26; // maximum values used in any test.
+  static uint64_t DEFAULT_SKIP = 8192;
+  static uint64_t DEFAULT_STRIPE_SIZE = 1024ULL * 1024 * 1024 * 911; // 911G
+  CacheDisk disk; // Only need one because it's just checked for failure.
+  CacheHostRecord hr1, hr2;
+  Vol* sample;
+  static int const sample_idx = 16;
+  Vol vols[MAX_VOLS];
+  Vol* vol_ptrs[MAX_VOLS]; // array of pointers.
+  char buff[2048];
+
+  // Only run at the highest levels.
+  if (REGRESSION_TEST_EXTENDED > level) {
+    *pstatus = REGRESSION_TEST_PASSED;
+    return;
+  }
+
+  *pstatus = REGRESSION_TEST_INPROGRESS;
+
+  disk.num_errors = 0;
+
+  for ( int i = 0 ; i < MAX_VOLS ; ++i ) {
+    vol_ptrs[i] = vols + i;
+    vols[i].disk = &disk;
+    vols[i].len = DEFAULT_STRIPE_SIZE;
+    snprintf(buff, sizeof(buff), "/dev/sd%c %" PRIu64 ":%" PRIu64,
+             'a' + i, DEFAULT_SKIP, vols[i].len);
+    vols[i].hash_id_md5.encodeBuffer(buff, strlen(buff));
+  }
+
+  hr1.vol_hash_table = 0;
+  hr1.vols = vol_ptrs;
+  hr1.num_vols = MAX_VOLS;
+  build_vol_hash_table(&hr1);
+
+  hr2.vol_hash_table = 0;
+  hr2.vols = vol_ptrs;
+  hr2.num_vols = MAX_VOLS;
+
+  sample = vols + sample_idx;
+  sample->len = 1024ULL * 1024 * 1024 * (1024+128); // 1.1 TB
+  snprintf(buff, sizeof(buff), "/dev/sd%c %" PRIu64 ":%" PRIu64,
+           'a' + sample_idx, DEFAULT_SKIP, sample->len);
+  sample->hash_id_md5.encodeBuffer(buff, strlen(buff));
+  build_vol_hash_table(&hr2);
+
+  // See what the difference is
+  int to = 0, from = 0;
+  int then = 0, now = 0;
+  for ( int i = 0 ; i < VOL_HASH_TABLE_SIZE ; ++i ) {
+    if (hr1.vol_hash_table[i] == sample_idx) ++then;
+    if (hr2.vol_hash_table[i] == sample_idx) ++now;
+    if (hr1.vol_hash_table[i] != hr2.vol_hash_table[i]) {
+      if (hr1.vol_hash_table[i] == sample_idx)
+        ++from;
+      else
+        ++to;
+    }
+  }
+  rprintf(t, "Cache stability difference - "
+          "delta = %d of %d : %d to, %d from, originally %d slots, now %d slots (net gain = %d/%d)\n"
+          , to+from, VOL_HASH_TABLE_SIZE, to, from, then, now, now-then, to-from
+    );
+  *pstatus = REGRESSION_TEST_PASSED;
+
+  hr1.vols = 0;
+  hr2.vols = 0;
+}

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/iocore/cache/I_Cache.h
----------------------------------------------------------------------
diff --git a/iocore/cache/I_Cache.h b/iocore/cache/I_Cache.h
index b89357f..5a84f0f 100644
--- a/iocore/cache/I_Cache.h
+++ b/iocore/cache/I_Cache.h
@@ -52,6 +52,7 @@
 #define CACHE_COMPRESSION_LIBLZMA        3
 
 struct CacheVC;
+struct CacheDisk;
 #ifdef HTTP_CACHE
 class CacheLookupHttpConfig;
 class URL;
@@ -132,6 +133,27 @@ struct CacheProcessor:public Processor
 
   Action *deref(Continuation *cont, CacheKey *key, bool cluster_cache_local,
                 CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
+
+  /** Mark physical disk/device/file as offline.
+      All stripes for this device are disabled.
+
+      @return @c true if there are any storage devices remaining online, @c false if not.
+
+      @note This is what is called if a disk is disabled due to I/O errors.
+  */
+  bool mark_storage_offline(CacheDisk* d);
+
+  /** Find the storage for a @a path.
+      If @a len is 0 then @a path is presumed null terminated.
+      @return @c NULL if the path does not match any defined storage.
+   */
+  CacheDisk* find_by_path(char const* path, int len = 0);
+
+  /** Check if there are any online storage devices.
+      If this returns @c false then the cache should be disabled as there is no storage available.
+  */
+  bool has_online_storage() const;
+
   static int IsCacheEnabled();
 
   static bool IsCacheReady(CacheFragType type);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/iocore/cache/P_CacheDisk.h
----------------------------------------------------------------------
diff --git a/iocore/cache/P_CacheDisk.h b/iocore/cache/P_CacheDisk.h
index e5133d5..c704bdc 100644
--- a/iocore/cache/P_CacheDisk.h
+++ b/iocore/cache/P_CacheDisk.h
@@ -28,7 +28,7 @@
 
 extern int cache_config_max_disk_errors;
 
-#define DISK_BAD(_x)                    (_x->num_errors >= cache_config_max_disk_errors)
+#define DISK_BAD(_x)                    ((_x)->num_errors >= cache_config_max_disk_errors)
 #define DISK_BAD_SIGNALLED(_x)          (_x->num_errors > cache_config_max_disk_errors)
 #define SET_DISK_BAD(_x)                (_x->num_errors = cache_config_max_disk_errors)
 #define SET_DISK_OKAY(_x)               (_x->num_errors = 0)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/lib/records/I_RecEvents.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecEvents.h b/lib/records/I_RecEvents.h
index bb7f580..7454b48 100644
--- a/lib/records/I_RecEvents.h
+++ b/lib/records/I_RecEvents.h
@@ -35,5 +35,8 @@
 #define REC_EVENT_HTTP_CLUSTER_DELTA    10007
 #define REC_EVENT_ROLL_LOG_FILES        10008
 #define REC_EVENT_LIBRECORDS            10009
+#define REC_EVENT_CONFIG_FILE_UPDATE_NO_INC_VERSION   10010
+
+#define REC_EVENT_CACHE_DISK_CONTROL     10011
 
 #endif

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/lib/ts/ink_args.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_args.cc b/lib/ts/ink_args.cc
index ba537b9..59722ef 100644
--- a/lib/ts/ink_args.cc
+++ b/lib/ts/ink_args.cc
@@ -213,8 +213,13 @@ usage(const ArgumentDescription * argument_descriptions, unsigned n_argument_des
   for (unsigned i = 0; i < n_argument_descriptions; i++) {
     if (!argument_descriptions[i].description)
       continue;
-    fprintf(stderr, "  -%c, --%-17s %s",
-            argument_descriptions[i].key,
+
+    fprintf(stderr, "  ");
+
+    if ('-' == argument_descriptions[i].key) fprintf(stderr, "   ");
+    else fprintf(stderr, "-%c,", argument_descriptions[i].key);
+                                               
+    fprintf(stderr, " --%-17s %s",
             argument_descriptions[i].name,
             argument_types_descriptions[argument_descriptions[i].type ?
                                         strchr(argument_types_keys,

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/lib/ts/ink_args.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_args.h b/lib/ts/ink_args.h
index c32aa1a..74d1081 100644
--- a/lib/ts/ink_args.h
+++ b/lib/ts/ink_args.h
@@ -40,7 +40,7 @@ typedef void ArgumentFunction(const ArgumentDescription * argument_descriptions,
 struct ArgumentDescription
 {
   const char *name;
-  char key;
+  char key; // set to '-' if no single character key.
   /*
      "I" = integer
      "L" = int64_t

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/BaseManager.h
----------------------------------------------------------------------
diff --git a/mgmt/BaseManager.h b/mgmt/BaseManager.h
index 5063a93..a651e28 100644
--- a/mgmt/BaseManager.h
+++ b/mgmt/BaseManager.h
@@ -64,10 +64,15 @@
 #define MGMT_EVENT_ROLL_LOG_FILES        10008
 #define MGMT_EVENT_LIBRECORDS            10009
 #define MGMT_EVENT_CONFIG_FILE_UPDATE_NO_INC_VERSION   10010
+// cache storage operations - each is a distinct event.
+// this is done because the code paths share nothing but boilerplate logic
+// so it's easier to do this than to try to encode an opcode and yet another
+// case statement.
+#define MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE     10011
 
 /***********************************************************************
  *
- * MODULAIZATTION: if you are adding new signals, please ensure to add
+ * MODULARIZATION: if you are adding new signals, please ensure to add
  *                 the corresponding signals in librecords/I_RecSignals.h
  *
  *

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/LocalManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index dc30dcd..898e87c 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -909,7 +909,7 @@ LocalManager::processEventQueue()
         ink_assert(enqueue(mgmt_event_queue, mh));
         return;
       }
-      Debug("lm", "[TrafficManager] ==> Sending signal event '%d'\n", mh->msg_id);
+      Debug("lm", "[TrafficManager] ==> Sending signal event '%d' payload=%d\n", mh->msg_id, mh->data_len);
       lmgmt->sendMgmtMsgToProcesses(mh);
     }
     ats_free(mh);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/ProcessManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/ProcessManager.cc b/mgmt/ProcessManager.cc
index 35bbae6..0328893 100644
--- a/mgmt/ProcessManager.cc
+++ b/mgmt/ProcessManager.cc
@@ -125,7 +125,7 @@ ProcessManager::processEventQueue()
   while (!queue_is_empty(mgmt_event_queue)) {
     MgmtMessageHdr *mh = (MgmtMessageHdr *) dequeue(mgmt_event_queue);
 
-    Debug("pmgmt", "[ProcessManager] ==> Processing event id '%d'\n", mh->msg_id);
+    Debug("pmgmt", "[ProcessManager] ==> Processing event id '%d' payload=%d\n", mh->msg_id, mh->data_len);
     if (mh->data_len > 0) {
       executeMgmtCallback(mh->msg_id, (char *) mh + sizeof(MgmtMessageHdr), mh->data_len);
     } else {
@@ -333,6 +333,9 @@ ProcessManager::handleMgmtMsgFromLM(MgmtMessageHdr * mh)
   case MGMT_EVENT_LIBRECORDS:
     signalMgmtEntity(MGMT_EVENT_LIBRECORDS, data_raw, mh->data_len);
     break;
+  case MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE:
+    signalMgmtEntity(MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE, data_raw, mh->data_len);
+    break;
   default:
     mgmt_elog(stderr, 0, "[ProcessManager::pollLMConnection] unknown type %d\n", mh->msg_id);
     break;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/api/CoreAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPI.cc b/mgmt/api/CoreAPI.cc
index 370d6a7..b99d616 100644
--- a/mgmt/api/CoreAPI.cc
+++ b/mgmt/api/CoreAPI.cc
@@ -291,6 +291,20 @@ Bounce(bool cluster)
   return TS_ERR_OKAY;
 }
 
+/*-------------------------------------------------------------------------
+ * StorageDeviceCmdOffline
+ *-------------------------------------------------------------------------
+ * Disable a storage device.
+ * [amc] I don't think this is called but is required because of the way the
+ * CoreAPI is linked (it must match the remote CoreAPI signature so compiling
+ * this source or CoreAPIRemote.cc yields the same set of symbols).
+ */
+TSError
+StorageDeviceCmdOffline(char const* dev)
+{
+  lmgmt->signalEvent(MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE, dev);
+  return TS_ERR_OKAY;
+}
 /**************************************************************************
  * RECORD OPERATIONS
  *************************************************************************/

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/api/CoreAPI.h
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPI.h b/mgmt/api/CoreAPI.h
index dfd2cc1..87dd84e 100644
--- a/mgmt/api/CoreAPI.h
+++ b/mgmt/api/CoreAPI.h
@@ -55,6 +55,7 @@ TSError Reconfigure();         // TS reread config files
 TSError Restart(bool cluster); //restart TM
 TSError HardRestart();         //restart traffic_cop
 TSError Bounce(bool cluster);  //restart traffic_server
+TSError StorageDeviceCmdOffline(char const* dev); // Storage device operation.
 
 /***************************************************************************
  * Record Operations

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/api/CoreAPIRemote.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/CoreAPIRemote.cc b/mgmt/api/CoreAPIRemote.cc
index 6c0ecc3..8ccdac0 100644
--- a/mgmt/api/CoreAPIRemote.cc
+++ b/mgmt/api/CoreAPIRemote.cc
@@ -464,6 +464,18 @@ Bounce(bool cluster)
 }
 
 
+/*-------------------------------------------------------------------------
+ * StorageDeviceCmdOffline
+ *-------------------------------------------------------------------------
+ * Disable a storage device.
+ */
+TSError
+StorageDeviceCmdOffline(char const* dev)
+{
+  TSError ret;
+  ret = send_request_name(main_socket_fd, STORAGE_DEVICE_CMD_OFFLINE, dev);
+  return TS_ERR_OKAY != ret ? ret : parse_reply(main_socket_fd);
+}
 /***************************************************************************
  * Record Operations
  ***************************************************************************/

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/api/INKMgmtAPI.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/INKMgmtAPI.cc b/mgmt/api/INKMgmtAPI.cc
index ac9a139..709debc 100644
--- a/mgmt/api/INKMgmtAPI.cc
+++ b/mgmt/api/INKMgmtAPI.cc
@@ -1819,6 +1819,12 @@ TSBounce(bool cluster)
   return Bounce(cluster);
 }
 
+tsapi TSError
+TSStorageDeviceCmdOffline(char const* dev)
+{
+  return StorageDeviceCmdOffline(dev);
+}
+
 
 /*--- diags output operations ---------------------------------------------*/
 tsapi void

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/api/NetworkUtilsDefs.h
----------------------------------------------------------------------
diff --git a/mgmt/api/NetworkUtilsDefs.h b/mgmt/api/NetworkUtilsDefs.h
index 987874a..6f0127b 100644
--- a/mgmt/api/NetworkUtilsDefs.h
+++ b/mgmt/api/NetworkUtilsDefs.h
@@ -79,6 +79,7 @@ typedef enum
   DIAGS,
   STATS_RESET_NODE,
   STATS_RESET_CLUSTER,
+  STORAGE_DEVICE_CMD_OFFLINE,
   UNDEFINED_OP /* This must be last */
 } OpType;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/api/TSControlMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/api/TSControlMain.cc b/mgmt/api/TSControlMain.cc
index d96c6a9..c507f5b 100644
--- a/mgmt/api/TSControlMain.cc
+++ b/mgmt/api/TSControlMain.cc
@@ -317,6 +317,17 @@ ts_ctrl_main(void *arg)
               }
               break;
 
+            case STORAGE_DEVICE_CMD_OFFLINE:
+              ret = handle_storage_device_cmd_offline(client_entry->sock_info, req);
+              ats_free(req);     // free the request allocated by preprocess_msg
+              if (ret == TS_ERR_NET_WRITE || ret == TS_ERR_NET_EOF) {
+                Debug("ts_main", "[ts_ctrl_main] ERROR:handle_storage_device_cmd_offline\n");
+                remove_client(client_entry, accepted_con);
+                con_entry = ink_hash_table_iterator_next(accepted_con, &con_state);
+                continue;
+              }
+              break;
+
             case EVENT_RESOLVE:
               ret = handle_event_resolve(client_entry->sock_info, req);
               ats_free(req);     // free the request allocated by preprocess_msg
@@ -732,6 +743,29 @@ handle_restart(struct SocketInfo sock_info, char *req, bool bounce)
 }
 
 /**************************************************************************
+ * handle_storage_device_cmd_offline
+ *
+ * purpose: handle storage offline command.
+ * input: struct SocketInfo sock_info - the socket to use to talk to client
+ * output: TS_ERR_xx
+ * note: None
+ *************************************************************************/
+TSError
+handle_storage_device_cmd_offline(struct SocketInfo sock_info, char *req)
+{
+  TSError ret = TS_ERR_OKAY;
+
+  if (!req) {
+    ret = send_reply(sock_info, TS_ERR_PARAMS);
+    return ret;                 // shouldn't get here
+  }
+  // forward to server
+  lmgmt->signalEvent(MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE, req);
+  ret = send_reply(sock_info, ret);
+  return ret;
+}
+
+/**************************************************************************
  * handle_event_resolve
  *
  * purpose: handles request to resolve an event

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/api/TSControlMain.h
----------------------------------------------------------------------
diff --git a/mgmt/api/TSControlMain.h b/mgmt/api/TSControlMain.h
index 4be762d..397b8bb 100644
--- a/mgmt/api/TSControlMain.h
+++ b/mgmt/api/TSControlMain.h
@@ -58,6 +58,7 @@ TSError handle_proxy_state_get(struct SocketInfo sock_info);
 TSError handle_proxy_state_set(struct SocketInfo sock_info, char *req);
 TSError handle_reconfigure(struct SocketInfo sock_info);
 TSError handle_restart(struct SocketInfo sock_info, char *req, bool bounce);
+TSError handle_storage_device_cmd_offline(struct SocketInfo sock_info, char *req);
 
 TSError handle_event_resolve(struct SocketInfo sock_info, char *req);
 TSError handle_event_get_mlt(struct SocketInfo sock_info);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/mgmt/api/include/mgmtapi.h
----------------------------------------------------------------------
diff --git a/mgmt/api/include/mgmtapi.h b/mgmt/api/include/mgmtapi.h
index c562733..7b962a6 100644
--- a/mgmt/api/include/mgmtapi.h
+++ b/mgmt/api/include/mgmtapi.h
@@ -1026,6 +1026,12 @@ extern "C"
  */
   tsapi TSError TSBounce(bool cluster);
 
+/* TSStorageDeviceOp: Request an operation on a storage device.
+ * @arg dev Target device, specified by path to device.
+ * @return Success.
+ */
+  tsapi TSError TSStorageDeviceCmdOffline(char const* dev);
+
 /*--- diags output operations ---------------------------------------------*/
 /* TSDiags: enables users to manipulate run-time diagnostics, and print
  *           user-formatted notices, warnings and errors

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f8cb3361/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index d715319..a48e48a 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -117,6 +117,7 @@ extern "C" int plock(int);
 static const long MAX_LOGIN =  sysconf(_SC_LOGIN_NAME_MAX) <= 0 ? _POSIX_LOGIN_NAME_MAX :  sysconf(_SC_LOGIN_NAME_MAX);
 
 static void * mgmt_restart_shutdown_callback(void *, char *, int data_len);
+static void*  mgmt_storage_device_cmd_callback(void* x, char* data, int len);
 
 static int version_flag = DEFAULT_VERSION_FLAG;
 
@@ -1624,6 +1625,11 @@ main(int /* argc ATS_UNUSED */, char **argv)
     pmgmt->registerMgmtCallback(MGMT_EVENT_SHUTDOWN, mgmt_restart_shutdown_callback, NULL);
     pmgmt->registerMgmtCallback(MGMT_EVENT_RESTART, mgmt_restart_shutdown_callback, NULL);
 
+    // Callback for various storage commands. These all go to the same function so we
+    // pass the event code along so it can do the right thing. We cast that to <int> first
+    // just to be safe because the value is a #define, not a typed value.
+    pmgmt->registerMgmtCallback(MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE, mgmt_storage_device_cmd_callback, reinterpret_cast<void*>(static_cast<int>(MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE)));
+
     // The main thread also becomes a net thread.
     ink_set_thread_name("[ET_NET 0]");
 
@@ -1670,3 +1676,22 @@ mgmt_restart_shutdown_callback(void *, char *, int /* data_len ATS_UNUSED */)
   sync_cache_dir_on_shutdown();
   return NULL;
 }
+
+static void*
+mgmt_storage_device_cmd_callback(void* data, char* arg, int len)
+{
+  // data is the device name to control
+  CacheDisk* d = cacheProcessor.find_by_path(arg, len);
+  // Actual command is in @a data.
+  intptr_t cmd = reinterpret_cast<intptr_t>(data);
+
+  if (d) {
+    switch (cmd) {
+    case MGMT_EVENT_STORAGE_DEVICE_CMD_OFFLINE:
+      Debug("server", "Marking %.*s offline", len, arg);
+      cacheProcessor.mark_storage_offline(d);
+      break;
+    }
+  }
+  return NULL;
+}


[20/28] git commit: s/and/an/

Posted by zw...@apache.org.
s/and/an/


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c4b5e554
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c4b5e554
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c4b5e554

Branch: refs/heads/5.0.x
Commit: c4b5e554d8a3d6a50d9bc9c755e59ddb7fc9b12d
Parents: 2fe9722
Author: James Peach <jp...@apache.org>
Authored: Fri Jan 24 15:00:52 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Fri Jan 24 15:01:03 2014 -0800

----------------------------------------------------------------------
 proxy/logging/LogConfig.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c4b5e554/proxy/logging/LogConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogConfig.cc b/proxy/logging/LogConfig.cc
index 133ea21..6b381ce 100644
--- a/proxy/logging/LogConfig.cc
+++ b/proxy/logging/LogConfig.cc
@@ -596,9 +596,9 @@ LogConfig::setup_collation(LogConfig * prev_config)
     }
   } else {
     if (!collation_port) {
-      Note("Cannot activate log collation, %d is and invalid " "collation port", collation_port);
+      Note("Cannot activate log collation, %d is an invalid collation port", collation_port);
     } else if (collation_mode > COLLATION_HOST && strcmp(collation_host, "none") == 0) {
-      Note("Cannot activate log collation, \"%s\" is and invalid " "collation host", collation_host);
+      Note("Cannot activate log collation, \"%s\" is an invalid collation host", collation_host);
     } else {
       if (collation_mode == COLLATION_HOST) {
 


[04/28] git commit: TS-2305: fall back to ftruncate on posix_fallocate failure

Posted by zw...@apache.org.
TS-2305: fall back to ftruncate on posix_fallocate failure


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/813d3e1a
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/813d3e1a
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/813d3e1a

Branch: refs/heads/5.0.x
Commit: 813d3e1a261c46ff18e7837636b7b4ce5f931a2c
Parents: 207df86
Author: James Peach <jp...@apache.org>
Authored: Mon Jan 20 10:52:46 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Jan 21 15:53:03 2014 -0800

----------------------------------------------------------------------
 CHANGES            |  2 ++
 lib/ts/ink_file.cc | 11 ++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/813d3e1a/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 5e1075e..c73e4c3 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2305] Fall back to ftruncate if posix_fallocate fails.
+
   *) [TS-2504] Support OpenSSL installations that use the lib64 directory.
 
   *) [TS-799] Have AdminClient.pm created from .in file.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/813d3e1a/lib/ts/ink_file.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_file.cc b/lib/ts/ink_file.cc
index 53d064f..41891f1 100644
--- a/lib/ts/ink_file.cc
+++ b/lib/ts/ink_file.cc
@@ -344,14 +344,19 @@ ink_file_fd_zerofill(int fd, off_t size)
     return errno;
   }
 
+  // ZFS does not implement posix_fallocate() and fails with EINVAL. As a general workaround,
+  // just fall back to ftrucate if the preallocation fails.
 #if HAVE_POSIX_FALLOCATE
-  return posix_fallocate(fd, 0, size);
-#else
+  if (posix_fallocate(fd, 0, size) == 0) {
+    return 0;
+  }
+#endif
+
   if (ftruncate(fd, size) < 0) {
     return errno;
   }
+
   return 0;
-#endif
 }
 
 bool


[15/28] git commit: TS-2425: Update to TS-2261 for loading plugins as root

Posted by zw...@apache.org.
TS-2425: Update to TS-2261 for loading plugins as root


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/cd86569e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/cd86569e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/cd86569e

Branch: refs/heads/5.0.x
Commit: cd86569e9342829fe72e7a4b6492157fb352fa0b
Parents: 0089777
Author: Bryan Call <bc...@apache.org>
Authored: Thu Jan 23 15:50:14 2014 +0100
Committer: Bryan Call <bc...@apache.org>
Committed: Thu Jan 23 15:50:14 2014 +0100

----------------------------------------------------------------------
 CHANGES                         |  2 +
 proxy/Plugin.cc                 | 34 +++++++--------
 proxy/http/remap/RemapConfig.cc | 85 +++++++++++++++++-------------------
 proxy/http/remap/UrlMapping.cc  |  7 +--
 4 files changed, 59 insertions(+), 69 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cd86569e/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 0140b40..e795406 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2425] Update to TS-2261 for loading plugins as root
+
   *) [TS-2505] Add traffic_line --offline option.
 
   *) [TS-2305] Fall back to ftruncate if posix_fallocate fails.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cd86569e/proxy/Plugin.cc
----------------------------------------------------------------------
diff --git a/proxy/Plugin.cc b/proxy/Plugin.cc
index 56e2a68..0d315b6 100644
--- a/proxy/Plugin.cc
+++ b/proxy/Plugin.cc
@@ -111,29 +111,29 @@ plugin_load(int argc, char *argv[])
     }
     plugin_reg_temp = (plugin_reg_temp->link).next;
   }
-
-  handle = dll_open(path);
-  if (!handle) {
-    Fatal("unable to load '%s': %s", path, dll_error(handle));
-  }
-
-  // Allocate a new registration structure for the
-  //    plugin we're starting up
-  ink_assert(plugin_reg_current == NULL);
-  plugin_reg_current = new PluginRegInfo;
-  plugin_reg_current->plugin_path = ats_strdup(path);
-
-  init = (init_func_t) dll_findsym(handle, "TSPluginInit");
-  if (!init) {
-    Fatal("unable to find TSPluginInit function '%s': %s", path, dll_error(handle));
-  }
-
   // elevate the access to read files as root if compiled with capabilities, if not
   // change the effective user to root
   {
     uint32_t elevate_access = 0;
     REC_ReadConfigInteger(elevate_access, "proxy.config.plugin.load_elevated");
     ElevateAccess access(elevate_access != 0);
+
+    handle = dll_open(path);
+    if (!handle) {
+      Fatal("unable to load '%s': %s", path, dll_error(handle));
+    }
+
+    // Allocate a new registration structure for the
+    //    plugin we're starting up
+    ink_assert(plugin_reg_current == NULL);
+    plugin_reg_current = new PluginRegInfo;
+    plugin_reg_current->plugin_path = ats_strdup(path);
+
+    init = (init_func_t) dll_findsym(handle, "TSPluginInit");
+    if (!init) {
+      Fatal("unable to find TSPluginInit function '%s': %s", path, dll_error(handle));
+    }
+
     init(argc, argv);
   } // done elevating access
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cd86569e/proxy/http/remap/RemapConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/remap/RemapConfig.cc b/proxy/http/remap/RemapConfig.cc
index bc4a16b..787fbb0 100644
--- a/proxy/http/remap/RemapConfig.cc
+++ b/proxy/http/remap/RemapConfig.cc
@@ -663,44 +663,6 @@ remap_load_plugin(const char ** argv, int argc, url_mapping *mp, char *errbuf, i
     }
     Debug("remap_plugin", "New remap plugin info created for \"%s\"", c);
 
-    if ((pi->dlh = dlopen(c, RTLD_NOW)) == NULL) {
-#if defined(freebsd) || defined(openbsd)
-      err = (char *)dlerror();
-#else
-      err = dlerror();
-#endif
-      snprintf(errbuf, errbufsize, "Can't load plugin \"%s\" - %s", c, err ? err : "Unknown dlopen() error");
-      return -4;
-    }
-    pi->fp_tsremap_init = (remap_plugin_info::_tsremap_init *) dlsym(pi->dlh, TSREMAP_FUNCNAME_INIT);
-    pi->fp_tsremap_done = (remap_plugin_info::_tsremap_done *) dlsym(pi->dlh, TSREMAP_FUNCNAME_DONE);
-    pi->fp_tsremap_new_instance = (remap_plugin_info::_tsremap_new_instance *) dlsym(pi->dlh, TSREMAP_FUNCNAME_NEW_INSTANCE);
-    pi->fp_tsremap_delete_instance = (remap_plugin_info::_tsremap_delete_instance *) dlsym(pi->dlh, TSREMAP_FUNCNAME_DELETE_INSTANCE);
-    pi->fp_tsremap_do_remap = (remap_plugin_info::_tsremap_do_remap *) dlsym(pi->dlh, TSREMAP_FUNCNAME_DO_REMAP);
-    pi->fp_tsremap_os_response = (remap_plugin_info::_tsremap_os_response *) dlsym(pi->dlh, TSREMAP_FUNCNAME_OS_RESPONSE);
-
-    if (!pi->fp_tsremap_init) {
-      snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin \"%s\"", TSREMAP_FUNCNAME_INIT, c);
-      retcode = -10;
-    } else if (!pi->fp_tsremap_new_instance) {
-      snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin \"%s\"",
-                   TSREMAP_FUNCNAME_NEW_INSTANCE, c);
-      retcode = -11;
-    } else if (!pi->fp_tsremap_do_remap) {
-      snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin \"%s\"", TSREMAP_FUNCNAME_DO_REMAP, c);
-      retcode = -12;
-    }
-    if (retcode) {
-      if (errbuf && errbufsize > 0)
-        Debug("remap_plugin", "%s", errbuf);
-      dlclose(pi->dlh);
-      pi->dlh = NULL;
-      return retcode;
-    }
-    memset(&ri, 0, sizeof(ri));
-    ri.size = sizeof(ri);
-    ri.tsremap_version = TSREMAP_VERSION;
-
     // elevate the access to read files as root if compiled with capabilities, if not
     // change the effective user to root
     {
@@ -708,6 +670,44 @@ remap_load_plugin(const char ** argv, int argc, url_mapping *mp, char *errbuf, i
       REC_ReadConfigInteger(elevate_access, "proxy.config.plugin.load_elevated");
       ElevateAccess access(elevate_access != 0);
 
+      if ((pi->dlh = dlopen(c, RTLD_NOW)) == NULL) {
+#if defined(freebsd) || defined(openbsd)
+        err = (char *)dlerror();
+#else
+        err = dlerror();
+#endif
+        snprintf(errbuf, errbufsize, "Can't load plugin \"%s\" - %s", c, err ? err : "Unknown dlopen() error");
+        return -4;
+      }
+      pi->fp_tsremap_init = (remap_plugin_info::_tsremap_init *) dlsym(pi->dlh, TSREMAP_FUNCNAME_INIT);
+      pi->fp_tsremap_done = (remap_plugin_info::_tsremap_done *) dlsym(pi->dlh, TSREMAP_FUNCNAME_DONE);
+      pi->fp_tsremap_new_instance = (remap_plugin_info::_tsremap_new_instance *) dlsym(pi->dlh, TSREMAP_FUNCNAME_NEW_INSTANCE);
+      pi->fp_tsremap_delete_instance = (remap_plugin_info::_tsremap_delete_instance *) dlsym(pi->dlh, TSREMAP_FUNCNAME_DELETE_INSTANCE);
+      pi->fp_tsremap_do_remap = (remap_plugin_info::_tsremap_do_remap *) dlsym(pi->dlh, TSREMAP_FUNCNAME_DO_REMAP);
+      pi->fp_tsremap_os_response = (remap_plugin_info::_tsremap_os_response *) dlsym(pi->dlh, TSREMAP_FUNCNAME_OS_RESPONSE);
+
+      if (!pi->fp_tsremap_init) {
+        snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin \"%s\"", TSREMAP_FUNCNAME_INIT, c);
+        retcode = -10;
+      } else if (!pi->fp_tsremap_new_instance) {
+        snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin \"%s\"",
+            TSREMAP_FUNCNAME_NEW_INSTANCE, c);
+        retcode = -11;
+      } else if (!pi->fp_tsremap_do_remap) {
+        snprintf(errbuf, errbufsize, "Can't find \"%s\" function in remap plugin \"%s\"", TSREMAP_FUNCNAME_DO_REMAP, c);
+        retcode = -12;
+      }
+      if (retcode) {
+        if (errbuf && errbufsize > 0)
+          Debug("remap_plugin", "%s", errbuf);
+        dlclose(pi->dlh);
+        pi->dlh = NULL;
+        return retcode;
+      }
+      memset(&ri, 0, sizeof(ri));
+      ri.size = sizeof(ri);
+      ri.tsremap_version = TSREMAP_VERSION;
+
       if (pi->fp_tsremap_init(&ri, tmpbuf, sizeof(tmpbuf) - 1) != TS_SUCCESS) {
         Warning("Failed to initialize plugin %s (non-zero retval) ... bailing out", pi->path);
         return -5;
@@ -768,14 +768,7 @@ remap_load_plugin(const char ** argv, int argc, url_mapping *mp, char *errbuf, i
   Debug("remap_plugin", "creating new plugin instance");
 
   TSReturnCode res = TS_ERROR;
-  // elevate the access to read files as root if compiled with capabilities, if not
-  // change the effective user to root
-  {
-    uint32_t elevate_access = 0;
-    REC_ReadConfigInteger(elevate_access, "proxy.config.plugin.load_elevated");
-    ElevateAccess access(elevate_access != 0);
-    res = pi->fp_tsremap_new_instance(parc, parv, &ih, tmpbuf, sizeof(tmpbuf) - 1);
-  } // done elevating access
+  res = pi->fp_tsremap_new_instance(parc, parv, &ih, tmpbuf, sizeof(tmpbuf) - 1);
 
   Debug("remap_plugin", "done creating new plugin instance");
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cd86569e/proxy/http/remap/UrlMapping.cc
----------------------------------------------------------------------
diff --git a/proxy/http/remap/UrlMapping.cc b/proxy/http/remap/UrlMapping.cc
index d5b00d1..58739c1 100644
--- a/proxy/http/remap/UrlMapping.cc
+++ b/proxy/http/remap/UrlMapping.cc
@@ -79,13 +79,8 @@ url_mapping::delete_instance(unsigned int index)
   remap_plugin_info* p = get_plugin(index);
 
   if (ih && p && p->fp_tsremap_delete_instance) {
-    // elevate the access to read files as root if compiled with capabilities, if not
-    // change the effective user to root
-    uint32_t elevate_access = 0;
-    REC_ReadConfigInteger(elevate_access, "proxy.config.plugin.load_elevated");
-    ElevateAccess access(elevate_access != 0);
     p->fp_tsremap_delete_instance(ih);
-  } // done elevating access
+  }
 }
 
 


[06/28] git commit: TS-2521: add stub for hacking documentation

Posted by zw...@apache.org.
TS-2521: add stub for hacking documentation


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/532003b2
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/532003b2
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/532003b2

Branch: refs/heads/5.0.x
Commit: 532003b27063138e2a584bb4981b7b9179ca86c6
Parents: f8cb336
Author: Igor Galić <i....@brainsware.org>
Authored: Wed Jan 22 14:36:08 2014 +0100
Committer: Igor Galić <i....@brainsware.org>
Committed: Wed Jan 22 14:36:08 2014 +0100

----------------------------------------------------------------------
 doc/arch/hacking/index.en.rst | 26 ++++++++++++++++++++++++++
 doc/arch/index.en.rst         |  9 ++++++---
 2 files changed, 32 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/532003b2/doc/arch/hacking/index.en.rst
----------------------------------------------------------------------
diff --git a/doc/arch/hacking/index.en.rst b/doc/arch/hacking/index.en.rst
new file mode 100644
index 0000000..b7edc7d
--- /dev/null
+++ b/doc/arch/hacking/index.en.rst
@@ -0,0 +1,26 @@
+Hacking
+*******
+
+.. 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.
+
+Introduction
+------------
+
+This is a documentation stub on how to hack Apache Traffic Server. Here we try to document things such as how to write
+and run unit or regression tests or how to inspect the state of the core with a debugger.
+

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/532003b2/doc/arch/index.en.rst
----------------------------------------------------------------------
diff --git a/doc/arch/index.en.rst b/doc/arch/index.en.rst
index 51f5b83..6cc9fac 100644
--- a/doc/arch/index.en.rst
+++ b/doc/arch/index.en.rst
@@ -1,5 +1,5 @@
-Architecture
-******************
+Architecture and Hacking
+************************
 
 .. Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
@@ -21,10 +21,12 @@ Architecture
 Introduction
 --------------
 
-The original architectural documents for Traffic Server were lost in the transation to an open source project. The
+The original architectural documents for Traffic Server were lost in the transition to an open source project. The
 documents in this section are provisional and were written based on the existing code. The purpose is to have a high
 level description of aspects of Traffic Server to better inform ongoing work.
 
+In the final section on "hacking" we try to document our approaches to understanding and modifying the source.
+
 Contents:
 
 .. toctree::
@@ -32,3 +34,4 @@ Contents:
 
    cache/cache.en
    proposals/hostdb.en
+   hacking/index.en


[12/28] git commit: Add parans to fix build error with -Wall from commit a5c00b225

Posted by zw...@apache.org.
Add parans to fix build error with -Wall from commit a5c00b225


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e4e79401
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e4e79401
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e4e79401

Branch: refs/heads/5.0.x
Commit: e4e79401da7d1c2eac1c67fd1b539eea98ea78f2
Parents: 6af64a9
Author: Uri Shachar <us...@apache.org>
Authored: Thu Jan 23 16:01:05 2014 +0200
Committer: Uri Shachar <us...@apache.org>
Committed: Thu Jan 23 16:01:05 2014 +0200

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e4e79401/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 3f83952..2582d15 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6754,7 +6754,7 @@ HttpTransact::handle_response_keep_alive_headers(State* s, HTTPVersion ver, HTTP
   }
   else if (heads->status_get() == HTTP_STATUS_NO_CONTENT &&
       (s->source == SOURCE_HTTP_ORIGIN_SERVER && s->current.server->transfer_encoding != NO_TRANSFER_ENCODING
-       || heads->get_content_length() != 0)) {
+       || (heads->get_content_length() != 0))) {
     // some systems hang until the connection closes when receiving a 204 regardless of the K-A headers
     // close if there is any body response from the origin
     ka_action = KA_CLOSE;


[25/28] git commit: TS-2519: Stop using the ambiguous RECP_NULL

Posted by zw...@apache.org.
TS-2519: Stop using the ambiguous RECP_NULL

RECP_NULL is ambigious. Should stats with this prsistence type be
saved or not?

The current behavior is that all stats that are not RECP_NON_PERSISTENT
are persisted. Change all registrations of RECP_NULL stats to use
RECP_PERSISTENT instead. Change the build version stats to
RECP_NON_PERSISTENT, since we want these to update when Traffic
Server is upgraded.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/7352493c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/7352493c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/7352493c

Branch: refs/heads/5.0.x
Commit: 7352493c9ac8e349088fdcf840ac67915196bedc
Parents: 6215bf9
Author: James Peach <jp...@apache.org>
Authored: Wed Jan 22 21:46:13 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Mon Jan 27 09:30:14 2014 -0800

----------------------------------------------------------------------
 iocore/aio/AIO.cc                 |   8 +-
 iocore/dns/DNS.cc                 |  14 +-
 iocore/hostdb/HostDB.cc           |  12 +-
 iocore/net/Net.cc                 |  28 +--
 lib/records/test_RecProcess.i     |  12 +-
 lib/records/test_RecordsConfig.cc |  10 +-
 mgmt/BaseManager.h                |   2 +-
 mgmt/LocalManager.cc              |  29 ---
 proxy/ICPStats.cc                 |  52 ++--
 proxy/InkAPI.cc                   |  12 +-
 proxy/Main.cc                     |  14 +-
 proxy/SocksProxy.cc               |   4 +-
 proxy/http/HttpConfig.cc          | 440 ++++++++++++++++-----------------
 proxy/logging/LogStandalone.cc    |  19 +-
 14 files changed, 317 insertions(+), 339 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/iocore/aio/AIO.cc
----------------------------------------------------------------------
diff --git a/iocore/aio/AIO.cc b/iocore/aio/AIO.cc
index f8c1b9d..a64918a 100644
--- a/iocore/aio/AIO.cc
+++ b/iocore/aio/AIO.cc
@@ -150,15 +150,15 @@ ink_aio_init(ModuleVersion v)
 
   aio_rsb = RecAllocateRawStatBlock((int) AIO_STAT_COUNT);
   RecRegisterRawStat(aio_rsb, RECT_PROCESS, "proxy.process.cache.read_per_sec",
-                     RECD_FLOAT, RECP_NULL, (int) AIO_STAT_READ_PER_SEC, aio_stats_cb);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) AIO_STAT_READ_PER_SEC, aio_stats_cb);
   RecRegisterRawStat(aio_rsb, RECT_PROCESS, "proxy.process.cache.write_per_sec",
-                     RECD_FLOAT, RECP_NULL, (int) AIO_STAT_WRITE_PER_SEC, aio_stats_cb);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) AIO_STAT_WRITE_PER_SEC, aio_stats_cb);
   RecRegisterRawStat(aio_rsb, RECT_PROCESS,
                      "proxy.process.cache.KB_read_per_sec",
-                     RECD_FLOAT, RECP_NULL, (int) AIO_STAT_KB_READ_PER_SEC, aio_stats_cb);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) AIO_STAT_KB_READ_PER_SEC, aio_stats_cb);
   RecRegisterRawStat(aio_rsb, RECT_PROCESS,
                      "proxy.process.cache.KB_write_per_sec",
-                     RECD_FLOAT, RECP_NULL, (int) AIO_STAT_KB_WRITE_PER_SEC, aio_stats_cb);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) AIO_STAT_KB_WRITE_PER_SEC, aio_stats_cb);
 #if AIO_MODE != AIO_MODE_NATIVE
   memset(&aio_reqs, 0, MAX_DISKS_POSSIBLE * sizeof(AIO_Reqs *));
   ink_mutex_init(&insert_mutex, NULL);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/iocore/dns/DNS.cc
----------------------------------------------------------------------
diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
index 0a7d7cf..74d972e 100644
--- a/iocore/dns/DNS.cc
+++ b/iocore/dns/DNS.cc
@@ -1629,11 +1629,11 @@ ink_dns_init(ModuleVersion v)
   //
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
                      "proxy.process.dns.total_dns_lookups",
-                     RECD_INT, RECP_NULL, (int) dns_total_lookups_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) dns_total_lookups_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
                      "proxy.process.dns.lookup_avg_time",
-                     RECD_INT, RECP_NULL, (int) dns_response_time_stat, RecRawStatSyncHrTimeAvg);
+                     RECD_INT, RECP_PERSISTENT, (int) dns_response_time_stat, RecRawStatSyncHrTimeAvg);
 
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
                      "proxy.process.dns.success_avg_time",
@@ -1641,22 +1641,22 @@ ink_dns_init(ModuleVersion v)
 
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
                      "proxy.process.dns.lookup_successes",
-                     RECD_INT, RECP_NULL, (int) dns_lookup_success_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) dns_lookup_success_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
                      "proxy.process.dns.fail_avg_time",
-                     RECD_INT, RECP_NULL, (int) dns_fail_time_stat, RecRawStatSyncHrTimeAvg);
+                     RECD_INT, RECP_PERSISTENT, (int) dns_fail_time_stat, RecRawStatSyncHrTimeAvg);
 
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
                      "proxy.process.dns.lookup_failures",
-                     RECD_INT, RECP_NULL, (int) dns_lookup_fail_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) dns_lookup_fail_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
-                     "proxy.process.dns.retries", RECD_INT, RECP_NULL, (int) dns_retries_stat, RecRawStatSyncSum);
+                     "proxy.process.dns.retries", RECD_INT, RECP_PERSISTENT, (int) dns_retries_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
                      "proxy.process.dns.max_retries_exceeded",
-                     RECD_INT, RECP_NULL, (int) dns_max_retries_exceeded_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) dns_max_retries_exceeded_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(dns_rsb, RECT_PROCESS,
                      "proxy.process.dns.in_flight",

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/iocore/hostdb/HostDB.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index d2c5e76..e4adbe0 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -2459,29 +2459,29 @@ ink_hostdb_init(ModuleVersion v)
 
   RecRegisterRawStat(hostdb_rsb, RECT_PROCESS,
                      "proxy.process.hostdb.total_entries",
-                     RECD_INT, RECP_NULL, (int) hostdb_total_entries_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) hostdb_total_entries_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(hostdb_rsb, RECT_PROCESS,
                      "proxy.process.hostdb.total_lookups",
-                     RECD_INT, RECP_NULL, (int) hostdb_total_lookups_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) hostdb_total_lookups_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(hostdb_rsb, RECT_PROCESS,
                      "proxy.process.hostdb.total_hits",
                      RECD_INT, RECP_NON_PERSISTENT, (int) hostdb_total_hits_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(hostdb_rsb, RECT_PROCESS,
-                     "proxy.process.hostdb.ttl", RECD_FLOAT, RECP_NULL, (int) hostdb_ttl_stat, RecRawStatSyncAvg);
+                     "proxy.process.hostdb.ttl", RECD_FLOAT, RECP_PERSISTENT, (int) hostdb_ttl_stat, RecRawStatSyncAvg);
 
   RecRegisterRawStat(hostdb_rsb, RECT_PROCESS,
                      "proxy.process.hostdb.ttl_expires",
-                     RECD_INT, RECP_NULL, (int) hostdb_ttl_expires_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) hostdb_ttl_expires_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(hostdb_rsb, RECT_PROCESS,
                      "proxy.process.hostdb.re_dns_on_reload",
-                     RECD_INT, RECP_NULL, (int) hostdb_re_dns_on_reload_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) hostdb_re_dns_on_reload_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(hostdb_rsb, RECT_PROCESS,
-                     "proxy.process.hostdb.bytes", RECD_INT, RECP_NULL, (int) hostdb_bytes_stat, RecRawStatSyncCount);
+                     "proxy.process.hostdb.bytes", RECD_INT, RECP_PERSISTENT, (int) hostdb_bytes_stat, RecRawStatSyncCount);
 
   ts_host_res_global_init();
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/iocore/net/Net.cc
----------------------------------------------------------------------
diff --git a/iocore/net/Net.cc b/iocore/net/Net.cc
index 485aef1..11c0c48 100644
--- a/iocore/net/Net.cc
+++ b/iocore/net/Net.cc
@@ -49,14 +49,14 @@ register_net_stats()
   // Register statistics
   //
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.net_handler_run",
-                     RECD_INT, RECP_NULL, (int) net_handler_run_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_handler_run_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_handler_run_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.read_bytes",
-                     RECD_INT, RECP_NULL, (int) net_read_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_read_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.write_bytes",
-                     RECD_INT, RECP_NULL, (int) net_write_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_write_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.connections_currently_open",
                      RECD_INT, RECP_NON_PERSISTENT, (int) net_connections_currently_open_stat, RecRawStatSyncSum);
@@ -67,49 +67,49 @@ register_net_stats()
   NET_CLEAR_DYN_STAT(net_accepts_currently_open_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_readfromnet",
-                     RECD_INT, RECP_NULL, (int) net_calls_to_readfromnet_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_calls_to_readfromnet_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_calls_to_readfromnet_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_readfromnet_afterpoll",
-                     RECD_INT, RECP_NULL, (int) net_calls_to_readfromnet_afterpoll_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_calls_to_readfromnet_afterpoll_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_calls_to_readfromnet_afterpoll_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_read",
-                     RECD_INT, RECP_NULL, (int) net_calls_to_read_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_calls_to_read_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_calls_to_read_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_read_nodata",
-                     RECD_INT, RECP_NULL, (int) net_calls_to_read_nodata_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_calls_to_read_nodata_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_calls_to_read_nodata_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_writetonet",
-                     RECD_INT, RECP_NULL, (int) net_calls_to_writetonet_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_calls_to_writetonet_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_calls_to_writetonet_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_writetonet_afterpoll",
-                     RECD_INT, RECP_NULL, (int) net_calls_to_writetonet_afterpoll_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_calls_to_writetonet_afterpoll_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_calls_to_writetonet_afterpoll_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_write",
-                     RECD_INT, RECP_NULL, (int) net_calls_to_write_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_calls_to_write_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_calls_to_write_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.calls_to_write_nodata",
-                     RECD_INT, RECP_NULL, (int) net_calls_to_write_nodata_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) net_calls_to_write_nodata_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(net_calls_to_write_nodata_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.socks.connections_successful",
-                     RECD_INT, RECP_NULL, (int) socks_connections_successful_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) socks_connections_successful_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.socks.connections_unsuccessful",
-                     RECD_INT, RECP_NULL, (int) socks_connections_unsuccessful_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) socks_connections_unsuccessful_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.socks.connections_currently_open",
                      RECD_INT, RECP_NON_PERSISTENT, (int) socks_connections_currently_open_stat, RecRawStatSyncSum);
   NET_CLEAR_DYN_STAT(socks_connections_currently_open_stat);
 
   RecRegisterRawStat(net_rsb, RECT_PROCESS, "proxy.process.net.inactivity_cop_lock_acquire_failure",
-                     RECD_INT, RECP_NULL, (int) inactivity_cop_lock_acquire_failure_stat,
+                     RECD_INT, RECP_PERSISTENT, (int) inactivity_cop_lock_acquire_failure_stat,
                      RecRawStatSyncSum);
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/lib/records/test_RecProcess.i
----------------------------------------------------------------------
diff --git a/lib/records/test_RecProcess.i b/lib/records/test_RecProcess.i
index 82084cf..4f15703 100644
--- a/lib/records/test_RecProcess.i
+++ b/lib/records/test_RecProcess.i
@@ -510,25 +510,25 @@ Test03()
   g_rsb = RecAllocateRawStatBlock((int) MY_STAT_COUNT);
 
   RecRegisterRawStat(g_rsb, RECT_PROCESS, "proxy.process.test_raw_stat_a",
-                     RECD_FLOAT, RECP_NULL, (int) MY_STAT_A, RecRawStatSyncAvg);
+                     RECD_FLOAT, RECP_NON_PERSISTENT, (int) MY_STAT_A, RecRawStatSyncAvg);
 
   RecRegisterRawStat(g_rsb, RECT_PROCESS, "proxy.process.test_raw_stat_b",
                      RECD_INT, RECP_PERSISTENT, (int) MY_STAT_B, RecRawStatSyncSum);
 
   RecRegisterRawStat(g_rsb, RECT_PROCESS, "proxy.process.test_raw_stat_c",
-                     RECD_INT, RECP_NULL, (int) MY_STAT_C, RecRawStatSyncCount);
+                     RECD_INT, RECP_NON_PERSISTENT, (int) MY_STAT_C, RecRawStatSyncCount);
 
   RecRegisterRawStat(g_rsb, RECT_PROCESS, "proxy.process.test_raw_stat_d",
-                     RECD_FLOAT, RECP_NULL, (int) MY_STAT_D, raw_stat_sync_ticks_per_sec);
+                     RECD_FLOAT, RECP_NON_PERSISTENT, (int) MY_STAT_D, raw_stat_sync_ticks_per_sec);
 
   RecRegisterRawStat(g_rsb, RECT_PROCESS, "proxy.process.test_raw_stat_e",
-                     RECD_FLOAT, RECP_NULL, (int) MY_STAT_E, RecRawStatSyncHrTimeAvg);
+                     RECD_FLOAT, RECP_NON_PERSISTENT, (int) MY_STAT_E, RecRawStatSyncHrTimeAvg);
   RecRegisterRawStat(g_rsb, RECT_PROCESS, "proxy.process.test_raw_stat_f",
-                     RECD_INT, RECP_NULL, (int) MY_STAT_F, RecRawStatSyncCount);
+                     RECD_INT, RECP_NON_PERSISTENT, (int) MY_STAT_F, RecRawStatSyncCount);
   // If forget to Register this RawStat, we will have SEGV when checking 
   // g_rsb->global[MY_STAT_G]
   RecRegisterRawStat(g_rsb, RECT_PROCESS, "proxy.process.test_raw_stat_g",
-                     RECD_INT, RECP_NULL, (int) MY_STAT_G, RecRawStatSyncSum);
+                     RECD_INT, RECP_NON_PERSISTENT, (int) MY_STAT_G, RecRawStatSyncSum);
 
   // Schedule a bunch of continuations that will use the stats registered above
   RawStatCont *sc = new RawStatCont(new_ProxyMutex());

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/lib/records/test_RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/lib/records/test_RecordsConfig.cc b/lib/records/test_RecordsConfig.cc
index 0c395eb..e62e4a8 100644
--- a/lib/records/test_RecordsConfig.cc
+++ b/lib/records/test_RecordsConfig.cc
@@ -51,10 +51,10 @@ RecordsConfigRegister()
   RecRegisterConfigCounter(RECT_CONFIG, "proxy.config.link_test_3", 0, RECU_DYNAMIC, RECC_NULL, NULL);
 
   // NODE
-  RecRegisterStatString(RECT_NODE, "proxy.node.cb_test_1", "cb_test_1__original", RECP_NULL);
-  RecRegisterStatString(RECT_NODE, "proxy.node.cb_test_2", "cb_test_2__original", RECP_NULL);
-  RecRegisterStatInt(RECT_NODE, "proxy.node.cb_test_int", 0, RECP_NULL);
-  RecRegisterStatFloat(RECT_NODE, "proxy.node.cb_test_float", 0.0f, RECP_NULL);
-  RecRegisterStatCounter(RECT_NODE, "proxy.node.cb_test_count", 0, RECP_NULL);
+  RecRegisterStatString(RECT_NODE, "proxy.node.cb_test_1", "cb_test_1__original", RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_NODE, "proxy.node.cb_test_2", "cb_test_2__original", RECP_NON_PERSISTENT);
+  RecRegisterStatInt(RECT_NODE, "proxy.node.cb_test_int", 0, RECP_NON_PERSISTENT);
+  RecRegisterStatFloat(RECT_NODE, "proxy.node.cb_test_float", 0.0f, RECP_NON_PERSISTENT);
+  RecRegisterStatCounter(RECT_NODE, "proxy.node.cb_test_count", 0, RECP_NON_PERSISTENT);
 
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/mgmt/BaseManager.h
----------------------------------------------------------------------
diff --git a/mgmt/BaseManager.h b/mgmt/BaseManager.h
index a651e28..0fa7a3c 100644
--- a/mgmt/BaseManager.h
+++ b/mgmt/BaseManager.h
@@ -92,7 +92,7 @@
 #define MGMT_SIGNAL_LOGGING_WARNING       10
 // Currently unused: 11
 // Currently unused: 12
-#define MGMT_SIGNAL_PLUGIN_ADD_REC        13
+// Currently unused: 13
 #define MGMT_SIGNAL_PLUGIN_SET_CONFIG     14
 #define MGMT_SIGNAL_LOG_FILES_ROLLED      15
 #define MGMT_SIGNAL_LIBRECORDS            16

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/mgmt/LocalManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index 2bc67ad..ce4b85a 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -617,35 +617,6 @@ LocalManager::handleMgmtMsgFromProcesses(MgmtMessageHdr * mh)
   case MGMT_SIGNAL_CONFIG_FILE_READ:
     mgmt_log(stderr, "[LocalManager::handleMgmtMsgFromProcesses] File done '%d'\n", data_raw);
     break;
-  case MGMT_SIGNAL_PLUGIN_ADD_REC:
-    {
-      char var_name[256];
-      char var_value[256];
-      RecDataT data_type;
-      // data_type is an enum type, so cast to an int* to avoid warnings. /leif
-      // coverity[secure_coding]
-      if (sscanf(data_raw, "%255s %d %255s", var_name, (int *) &data_type, var_value) != 3) {
-        Debug("lm", "Warning: Bad data_type: %s", (char *) data_raw);
-        data_type = RECD_MAX;
-      }
-      switch (data_type) {
-      case RECD_COUNTER:
-        RecRegisterStatCounter(RECT_PLUGIN, var_name, ink_atoi64(var_value), RECP_NULL);
-        break;
-      case RECD_INT:
-        RecRegisterStatInt(RECT_PLUGIN, var_name, ink_atoi64(var_value), RECP_NULL);
-        break;
-      case RECD_FLOAT:
-        RecRegisterStatFloat(RECT_PLUGIN, var_name, atof(var_value), RECP_NULL);
-        break;
-      case RECD_STRING:
-        RecRegisterStatString(RECT_PLUGIN, var_name, var_value, RECP_NULL);
-        break;
-      default:
-        break;
-      }
-      break;
-    }
   case MGMT_SIGNAL_PLUGIN_SET_CONFIG:
     {
       char var_name[256];

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/proxy/ICPStats.cc
----------------------------------------------------------------------
diff --git a/proxy/ICPStats.cc b/proxy/ICPStats.cc
index b9da078..9cb370b 100644
--- a/proxy/ICPStats.cc
+++ b/proxy/ICPStats.cc
@@ -44,81 +44,81 @@ ICPProcessor::InitICPStatCallbacks()
 
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.config_mgmt_callouts",
-                     RECD_INT, RECP_NULL, (int) config_mgmt_callouts_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) config_mgmt_callouts_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.reconfig_polls",
-                     RECD_INT, RECP_NULL, (int) reconfig_polls_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) reconfig_polls_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.reconfig_events",
-                     RECD_INT, RECP_NULL, (int) reconfig_events_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) reconfig_events_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.invalid_poll_data",
-                     RECD_INT, RECP_NULL, (int) invalid_poll_data_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) invalid_poll_data_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.no_data_read",
-                     RECD_INT, RECP_NULL, (int) no_data_read_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) no_data_read_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
-                     "proxy.process.icp.short_read", RECD_INT, RECP_NULL, (int) short_read_stat, RecRawStatSyncCount);
+                     "proxy.process.icp.short_read", RECD_INT, RECP_PERSISTENT, (int) short_read_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.invalid_sender",
-                     RECD_INT, RECP_NULL, (int) invalid_sender_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) invalid_sender_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.read_not_v2_icp",
-                     RECD_INT, RECP_NULL, (int) read_not_v2_icp_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) read_not_v2_icp_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.icp_remote_query_requests",
-                     RECD_INT, RECP_NULL, (int) icp_remote_query_requests_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_remote_query_requests_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.icp_remote_responses",
-                     RECD_INT, RECP_NULL, (int) icp_remote_responses_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_remote_responses_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.cache_lookup_success",
-                     RECD_INT, RECP_NULL, (int) icp_cache_lookup_success_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_cache_lookup_success_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.cache_lookup_fail",
-                     RECD_INT, RECP_NULL, (int) icp_cache_lookup_fail_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_cache_lookup_fail_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.query_response_write",
-                     RECD_INT, RECP_NULL, (int) query_response_write_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) query_response_write_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.query_response_partial_write",
-                     RECD_INT, RECP_NULL, (int) query_response_partial_write_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) query_response_partial_write_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.no_icp_request_for_response",
-                     RECD_INT, RECP_NULL, (int) no_icp_request_for_response_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) no_icp_request_for_response_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.icp_response_request_nolock",
-                     RECD_INT, RECP_NULL, (int) icp_response_request_nolock_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_response_request_nolock_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.icp_start_icpoff",
-                     RECD_INT, RECP_NULL, (int) icp_start_icpoff_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_start_icpoff_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.send_query_partial_write",
-                     RECD_INT, RECP_NULL, (int) send_query_partial_write_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) send_query_partial_write_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.icp_queries_no_expected_replies",
-                     RECD_INT, RECP_NULL, (int) icp_queries_no_expected_replies_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_queries_no_expected_replies_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.icp_query_hits",
-                     RECD_INT, RECP_NULL, (int) icp_query_hits_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_query_hits_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.icp_query_misses",
-                     RECD_INT, RECP_NULL, (int) icp_query_misses_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_query_misses_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.invalid_icp_query_response",
-                     RECD_INT, RECP_NULL, (int) invalid_icp_query_response_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) invalid_icp_query_response_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.icp_query_requests",
-                     RECD_INT, RECP_NULL, (int) icp_query_requests_stat, RecRawStatSyncCount);
+                     RECD_INT, RECP_PERSISTENT, (int) icp_query_requests_stat, RecRawStatSyncCount);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.total_icp_response_time",
-                     RECD_FLOAT, RECP_NULL, (int) total_icp_response_time_stat, RecRawStatSyncMHrTimeAvg);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) total_icp_response_time_stat, RecRawStatSyncMHrTimeAvg);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.total_udp_send_queries",
-                     RECD_INT, RECP_NULL, (int) total_udp_send_queries_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) total_udp_send_queries_stat, RecRawStatSyncSum);
   RecRegisterRawStat(icp_rsb, RECT_PROCESS,
                      "proxy.process.icp.total_icp_request_time",
-                     RECD_FLOAT, RECP_NULL, (int) total_icp_request_time_stat, RecRawStatSyncMHrTimeAvg);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) total_icp_request_time_stat, RecRawStatSyncMHrTimeAvg);
 
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/proxy/InkAPI.cc
----------------------------------------------------------------------
diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index 53a8b65..a0f752f 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -6663,7 +6663,17 @@ TSStatCreate(const char *the_name, TSRecordDataType the_type, TSStatPersistence
     syncer = RecRawStatSyncCount;
     break;
   }
-  RecRegisterRawStat(api_rsb, RECT_PLUGIN, the_name, (RecDataT)the_type, (RecPersistT)persist, id, syncer);
+
+  switch (persist) {
+  case TS_STAT_PERSISTENT:
+    RecRegisterRawStat(api_rsb, RECT_PLUGIN, the_name, (RecDataT)the_type, RECP_PERSISTENT, id, syncer);
+    break;
+  case TS_STAT_NON_PERSISTENT:
+    RecRegisterRawStat(api_rsb, RECT_PLUGIN, the_name, (RecDataT)the_type, RECP_NON_PERSISTENT, id, syncer);
+    break;
+  default:
+    return TS_ERROR;
+  }
 
   return id;
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index a48e48a..f224e9b 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -326,13 +326,13 @@ initialize_process_manager()
   //
   // Define version info records
   //
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.short", appVersionInfo.VersionStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.long", appVersionInfo.FullVersionInfoStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_number", appVersionInfo.BldNumStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_time", appVersionInfo.BldTimeStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_date", appVersionInfo.BldDateStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_machine", appVersionInfo.BldMachineStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_person", appVersionInfo.BldPersonStr, RECP_NULL);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.short", appVersionInfo.VersionStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.long", appVersionInfo.FullVersionInfoStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_number", appVersionInfo.BldNumStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_time", appVersionInfo.BldTimeStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_date", appVersionInfo.BldDateStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_machine", appVersionInfo.BldMachineStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_person", appVersionInfo.BldPersonStr, RECP_NON_PERSISTENT);
 }
 
 //

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/proxy/SocksProxy.cc
----------------------------------------------------------------------
diff --git a/proxy/SocksProxy.cc b/proxy/SocksProxy.cc
index 10b2b10..e447f12 100644
--- a/proxy/SocksProxy.cc
+++ b/proxy/SocksProxy.cc
@@ -535,11 +535,11 @@ start_SocksProxy(int port)
   if (socksproxy_stat_block) {
     RecRegisterRawStat(socksproxy_stat_block, RECT_PROCESS,
                        "proxy.process.socks.proxy.http_connections",
-                       RECD_INT, RECP_NULL, socksproxy_http_connections_stat, RecRawStatSyncCount);
+                       RECD_INT, RECP_PERSISTENT, socksproxy_http_connections_stat, RecRawStatSyncCount);
 
     RecRegisterRawStat(socksproxy_stat_block, RECT_PROCESS,
                        "proxy.process.socks.proxy.tunneled_connections",
-                       RECD_INT, RECP_NULL, socksproxy_tunneled_connections_stat, RecRawStatSyncCount);
+                       RECD_INT, RECP_PERSISTENT, socksproxy_tunneled_connections_stat, RecRawStatSyncCount);
   }
 }
 


[27/28] git commit: TS-2519: update CHANGES

Posted by zw...@apache.org.
TS-2519: update CHANGES


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/77e2776b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/77e2776b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/77e2776b

Branch: refs/heads/5.0.x
Commit: 77e2776bab304f3548749569f75d34432fa15cc6
Parents: e2ffb69
Author: James Peach <jp...@apache.org>
Authored: Mon Jan 27 11:34:32 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Mon Jan 27 11:34:32 2014 -0800

----------------------------------------------------------------------
 CHANGES | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/77e2776b/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 81e8e6e..d2cce2d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2519] Make build version metrics non-persistent.
+
   *) [TS-1606] Log buffers are not flushed periodically when TS is launched 
    with NO_REMOTE_MANAGEMENT flag
 


[18/28] git commit: TS-2481 Incorrect origin server port used sometimes (with keep-alive).

Posted by zw...@apache.org.
TS-2481 Incorrect origin server port used sometimes (with keep-alive).


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/12b2882d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/12b2882d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/12b2882d

Branch: refs/heads/5.0.x
Commit: 12b2882da8dd17001eef1e706610987db794c70b
Parents: 5b16367
Author: Dimitry Andric <di...@andric.com>
Authored: Fri Jan 24 11:22:36 2014 +0100
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 24 11:22:36 2014 +0100

----------------------------------------------------------------------
 CHANGES              | 3 +++
 proxy/http/HttpSM.cc | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/12b2882d/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index a24e138..7d24d27 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2481] Incorrect origin server port used sometimes (with keep-alive).
+   Author: Dimitry Andric <di...@andric.com>
+
   *) [TS-2526] Remove the g_stats_snap_fpath global variable.
 
   *) [TS-2525] Remove restrictions on outbound transparency with SSL.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/12b2882d/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 5b1b855..41f8cf1 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -4536,8 +4536,8 @@ HttpSM::do_http_server_open(bool raw)
     HttpServerSession *existing_ss = ua_session->get_server_session();
 
     if (existing_ss) {
-      // [amc] Is this OK? Should we compare ports? (not done by ats_ip_addr_cmp)
-      if (ats_ip_addr_eq(&existing_ss->server_ip.sa, &t_state.current.server->addr.sa)) {
+      if (ats_ip_addr_eq(&existing_ss->server_ip.sa, &t_state.current.server->addr.sa) &&
+          ats_ip_port_cast(&existing_ss->server_ip) == ats_ip_port_cast(&t_state.current.server->addr)) {
         ua_session->attach_server_session(NULL);
         existing_ss->state = HSS_ACTIVE;
         this->attach_server_session(existing_ss);


[08/28] git commit: Reorder the build subdirs, such that all code compiles first

Posted by zw...@apache.org.
Reorder the build subdirs, such that all code compiles first


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/27e8fb91
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/27e8fb91
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/27e8fb91

Branch: refs/heads/5.0.x
Commit: 27e8fb9148beca6878014980b57abf08a2173ffd
Parents: e876654
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Jan 23 05:45:23 2014 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Jan 23 05:45:23 2014 -0700

----------------------------------------------------------------------
 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/27e8fb91/Makefile.am
----------------------------------------------------------------------
diff --git a/Makefile.am b/Makefile.am
index 0ad9b06..398f300 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,7 +29,7 @@ export CCACHE_BASEDIR
 # proxy/api/ts has to be built first, since so much of libraries and "core
 # depends on the generates ts/ts.h include file.
 
-SUBDIRS =  proxy/api/ts iocore lib proxy/hdrs proxy/shared mgmt proxy rc doc plugins cmd tools example
+SUBDIRS =  proxy/api/ts iocore lib proxy/hdrs proxy/shared mgmt proxy cmd plugins tools example rc doc
 
 
 DIST_BUILD_USER=`id -nu`


[14/28] git commit: Cleanup some dead code from Log.cc

Posted by zw...@apache.org.
Cleanup some dead code from Log.cc


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/00897775
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/00897775
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/00897775

Branch: refs/heads/5.0.x
Commit: 00897775dcf48740952db91f9dabfedec71e582a
Parents: 8cf2b4d
Author: Yakov Markovitch <ym...@gmail.com>
Authored: Thu Jan 23 16:20:48 2014 +0200
Committer: Uri Shachar <us...@apache.org>
Committed: Thu Jan 23 16:20:48 2014 +0200

----------------------------------------------------------------------
 proxy/logging/Log.cc | 4 ----
 1 file changed, 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/00897775/proxy/logging/Log.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 6a64ce7..6f326c9 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -57,8 +57,6 @@
 
 #include "ink_apidefs.h"
 
-#define FLUSH_THREAD_SLEEP_TIMEOUT (1)
-#define FLUSH_THREAD_MIN_FLUSH_COUNTER (FLUSH_ARRAY_SIZE/4)
 #define PERIODIC_TASKS_INTERVAL 5 // TODO: Maybe this should be done as a config option
 
 // Log global objects
@@ -945,10 +943,8 @@ Log::init(int flags)
     //
     create_threads();
 
-#ifndef INK_SINGLE_THREADED
     eventProcessor.schedule_every(NEW (new PeriodicWakeup(collation_preproc_threads, 1)),
                                   HRTIME_SECOND, ET_CALL);
-#endif
     init_status |= PERIODIC_WAKEUP_SCHEDULED;
 
     // Clear any stat values that need to be reset on startup


[23/28] git commit: TS-2519: make using RECP_NULL a compilation error

Posted by zw...@apache.org.
TS-2519: make using RECP_NULL a compilation error

RECP_NULL can still be useful to represent the case when a record
does not have a persistence type. It might be a configuration record,
for example. However, stats records shold never be registered as
RECP_NULL, because that's ambiguous as to whether it should be
persisted This change add some template helpers to ensure that any
attempt to register a RECP_NULL stat dies in a horrible shower of
compiler errors.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/7eeb5c78
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/7eeb5c78
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/7eeb5c78

Branch: refs/heads/5.0.x
Commit: 7eeb5c782b2f49a99d5e0ec62599f8c171fa7ea1
Parents: 7352493
Author: James Peach <jp...@apache.org>
Authored: Wed Jan 22 21:47:07 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Mon Jan 27 09:30:14 2014 -0800

----------------------------------------------------------------------
 lib/records/I_RecCore.h    | 14 ++++++++++----
 lib/records/I_RecDefs.h    | 25 +++++++++++++++++++++++++
 lib/records/I_RecProcess.h |  4 +++-
 lib/records/P_RecCore.cc   |  8 ++++----
 lib/records/RecProcess.cc  |  2 +-
 5 files changed, 43 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7eeb5c78/lib/records/I_RecCore.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecCore.h b/lib/records/I_RecCore.h
index 424b1c2..e9b1a4f 100644
--- a/lib/records/I_RecCore.h
+++ b/lib/records/I_RecCore.h
@@ -73,11 +73,17 @@ const char * RecConfigOverrideFromEnvironment(const char * name, const char * va
 //-------------------------------------------------------------------------
 // Stat Registration
 //-------------------------------------------------------------------------
-int RecRegisterStatInt(RecT rec_type, const char *name, RecInt data_default, RecPersistT persist_type);
-int RecRegisterStatFloat(RecT rec_type, const char *name, RecFloat data_default, RecPersistT persist_type);
-int RecRegisterStatString(RecT rec_type, const char *name, RecString data_default, RecPersistT persist_type);
-int RecRegisterStatCounter(RecT rec_type, const char *name, RecCounter data_default, RecPersistT persist_type);
+int _RecRegisterStatInt(RecT rec_type, const char *name, RecInt data_default, RecPersistT persist_type);
+#define RecRegisterStatInt(rec_type, name, data_default, persist_type) _RecRegisterStatInt((rec_type), (name), (data_default), REC_PERSISTENCE_TYPE(persist_type))
 
+int _RecRegisterStatFloat(RecT rec_type, const char *name, RecFloat data_default, RecPersistT persist_type);
+#define RecRegisterStatFloat(rec_type, name, data_default, persist_type) _RecRegisterStatFloat((rec_type), (name), (data_default), REC_PERSISTENCE_TYPE(persist_type))
+
+int _RecRegisterStatString(RecT rec_type, const char *name, RecString data_default, RecPersistT persist_type);
+#define RecRegisterStatString(rec_type, name, data_default, persist_type) _RecRegisterStatString((rec_type), (name), (data_default), REC_PERSISTENCE_TYPE(persist_type))
+
+int _RecRegisterStatCounter(RecT rec_type, const char *name, RecCounter data_default, RecPersistT persist_type);
+#define RecRegisterStatCounter(rec_type, name, data_default, persist_type) _RecRegisterStatCounter((rec_type), (name), (data_default), REC_PERSISTENCE_TYPE(persist_type))
 
 //-------------------------------------------------------------------------
 // Config Registration

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7eeb5c78/lib/records/I_RecDefs.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecDefs.h b/lib/records/I_RecDefs.h
index 5a9c121..ec3afbc 100644
--- a/lib/records/I_RecDefs.h
+++ b/lib/records/I_RecDefs.h
@@ -88,6 +88,31 @@ enum RecPersistT
   RECP_NON_PERSISTENT
 };
 
+// RECP_NULL should never be used by callers of RecRegisterStat*(). You have to decide
+// whether to persist stats or not. The template goop below make sure that passing RECP_NULL
+// is a very ugle compile-time error.
+
+namespace rec {
+namespace detail {
+template <RecPersistT>
+struct is_valid_persistence;
+
+template<>
+struct is_valid_persistence<RECP_PERSISTENT>
+{
+  static const RecPersistT value = RECP_PERSISTENT;
+};
+
+template<>
+struct is_valid_persistence<RECP_NON_PERSISTENT>
+{
+  static const RecPersistT value = RECP_NON_PERSISTENT;
+};
+
+}}
+
+#define REC_PERSISTENCE_TYPE(P) rec::detail::is_valid_persistence<P>::value
+
 enum RecUpdateT
 {
   RECU_NULL,                    // default: don't know the behavior

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7eeb5c78/lib/records/I_RecProcess.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecProcess.h b/lib/records/I_RecProcess.h
index 8faffe7..123041e 100644
--- a/lib/records/I_RecProcess.h
+++ b/lib/records/I_RecProcess.h
@@ -46,8 +46,10 @@ void RecProcess_set_remote_sync_interval_ms(int ms);
 // RawStat Registration
 //-------------------------------------------------------------------------
 RecRawStatBlock *RecAllocateRawStatBlock(int num_stats);
-int RecRegisterRawStat(RecRawStatBlock * rsb, RecT rec_type, const char *name, RecDataT data_type, RecPersistT persist_type, int id, RecRawStatSyncCb sync_cb);
 
+int _RecRegisterRawStat(RecRawStatBlock * rsb, RecT rec_type, const char *name, RecDataT data_type, RecPersistT persist_type, int id, RecRawStatSyncCb sync_cb);
+#define RecRegisterRawStat(rsb, rec_type, name, data_type, persist_type, id, sync_cb) \
+  _RecRegisterRawStat((rsb), (rec_type), (name), (data_type), REC_PERSISTENCE_TYPE(persist_type), (id), (sync_cb))
 
 // RecRawStatRange* RecAllocateRawStatRange (int num_buckets);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7eeb5c78/lib/records/P_RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/P_RecCore.cc b/lib/records/P_RecCore.cc
index 2be8116..152bf05 100644
--- a/lib/records/P_RecCore.cc
+++ b/lib/records/P_RecCore.cc
@@ -291,25 +291,25 @@ recv_message_cb(RecMessage * msg, RecMessageT msg_type, void */* cookie */)
   }
 
 int
-RecRegisterStatInt(RecT rec_type, const char *name, RecInt data_default, RecPersistT persist_type)
+_RecRegisterStatInt(RecT rec_type, const char *name, RecInt data_default, RecPersistT persist_type)
 {
   REC_REGISTER_STAT_XXX(rec_int, RECD_INT);
 }
 
 int
-RecRegisterStatFloat(RecT rec_type, const char *name, RecFloat data_default, RecPersistT persist_type)
+_RecRegisterStatFloat(RecT rec_type, const char *name, RecFloat data_default, RecPersistT persist_type)
 {
   REC_REGISTER_STAT_XXX(rec_float, RECD_FLOAT);
 }
 
 int
-RecRegisterStatString(RecT rec_type, const char *name, RecString data_default, RecPersistT persist_type)
+_RecRegisterStatString(RecT rec_type, const char *name, RecString data_default, RecPersistT persist_type)
 {
   REC_REGISTER_STAT_XXX(rec_string, RECD_STRING);
 }
 
 int
-RecRegisterStatCounter(RecT rec_type, const char *name, RecCounter data_default, RecPersistT persist_type)
+_RecRegisterStatCounter(RecT rec_type, const char *name, RecCounter data_default, RecPersistT persist_type)
 {
   REC_REGISTER_STAT_XXX(rec_counter, RECD_COUNTER);
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7eeb5c78/lib/records/RecProcess.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecProcess.cc b/lib/records/RecProcess.cc
index 5dc7392..8cab1de 100644
--- a/lib/records/RecProcess.cc
+++ b/lib/records/RecProcess.cc
@@ -532,7 +532,7 @@ RecAllocateRawStatBlock(int num_stats)
 // RecRegisterRawStat
 //-------------------------------------------------------------------------
 int
-RecRegisterRawStat(RecRawStatBlock *rsb, RecT rec_type, const char *name, RecDataT data_type, RecPersistT persist_type, int id,
+_RecRegisterRawStat(RecRawStatBlock *rsb, RecT rec_type, const char *name, RecDataT data_type, RecPersistT persist_type, int id,
                    RecRawStatSyncCb sync_cb)
 {
   Debug("stats", "RecRawStatSyncCb(%s): rsb pointer:%p id:%d\n", name, rsb, id);


[21/28] git commit: TS-2504: Set LDFLAGS/CPPFLAGS properly in crypto.m4

Posted by zw...@apache.org.
TS-2504: Set LDFLAGS/CPPFLAGS properly in crypto.m4

At the end of AX_CHECK_OPENSSL(), LDFLAGS/CPPFLAGS/LIBS variables
will be reset, so there is no sense in setting these variables within
AX_CHECK_OPENSSL(). We should set them outside of it.

Signed-off-by: Yunkai Zhang <qi...@taobao.com>


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/0f4c7b8f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/0f4c7b8f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/0f4c7b8f

Branch: refs/heads/5.0.x
Commit: 0f4c7b8ffb26326dbd2cde77c986726ffe8f0552
Parents: c4b5e55
Author: Yunkai Zhang <qi...@taobao.com>
Authored: Sun Jan 26 02:25:57 2014 +0800
Committer: Yunkai Zhang <qi...@taobao.com>
Committed: Sun Jan 26 02:43:26 2014 +0800

----------------------------------------------------------------------
 build/crypto.m4 | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0f4c7b8f/build/crypto.m4
----------------------------------------------------------------------
diff --git a/build/crypto.m4 b/build/crypto.m4
index 94919dc..08730c9 100644
--- a/build/crypto.m4
+++ b/build/crypto.m4
@@ -22,16 +22,20 @@ dnl
 dnl TS_CHECK_CRYPTO: look for crypto libraries and headers
 dnl
 AC_DEFUN([TS_CHECK_CRYPTO], [
-  enable_crypto=no
   AC_SEARCH_LIBS([crypt], [crypt], [AC_SUBST([LIBCRYPT],["-lcrypt"])])
 
   AX_CHECK_OPENSSL([
-    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
-    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
+    enable_crypto=yes
   ], [
-   AC_ERROR(failed to find OpenSSL)
+    AC_ERROR(failed to find OpenSSL)
+    enable_crypto=no
   ])
 
+  if test "x${enable_crypto}" = "xyes"; then
+    TS_ADDTO(LDFLAGS, [$OPENSSL_LDFLAGS])
+    TS_ADDTO(CPPFLAGS, [$OPENSSL_INCLUDES])
+  fi
+
   dnl add checks for other varieties of ssl here
 ])
 dnl


[19/28] git commit: Fix typo in traffic_shell

Posted by zw...@apache.org.
Fix typo in traffic_shell


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/2fe97225
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/2fe97225
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/2fe97225

Branch: refs/heads/5.0.x
Commit: 2fe972255c7fc2be791229561839df626138b4c7
Parents: 12b2882
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Jan 24 14:28:00 2014 +0100
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Jan 24 14:28:00 2014 +0100

----------------------------------------------------------------------
 cmd/traffic_shell/ShowCmd.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2fe97225/cmd/traffic_shell/ShowCmd.cc
----------------------------------------------------------------------
diff --git a/cmd/traffic_shell/ShowCmd.cc b/cmd/traffic_shell/ShowCmd.cc
index ed71560..9dc5bdf 100644
--- a/cmd/traffic_shell/ShowCmd.cc
+++ b/cmd/traffic_shell/ShowCmd.cc
@@ -2030,7 +2030,7 @@ ShowHttpTransStats()
   Cli_Printf("Questionable Client Aborts -- %f %%  %d\n", 100 * frac_avg_10s_errors_possible_aborts,
              msec_avg_10s_errors_possible_aborts);
   Cli_Printf("Partial Request Hangups ----- %f %%  %d\n", 100 * frac_avg_10s_errors_early_hangups,
-             msec_avg_10s_errors_possible_aborts);
+             msec_avg_10s_errors_early_hangups);
   Cli_Printf("Pre-Request Hangups --------- %f %%  %d\n", 100 * frac_avg_10s_errors_empty_hangups,
              msec_avg_10s_errors_empty_hangups);
   Cli_Printf("Pre-Connect Hangups --------- %f %%  %d\n", 100 * frac_avg_10s_errors_pre_accept_hangups,


[13/28] git commit: Add parans to the _right_ place to fix build with -Wall

Posted by zw...@apache.org.
Add parans to the _right_ place to fix build with -Wall


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8cf2b4d7
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8cf2b4d7
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8cf2b4d7

Branch: refs/heads/5.0.x
Commit: 8cf2b4d7c46702c289b664df554623f6950dcfc3
Parents: e4e7940
Author: Uri Shachar <us...@apache.org>
Authored: Thu Jan 23 16:06:22 2014 +0200
Committer: Uri Shachar <us...@apache.org>
Committed: Thu Jan 23 16:06:22 2014 +0200

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8cf2b4d7/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 2582d15..a3187b2 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6753,8 +6753,8 @@ HttpTransact::handle_response_keep_alive_headers(State* s, HTTPVersion ver, HTTP
     ka_action = KA_DISABLED;
   }
   else if (heads->status_get() == HTTP_STATUS_NO_CONTENT &&
-      (s->source == SOURCE_HTTP_ORIGIN_SERVER && s->current.server->transfer_encoding != NO_TRANSFER_ENCODING
-       || (heads->get_content_length() != 0))) {
+      ((s->source == SOURCE_HTTP_ORIGIN_SERVER && s->current.server->transfer_encoding != NO_TRANSFER_ENCODING)
+       || heads->get_content_length() != 0)) {
     // some systems hang until the connection closes when receiving a 204 regardless of the K-A headers
     // close if there is any body response from the origin
     ka_action = KA_CLOSE;


[16/28] git commit: TS-2525: Remove restriction on outbound transparency with SSL.

Posted by zw...@apache.org.
TS-2525: Remove restriction on outbound transparency with SSL.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/c2434df8
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/c2434df8
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/c2434df8

Branch: refs/heads/5.0.x
Commit: c2434df8c2a0726cb69d1b95c50857cd073f7ce2
Parents: cd86569
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Thu Jan 23 12:22:48 2014 -0600
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Thu Jan 23 12:22:48 2014 -0600

----------------------------------------------------------------------
 CHANGES                                         |  2 ++
 .../configuration/records.config.en.rst         | 24 ++++++++++----------
 lib/records/RecHttp.cc                          | 10 ++++++--
 3 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c2434df8/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index e795406..162e255 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2525] Remove restrictions on outbound transparency with SSL.
+
   *) [TS-2425] Update to TS-2261 for loading plugins as root
 
   *) [TS-2505] Add traffic_line --offline option.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c2434df8/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index a7d03d8..c0d78a5 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -250,7 +250,7 @@ Value Effect
 Network
 =======
 
-.. ts:cv:: LOCAL proxy.local.incoming_ip_to_bind STRING 0.0.0.0 ::
+.. ts:cv:: LOCAL proxy.local.incoming_ip_to_bind STRING 0.0.0.0 [::]
 
    Controls the global default IP addresses to which to bind proxy server ports. The value is a space separated list of IP addresses, one per supported IP address family (currently IPv4 and IPv6).
 
@@ -270,9 +270,9 @@ Unless explicitly specified in `proxy.config.http.server_ports`_ the server port
 
    Set the global default for IPv4 to ``191.68.101.18`` and the global default for IPv6 to ``fc07:192:168:101::17``.::
 
-      LOCAL proxy.local.incoming_ip_to_bind STRING 192.168.101.18 fc07:192:168:101::17
+      LOCAL proxy.local.incoming_ip_to_bind STRING 192.168.101.18 [fc07:192:168:101::17]
 
-.. ts:cv:: LOCAL proxy.local.outgoing_ip_to_bind STRING 0.0.0.0 ::
+.. ts:cv:: LOCAL proxy.local.outgoing_ip_to_bind STRING 0.0.0.0 [::]
 
    This controls the global default for the local IP address for outbound connections to origin servers. The value is a list of space separated IP addresses, one per supported IP address family (currently IPv4 and IPv6).
 
@@ -284,7 +284,7 @@ Unless explicitly specified in `proxy.config.http.server_ports`_ the server port
 
 .. topic:: Example
 
-   Set the default local outbound IP address for IPv4 connectionsn to ``192.168.101.18``.::
+   Set the default local outbound IP address for IPv4 connections to ``192.168.101.18``.::
 
       LOCAL proxy.local.outgoing_ip_to_bind STRING 192.168.101.18
 
@@ -292,7 +292,7 @@ Unless explicitly specified in `proxy.config.http.server_ports`_ the server port
 
    Set the default local outbound IP address to ``192.168.101.17`` for IPv4 and ``fc07:192:168:101::17`` for IPv6.::
 
-      LOCAL proxy.local.outgoing_ip_to_bind STRING 192.168.101.17 fc07:192:168:101::17
+      LOCAL proxy.local.outgoing_ip_to_bind STRING 192.168.101.17 [fc07:192:168:101::17]
 
 Cluster
 =======
@@ -433,14 +433,14 @@ ipv6
    Use IPv6. This is forced if the ``ip-in`` option is used with an IPv6 address.
 
 tr-in
-   Inbound transparent. The proxy port will accept connections to any IP address on the port. To have IPv6 inbound transparent you must use this and the ``ipv6`` option. This overrides :ts:cv:`proxy.local.incoming_ip_to_bind`.
+   Inbound transparent. The proxy port will accept connections to any IP address on the port. To have IPv6 inbound transparent you must use this and the ``ipv6`` option. This overrides :ts:cv:`proxy.local.incoming_ip_to_bind` for this port.
 
    Not compatible with: ``ip-in``, ``ssl``, ``blind``
 
 tr-out
-   Outbound transparent. If ATS connects to an origin server for a transaction on this port, it will use the client's address as its local address. This overrides :ts:cv:`proxy.local.outgoing_ip_to_bind`.
+   Outbound transparent. If ATS connects to an origin server for a transaction on this port, it will use the client's address as its local address. This overrides :ts:cv:`proxy.local.outgoing_ip_to_bind` for this port.
 
-   Not compatible with: ``ip-out``, ``ssl``, ``ip-resolve``
+   Not compatible with: ``ip-out``, ``ip-resolve``
 
 tr-full
    Fully transparent. This is a convenience option and is identical to specifying both ``tr-in`` and ``tr-out``.
@@ -451,7 +451,7 @@ tr-pass
    Transparent pass through. This option is useful only for inbound transparent proxy ports. If the parsing of the expected HTTP header fails, then the transaction is switched to a blind tunnel instead of generating an error response to the client. It effectively enables :ts:cv:`proxy.config.http.use_client_target_addr` for the transaction as there is no other place to obtain the origin server address.
 
 ip-in
-   Set the local IP address for the port. This is the address to which clients will connect. This forces the IP address family for the port. The ``ipv4`` or ``ipv6`` can be used but it is optional and is an error for it to disagree with the IP address family of this value. An IPv6 address **must** be enclosed in square brackets. If this options is omitted :ts:cv:`proxy.local.incoming_ip_to_bind` is used.
+   Set the local IP address for the port. This is the address to which clients will connect. This forces the IP address family for the port. The ``ipv4`` or ``ipv6`` can be used but it is optional and is an error for it to disagree with the IP address family of this value. An IPv6 address **must** be enclosed in square brackets. If this option is omitted :ts:cv:`proxy.local.incoming_ip_to_bind` is used.
 
    Not compatible with: ``tr-in``.
 
@@ -470,7 +470,7 @@ ip-resolve
 ssl
    Require SSL termination for inbound connections. SSL :ref:`must be configured <configuring-ssl-termination>` for this option to provide a functional server port.
 
-   Not compatible with: ``tr-in``, ``tr-out``, ``blind``.
+   Not compatible with: ``tr-in``, ``blind``.
 
 blind
    Accept only ``CONNECT`` transactions on this port.
@@ -905,9 +905,9 @@ Negative Response Caching
 
 .. ts:cv:: CONFIG proxy.config.http.negative_caching_lifetime INT 1800
 
-   How long (in seconds) Traffic Server keeps the negative responses  valid in cache. This value only affects negative 
+   How long (in seconds) Traffic Server keeps the negative responses  valid in cache. This value only affects negative
    responses that do have explicit ``Expires:`` or ``Cache-Control:`` lifetimes set by the server.
-   
+
 Proxy User Variables
 ====================
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c2434df8/lib/records/RecHttp.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecHttp.cc b/lib/records/RecHttp.cc
index e9ad2b5..fc75907 100644
--- a/lib/records/RecHttp.cc
+++ b/lib/records/RecHttp.cc
@@ -264,7 +264,6 @@ HttpProxyPort::processOptions(char const* opts) {
       af_set_p = true;
     } else if (0 == strcasecmp(OPT_SSL, item)) {
       m_type = TRANSPORT_SSL;
-      m_inbound_transparent_p = m_outbound_transparent_p = false;
     } else if (0 == strcasecmp(OPT_PLUGIN, item)) {
       m_type = TRANSPORT_PLUGIN;
     } else if (0 == strcasecmp(OPT_TRANSPARENT_INBOUND, item)) {
@@ -321,8 +320,9 @@ HttpProxyPort::processOptions(char const* opts) {
         (m_host_res_preference[0] != HOST_RES_PREFER_CLIENT ||
          m_host_res_preference[1] != HOST_RES_PREFER_NONE
     )) {
-      Warning("Outbound transparent ports require the IP address resolution ordering '%s,%s'. "
+      Warning("Outbound transparent port '%s' requires the IP address resolution ordering '%s,%s'. "
               "This is set automatically and does not need to be set explicitly."
+              , opts
               , HOST_RES_PREFERENCE_STRING[HOST_RES_PREFER_CLIENT]
               , HOST_RES_PREFERENCE_STRING[HOST_RES_PREFER_NONE]
         );
@@ -331,6 +331,12 @@ HttpProxyPort::processOptions(char const* opts) {
     m_host_res_preference[1] = HOST_RES_PREFER_NONE;
   }
 
+  // Can't be inbound transparent and SSL.
+  if (TRANSPORT_SSL == m_type && m_inbound_transparent_p) {
+    Warning("SSL and inbound transparency on the same port is not supported - transparency disabled:  '%s'", opts);
+    m_inbound_transparent_p = false;
+  }
+
   // Transparent pass-through requires tr-in
   if (m_transparent_passthrough && !m_inbound_transparent_p) {
     Warning("Port descriptor '%s' has transparent pass-through enabled without inbound transparency, this will be ignored.", opts);


[24/28] TS-2519: Stop using the ambiguous RECP_NULL

Posted by zw...@apache.org.
http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index be6f0d8..61ba66b 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -176,31 +176,31 @@ register_stat_callbacks()
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.completed_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_completed_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_completed_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_incoming_connections",
-                     RECD_COUNTER, RECP_NULL, (int) http_total_incoming_connections_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_total_incoming_connections_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_client_connections",
-                     RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_total_client_connections_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_client_connections_ipv4",
-                     RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_ipv4_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_total_client_connections_ipv4_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_client_connections_ipv6",
-                     RECD_COUNTER, RECP_NULL, (int) http_total_client_connections_ipv6_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_total_client_connections_ipv6_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_server_connections",
-                     RECD_COUNTER, RECP_NULL, (int) http_total_server_connections_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_total_server_connections_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_parent_proxy_connections",
-                     RECD_COUNTER, RECP_NULL, (int) http_total_parent_proxy_connections_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_total_parent_proxy_connections_stat, RecRawStatSyncCount);
 
   // Upstream current connections stats
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
@@ -218,59 +218,59 @@ register_stat_callbacks()
   HTTP_CLEAR_DYN_STAT(http_current_cache_connections_stat);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.avg_transactions_per_client_connection",
-                     RECD_FLOAT, RECP_NULL, (int) http_transactions_per_client_con, RecRawStatSyncAvg);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) http_transactions_per_client_con, RecRawStatSyncAvg);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.avg_transactions_per_server_connection",
-                     RECD_FLOAT, RECP_NULL, (int) http_transactions_per_server_con, RecRawStatSyncAvg);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) http_transactions_per_server_con, RecRawStatSyncAvg);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.avg_transactions_per_parent_connection",
-                     RECD_FLOAT, RECP_NULL, (int) http_transactions_per_parent_con, RecRawStatSyncAvg);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) http_transactions_per_parent_con, RecRawStatSyncAvg);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.client_connection_time",
-                     RECD_INT, RECP_NULL, (int) http_client_connection_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_client_connection_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.parent_proxy_connection_time",
-                     RECD_INT, RECP_NULL, (int) http_parent_proxy_connection_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_parent_proxy_connection_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.server_connection_time",
-                     RECD_INT, RECP_NULL, (int) http_server_connection_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_server_connection_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_connection_time",
-                     RECD_INT, RECP_NULL, (int) http_cache_connection_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_cache_connection_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.errors.pre_accept_hangups",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_pre_accept_hangups_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.errors.pre_accept_hangups",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_pre_accept_hangups_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.errors.empty_hangups",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_empty_hangups_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.errors.empty_hangups",
-                     RECD_FLOAT, RECP_NULL, (int) http_ua_msecs_counts_errors_empty_hangups_stat, RecRawStatSyncCount);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) http_ua_msecs_counts_errors_empty_hangups_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.errors.early_hangups",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_early_hangups_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.errors.early_hangups",
-                     RECD_FLOAT, RECP_NULL, (int) http_ua_msecs_counts_errors_early_hangups_stat, RecRawStatSyncCount);
+                     RECD_FLOAT, RECP_PERSISTENT, (int) http_ua_msecs_counts_errors_early_hangups_stat, RecRawStatSyncCount);
 
 
 
@@ -278,391 +278,391 @@ register_stat_callbacks()
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.incoming_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_incoming_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_incoming_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.outgoing_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_outgoing_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_outgoing_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.incoming_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_incoming_responses_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_incoming_responses_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.invalid_client_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_invalid_client_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_invalid_client_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.missing_host_hdr",
-                     RECD_COUNTER, RECP_NULL, (int) http_missing_host_hdr_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_missing_host_hdr_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.get_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_get_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_get_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.head_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_head_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_head_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.trace_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_trace_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_trace_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.options_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_options_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_options_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.post_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_post_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_post_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.put_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_put_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_put_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.push_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_push_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_push_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.delete_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_delete_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_delete_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.purge_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_purge_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_purge_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.connect_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_connect_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_connect_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.extension_method_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_extension_method_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_extension_method_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.client_no_cache_requests",
-                     RECD_COUNTER, RECP_NULL, (int) http_client_no_cache_requests_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_client_no_cache_requests_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.broken_server_connections",
-                     RECD_COUNTER, RECP_NULL, (int) http_broken_server_connections_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_broken_server_connections_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_lookups",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_lookups_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_lookups_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_writes",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_writes_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_writes_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_updates",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_updates_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_updates_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_deletes",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_deletes_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_deletes_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tunnels",
-                     RECD_COUNTER, RECP_NULL, (int) http_tunnels_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tunnels_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.throttled_proxy_only",
-                     RECD_COUNTER, RECP_NULL, (int) http_throttled_proxy_only_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_throttled_proxy_only_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_taxonomy.i0_n0_m0",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i0_n0_m0_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_taxonomy_i0_n0_m0_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_taxonomy.i1_n0_m0",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i1_n0_m0_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_taxonomy_i1_n0_m0_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_taxonomy.i0_n1_m0",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i0_n1_m0_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_taxonomy_i0_n1_m0_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_taxonomy.i1_n1_m0",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i1_n1_m0_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_taxonomy_i1_n1_m0_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_taxonomy.i0_n0_m1",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i0_n0_m1_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_taxonomy_i0_n0_m1_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_taxonomy.i1_n0_m1",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i1_n0_m1_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_taxonomy_i1_n0_m1_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_taxonomy.i0_n1_m1",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i0_n1_m1_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_taxonomy_i0_n1_m1_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_taxonomy.i1_n1_m1",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_taxonomy_i1_n1_m1_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_taxonomy_i1_n1_m1_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.icp_suggested_lookups",
-                     RECD_COUNTER, RECP_NULL, (int) http_icp_suggested_lookups_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_icp_suggested_lookups_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.client_transaction_time",
-                     RECD_INT, RECP_NULL, (int) http_client_transaction_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_client_transaction_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.client_write_time",
-                     RECD_INT, RECP_NULL, (int) http_client_write_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_client_write_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.server_read_time",
-                     RECD_INT, RECP_NULL, (int) http_server_read_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_server_read_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.icp_transaction_time",
-                     RECD_INT, RECP_NULL, (int) http_icp_transaction_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_icp_transaction_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.icp_raw_transaction_time",
-                     RECD_INT, RECP_NULL, (int) http_icp_raw_transaction_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_icp_raw_transaction_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.parent_proxy_transaction_time",
-                     RECD_INT, RECP_NULL, (int) http_parent_proxy_transaction_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_parent_proxy_transaction_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.parent_proxy_raw_transaction_time",
-                     RECD_INT, RECP_NULL, (int) http_parent_proxy_raw_transaction_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_parent_proxy_raw_transaction_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.server_transaction_time",
-                     RECD_INT, RECP_NULL, (int) http_server_transaction_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_server_transaction_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.server_raw_transaction_time",
-                     RECD_INT, RECP_NULL, (int) http_server_raw_transaction_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_server_raw_transaction_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_request_header_total_size",
-                     RECD_INT, RECP_NULL, (int) http_user_agent_request_header_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_user_agent_request_header_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_response_header_total_size",
-                     RECD_INT, RECP_NULL, (int) http_user_agent_response_header_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_user_agent_response_header_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_request_document_total_size",
-                     RECD_INT, RECP_NULL, (int) http_user_agent_request_document_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_user_agent_request_document_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_response_document_total_size",
-                     RECD_INT, RECP_NULL, (int) http_user_agent_response_document_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_user_agent_response_document_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_request_header_total_size",
-                     RECD_INT, RECP_NULL, (int) http_origin_server_request_header_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_origin_server_request_header_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_response_header_total_size",
-                     RECD_INT, RECP_NULL, (int) http_origin_server_response_header_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_origin_server_response_header_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_request_document_total_size",
-                     RECD_INT, RECP_NULL, (int) http_origin_server_request_document_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_origin_server_request_document_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_response_document_total_size",
-                     RECD_INT, RECP_NULL,
+                     RECD_INT, RECP_PERSISTENT,
                      (int) http_origin_server_response_document_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.parent_proxy_request_total_bytes",
-                     RECD_INT, RECP_NULL, (int) http_parent_proxy_request_total_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_parent_proxy_request_total_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.parent_proxy_response_total_bytes",
-                     RECD_INT, RECP_NULL, (int) http_parent_proxy_response_total_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_parent_proxy_response_total_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.pushed_response_header_total_size",
-                     RECD_INT, RECP_NULL, (int) http_pushed_response_header_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_pushed_response_header_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.pushed_document_total_size",
-                     RECD_INT, RECP_NULL, (int) http_pushed_document_total_size_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_pushed_document_total_size_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.response_document_size_100",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_100_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_document_size_100_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.response_document_size_1K",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_1K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_document_size_1K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.response_document_size_3K",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_3K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_document_size_3K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.response_document_size_5K",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_5K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_document_size_5K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.response_document_size_10K",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_10K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_document_size_10K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.response_document_size_1M",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_1M_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_document_size_1M_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.response_document_size_inf",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_document_size_inf_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_document_size_inf_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_document_size_100",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_100_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_document_size_100_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_document_size_1K",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_1K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_document_size_1K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_document_size_3K",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_3K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_document_size_3K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_document_size_5K",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_5K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_document_size_5K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_document_size_10K",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_10K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_document_size_10K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_document_size_1M",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_1M_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_document_size_1M_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.request_document_size_inf",
-                     RECD_COUNTER, RECP_NULL, (int) http_request_document_size_inf_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_request_document_size_inf_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_speed_bytes_per_sec_100",
-                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_100_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_user_agent_speed_bytes_per_sec_100_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_speed_bytes_per_sec_1K",
-                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_1K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_user_agent_speed_bytes_per_sec_1K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_speed_bytes_per_sec_10K",
-                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_10K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_user_agent_speed_bytes_per_sec_10K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_speed_bytes_per_sec_100K",
-                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_100K_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_user_agent_speed_bytes_per_sec_100K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_speed_bytes_per_sec_1M",
-                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_1M_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_user_agent_speed_bytes_per_sec_1M_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_speed_bytes_per_sec_10M",
-                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_10M_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_user_agent_speed_bytes_per_sec_10M_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.user_agent_speed_bytes_per_sec_100M",
-                     RECD_COUNTER, RECP_NULL, (int) http_user_agent_speed_bytes_per_sec_100M_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_user_agent_speed_bytes_per_sec_100M_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_speed_bytes_per_sec_100",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_origin_server_speed_bytes_per_sec_100_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_speed_bytes_per_sec_1K",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_origin_server_speed_bytes_per_sec_1K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_speed_bytes_per_sec_10K",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_origin_server_speed_bytes_per_sec_10K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_speed_bytes_per_sec_100K",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_origin_server_speed_bytes_per_sec_100K_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_speed_bytes_per_sec_1M",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_origin_server_speed_bytes_per_sec_1M_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_speed_bytes_per_sec_10M",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_origin_server_speed_bytes_per_sec_10M_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.origin_server_speed_bytes_per_sec_100M",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_origin_server_speed_bytes_per_sec_100M_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_transactions_time",
-                     RECD_INT, RECP_NULL, (int) http_total_transactions_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_total_transactions_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_transactions_think_time",
-                     RECD_INT, RECP_NULL, (int) http_total_transactions_think_time_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_total_transactions_think_time_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_hit_fresh",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_fresh_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_hit_fresh_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_hit_mem_fresh",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_mem_fresh_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_hit_mem_fresh_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_hit_revalidated",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_reval_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_hit_reval_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_hit_ims",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_ims_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_hit_ims_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_hit_stale_served",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_hit_stale_served_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_hit_stale_served_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_miss_cold",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_cold_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_miss_cold_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_miss_changed",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_changed_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_miss_changed_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_miss_client_no_cache",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_client_no_cache_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_miss_client_no_cache_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_miss_client_not_cacheable",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_uncacheable_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_miss_uncacheable_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_miss_ims",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_miss_ims_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_miss_ims_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_read_error",
-                     RECD_COUNTER, RECP_NULL, (int) http_cache_read_error_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_cache_read_error_stat, RecRawStatSyncCount);
 
   /////////////////////////////////////////
   // Bandwidth Savings Transaction Stats //
@@ -670,147 +670,147 @@ register_stat_callbacks()
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_hit_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_tcp_hit_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tcp_hit_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_hit_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_hit_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_hit_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_hit_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_hit_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_hit_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_miss_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_tcp_miss_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tcp_miss_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_miss_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_miss_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_miss_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_miss_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_miss_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_miss_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_expired_miss_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_tcp_expired_miss_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tcp_expired_miss_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_expired_miss_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_expired_miss_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_expired_miss_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_expired_miss_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_expired_miss_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_expired_miss_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_refresh_hit_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_tcp_refresh_hit_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tcp_refresh_hit_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_refresh_hit_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_refresh_hit_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_refresh_hit_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_refresh_hit_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_refresh_hit_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_refresh_hit_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_refresh_miss_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_tcp_refresh_miss_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tcp_refresh_miss_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_refresh_miss_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_refresh_miss_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_refresh_miss_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_refresh_miss_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_refresh_miss_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_refresh_miss_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_client_refresh_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_tcp_client_refresh_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tcp_client_refresh_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_client_refresh_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_client_refresh_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_client_refresh_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_client_refresh_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_client_refresh_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_client_refresh_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_ims_hit_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_tcp_ims_hit_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tcp_ims_hit_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_ims_hit_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_ims_hit_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_ims_hit_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_ims_hit_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_ims_hit_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_ims_hit_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_ims_miss_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_tcp_ims_miss_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_tcp_ims_miss_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_ims_miss_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_ims_miss_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_ims_miss_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.tcp_ims_miss_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_tcp_ims_miss_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_tcp_ims_miss_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.err_client_abort_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_err_client_abort_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_err_client_abort_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.err_client_abort_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_err_client_abort_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_err_client_abort_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.err_client_abort_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_err_client_abort_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_err_client_abort_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.err_connect_fail_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_err_connect_fail_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_err_connect_fail_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.err_connect_fail_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_err_connect_fail_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_err_connect_fail_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.err_connect_fail_origin_server_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_err_connect_fail_origin_server_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_err_connect_fail_origin_server_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.misc_count_stat",
-                     RECD_COUNTER, RECP_NULL, (int) http_misc_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_misc_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.misc_user_agent_bytes_stat",
-                     RECD_INT, RECP_NULL, (int) http_misc_user_agent_bytes_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_misc_user_agent_bytes_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.background_fill_bytes_aborted_stat",
-                     RECD_INT, RECP_NULL, (int) http_background_fill_bytes_aborted_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_background_fill_bytes_aborted_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.background_fill_bytes_completed_stat",
-                     RECD_INT, RECP_NULL, (int) http_background_fill_bytes_completed_stat, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_background_fill_bytes_completed_stat, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_write_errors",
-                     RECD_INT, RECP_NULL, (int) http_cache_write_errors, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_cache_write_errors, RecRawStatSyncSum);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.cache_read_errors",
-                     RECD_INT, RECP_NULL, (int) http_cache_read_errors, RecRawStatSyncSum);
+                     RECD_INT, RECP_PERSISTENT, (int) http_cache_read_errors, RecRawStatSyncSum);
 
   ////////////////////////////////////////////////////////////////////////////////
   // status code counts
@@ -818,179 +818,179 @@ register_stat_callbacks()
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.100_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_100_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_100_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.101_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_101_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_101_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.1xx_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_1xx_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_1xx_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.200_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_200_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_200_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.201_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_201_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_201_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.202_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_202_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_202_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.203_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_203_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_203_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.204_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_204_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_204_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.205_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_205_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_205_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.206_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_206_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_206_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.2xx_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_2xx_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_2xx_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.300_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_300_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_300_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.301_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_301_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_301_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.302_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_302_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_302_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.303_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_303_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_303_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.304_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_304_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_304_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.305_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_305_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_305_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.307_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_307_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_307_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.3xx_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_3xx_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_3xx_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.400_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_400_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_400_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.401_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_401_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_401_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.402_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_402_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_402_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.403_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_403_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_403_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.404_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_404_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_404_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.405_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_405_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_405_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.406_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_406_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_406_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.407_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_407_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_407_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.408_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_408_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_408_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.409_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_409_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_409_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.410_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_410_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_410_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.411_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_411_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_411_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.412_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_412_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_412_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.413_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_413_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_413_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.414_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_414_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_414_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.415_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_415_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_415_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.416_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_416_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_416_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.4xx_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_4xx_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_4xx_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.500_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_500_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_500_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.501_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_501_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_501_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.502_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_502_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_502_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.503_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_503_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_503_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.504_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_504_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_504_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.505_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_505_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_505_count_stat, RecRawStatSyncCount);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.5xx_responses",
-                     RECD_COUNTER, RECP_NULL, (int) http_response_status_5xx_count_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_response_status_5xx_count_stat, RecRawStatSyncCount);
 
 
   ////////////////////////////////////////////////////////////////////////////////
@@ -1000,107 +1000,107 @@ register_stat_callbacks()
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.hit_fresh",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_hit_fresh_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_hit_fresh_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.hit_fresh",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_hit_fresh_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.hit_fresh.process",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_hit_fresh_process_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_hit_fresh_process_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.hit_fresh.process",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_hit_fresh_process_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.hit_revalidated",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_hit_reval_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_hit_reval_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.hit_revalidated",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_hit_reval_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.miss_cold",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_miss_cold_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_miss_cold_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.miss_cold",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_miss_cold_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.miss_not_cacheable",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_miss_uncacheable_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_miss_uncacheable_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.miss_not_cacheable",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_miss_uncacheable_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.miss_changed",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_miss_changed_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_miss_changed_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.miss_changed",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_miss_changed_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.miss_client_no_cache",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_miss_client_no_cache_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.miss_client_no_cache",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_miss_client_no_cache_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.errors.aborts",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_errors_aborts_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_errors_aborts_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.errors.aborts",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_aborts_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.errors.possible_aborts",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_possible_aborts_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.errors.possible_aborts",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_possible_aborts_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.errors.connect_failed",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_connect_failed_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.errors.connect_failed",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_connect_failed_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.errors.other",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_errors_other_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_errors_other_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.errors.other",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_errors_other_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_counts.other.unclassified",
-                     RECD_COUNTER, RECP_NULL, (int) http_ua_msecs_counts_other_unclassified_stat, RecRawStatSyncCount);
+                     RECD_COUNTER, RECP_PERSISTENT, (int) http_ua_msecs_counts_other_unclassified_stat, RecRawStatSyncCount);
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.transaction_totaltime.other.unclassified",
-                     RECD_FLOAT, RECP_NULL,
+                     RECD_FLOAT, RECP_PERSISTENT,
                      (int) http_ua_msecs_counts_other_unclassified_stat, RecRawStatSyncIntMsecsToFloatSeconds);
 
   RecRegisterRawStat(http_rsb, RECT_PROCESS,
                      "proxy.process.http.total_x_redirect_count",
-                     RECD_COUNTER, RECP_NULL,
+                     RECD_COUNTER, RECP_PERSISTENT,
                      (int) http_total_x_redirect_stat, RecRawStatSyncCount);
 
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7352493c/proxy/logging/LogStandalone.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogStandalone.cc b/proxy/logging/LogStandalone.cc
index c60d703..43746cd 100644
--- a/proxy/logging/LogStandalone.cc
+++ b/proxy/logging/LogStandalone.cc
@@ -121,20 +121,17 @@ initialize_process_manager()
   //
   // Define version info records
   //
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.short", appVersionInfo.VersionStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS,
-                        "proxy.process.version.server.long", appVersionInfo.FullVersionInfoStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_number", appVersionInfo.BldNumStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_time", appVersionInfo.BldTimeStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_date", appVersionInfo.BldDateStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS,
-                        "proxy.process.version.server.build_machine", appVersionInfo.BldMachineStr, RECP_NULL);
-  RecRegisterStatString(RECT_PROCESS,
-                        "proxy.process.version.server.build_person", appVersionInfo.BldPersonStr, RECP_NULL);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.short", appVersionInfo.VersionStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.long", appVersionInfo.FullVersionInfoStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_number", appVersionInfo.BldNumStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_time", appVersionInfo.BldTimeStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_date", appVersionInfo.BldDateStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_machine", appVersionInfo.BldMachineStr, RECP_NON_PERSISTENT);
+  RecRegisterStatString(RECT_PROCESS, "proxy.process.version.server.build_person", appVersionInfo.BldPersonStr, RECP_NON_PERSISTENT);
 //    RecRegisterStatString(RECT_PROCESS,
 //                         "proxy.process.version.server.build_compile_flags",
 //                         appVersionInfo.BldCompileFlagsStr,
-//                         RECP_NULL);
+//                         RECP_NON_PERSISTENT);
 }
 
 /*-------------------------------------------------------------------------


[03/28] git commit: TS-2504: fix bad OpenSSL lib64 detection patch merge

Posted by zw...@apache.org.
TS-2504: fix bad OpenSSL lib64 detection patch merge


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/207df86f
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/207df86f
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/207df86f

Branch: refs/heads/5.0.x
Commit: 207df86f799d3653154fc6f2b3731b96d19337d4
Parents: 1ae99c0
Author: James Peach <jp...@apache.org>
Authored: Tue Jan 21 15:51:24 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Tue Jan 21 15:51:24 2014 -0800

----------------------------------------------------------------------
 build/ax_check_openssl.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/207df86f/build/ax_check_openssl.m4
----------------------------------------------------------------------
diff --git a/build/ax_check_openssl.m4 b/build/ax_check_openssl.m4
index b3f371b..e0c4029 100644
--- a/build/ax_check_openssl.m4
+++ b/build/ax_check_openssl.m4
@@ -78,7 +78,7 @@ AC_DEFUN([AX_CHECK_OPENSSL], [
             AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
             if test -f "$ssldir/include/openssl/ssl.h"; then
                 OPENSSL_INCLUDES="-I$ssldir/include"
-                if test -d "$withval/lib64"; then
+                if test -d "$ssldir/lib64"; then
                   OPENSSL_LDFLAGS="-L$ssldir/lib64"
                 else
                   OPENSSL_LDFLAGS="-L$ssldir/lib"


[17/28] git commit: TS-2526: remove the g_stats_snap_fpath global variable

Posted by zw...@apache.org.
TS-2526: remove the g_stats_snap_fpath global variable


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/5b163671
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/5b163671
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/5b163671

Branch: refs/heads/5.0.x
Commit: 5b163671cd1412b1a7bd6084e14539200634a43e
Parents: c2434df
Author: James Peach <jp...@apache.org>
Authored: Wed Jan 22 12:16:56 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Thu Jan 23 17:12:45 2014 -0800

----------------------------------------------------------------------
 CHANGES                  |  2 ++
 lib/records/I_RecCore.h  |  4 ++++
 lib/records/P_RecCore.cc |  8 +++++---
 lib/records/P_RecCore.h  |  3 ---
 lib/records/RecCore.cc   | 13 ++++++++++---
 mgmt/LocalManager.cc     |  8 ++------
 6 files changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5b163671/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 162e255..a24e138 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-2526] Remove the g_stats_snap_fpath global variable.
+
   *) [TS-2525] Remove restrictions on outbound transparency with SSL.
 
   *) [TS-2425] Update to TS-2261 for loading plugins as root

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5b163671/lib/records/I_RecCore.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecCore.h b/lib/records/I_RecCore.h
index 4b3088c..424b1c2 100644
--- a/lib/records/I_RecCore.h
+++ b/lib/records/I_RecCore.h
@@ -62,6 +62,10 @@ char * RecConfigReadLogDir();
 // value, NULL is returned. The caller MUST release the result with ats_free().
 char * RecConfigReadConfigPath(const char * file_variable, const char * default_value = NULL);
 
+// Return a copy of the persistent stats file. This is $RUNTIMEDIR/records.snap.
+// The caller MUST release the result with ats_free().
+char * RecConfigReadPersistentStatsPath();
+
 // Test whether the named configuration value is overridden by an environment variable. Return either
 // the overridden value, or the original value. Caller MUST NOT free the result.
 const char * RecConfigOverrideFromEnvironment(const char * name, const char * value);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5b163671/lib/records/P_RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/P_RecCore.cc b/lib/records/P_RecCore.cc
index f176192..2be8116 100644
--- a/lib/records/P_RecCore.cc
+++ b/lib/records/P_RecCore.cc
@@ -531,11 +531,12 @@ RecReadStatsFile()
   RecRecord *r;
   RecMessage *m;
   RecMessageItr itr;
+  xptr<char> snap_fpath(RecConfigReadPersistentStatsPath());
 
   // lock our hash table
   ink_rwlock_wrlock(&g_records_rwlock);
 
-  if ((m = RecMessageReadFromDisk(g_stats_snap_fpath)) != NULL) {
+  if ((m = RecMessageReadFromDisk(snap_fpath)) != NULL) {
     if (RecMessageUnmarshalFirst(m, &itr, &r) != REC_ERR_FAIL) {
       do {
         if ((r->name == NULL) || (!strlen(r->name)))
@@ -562,6 +563,7 @@ RecSyncStatsFile()
   RecMessage *m;
   int i, num_records;
   bool sync_to_disk;
+  xptr<char> snap_fpath(RecConfigReadPersistentStatsPath());
 
   /*
    * g_mode_type should be initialized by
@@ -585,8 +587,8 @@ RecSyncStatsFile()
       rec_mutex_release(&(r->lock));
     }
     if (sync_to_disk) {
-      RecDebug(DL_Note, "Writing '%s' [%d bytes]", g_stats_snap_fpath, m->o_write - m->o_start + sizeof(RecMessageHdr));
-      RecMessageWriteToDisk(m, g_stats_snap_fpath);
+      RecDebug(DL_Note, "Writing '%s' [%d bytes]", (const char *)snap_fpath, m->o_write - m->o_start + sizeof(RecMessageHdr));
+      RecMessageWriteToDisk(m, snap_fpath);
     }
     RecMessageFree(m);
   }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5b163671/lib/records/P_RecCore.h
----------------------------------------------------------------------
diff --git a/lib/records/P_RecCore.h b/lib/records/P_RecCore.h
index f0335b9..63109f6 100644
--- a/lib/records/P_RecCore.h
+++ b/lib/records/P_RecCore.h
@@ -49,9 +49,6 @@ extern LLQ *g_rec_config_contents_llq;
 extern InkHashTable *g_rec_config_contents_ht;
 extern ink_mutex g_rec_config_lock;
 
-// stats.snap items
-extern const char *g_stats_snap_fpath;
-
 //-------------------------------------------------------------------------
 // Initialization
 //-------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5b163671/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index 532aecc..484a9c6 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -36,7 +36,6 @@ InkHashTable *g_records_ht = NULL;
 ink_rwlock g_records_rwlock;
 int g_num_records = 0;
 
-const char *g_stats_snap_fpath = NULL;
 int g_num_update[RECT_MAX];
 
 RecTree *g_records_tree = NULL;
@@ -177,8 +176,6 @@ RecCoreInit(RecModeT mode_type, Diags *_diags)
   }
   // read stats
   if ((mode_type == RECM_SERVER) || (mode_type == RECM_STAND_ALONE)) {
-    xptr<char> rundir(RecConfigReadRuntimeDir());
-    g_stats_snap_fpath = Layout::relative_to(rundir, REC_RAW_STATS_FILE);
     RecReadStatsFile();
   }
   // read configs
@@ -1111,6 +1108,16 @@ RecConfigReadConfigPath(const char * file_variable, const char * default_value)
 }
 
 //-------------------------------------------------------------------------
+// RecConfigReadPersistentStatsPath
+//-------------------------------------------------------------------------
+char *
+RecConfigReadPersistentStatsPath()
+{
+  xptr<char> rundir(RecConfigReadRuntimeDir());
+  return Layout::relative_to(rundir, REC_RAW_STATS_FILE);
+}
+
+//-------------------------------------------------------------------------
 // REC_SignalManager (TS)
 //-------------------------------------------------------------------------
 #if defined (REC_BUILD_MGMT)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/5b163671/mgmt/LocalManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index 898e87c..2bc67ad 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -124,8 +124,6 @@ LocalManager::rollLogFiles()
 void
 LocalManager::clearStats(const char *name)
 {
-  char *statsPath;
-
   // Clear our records and then send the signal.  There is a race condition
   //  here where our stats could get re-updated from the proxy
   //  before the proxy clears them, but this should be rare.
@@ -146,14 +144,12 @@ LocalManager::clearStats(const char *name)
   //   that operation works even when the proxy is off
   //
   if (this->proxy_running == 0) {
-    xptr<char> rundir(RecConfigReadRuntimeDir());
-    statsPath = Layout::relative_to(rundir, REC_RAW_STATS_FILE);
+    xptr<char> statsPath(RecConfigReadPersistentStatsPath());
     if (unlink(statsPath) < 0) {
       if (errno != ENOENT) {
-        mgmt_log(stderr, "[LocalManager::clearStats] Unlink of %s failed : %s\n", REC_RAW_STATS_FILE, strerror(errno));
+        mgmt_log(stderr, "[LocalManager::clearStats] Unlink of %s failed : %s\n", (const char *)statsPath, strerror(errno));
       }
     }
-    ats_free(statsPath);
   }
 }
 


[09/28] git commit: TS-2419: Don't close client connection when responding with a 204 and there is no body - Fixed a bug when the 204 is served by cache

Posted by zw...@apache.org.
TS-2419: Don't close client connection when responding with a 204 and
there is no body - Fixed a bug when the 204 is served by cache


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a5c00b22
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a5c00b22
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a5c00b22

Branch: refs/heads/5.0.x
Commit: a5c00b225cb8e408cf7f1b117185e1a2bb3d11dc
Parents: e876654
Author: Bryan Call <bc...@apache.org>
Authored: Thu Jan 23 14:15:08 2014 +0100
Committer: Bryan Call <bc...@apache.org>
Committed: Thu Jan 23 14:15:08 2014 +0100

----------------------------------------------------------------------
 proxy/http/HttpTransact.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a5c00b22/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index f09e50a..3f83952 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6753,7 +6753,8 @@ HttpTransact::handle_response_keep_alive_headers(State* s, HTTPVersion ver, HTTP
     ka_action = KA_DISABLED;
   }
   else if (heads->status_get() == HTTP_STATUS_NO_CONTENT &&
-      (s->current.server->transfer_encoding != NO_TRANSFER_ENCODING || heads->get_content_length() != 0)) {
+      (s->source == SOURCE_HTTP_ORIGIN_SERVER && s->current.server->transfer_encoding != NO_TRANSFER_ENCODING
+       || heads->get_content_length() != 0)) {
     // some systems hang until the connection closes when receiving a 204 regardless of the K-A headers
     // close if there is any body response from the origin
     ka_action = KA_CLOSE;


[26/28] git commit: TS-2519: handle stat persistence type changes

Posted by zw...@apache.org.
TS-2519: handle stat persistence type changes

When Traffic Server is upgraded, it is possible for stats to change
their persistence type. If it changes from persistent to non-persistent,
we don't want to preserve the previous value. Detect this case when
we load the records snapshot and also when we register stats.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e2ffb69c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e2ffb69c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e2ffb69c

Branch: refs/heads/5.0.x
Commit: e2ffb69c179c7daf65e819b29c90ebde4546b94e
Parents: 7eeb5c7
Author: James Peach <jp...@apache.org>
Authored: Thu Jan 23 16:21:25 2014 -0800
Committer: James Peach <jp...@apache.org>
Committed: Mon Jan 27 09:40:13 2014 -0800

----------------------------------------------------------------------
 lib/records/I_RecCore.h  |  1 +
 lib/records/P_RecCore.cc | 30 ++++++++++++++++++++++++--
 lib/records/RecCore.cc   | 49 ++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 75 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e2ffb69c/lib/records/I_RecCore.h
----------------------------------------------------------------------
diff --git a/lib/records/I_RecCore.h b/lib/records/I_RecCore.h
index e9b1a4f..5bc1358 100644
--- a/lib/records/I_RecCore.h
+++ b/lib/records/I_RecCore.h
@@ -151,6 +151,7 @@ int RecGetRecordByte(const char *name, RecByte * rec_byte, bool lock = true);
 //------------------------------------------------------------------------
 int RecGetRecordType(const char *name, RecT * rec_type, bool lock = true);
 int RecGetRecordDataType(const char *name, RecDataT * data_type, bool lock = true);
+int RecGetRecordPersistenceType(const char *name, RecPersistT * persist_type, bool lock = true);
 int RecGetRecordUpdateCount(RecT data_type);
 int RecGetRecordOrderAndId(const char *name, int *order, int *id, bool lock = true);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e2ffb69c/lib/records/P_RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/P_RecCore.cc b/lib/records/P_RecCore.cc
index 152bf05..b90a5d3 100644
--- a/lib/records/P_RecCore.cc
+++ b/lib/records/P_RecCore.cc
@@ -531,6 +531,7 @@ RecReadStatsFile()
   RecRecord *r;
   RecMessage *m;
   RecMessageItr itr;
+  RecPersistT persist_type = RECP_NULL;
   xptr<char> snap_fpath(RecConfigReadPersistentStatsPath());
 
   // lock our hash table
@@ -539,8 +540,33 @@ RecReadStatsFile()
   if ((m = RecMessageReadFromDisk(snap_fpath)) != NULL) {
     if (RecMessageUnmarshalFirst(m, &itr, &r) != REC_ERR_FAIL) {
       do {
-        if ((r->name == NULL) || (!strlen(r->name)))
+        if ((r->name == NULL) || (!strlen(r->name))) {
           continue;
+        }
+
+        // If we don't have a persistence type for this record, it means that it is not a stat, or it is
+        // not registered yet. Either way, it's ok to just set the persisted value and keep going.
+        if (RecGetRecordPersistenceType(r->name, &persist_type, false /* lock */) != REC_ERR_OKAY) {
+          RecDebug(DL_Debug, "restoring value for persisted stat '%s'", r->name);
+          RecSetRecord(r->rec_type, r->name, r->data_type, &(r->data), &(r->stat_meta.data_raw), false);
+          continue;
+        }
+
+        if (!REC_TYPE_IS_STAT(r->rec_type)) {
+          // This should not happen, but be defensive against records changing their type ..
+          RecLog(DL_Warning, "skipping restore of non-stat record '%s'", r->name);
+          continue;
+        }
+
+        // Check whether the persistence type was changed by a new software version. If the record is
+        // already registered with an updated persistence type, then we don't want to set it. We should
+        // keep the registered value.
+        if (persist_type == RECP_NON_PERSISTENT) {
+          RecDebug(DL_Debug, "preserving current value of formerly persistent stat '%s'", r->name);
+          continue;
+        }
+
+        RecDebug(DL_Debug, "restoring value for persisted stat '%s'", r->name);
         RecSetRecord(r->rec_type, r->name, r->data_type, &(r->data), &(r->stat_meta.data_raw), false);
       } while (RecMessageUnmarshalNext(m, &itr, &r) != REC_ERR_FAIL);
     }
@@ -579,7 +605,7 @@ RecSyncStatsFile()
       r = &(g_records[i]);
       rec_mutex_acquire(&(r->lock));
       if (REC_TYPE_IS_STAT(r->rec_type)) {
-        if (r->stat_meta.persist_type != RECP_NON_PERSISTENT) {
+        if (r->stat_meta.persist_type == RECP_PERSISTENT) {
           m = RecMessageMarshal_Realloc(m, r);
           sync_to_disk = true;
         }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e2ffb69c/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index 484a9c6..1ed4e10 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -44,7 +44,7 @@ RecTree *g_records_tree = NULL;
 // register_record
 //-------------------------------------------------------------------------
 static RecRecord *
-register_record(RecT rec_type, const char *name, RecDataT data_type, RecData data_default)
+register_record(RecT rec_type, const char *name, RecDataT data_type, RecData data_default, RecPersistT persist_type)
 {
   RecRecord *r = NULL;
 
@@ -61,6 +61,10 @@ register_record(RecT rec_type, const char *name, RecDataT data_type, RecData dat
     RecDataSet(r->data_type, &(r->data), &(data_default));
     RecDataSet(r->data_type, &(r->data_default), &(data_default));
     ink_hash_table_insert(g_records_ht, name, (void *) r);
+
+    if (REC_TYPE_IS_STAT(r->rec_type)) {
+      r->stat_meta.persist_type = persist_type;
+    }
   }
 
   // we're now registered
@@ -467,6 +471,34 @@ RecGetRecordDataType(const char *name, RecDataT * data_type, bool lock)
 }
 
 int
+RecGetRecordPersistenceType(const char *name, RecPersistT * persist_type, bool lock)
+{
+  int err = REC_ERR_FAIL;
+  RecRecord *r = NULL;
+
+  if (lock) {
+    ink_rwlock_rdlock(&g_records_rwlock);
+  }
+
+  *persist_type = RECP_NULL;
+
+  if (ink_hash_table_lookup(g_records_ht, name, (void **) &r)) {
+    rec_mutex_acquire(&(r->lock));
+    if (REC_TYPE_IS_STAT(r->rec_type)) {
+      *persist_type = r->stat_meta.persist_type;
+      err = REC_ERR_OKAY;
+    }
+    rec_mutex_release(&(r->lock));
+  }
+
+  if (lock) {
+    ink_rwlock_unlock(&g_records_rwlock);
+  }
+
+  return err;
+}
+
+int
 RecGetRecordUpdateCount(RecT data_type)
 {
   return g_num_update[data_type];
@@ -690,10 +722,21 @@ RecRegisterStat(RecT rec_type, const char *name, RecDataT data_type, RecData dat
   RecRecord *r = NULL;
 
   ink_rwlock_wrlock(&g_records_rwlock);
-  if ((r = register_record(rec_type, name, data_type, data_default)) != NULL) {
+  if ((r = register_record(rec_type, name, data_type, data_default, persist_type)) != NULL) {
+    // If the persistence type we found in the records hash is not the same as the persistence
+    // type we are registering, then that means that it changed between the previous software
+    // version and the current version. If the metric changed to non-persistent, reset to the
+    // new default value.
+    if ((r->stat_meta.persist_type == RECP_NULL ||r->stat_meta.persist_type == RECP_PERSISTENT) &&
+        persist_type == RECP_NON_PERSISTENT) {
+      RecDebug(DL_Debug, "resetting default value for formerly persisted stat '%s'", r->name);
+      RecDataSet(r->data_type, &(r->data), &(data_default));
+    }
+
     r->stat_meta.persist_type = persist_type;
   } else {
     ink_assert(!"Can't register record!");
+    RecDebug(DL_Warning, "failed to register '%s' record", name);
   }
   ink_rwlock_unlock(&g_records_rwlock);
 
@@ -711,7 +754,7 @@ RecRegisterConfig(RecT rec_type, const char *name, RecDataT data_type,
 {
   RecRecord *r;
   ink_rwlock_wrlock(&g_records_rwlock);
-  if ((r = register_record(rec_type, name, data_type, data_default)) != NULL) {
+  if ((r = register_record(rec_type, name, data_type, data_default, RECP_NULL)) != NULL) {
     // Note: do not modify 'record->config_meta.update_required'
     r->config_meta.update_type = update_type;
     r->config_meta.check_type = check_type;


[07/28] git commit: TS-1668: Updated the documentation for HSTS

Posted by zw...@apache.org.
TS-1668: Updated the documentation for HSTS


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/e8766548
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/e8766548
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/e8766548

Branch: refs/heads/5.0.x
Commit: e8766548d1e1da8364dd865a4726292081d50eb7
Parents: 532003b
Author: Bryan Call <bc...@apache.org>
Authored: Thu Jan 23 09:11:48 2014 +0100
Committer: Bryan Call <bc...@apache.org>
Committed: Thu Jan 23 09:11:48 2014 +0100

----------------------------------------------------------------------
 doc/reference/configuration/records.config.en.rst | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e8766548/doc/reference/configuration/records.config.en.rst
----------------------------------------------------------------------
diff --git a/doc/reference/configuration/records.config.en.rst b/doc/reference/configuration/records.config.en.rst
index 214b129..a7d03d8 100644
--- a/doc/reference/configuration/records.config.en.rst
+++ b/doc/reference/configuration/records.config.en.rst
@@ -2050,8 +2050,8 @@ SSL Termination
 
   This configuration specifies the max-age value that will be used
   when adding the Strict-Transport-Security header.  The value is in seconds.
-  A value of 0 will set the max-age value to 0 and should remove the
-  hsts entry from the client.  A value of -1 will disable this feature and
+  A value of ``0`` will set the max-age value to ``0`` and should remove the
+  HSTS entry from the client.  A value of ``-1`` will disable this feature and
   not set the header.  This option is only used for HTTPS requests and the
   header will not be set on HTTP requests.
 
@@ -2059,7 +2059,7 @@ SSL Termination
 
   Enables (``1``) or disables (``0``) adding the includeSubdomain value
   to the Strict-Transport-Security header.  proxy.config.ssl.hsts_max_age
-  needs to be set to a non -1 value for this configuration to take effect.
+  needs to be set to a non ``-1`` value for this configuration to take effect.
 
 Client-Related Configuration
 ----------------------------


[22/28] git commit: TS-1606: Log buffers are not flushed periodically when TS is launched with NO_REMOTE_MANAGEMENT flag

Posted by zw...@apache.org.
TS-1606: Log buffers are not flushed periodically when TS is launched with NO_REMOTE_MANAGEMENT flag

Also fix wrong check in Log::flush_thread_main. Credit to Yakov Markovitch <ym...@gmail.com> for
pinpointing the problem.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6215bf9e
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6215bf9e
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6215bf9e

Branch: refs/heads/5.0.x
Commit: 6215bf9e9dc3bf21f9507ce6856891e8168331c2
Parents: 0f4c7b8
Author: Uri Shachar <us...@apache.org>
Authored: Sun Jan 26 18:13:01 2014 +0200
Committer: Uri Shachar <us...@apache.org>
Committed: Sun Jan 26 18:13:01 2014 +0200

----------------------------------------------------------------------
 CHANGES              |  3 ++
 proxy/logging/Log.cc | 79 ++++++++++++++++++-----------------------------
 proxy/logging/Log.h  |  4 +--
 3 files changed, 34 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6215bf9e/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 7d24d27..81e8e6e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache Traffic Server 4.2.0
 
+  *) [TS-1606] Log buffers are not flushed periodically when TS is launched 
+   with NO_REMOTE_MANAGEMENT flag
+
   *) [TS-2481] Incorrect origin server port used sometimes (with keep-alive).
    Author: Dimitry Andric <di...@andric.com>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6215bf9e/proxy/logging/Log.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 6f326c9..ebf0233 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -938,15 +938,6 @@ Log::init(int flags)
     REC_RegisterConfigUpdateFunc("proxy.local.log.collation_mode",
                                  &Log::handle_logging_mode_change, NULL);
 
-    // we must create the flush thread since it takes care of the
-    // periodic events (should this behavior be reversed ?)
-    //
-    create_threads();
-
-    eventProcessor.schedule_every(NEW (new PeriodicWakeup(collation_preproc_threads, 1)),
-                                  HRTIME_SECOND, ET_CALL);
-    init_status |= PERIODIC_WAKEUP_SCHEDULED;
-
     // Clear any stat values that need to be reset on startup
     //
     RecSetRawStatSum(log_rsb, log_stat_log_files_open_stat, 0);
@@ -997,13 +988,9 @@ Log::init_when_enabled()
                         Log::config->rolling_size_mb));
 
     // create the flush thread and the collation thread
-    //
     create_threads();
-
-    // schedule periodic wakeup
-    // ToDo: Why was this removed??
-    //
-    //      eventProcessor.schedule_every (NEW (new PeriodicWakeup()), HRTIME_SECOND, ET_CALL);
+    eventProcessor.schedule_every(NEW (new PeriodicWakeup(collation_preproc_threads, 1)),
+                                  HRTIME_SECOND, ET_CALL);
 
     init_status |= FULLY_INITIALIZED;
   }
@@ -1017,39 +1004,35 @@ Log::init_when_enabled()
 void
 Log::create_threads()
 {
-  if (!(init_status & THREADS_CREATED)) {
-
-    char desc[64];
-    preproc_notify = new EventNotify[collation_preproc_threads];
+  char desc[64];
+  preproc_notify = new EventNotify[collation_preproc_threads];
 
-    size_t stacksize;
-    REC_ReadConfigInteger(stacksize, "proxy.config.thread.default.stacksize");
+  size_t stacksize;
+  REC_ReadConfigInteger(stacksize, "proxy.config.thread.default.stacksize");
 
-    // start the preproc threads
-    //
-    // no need for the conditional var since it will be relying on
-    // on the event system.
-    for (int i = 0; i < collation_preproc_threads; i++) {
-      Continuation *preproc_cont = NEW(new LoggingPreprocContinuation(i));
-      sprintf(desc, "[LOG_PREPROC %d]", i);
-      eventProcessor.spawn_thread(preproc_cont, desc, stacksize);
-    }
+  // start the preproc threads
+  //
+  // no need for the conditional var since it will be relying on
+  // on the event system.
+  for (int i = 0; i < collation_preproc_threads; i++) {
+    Continuation *preproc_cont = NEW(new LoggingPreprocContinuation(i));
+    sprintf(desc, "[LOG_PREPROC %d]", i);
+    eventProcessor.spawn_thread(preproc_cont, desc, stacksize);
+  }
 
-    // Now, only one flush thread is supported.
-    // TODO: Enable multiple flush threads, such as
-    //       one flush thread per file.
-    //
-    flush_notify = new EventNotify;
-    flush_data_list = new InkAtomicList;
+  // Now, only one flush thread is supported.
+  // TODO: Enable multiple flush threads, such as
+  //       one flush thread per file.
+  //
+  flush_notify = new EventNotify;
+  flush_data_list = new InkAtomicList;
 
-    sprintf(desc, "Logging flush buffer list");
-    ink_atomiclist_init(flush_data_list, desc, 0);
-    Continuation *flush_cont = NEW(new LoggingFlushContinuation(0));
-    sprintf(desc, "[LOG_FLUSH]");
-    eventProcessor.spawn_thread(flush_cont, desc, stacksize);
+  sprintf(desc, "Logging flush buffer list");
+  ink_atomiclist_init(flush_data_list, desc, 0);
+  Continuation *flush_cont = NEW(new LoggingFlushContinuation(0));
+  sprintf(desc, "[LOG_FLUSH]");
+  eventProcessor.spawn_thread(flush_cont, desc, stacksize);
 
-    init_status |= THREADS_CREATED;
-  }
 }
 
 /*-------------------------------------------------------------------------
@@ -1323,12 +1306,10 @@ Log::flush_thread_main(void * /* args ATS_UNUSED */)
     // Time to work on periodic events??
     //
     now = ink_get_hrtime() / HRTIME_SECOND;
-    if (now > last_time) {
-      if ((now % (PERIODIC_TASKS_INTERVAL)) == 0) {
-        Debug("log-preproc", "periodic tasks for %" PRId64, (int64_t)now);
-        periodic_tasks(now);
-      }
-      last_time = (now = ink_get_hrtime() / HRTIME_SECOND);
+    if (now >= last_time + PERIODIC_TASKS_INTERVAL) {
+      Debug("log-preproc", "periodic tasks for %" PRId64, (int64_t)now);
+      periodic_tasks(now);
+      last_time = ink_get_hrtime() / HRTIME_SECOND;
     }
 
     // wait for more work; a spurious wake-up is ok since we'll just

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6215bf9e/proxy/logging/Log.h
----------------------------------------------------------------------
diff --git a/proxy/logging/Log.h b/proxy/logging/Log.h
index 92c4525..843c1d3 100644
--- a/proxy/logging/Log.h
+++ b/proxy/logging/Log.h
@@ -374,9 +374,7 @@ public:
   enum InitFlags
   {
     FIELDS_INITIALIZED = 1,
-    THREADS_CREATED = 2,
-    PERIODIC_WAKEUP_SCHEDULED = 4,
-    FULLY_INITIALIZED = 8
+    FULLY_INITIALIZED = 2
   };
 
   enum ConfigFlags


[11/28] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver

Posted by zw...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/trafficserver


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6af64a9d
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6af64a9d
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6af64a9d

Branch: refs/heads/5.0.x
Commit: 6af64a9d23c8f42d8082a9f44f19e354c99865b6
Parents: 38f0f0c 27e8fb9
Author: Bryan Call <bc...@apache.org>
Authored: Thu Jan 23 14:20:39 2014 +0100
Committer: Bryan Call <bc...@apache.org>
Committed: Thu Jan 23 14:20:39 2014 +0100

----------------------------------------------------------------------

----------------------------------------------------------------------