You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2013/05/04 17:30:22 UTC

[01/50] git commit: TS-1850: improved SSL error reporting

Updated Branches:
  refs/heads/sphinx-docs d9f943ed7 -> f032bbcd1


TS-1850: improved SSL error reporting

Many SSL certificate management errors don't report the full OpenSSL
error stack, making the error difficult to diagnose. We should log
the full error stack in those cases.

Add varargs logging macros to Diags.h.  Add const to Diags members
where possible.  Improve SSL certificate error reporting


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

Branch: refs/heads/sphinx-docs
Commit: bb2fcaad3ad568e9aa64c2bcffbd9992249f72f7
Parents: 95a28c7
Author: James Peach <jp...@apache.org>
Authored: Wed Apr 24 16:01:44 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Wed Apr 24 16:04:40 2013 -0700

----------------------------------------------------------------------
 CHANGES                 |    2 +
 iocore/net/P_SSLUtils.h |    2 +-
 iocore/net/SSLUtils.cc  |  248 +++++++++++++++++++-----------------------
 3 files changed, 114 insertions(+), 138 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb2fcaad/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 0b43956..d75f00d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1850] Improve SSL certificate error reporting.
+
   *) [TS-1848] Fix MIMEHdr::field_value_set_int64() wrapper.
    Author: Yunkai Zhang <qi...@taobao.com>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb2fcaad/iocore/net/P_SSLUtils.h
----------------------------------------------------------------------
diff --git a/iocore/net/P_SSLUtils.h b/iocore/net/P_SSLUtils.h
index d336706..5f6dc01 100644
--- a/iocore/net/P_SSLUtils.h
+++ b/iocore/net/P_SSLUtils.h
@@ -53,7 +53,7 @@ SSL_CTX * SSLInitClientContext(const SSLConfigParams * param);
 void SSLInitializeLibrary();
 
 // Log an SSL error.
-void SSLError(const char *errStr, bool critical = true);
+void SSLError(const char * fmt, ...) TS_PRINTFLIKE(1, 2);
 
 // Log a SSL network buffer.
 void SSLDebugBufferPrint(const char * tag, const char * buffer, unsigned buflen, const char * message);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb2fcaad/iocore/net/SSLUtils.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index 9827815..2cbcf77 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -49,6 +49,44 @@ typedef SSL_METHOD * ink_ssl_method_t;
 static ProxyMutex ** sslMutexArray;
 static bool open_ssl_initialized = false;
 
+struct ats_x509_certificate
+{
+  explicit ats_x509_certificate(X509 * x) : x509(x) {}
+  ~ats_x509_certificate() { if (x509) X509_free(x509); }
+
+  operator bool() const {
+      return x509 != NULL;
+  }
+
+  X509 * x509;
+
+private:
+  ats_x509_certificate(const ats_x509_certificate&);
+  ats_x509_certificate& operator=(const ats_x509_certificate&);
+};
+
+struct ats_file_bio
+{
+    ats_file_bio(const char * path, const char * mode)
+      : bio(BIO_new_file(path, mode)) {
+    }
+
+    ~ats_file_bio() {
+        (void)BIO_set_close(bio, BIO_CLOSE);
+        BIO_free(bio);
+    }
+
+    operator bool() const {
+        return bio != NULL;
+    }
+
+    BIO * bio;
+
+private:
+    ats_file_bio(const ats_file_bio&);
+    ats_file_bio& operator=(const ats_file_bio&);
+};
+
 static unsigned long
 SSL_pthreads_thread_id()
 {
@@ -74,45 +112,29 @@ SSL_locking_callback(int mode, int type, const char * file, int line)
   }
 }
 
-static int
-SSL_CTX_add_extra_chain_cert_file(SSL_CTX * ctx, const char *file)
+static bool
+SSL_CTX_add_extra_chain_cert_file(SSL_CTX * ctx, const char * chainfile)
 {
-  BIO *in;
-  int ret = 0;
-  X509 *x = NULL;
+  ats_file_bio bio(chainfile, "r");
 
-  in = BIO_new(BIO_s_file_internal());
-  if (in == NULL) {
-    SSLerr(SSL_F_SSL_USE_CERTIFICATE_FILE, ERR_R_BUF_LIB);
-    goto end;
+  if (!bio) {
+    return false;
   }
 
-  if (BIO_read_filename(in, file) <= 0) {
-    SSLerr(SSL_F_SSL_USE_CERTIFICATE_FILE, ERR_R_SYS_LIB);
-    goto end;
-  }
+  for (;;) {
+    ats_x509_certificate certificate(PEM_read_bio_X509_AUX(bio.bio, NULL, NULL, NULL));
 
-  // j = ERR_R_PEM_LIB;
-  while ((x = PEM_read_bio_X509(in, NULL, ctx->default_passwd_callback, ctx->default_passwd_callback_userdata)) != NULL) {
-    ret = SSL_CTX_add_extra_chain_cert(ctx, x);
-    if (!ret) {
-        X509_free(x);
-        BIO_free(in);
-	return -1;
-     }
+    if (!certificate) {
+      // No more the certificates in this file.
+      break;
     }
-/*  x = PEM_read_bio_X509(in, NULL, ctx->default_passwd_callback, ctx->default_passwd_callback_userdata);
-  if (x == NULL) {
-    SSLerr(SSL_F_SSL_USE_CERTIFICATE_FILE, j);
-    goto end;
-  }
-
-  ret = SSL_CTX_add_extra_chain_cert(ctx, x);*/
-end:
-  //  if (x != NULL) X509_free(x);
-  if (in != NULL)
-    BIO_free(in);
-  return (ret);
+
+    if (!SSL_CTX_add_extra_chain_cert(ctx, certificate.x509)) {
+      return false;
+    }
+  }
+
+  return true;
 }
 
 #if TS_USE_TLS_SNI
@@ -202,7 +224,7 @@ SSLInitializeLibrary()
 }
 
 void
-SSLError(const char *errStr, bool critical)
+SSLError(const char * fmt, ...)
 {
   unsigned long l;
   char buf[256];
@@ -210,28 +232,14 @@ SSLError(const char *errStr, bool critical)
   int line, flags;
   unsigned long es;
 
-  if (!critical) {
-    if (errStr) {
-      Debug("ssl_error", "SSL ERROR: %s", errStr);
-    } else {
-      Debug("ssl_error", "SSL ERROR");
-    }
-  } else {
-    if (errStr) {
-      Error("SSL ERROR: %s", errStr);
-    } else {
-      Error("SSL ERROR");
-    }
-  }
+  va_list ap;
+  va_start(ap, fmt);
+  ErrorV(fmt, ap);
+  va_end(ap);
 
   es = CRYPTO_thread_id();
   while ((l = ERR_get_error_line_data(&file, &line, &data, &flags)) != 0) {
-    if (!critical) {
-      Debug("ssl_error", "SSL::%lu:%s:%s:%d:%s", es,
-            ERR_error_string(l, buf), file, line, (flags & ERR_TXT_STRING) ? data : "");
-    } else {
-      Error("SSL::%lu:%s:%s:%d:%s", es, ERR_error_string(l, buf), file, line, (flags & ERR_TXT_STRING) ? data : "");
-    }
+    Error("SSL::%lu:%s:%s:%d:%s", es, ERR_error_string(l, buf), file, line, (flags & ERR_TXT_STRING) ? data : "");
   }
 }
 
@@ -285,50 +293,51 @@ SSLInitServerContext(
 
   SSL_CTX_set_quiet_shutdown(ctx, 1);
 
+  // XXX OpenSSL recommends that we should use SSL_CTX_use_certificate_chain_file() here. That API
+  // also loads only the first certificate, but it allows the intermediate CA certificate chain to
+  // be in the same file. SSL_CTX_use_certificate_chain_file() was added in OpenSSL 0.9.3.
   completeServerCertPath = Layout::relative_to(params->serverCertPathOnly, serverCertPtr);
-
-  if (SSL_CTX_use_certificate_file(ctx, completeServerCertPath, SSL_FILETYPE_PEM) <= 0) {
-    Error ("SSL ERROR: Cannot use server certificate file: %s", (const char *)completeServerCertPath);
+  if (!SSL_CTX_use_certificate_file(ctx, completeServerCertPath, SSL_FILETYPE_PEM)) {
+    SSLError("failed to load certificate from %s", (const char *)completeServerCertPath);
     goto fail;
   }
 
+  // First, load any CA chains from the global chain file.
+  if (params->serverCertChainPath) {
+    xptr<char> completeServerCaCertPath(Layout::relative_to(params->serverCACertPath, params->serverCertChainPath));
+    if (!SSL_CTX_add_extra_chain_cert_file(ctx, completeServerCaCertPath)) {
+      SSLError("failed to load global certificate chain from %s", (const char *)completeServerCaCertPath);
+      goto fail;
+    }
+  }
+
+  // Now, load any additional certificate chains specified in this entry.
   if (serverCaCertPtr) {
     xptr<char> completeServerCaCertPath(Layout::relative_to(params->serverCACertPath, serverCaCertPtr));
-    if (SSL_CTX_add_extra_chain_cert_file(ctx, completeServerCaCertPath) <= 0) {
-      Error ("SSL ERROR: Cannot use server certificate chain file: %s", (const char *)completeServerCaCertPath);
+    if (!SSL_CTX_add_extra_chain_cert_file(ctx, completeServerCaCertPath)) {
+      SSLError("failed to load certificate chain from %s", (const char *)completeServerCaCertPath);
       goto fail;
     }
   }
 
   if (serverKeyPtr == NULL) {
     // assume private key is contained in cert obtained from multicert file.
-    if (SSL_CTX_use_PrivateKey_file(ctx, completeServerCertPath, SSL_FILETYPE_PEM) <= 0) {
-      Error("SSL ERROR: Cannot use server private key file: %s", (const char *)completeServerCertPath);
+    if (!SSL_CTX_use_PrivateKey_file(ctx, completeServerCertPath, SSL_FILETYPE_PEM)) {
+      SSLError("failed to load server private key from %s", (const char *)completeServerCertPath);
       goto fail;
     }
-  } else {
-    if (params->serverKeyPathOnly != NULL) {
-      xptr<char> completeServerKeyPath(Layout::get()->relative_to(params->serverKeyPathOnly, serverKeyPtr));
-      if (SSL_CTX_use_PrivateKey_file(ctx, completeServerKeyPath, SSL_FILETYPE_PEM) <= 0) {
-        Error("SSL ERROR: Cannot use server private key file: %s", (const char *)completeServerKeyPath);
-        goto fail;
-      }
-    } else {
-      SSLError("Empty ssl private key path in records.config.");
-    }
-
-  }
-
-  if (params->serverCertChainPath) {
-    xptr<char> completeServerCaCertPath(Layout::relative_to(params->serverCACertPath, params->serverCertChainPath));
-    if (SSL_CTX_add_extra_chain_cert_file(ctx, params->serverCertChainPath) <= 0) {
-      Error ("SSL ERROR: Cannot use server certificate chain file: %s", (const char *)completeServerCaCertPath);
+  } else if (params->serverKeyPathOnly != NULL) {
+    xptr<char> completeServerKeyPath(Layout::get()->relative_to(params->serverKeyPathOnly, serverKeyPtr));
+    if (!SSL_CTX_use_PrivateKey_file(ctx, completeServerKeyPath, SSL_FILETYPE_PEM)) {
+      SSLError("failed to load server private key from %s", (const char *)completeServerKeyPath);
       goto fail;
     }
+  } else {
+    SSLError("empty SSL private key path in records.config");
   }
 
   if (!SSL_CTX_check_private_key(ctx)) {
-    SSLError("Server private key does not match the certificate public key");
+    SSLError("server private key does not match the certificate public key");
     goto fail;
   }
 
@@ -349,21 +358,23 @@ SSLInitServerContext(
     } else {
       // disable client cert support
       server_verify_client = SSL_VERIFY_NONE;
-      Error("Illegal Client Certification Level in records.config");
+      Error("illegal client certification level %d in records.config", server_verify_client);
     }
 
+    // XXX I really don't think that this is a good idea. We should be setting this a some finer granularity,
+    // possibly per SSL CTX. httpd uses md5(host:port), which seems reasonable.
     session_id_context = 1;
+    SSL_CTX_set_session_id_context(ctx, (const unsigned char *) &session_id_context, sizeof(session_id_context));
 
     SSL_CTX_set_verify(ctx, server_verify_client, NULL);
     SSL_CTX_set_verify_depth(ctx, params->verify_depth); // might want to make configurable at some point.
-    SSL_CTX_set_session_id_context(ctx, (const unsigned char *) &session_id_context, sizeof session_id_context);
 
     SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(params->serverCACertFilename));
   }
 
   if (params->cipherSuite != NULL) {
     if (!SSL_CTX_set_cipher_list(ctx, params->cipherSuite)) {
-      SSLError("Invalid Cipher Suite in records.config");
+      SSLError("invalid cipher suite in records.config");
       goto fail;
     }
   }
@@ -392,7 +403,7 @@ SSLInitClientContext(const SSLConfigParams * params)
   // disable selected protocols
   SSL_CTX_set_options(client_ctx, params->ssl_ctx_options);
   if (!client_ctx) {
-    SSLError("Cannot create new client context");
+    SSLError("cannot create new client context");
     return NULL;
   }
 
@@ -404,22 +415,20 @@ SSLInitClientContext(const SSLConfigParams * params)
   }
 
   if (params->clientCertPath != 0) {
-    if (SSL_CTX_use_certificate_file(client_ctx, params->clientCertPath, SSL_FILETYPE_PEM) <= 0) {
-      Error ("SSL Error: Cannot use client certificate file: %s", params->clientCertPath);
-      SSL_CTX_free(client_ctx);
-      return NULL;
+    if (!SSL_CTX_use_certificate_file(client_ctx, params->clientCertPath, SSL_FILETYPE_PEM)) {
+      SSLError("failed to load client certificate from %s", params->clientCertPath);
+      goto fail;
     }
 
-    if (SSL_CTX_use_PrivateKey_file(client_ctx, clientKeyPtr, SSL_FILETYPE_PEM) <= 0) {
-      Error ("SSL ERROR: Cannot use client private key file: %s", clientKeyPtr);
-      SSL_CTX_free(client_ctx);
-      return NULL;
+    if (!SSL_CTX_use_PrivateKey_file(client_ctx, clientKeyPtr, SSL_FILETYPE_PEM)) {
+      SSLError("failed to load client private key file from %s", clientKeyPtr);
+      goto fail;
     }
 
     if (!SSL_CTX_check_private_key(client_ctx)) {
-      Error("SSL ERROR: Client private key (%s) does not match the certificate public key (%s)", clientKeyPtr, params->clientCertPath);
-      SSL_CTX_free(client_ctx);
-      return NULL;
+      SSLError("client private key (%s) does not match the certificate public key (%s)",
+          clientKeyPtr, params->clientCertPath);
+      goto fail;
     }
   }
 
@@ -431,56 +440,21 @@ SSLInitClientContext(const SSLConfigParams * params)
     SSL_CTX_set_verify_depth(client_ctx, params->client_verify_depth);
 
     if (params->clientCACertFilename != NULL && params->clientCACertPath != NULL) {
-      if ((!SSL_CTX_load_verify_locations(client_ctx, params->clientCACertFilename,
-                                          params->clientCACertPath)) ||
+      if ((!SSL_CTX_load_verify_locations(client_ctx, params->clientCACertFilename, params->clientCACertPath)) ||
           (!SSL_CTX_set_default_verify_paths(client_ctx))) {
-        Error("SSL ERROR: Client CA Certificate file (%s) or CA Certificate path (%s) invalid", params->clientCACertFilename, params->clientCACertPath);
-        SSL_CTX_free(client_ctx);
-        return NULL;
+        SSLError("invalid client CA Certificate file (%s) or CA Certificate path (%s)",
+            params->clientCACertFilename, params->clientCACertPath);
+        goto fail;
       }
     }
   }
 
   return client_ctx;
-}
-
-struct ats_x509_certificate
-{
-  explicit ats_x509_certificate(X509 * x) : x509(x) {}
-  ~ats_x509_certificate() { if (x509) X509_free(x509); }
-
-  operator bool() const {
-      return x509 != NULL;
-  }
-
-  X509 * x509;
 
-private:
-  ats_x509_certificate(const ats_x509_certificate&);
-  ats_x509_certificate& operator=(const ats_x509_certificate&);
-};
-
-struct ats_file_bio
-{
-    ats_file_bio(const char * path, const char * mode)
-      : bio(BIO_new_file(path, mode)) {
-    }
-
-    ~ats_file_bio() {
-        (void)BIO_set_close(bio, BIO_CLOSE);
-        BIO_free(bio);
-    }
-
-    operator bool() const {
-        return bio != NULL;
-    }
-
-    BIO * bio;
-
-private:
-    ats_file_bio(const ats_file_bio&);
-    ats_file_bio& operator=(const ats_file_bio&);
-};
+fail:
+  SSL_CTX_free(client_ctx);
+  return NULL;
+}
 
 static char *
 asn1_strdup(ASN1_STRING * s)
@@ -657,7 +631,7 @@ SSLParseCertificateConfiguration(
   }
 
   if (!file_buf) {
-    Error("%s: failed to read SSL certificate configuration from %s", __func__, params->configFilePath);
+    Error("failed to read SSL certificate configuration from %s", params->configFilePath);
     return false;
   }
 


[17/50] git commit: TS-1839 Change Layout initialization, such that if the install directory doesn't exist, we just give a warning. This fixes the problem where e.g. make test fails.

Posted by jp...@apache.org.
TS-1839 Change Layout initialization, such that if the install
directory doesn't exist, we just give a warning. This fixes
the problem where e.g. make test fails.


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

Branch: refs/heads/sphinx-docs
Commit: dba01ebb6fcb060491330efb9c051d17963cc683
Parents: 1250c7c
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Apr 26 20:32:04 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Apr 26 20:32:04 2013 -0600

----------------------------------------------------------------------
 CHANGES          |    3 +++
 lib/ts/Layout.cc |    7 +++----
 2 files changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dba01ebb/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index e13b24a..76200e2 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1839] We fail "make test" on some platforms, due to install
+   directory missing.
+
   *) [TS-1856] Replace SIZE() macro with COUNTOF() and countof().
 
   *) [TS-1853] Fix formatting in logstats to be consistenly 2 decimals.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/dba01ebb/lib/ts/Layout.cc
----------------------------------------------------------------------
diff --git a/lib/ts/Layout.cc b/lib/ts/Layout.cc
index 0ca75d2..d1001cb 100644
--- a/lib/ts/Layout.cc
+++ b/lib/ts/Layout.cc
@@ -159,10 +159,6 @@ Layout::Layout(const char *_prefix)
       ink_strlcpy(path, TS_BUILD_PREFIX, sizeof(path));
     }
 
-    if (access(path, R_OK) == -1) {
-      ink_error("unable to access() TS_ROOT '%s': %d, %s\n", path, errno, strerror(errno));
-      return;
-    }
     prefix = ats_strdup(path);
   }
   exec_prefix = layout_relative(prefix, TS_BUILD_EXEC_PREFIX);
@@ -204,6 +200,9 @@ Layout::Layout(const char *_prefix)
   PrintSTR(cachedir);
 #endif
 
+  if (access(prefix, F_OK) == -1) {
+    ink_error("unable to access() TS_ROOT '%s': %d, %s\n", prefix, errno, strerror(errno));
+  }
 }
 
 Layout::~Layout()


[38/50] git commit: TS-1843: detect and link libhwloc on Ubuntu

Posted by jp...@apache.org.
TS-1843: detect and link libhwloc on Ubuntu

Fix the hwloc-enabled build on current and older Ubuntu releases.
This requires explicitly testing for the HWLOC_OBJ_PU symbol, and
using pkg-cofig to find the correct build options.


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

Branch: refs/heads/sphinx-docs
Commit: 7e417c4712e36c9c38cf60b98783b24ad2a1c4f3
Parents: 54e9a1e
Author: James Peach <jp...@apache.org>
Authored: Mon Apr 22 13:16:23 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Apr 29 09:15:56 2013 -0700

----------------------------------------------------------------------
 CHANGES                                  |    4 ++-
 configure.ac                             |   32 +++++++++++++-----------
 iocore/cluster/ClusterHandlerBase.cc     |    6 +----
 iocore/eventsystem/UnixEventProcessor.cc |    8 +++++-
 lib/ts/Makefile.am                       |   13 +++++++++-
 lib/ts/ink_defs.cc                       |   27 ++++++++++++--------
 proxy/Makefile.am                        |    3 +-
 7 files changed, 58 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7e417c47/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index dbb5fd0..b99556e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,7 +2,9 @@
   Changes with Apache Traffic Server 3.3.3
 
 
-  *) [TS-1858] Fix redefinition of timersub on Solaris
+  *) [TS-1843] Detect and link libhwloc on Ubuntu.
+
+  *) [TS-1858] Fix redefinition of timersub on Solaris.
 
   *) [TS-1861] Build fails with reclaimable freelist enabled.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7e417c47/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 6e7549a..8d48401 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1235,14 +1235,24 @@ AC_SUBST(use_linux_native_aio)
 # Check for hwloc library.
 # If we don't find it, disable checking for header.
 use_hwloc=0
-AS_IF([test "x$enable_hwloc" = "xyes"],
-  AC_CHECK_LIB([hwloc],[hwloc_topology_init],
-    [AC_SUBST([LIBHWLOC], ["-lhwloc"])
-     use_hwloc=1
-    ],
-    [enable_hwloc=no]
+
+AS_IF([test "x$enable_hwloc" = "xyes"], [
+  AC_CHECK_HEADERS([hwloc.h], [],
+    [AC_MSG_WARN([hwloc.h header not found, try --disable-hwloc])], []
   )
-)
+
+  # Old versions of libhwloc don't have HWLOC_OBJ_PU.
+  AC_CHECK_DECL(HWLOC_OBJ_PU,
+    [AC_DEFINE(HAVE_HWLOC_OBJ_PU, 1, [Whether HWLOC_OBJ_PU is available])], [],
+    [#include <hwloc.h>]
+  )
+
+  # Use pkg-config, because some distros (*cough* Ubuntu) put hwloc in unusual places.
+  PKG_CHECK_MODULES([hwloc], [hwloc], [use_hwloc=yes], [use_hwloc=no])
+  AC_SUBST([hwloc_CFLAGS])
+  AC_SUBST([hwloc_LIBS])
+])
+
 AC_SUBST(use_hwloc)
 
 #
@@ -1489,14 +1499,6 @@ if test "x${enable_posix_cap}" != "xno"; then
   )
 fi
 
-if test "x${enable_hwloc}" = "xyes"; then
-  AC_CHECK_HEADERS([hwloc.h],
-    [],
-    [AC_MSG_FAILURE([hwloc header not found. Try --disable-hwloc])],
-    []
-  )
-fi
-
 # Check for high-resolution timestamps in struct stat
 AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec])
 AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7e417c47/iocore/cluster/ClusterHandlerBase.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterHandlerBase.cc b/iocore/cluster/ClusterHandlerBase.cc
index 19a9747..b245db6 100644
--- a/iocore/cluster/ClusterHandlerBase.cc
+++ b/iocore/cluster/ClusterHandlerBase.cc
@@ -1152,11 +1152,7 @@ failed:
         // Startup the periodic events to process entries in
         //  external_incoming_control.
 
-#if defined(freebsd)
-        int procs_online = 1;
-#else
-        int procs_online = sysconf(_SC_NPROCESSORS_ONLN);
-#endif
+        int procs_online = ink_number_of_processors();
         int total_callbacks = min(procs_online, MAX_COMPLETION_CALLBACK_EVENTS);
         for (int n = 0; n < total_callbacks; ++n) {
           callout_cont[n] = NEW(new ClusterCalloutContinuation(this));

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7e417c47/iocore/eventsystem/UnixEventProcessor.cc
----------------------------------------------------------------------
diff --git a/iocore/eventsystem/UnixEventProcessor.cc b/iocore/eventsystem/UnixEventProcessor.cc
index 1821809..8613cd3 100644
--- a/iocore/eventsystem/UnixEventProcessor.cc
+++ b/iocore/eventsystem/UnixEventProcessor.cc
@@ -169,7 +169,13 @@ EventProcessor::start(int n_event_threads)
   ink_cpuset_t cpuset;
   int socket = hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_SOCKET);
   int cu = hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_CORE);
-  int pu = hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_PU);
+  int pu = cu;
+
+  // Older versions of libhwloc (eg. Ubuntu 10.04) don't have pHWLOC_OBJ_PU.
+#if HAVE_HWLOC_OBJ_PU
+  pu = hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_PU);
+#endif
+
   Debug("iocore_thread", "socket: %d core: %d logical processor: %d affinity: %d", socket, cu, pu, affinity);
 #endif
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7e417c47/lib/ts/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/ts/Makefile.am b/lib/ts/Makefile.am
index 689df2f..2b6692d 100644
--- a/lib/ts/Makefile.am
+++ b/lib/ts/Makefile.am
@@ -25,7 +25,18 @@ AM_CPPFLAGS = -I$(top_srcdir)/lib
 lib_LTLIBRARIES = libtsutil.la
 
 libtsutil_la_LDFLAGS = -no-undefined -version-info @TS_LIBTOOL_VERSION@
-libtsutil_la_LIBADD = @LIBOBJS@ @LIBPCRE@ @LIBSSL@ @LIBTCL@ @LIBRESOLV@ @LIBRT@ @LIBSOCKET@ @LIBNSL@ @LIBCAP@ @LIBHWLOC@ -lc
+libtsutil_la_LIBADD = \
+  @hwloc_LIBS@ \
+  @LIBOBJS@ \
+  @LIBPCRE@ \
+  @LIBSSL@ \
+  @LIBTCL@ \
+  @LIBRESOLV@ \
+  @LIBRT@ \
+  @LIBSOCKET@ \
+  @LIBNSL@ \
+  @LIBCAP@ \
+  -lc
 
 libtsutil_la_SOURCES = \
   Allocator.h \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7e417c47/lib/ts/ink_defs.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_defs.cc b/lib/ts/ink_defs.cc
index a327bbb..dc68183 100644
--- a/lib/ts/ink_defs.cc
+++ b/lib/ts/ink_defs.cc
@@ -119,17 +119,21 @@ int
 ink_number_of_processors()
 {
 #if TS_USE_HWLOC
-  int cu;
-  int pu;
 
-  cu = hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_CORE);
-  pu = hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_PU);
-  if (pu > cu)
+  int cu = hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_CORE);
+
+#if HAVE_HWLOC_OBJ_PU
+  int pu = hwloc_get_nbobjs_by_type(ink_get_topology(), HWLOC_OBJ_PU);
+
+  if (pu > cu) {
     return cu + (pu - cu)/4;
-  else
-    return cu;
-#else
-#if defined(freebsd)
+  }
+#endif
+
+  return cu;
+
+#elif defined(freebsd)
+
   int mib[2], n;
   mib[0] = CTL_HW;
   mib[1] = HW_NCPU;
@@ -137,9 +141,10 @@ ink_number_of_processors()
   if (sysctl(mib, 2, &n, &len, NULL, 0) == -1)
     return 1;
   return n;
+
 #else
+
   return sysconf(_SC_NPROCESSORS_ONLN); // number of processing units (includes Hyper Threading)
-#endif /* freebsd */
 
-#endif /* TS_HAVE_HWLOC_H */
+#endif
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7e417c47/proxy/Makefile.am
----------------------------------------------------------------------
diff --git a/proxy/Makefile.am b/proxy/Makefile.am
index d68e6d8..3975db9 100644
--- a/proxy/Makefile.am
+++ b/proxy/Makefile.am
@@ -161,9 +161,10 @@ traffic_server_LDADD = \
   $(top_builddir)/lib/records/librecprocess.a \
   $(top_builddir)/iocore/eventsystem/libinkevent.a \
   $(which_libts) \
+  @hwloc_LIBS@ \
   @LIBTHREAD@ @LIBSOCKET@ @LIBNSL@ @LIBRESOLV@ @LIBRT@ \
   @LIBPCRE@ @LIBSSL@ @LIBTCL@ @LIBDL@ \
-  @LIBEXPAT@ @LIBDEMANGLE@ @LIBCAP@ @LIBHWLOC@ \
+  @LIBEXPAT@ @LIBDEMANGLE@ @LIBCAP@ \
   @LIBZ@ @LIBLZMA@ \
   @LIBMLD@ @LIBEXC@ -lm @LIBPROFILER@ @LIBEXECINFO@
 


[26/50] git commit: Make Store::n_disks unsigned

Posted by jp...@apache.org.
Make Store::n_disks unsigned


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

Branch: refs/heads/sphinx-docs
Commit: 011e6cee979166118677b1aabef76422ec9e944d
Parents: e574dd3
Author: James Peach <jp...@apache.org>
Authored: Sat Apr 27 19:39:09 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Apr 27 19:44:17 2013 -0700

----------------------------------------------------------------------
 iocore/cache/Cache.cc       |    3 +-
 iocore/cache/I_Store.h      |   15 ++++++----
 iocore/cache/Store.cc       |   59 ++++++++++++++++++++------------------
 iocore/hostdb/MultiCache.cc |   27 ++++++++++-------
 4 files changed, 57 insertions(+), 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/011e6cee/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index bc273d3..580d49b 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -597,7 +597,6 @@ CacheProcessor::start_internal(int flags)
   start_internal_flags = flags;
   clear = !!(flags & PROCESSOR_RECONFIGURE) || auto_clear_flag;
   fix = !!(flags & PROCESSOR_FIX);
-  int i;
   start_done = 0;
   int diskok = 1;
 
@@ -610,7 +609,7 @@ CacheProcessor::start_internal(int flags)
   ink_aio_set_callback(new AIO_Callback_handler());
   Span *sd;
   config_volumes.read_config_file();
-  for (i = 0; i < theCacheStore.n_disks; i++) {
+  for (unsigned i = 0; i < theCacheStore.n_disks; i++) {
     sd = theCacheStore.disk[i];
     char path[PATH_NAME_MAX];
     int opts = DEFAULT_CACHE_OPTIONS;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/011e6cee/iocore/cache/I_Store.h
----------------------------------------------------------------------
diff --git a/iocore/cache/I_Store.h b/iocore/cache/I_Store.h
index 55ea839..0188b1d 100644
--- a/iocore/cache/I_Store.h
+++ b/iocore/cache/I_Store.h
@@ -132,22 +132,25 @@ struct Store
   void add(Store & s);
   void dup(Store & s);
   void sort();
-  void extend(int i)
+  void extend(unsigned i)
   {
     if (i > n_disks) {
       disk = (Span **)ats_realloc(disk, i * sizeof(Span *));
-      for (int j = n_disks; j < i; j++)
+      for (unsigned j = n_disks; j < i; j++) {
         disk[j] = NULL;
+      }
       n_disks = i;
     }
   }
 
   // Non Thread-safe operations
-  unsigned int total_blocks(int after = 0) {
+  unsigned int total_blocks(unsigned after = 0) {
     int64_t t = 0;
-    for (int i = after; i < n_disks; i++)
-      if (disk[i])
+    for (unsigned i = after; i < n_disks; i++) {
+      if (disk[i]) {
         t += disk[i]->total_blocks();
+      }
+    }
     return (unsigned int) t;
   }
   // 0 on success -1 on failure
@@ -162,7 +165,7 @@ struct Store
   Store();
   ~Store();
 
-  int n_disks;
+  unsigned n_disks;
   Span **disk;
 
   //

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/011e6cee/iocore/cache/Store.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Store.cc b/iocore/cache/Store.cc
index eb75feb..9076dc1 100644
--- a/iocore/cache/Store.cc
+++ b/iocore/cache/Store.cc
@@ -54,8 +54,9 @@ void
 Store::add(Store & s)
 {
   // assume on different disks
-  for (int i = 0; i < s.n_disks; i++)
+  for (unsigned i = 0; i < s.n_disks; i++) {
     add(s.disk[i]);
+  }
   s.n_disks = 0;
   s.delete_all();
 }
@@ -68,9 +69,9 @@ Store::add(Store & s)
 void
 Store::free(Store & s)
 {
-  for (int i = 0; i < s.n_disks; i++)
+  for (unsigned i = 0; i < s.n_disks; i++) {
     for (Span * sd = s.disk[i]; sd; sd = sd->link.next) {
-      for (int j = 0; j < n_disks; j++)
+      for (unsigned j = 0; j < n_disks; j++)
         for (Span * d = disk[j]; d; d = d->link.next)
           if (!strcmp(sd->pathname, d->pathname)) {
             if (sd->offset < d->offset)
@@ -81,6 +82,7 @@ Store::free(Store & s)
       ink_release_assert(!"Store::free failed");
     Lfound:;
     }
+  }
 }
 
 void
@@ -88,19 +90,18 @@ Store::sort()
 {
   Span **vec = (Span **) alloca(sizeof(Span *) * n_disks);
   memset(vec, 0, sizeof(Span *) * n_disks);
-  int i;
-  for (i = 0; i < n_disks; i++) {
+  for (unsigned i = 0; i < n_disks; i++) {
     vec[i] = disk[i];
     disk[i] = NULL;
   }
 
   // sort by device
 
-  int n = 0;
-  for (i = 0; i < n_disks; i++) {
+  unsigned n = 0;
+  for (unsigned i = 0; i < n_disks; i++) {
     for (Span * sd = vec[i]; sd; sd = vec[i]) {
       vec[i] = vec[i]->link.next;
-      for (int d = 0; d < n; d++) {
+      for (unsigned d = 0; d < n; d++) {
         if (sd->disk_id == disk[d]->disk_id) {
           sd->link.next = disk[d];
           disk[d] = sd;
@@ -115,7 +116,7 @@ Store::sort()
 
   // sort by pathname x offset
 
-  for (i = 0; i < n_disks; i++) {
+  for (unsigned i = 0; i < n_disks; i++) {
   Lagain:
     Span * prev = 0;
     for (Span * sd = disk[i]; sd;) {
@@ -141,7 +142,7 @@ Store::sort()
 
   // merge adjacent spans
 
-  for (i = 0; i < n_disks; i++) {
+  for (unsigned i = 0; i < n_disks; i++) {
     for (Span * sd = disk[i]; sd;) {
       Span *next = sd->link.next;
       if (next && !strcmp(sd->pathname, next->pathname)) {
@@ -183,9 +184,10 @@ Span::path(char *filename, int64_t * aoffset, char *buf, int buflen)
 void
 Store::delete_all()
 {
-  for (int i = 0; i < n_disks; i++)
+  for (unsigned i = 0; i < n_disks; i++) {
     if (disk[i])
       delete disk[i];
+  }
   n_disks = 0;
   ats_free(disk);
   disk = NULL;
@@ -223,7 +225,7 @@ Store::remove(char *n)
 {
   bool found = false;
 Lagain:
-  for (int i = 0; i < n_disks; i++) {
+  for (unsigned i = 0; i < n_disks; i++) {
     Span *p = NULL;
     for (Span * sd = disk[i]; sd; sd = sd->link.next) {
       if (!strcmp(n, sd->pathname)) {
@@ -357,7 +359,7 @@ Lfail:;
 int
 Store::write_config_data(int fd)
 {
-  for (int i = 0; i < n_disks; i++)
+  for (unsigned i = 0; i < n_disks; i++)
     for (Span * sd = disk[i]; sd; sd = sd->link.next) {
       char buf[PATH_NAME_MAX + 64];
       snprintf(buf, sizeof(buf), "%s %" PRId64 "\n", sd->pathname, (int64_t) sd->blocks * (int64_t) STORE_BLOCK_SIZE);
@@ -772,10 +774,11 @@ Span::init(char *filename, int64_t size)
 void
 Store::normalize()
 {
-  int ndisks = 0;
-  for (int i = 0; i < n_disks; i++)
+  unsigned ndisks = 0;
+  for (unsigned i = 0; i < n_disks; i++) {
     if (disk[i])
       disk[ndisks++] = disk[i];
+  }
   n_disks = ndisks;
 }
 
@@ -821,7 +824,7 @@ Store::spread_alloc(Store & s, unsigned int blocks, bool mmapable)
   // Count the eligable disks..
   //
   int mmapable_disks = 0;
-  for (int k = 0; k < n_disks; k++) {
+  for (unsigned k = 0; k < n_disks; k++) {
     if (disk[k]->is_mmapable()) {
       mmapable_disks++;
     }
@@ -838,7 +841,7 @@ Store::spread_alloc(Store & s, unsigned int blocks, bool mmapable)
 
   int disks_left = spread_over;
 
-  for (int i = 0; blocks && i < n_disks; i++) {
+  for (unsigned i = 0; blocks && i < n_disks; i++) {
     if (!(mmapable && !disk[i]->is_mmapable())) {
       unsigned int target = blocks / disks_left;
       if (blocks - target > total_blocks(i + 1))
@@ -852,11 +855,10 @@ Store::spread_alloc(Store & s, unsigned int blocks, bool mmapable)
 void
 Store::try_realloc(Store & s, Store & diff)
 {
-  int i = 0;
-  for (i = 0; i < s.n_disks; i++) {
+  for (unsigned i = 0; i < s.n_disks; i++) {
     Span *prev = 0;
     for (Span * sd = s.disk[i]; sd;) {
-      for (int j = 0; j < n_disks; j++)
+      for (unsigned j = 0; j < n_disks; j++)
         for (Span * d = disk[j]; d; d = d->link.next)
           if (!strcmp(sd->pathname, d->pathname)) {
             if (sd->offset >= d->offset && (sd->end() <= d->end())) {
@@ -908,7 +910,7 @@ void
 Store::alloc(Store & s, unsigned int blocks, bool one_only, bool mmapable)
 {
   unsigned int oblocks = blocks;
-  for (int i = 0; blocks && i < n_disks; i++) {
+  for (unsigned i = 0; blocks && i < n_disks; i++) {
     if (!(mmapable && !disk[i]->is_mmapable())) {
       blocks -= try_alloc(s, disk[i], blocks, one_only);
       if (one_only && oblocks != blocks)
@@ -960,11 +962,12 @@ Store::write(int fd, char *name)
   if (ink_file_fd_writestring(fd, buf) == -1)
     return (-1);
 
-  for (int i = 0; i < n_disks; i++) {
+  for (unsigned i = 0; i < n_disks; i++) {
     int n = 0;
     Span *sd = NULL;
-    for (sd = disk[i]; sd; sd = sd->link.next)
+    for (sd = disk[i]; sd; sd = sd->link.next) {
       n++;
+    }
 
     snprintf(buf, sizeof(buf), "%d\n", n);
     if (ink_file_fd_writestring(fd, buf) == -1)
@@ -1052,8 +1055,7 @@ Store::read(int fd, char *aname)
   if (!disk)
     return -1;
   memset(disk, 0, sizeof(Span *) * n_disks);
-  int i;
-  for (i = 0; i < n_disks; i++) {
+  for (unsigned i = 0; i < n_disks; i++) {
     int n = 0;
 
     if (ink_file_fd_readline(fd, PATH_NAME_MAX, buf) <= 0)
@@ -1079,7 +1081,7 @@ Store::read(int fd, char *aname)
   }
   return 0;
 Lbail:
-  for (i = 0; i < n_disks; i++) {
+  for (unsigned i = 0; i < n_disks; i++) {
     if (disk[i])
       delete disk[i];
   }
@@ -1101,8 +1103,9 @@ Store::dup(Store & s)
 {
   s.n_disks = n_disks;
   s.disk = (Span **)ats_malloc(sizeof(Span *) * n_disks);
-  for (int i = 0; i < n_disks; i++)
+  for (unsigned i = 0; i < n_disks; i++) {
     s.disk[i] = disk[i]->dup();
+  }
 }
 
 int
@@ -1110,7 +1113,7 @@ Store::clear(char *filename, bool clear_dirs)
 {
   char z[STORE_BLOCK_SIZE];
   memset(z, 0, STORE_BLOCK_SIZE);
-  for (int i = 0; i < n_disks; i++) {
+  for (unsigned i = 0; i < n_disks; i++) {
     Span *ds = disk[i];
     for (int j = 0; j < disk[i]->paths(); j++) {
       char path[PATH_NAME_MAX + 1];

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/011e6cee/iocore/hostdb/MultiCache.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/MultiCache.cc b/iocore/hostdb/MultiCache.cc
index 8548b96..00af859 100644
--- a/iocore/hostdb/MultiCache.cc
+++ b/iocore/hostdb/MultiCache.cc
@@ -57,11 +57,12 @@ store_verify(Store *store)
 {
   if (!store)
     return 0;
-  for (int i = 0; i < store->n_disks; i++)
+  for (unsigned i = 0; i < store->n_disks; i++) {
     for (Span * sd = store->disk[i]; sd; sd = sd->link.next) {
       if (!sd->file_pathname && sd->offset)
         return 0;
     }
+  }
   return 1;
 }
 
@@ -231,7 +232,7 @@ MultiCacheBase::mmap_region(int blocks, int *fds, char *cur, bool private_flag,
     return cur;
   int p = 0;
   char *res = 0;
-  for (int i = 0; i < store->n_disks; i++) {
+  for (unsigned i = 0; i < store->n_disks; i++) {
     unsigned int target = blocks / (store->n_disks - i);
     unsigned int following = store->total_blocks(i + 1);
     if (blocks - target > following)
@@ -302,13 +303,12 @@ MultiCacheBase::mmap_data(bool private_flag, bool zero_fill)
 {
   int fds[MULTI_CACHE_MAX_FILES] = { 0 };
   int n_fds = 0;
-  int i = 0;
 
   // open files
   //
   if (!store || !store->n_disks)
     goto Lalloc;
-  for (i = 0; i < store->n_disks; i++) {
+  for (unsigned i = 0; i < store->n_disks; i++) {
     Span *ds = store->disk[i];
     for (int j = 0; j < store->disk[i]->paths(); j++) {
       char path[PATH_NAME_MAX + 1];
@@ -430,14 +430,15 @@ MultiCacheBase::mmap_data(bool private_flag, bool zero_fill)
   }
 
 
-  for (i = 0; i < n_fds; i++)
+  for (int i = 0; i < n_fds; i++) {
     if (fds[i] >= 0)
       ink_assert(!socketManager.close(fds[i]));
+  }
+
   return 0;
 Lalloc:
   {
-    if (data)
-      free(data);
+    free(data);
     char *cur = 0;
 
     data = (char *)ats_memalign(ats_pagesize(), totalsize);
@@ -451,15 +452,20 @@ Lalloc:
       cur += bytes_to_blocks(heap_size) * STORE_BLOCK_SIZE;
     }
     mapped_header = (MultiCacheHeader *) cur;
-    for (i = 0; i < n_fds; i++)
+    for (int i = 0; i < n_fds; i++) {
       if (fds[i] >= 0)
         socketManager.close(fds[i]);
+    }
+
     return 0;
   }
+
 Labort:
-  for (i = 0; i < n_fds; i++)
+  for (int i = 0; i < n_fds; i++) {
     if (fds[i] >= 0)
       socketManager.close(fds[i]);
+  }
+
   return -1;
 }
 
@@ -1399,8 +1405,7 @@ stealStore(Store & s, int blocks)
   }
   // grab some end portion of some block... so as not to damage the
   // pool header
-  int d = 0;
-  while (d < s.n_disks) {
+  for (unsigned d = 0; d < s.n_disks; ) {
     Span *ds = s.disk[d];
     while (ds) {
       if (!blocks)


[36/50] git commit: Remove obsolete jtest Makefile

Posted by jp...@apache.org.
Remove obsolete jtest Makefile


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

Branch: refs/heads/sphinx-docs
Commit: f7ed0f603d7fb9cb649418f049b0804dee25abdc
Parents: 22958d4
Author: James Peach <jp...@apache.org>
Authored: Sun Apr 28 16:14:09 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sun Apr 28 16:14:09 2013 -0700

----------------------------------------------------------------------
 tools/jtest/Makefile |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f7ed0f60/tools/jtest/Makefile
----------------------------------------------------------------------
diff --git a/tools/jtest/Makefile b/tools/jtest/Makefile
deleted file mode 100644
index 3b02312..0000000
--- a/tools/jtest/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
-all: jtest
-
-jtest: jtest.cc
-	$(CXX) $^ -o $@ -Wno-write-strings
-
-clean:
-	rm -f jtest


[21/50] git commit: Make Store::n_disks unsigned

Posted by jp...@apache.org.
Make Store::n_disks unsigned


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

Branch: refs/heads/sphinx-docs
Commit: 0dc121c1fec369691c7fcafa807ea8b50b2f766e
Parents: a58b8ec
Author: James Peach <jp...@apache.org>
Authored: Sat Apr 27 16:09:44 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Apr 27 16:09:44 2013 -0700

----------------------------------------------------------------------
 iocore/cache/Cache.cc  |    3 +--
 iocore/cache/I_Store.h |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0dc121c1/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index bc273d3..580d49b 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -597,7 +597,6 @@ CacheProcessor::start_internal(int flags)
   start_internal_flags = flags;
   clear = !!(flags & PROCESSOR_RECONFIGURE) || auto_clear_flag;
   fix = !!(flags & PROCESSOR_FIX);
-  int i;
   start_done = 0;
   int diskok = 1;
 
@@ -610,7 +609,7 @@ CacheProcessor::start_internal(int flags)
   ink_aio_set_callback(new AIO_Callback_handler());
   Span *sd;
   config_volumes.read_config_file();
-  for (i = 0; i < theCacheStore.n_disks; i++) {
+  for (unsigned i = 0; i < theCacheStore.n_disks; i++) {
     sd = theCacheStore.disk[i];
     char path[PATH_NAME_MAX];
     int opts = DEFAULT_CACHE_OPTIONS;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0dc121c1/iocore/cache/I_Store.h
----------------------------------------------------------------------
diff --git a/iocore/cache/I_Store.h b/iocore/cache/I_Store.h
index 55ea839..32b24c4 100644
--- a/iocore/cache/I_Store.h
+++ b/iocore/cache/I_Store.h
@@ -162,7 +162,7 @@ struct Store
   Store();
   ~Store();
 
-  int n_disks;
+  unsigned n_disks;
   Span **disk;
 
   //


[29/50] git commit: TS-1858: Fix redefinition of timersub on OmniOS with the ESI plugin.

Posted by jp...@apache.org.
TS-1858: Fix redefinition of timersub on OmniOS with the ESI plugin.


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

Branch: refs/heads/sphinx-docs
Commit: ddce361ffa08306423f200eba9c03b3a171d8679
Parents: 05fe0f5
Author: Daniel Gruno <hu...@apache.org>
Authored: Sun Apr 28 12:43:27 2013 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sun Apr 28 12:43:27 2013 +0200

----------------------------------------------------------------------
 plugins/experimental/esi/lib/FailureInfo.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/ddce361f/plugins/experimental/esi/lib/FailureInfo.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/lib/FailureInfo.h b/plugins/experimental/esi/lib/FailureInfo.h
index eca99f1..8f4705b 100644
--- a/plugins/experimental/esi/lib/FailureInfo.h
+++ b/plugins/experimental/esi/lib/FailureInfo.h
@@ -27,7 +27,7 @@
 #include <vector>
 #include <map>
 #include <sys/time.h>
-#if defined(solaris)
+#if defined(solaris) && !defined(timersub)
 #define timersub(a, b, result) \
   do { \
     (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \


[25/50] git commit: A better fix for gcc-4.8, from jpeach

Posted by jp...@apache.org.
A better fix for gcc-4.8, from jpeach


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

Branch: refs/heads/sphinx-docs
Commit: e574dd392a0e865ae1355e6c6f25ad5eb68c5ed9
Parents: 8e12350
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sat Apr 27 20:03:36 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sat Apr 27 20:03:36 2013 -0600

----------------------------------------------------------------------
 plugins/experimental/lua/hook.cc |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e574dd39/plugins/experimental/lua/hook.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/hook.cc b/plugins/experimental/lua/hook.cc
index e4a4e4e..3f3f7cb 100644
--- a/plugins/experimental/lua/hook.cc
+++ b/plugins/experimental/lua/hook.cc
@@ -97,6 +97,10 @@ LuaPushEventData(lua_State * lua, TSEvent event, void * edata)
 }
 
 
+#if defined(INLINE_LUA_HOOK_REFERENCE)
+typedef char __size_check[sizeof(this_type) == sizeof(void *) ? 0 : -1];
+#endif
+
 // For 64-bit pointers, we can inline the LuaHookReference, otherwise we need an extra malloc.
 //
 #if SIZEOF_VOID_POINTER >= 8
@@ -125,8 +129,6 @@ struct inline_tuple
 
   static void * allocate(const first_type first, const second_type second) {
 #if defined(INLINE_LUA_HOOK_REFERENCE)
-    typedef char __size_check[sizeof(this_type) == sizeof(void *) ? 0 : -1];
-
     this_type obj;
     obj.first() = first;
     obj.second() = second;


[50/50] git commit: Merge branch 'master' into sphinx-docs

Posted by jp...@apache.org.
Merge branch 'master' into sphinx-docs


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

Branch: refs/heads/sphinx-docs
Commit: f032bbcd129bfc473fef857dc6783902544e76cb
Parents: d9f943e 16099e8
Author: James Peach <jp...@apache.org>
Authored: Sat May 4 08:29:27 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat May 4 08:29:27 2013 -0700

----------------------------------------------------------------------
 .gitignore                                         |    2 +
 CHANGES                                            |  233 +-
 CRUFT.txt                                          |   34 +
 INSTALL                                            |    6 +-
 Makefile.am                                        |   29 +-
 STATUS                                             |    7 +-
 Vagrantfile                                        |  108 +
 build/ax_compare_version.m4                        |  177 +
 build/ax_compiler_vendor.m4                        |   84 +
 build/ax_lib_curl.m4                               |   38 +
 build/ax_path_generic.m4                           |  164 +
 build/ax_with_curses.m4                            |  518 +
 build/common.m4                                    |   12 +-
 build/plugins.mk                                   |   37 +
 ci/rat-excludes.txt                                |   13 +
 ci/regression                                      |   19 +-
 config.layout                                      |   20 +
 configure.ac                                       |  389 +-
 contrib/manifests/debian.pp                        |   32 +
 contrib/manifests/omnios.sh                        |   39 +
 contrib/manifests/redhat.pp                        |   32 +
 .../perl/AdminClient/lib/Apache/TS/AdminClient.pm  |    5 -
 .../ConfigMgmt/lib/Apache/TS/Config/Records.pm     |  131 +-
 contrib/python/compare_RecordsConfigcc.py          |   87 +
 contrib/python/compare_records_config.py           |   67 +
 contrib/tstop/.gitignore                           |    1 -
 contrib/tstop/Makefile                             |    5 -
 contrib/tstop/README                               |    4 -
 contrib/tstop/stats.h                              |  392 -
 contrib/tstop/tstop.cc                             |  379 -
 cop/TrafficCop.cc                                  |   49 +-
 doc/sdk/TSPluginInit.3                             |    2 +-
 doc/sdk/TSTrafficServerVersionGet.3                |    2 +-
 example/Makefile.am                                |    5 +-
 example/add-header/add-header.c                    |    6 +-
 example/app-template/app-template.cc               |    6 +-
 example/app-template/records.config.in             |    1 +
 example/append-transform/append-transform.c        |    8 +-
 example/basic-auth/basic-auth.c                    |   14 +-
 example/blacklist-1/blacklist-1.c                  |   10 +-
 example/bnull-transform/bnull-transform.c          |   10 +-
 example/cache-scan/cache-scan.cc                   |   13 +-
 example/hello/hello.c                              |    6 +-
 example/null-transform/null-transform.c            |   12 +-
 example/output-header/output-header.c              |    8 +-
 example/prefetch/test-hns-plugin.c                 |    2 +-
 example/protocol/Protocol.c                        |    3 +-
 example/protocol/TxnSM.c                           |   18 +-
 example/query-remap/query-remap.c                  |   13 +-
 example/remap/remap.cc                             |   26 +-
 example/replace-header/replace-header.c            |   12 +-
 example/response-header-1/response-header-1.c      |   11 +-
 example/server-transform/server-transform.c        |   35 +-
 example/session-1/session-1.c                      |    7 +-
 example/thread-1/thread-1.c                        |    8 +-
 example/thread-pool/psi.c                          |   15 +-
 example/thread-pool/thread.c                       |    5 +-
 iocore/aio/AIO.cc                                  |  150 +-
 iocore/aio/I_AIO.h                                 |   85 +-
 iocore/aio/Inline.cc                               |    3 +-
 iocore/aio/Makefile.am                             |   26 +
 iocore/aio/NTAIO.cc                                |  168 -
 iocore/aio/P_AIO.h                                 |   66 +-
 iocore/aio/test_AIO.cc                             |  522 +
 iocore/aio/test_AIO.i                              |  527 -
 iocore/aio/test_AIO.sample                         |    2 +
 iocore/aio/test_I_AIO.cc                           |   25 -
 iocore/aio/test_P_AIO.cc                           |   25 -
 iocore/cache/Cache.cc                              |  143 +-
 iocore/cache/CacheDir.cc                           |   36 +-
 iocore/cache/CacheDisk.cc                          |    2 +-
 iocore/cache/CacheLink.cc                          |    2 +-
 iocore/cache/CacheRead.cc                          |   10 +-
 iocore/cache/CacheVol.cc                           |   12 +-
 iocore/cache/CacheWrite.cc                         |  123 +-
 iocore/cache/I_Cache.h                             |    4 -
 iocore/cache/I_Store.h                             |   15 +-
 iocore/cache/Inline.cc                             |    3 +-
 iocore/cache/P_Cache.h                             |    5 -
 iocore/cache/P_CacheDir.h                          |    2 +-
 iocore/cache/P_CacheInternal.h                     |   31 +-
 iocore/cache/P_CacheVol.h                          |    6 +-
 iocore/cache/Store.cc                              |   59 +-
 iocore/cluster/ClusterAPI.cc                       |    2 +-
 iocore/cluster/ClusterHandler.cc                   |    2 +-
 iocore/cluster/ClusterHandlerBase.cc               |  103 +-
 iocore/cluster/ClusterHash.cc                      |    2 -
 iocore/cluster/ClusterMachine.cc                   |    9 +-
 iocore/cluster/ClusterProcessor.cc                 |    2 +-
 iocore/cluster/ClusterVConnection.cc               |    2 +-
 iocore/cluster/Inline.cc                           |    3 +-
 iocore/cluster/P_Cluster.h                         |    5 -
 iocore/cluster/P_ClusterCache.h                    |    2 +-
 iocore/cluster/P_ClusterHandler.h                  |    3 +
 iocore/dns/DNS.cc                                  |   45 +-
 iocore/dns/DNSConnection.cc                        |    2 -
 iocore/dns/I_DNS.h                                 |    4 -
 iocore/dns/Inline.cc                               |    3 +-
 iocore/dns/Makefile.am                             |    1 -
 iocore/dns/P_DNS.h                                 |    5 -
 iocore/dns/SRV.cc                                  |  161 -
 iocore/dns/SRV.h                                   |  114 +-
 iocore/eventsystem/IOBuffer.cc                     |    2 -
 iocore/eventsystem/I_EThread.h                     |    2 +-
 iocore/eventsystem/I_EventSystem.h                 |    4 -
 iocore/eventsystem/I_IOBuffer.h                    |   60 +-
 iocore/eventsystem/I_Lock.h                        |    8 +-
 iocore/eventsystem/I_SocketManager.h               |    2 +-
 iocore/eventsystem/I_Thread.h                      |    6 +-
 iocore/eventsystem/I_VConnection.h                 |   27 +-
 iocore/eventsystem/Inline.cc                       |    3 +-
 iocore/eventsystem/Makefile.am                     |   33 +
 iocore/eventsystem/P_EventSystem.h                 |    5 -
 iocore/eventsystem/P_IOBuffer.h                    |   16 +-
 iocore/eventsystem/P_UnixEThread.h                 |    2 +-
 iocore/eventsystem/P_UnixEventProcessor.h          |    4 +-
 iocore/eventsystem/P_VConnection.h                 |    2 +-
 iocore/eventsystem/ProtectedQueue.cc               |    2 +-
 iocore/eventsystem/SocketManager.cc                |    2 +-
 iocore/eventsystem/UnixEThread.cc                  |    1 -
 iocore/eventsystem/UnixEvent.cc                    |    9 +-
 iocore/eventsystem/UnixEventProcessor.cc           |   43 +-
 iocore/eventsystem/test_Buffer.cc                  |   44 +-
 iocore/eventsystem/test_Event.cc                   |  175 +
 iocore/eventsystem/test_Event.i                    |  174 -
 iocore/hostdb/HostDB.cc                            |  307 +-
 iocore/hostdb/I_HostDB.h                           |    4 -
 iocore/hostdb/I_HostDBProcessor.h                  |  158 +-
 iocore/hostdb/Inline.cc                            |    3 +-
 iocore/hostdb/MultiCache.cc                        |  139 +-
 iocore/hostdb/P_HostDB.h                           |    5 -
 iocore/hostdb/P_HostDBProcessor.h                  |  148 +-
 iocore/net/Connection.cc                           |    5 +-
 iocore/net/I_Net.h                                 |    4 -
 iocore/net/I_NetProcessor.h                        |   14 +-
 iocore/net/I_UDPConnection.h                       |   13 +-
 iocore/net/I_UDPNet.h                              |   30 +-
 iocore/net/I_UDPPacket.h                           |   22 +-
 iocore/net/Inline.cc                               |    3 +-
 iocore/net/Net.cc                                  |    1 -
 iocore/net/NetTest-http-server.c                   |    2 +-
 iocore/net/NetVCTest.cc                            |    9 +-
 iocore/net/P_InkBulkIO.h                           |    7 -
 iocore/net/P_LibBulkIO.h                           |    2 -
 iocore/net/P_Net.h                                 |    5 -
 iocore/net/P_NetVCTest.h                           |    2 +-
 iocore/net/P_SSLUtils.h                            |    2 +-
 iocore/net/P_UDPConnection.h                       |   34 +-
 iocore/net/P_UDPNet.h                              |  197 +-
 iocore/net/P_UDPPacket.h                           |   56 +-
 iocore/net/P_UnixNet.h                             |    7 +-
 iocore/net/P_UnixNetVConnection.h                  |    8 +-
 iocore/net/P_UnixUDPConnection.h                   |    2 +-
 iocore/net/SSLCertLookup.cc                        |    4 +-
 iocore/net/SSLNetVConnection.cc                    |   12 +-
 iocore/net/SSLUtils.cc                             |  252 +-
 iocore/net/Socks.cc                                |   18 +-
 iocore/net/UnixConnection.cc                       |    1 -
 iocore/net/UnixNet.cc                              |    9 +-
 iocore/net/UnixNetAccept.cc                        |    4 +-
 iocore/net/UnixNetProcessor.cc                     |    4 +-
 iocore/net/UnixNetVConnection.cc                   |   65 +-
 iocore/net/UnixUDPConnection.cc                    |   10 +-
 iocore/net/UnixUDPNet.cc                           |  720 +--
 iocore/net/test_certlookup.cc                      |    4 +-
 lib/cpp11api/Makefile.am                           |    2 +-
 lib/cpp11api/cpp11api.cc                           |    9 +-
 lib/records/I_RecCore.h                            |    3 +-
 lib/records/I_RecDefs.h                            |    5 +-
 lib/records/I_RecProcess.h                         |    2 +-
 lib/records/P_RecCore.cc                           |   77 +-
 lib/records/P_RecCore.h                            |    2 +
 lib/records/P_RecDefs.h                            |    6 +-
 lib/records/P_RecUtils.h                           |   10 +-
 lib/records/RecCore.cc                             |   47 +-
 lib/records/RecLocal.cc                            |    2 +-
 lib/records/RecMessage.cc                          |    4 +-
 lib/records/RecProcess.cc                          |   48 +-
 lib/records/RecUtils.cc                            |  218 +-
 lib/records/test_RecProcess.i                      |    4 +-
 lib/ts/Allocator.h                                 |    2 +-
 lib/ts/Compatability.h                             |    2 +-
 lib/ts/CompileParseRules.cc                        |    1 -
 lib/ts/Diags.cc                                    |   37 +-
 lib/ts/Diags.h                                     |   60 +-
 lib/ts/HostLookup.cc                               |    5 +-
 lib/ts/INK_MD5.h                                   |    3 +-
 lib/ts/IpMap.h                                     |    2 +-
 lib/ts/IpMapTest.cc                                |    6 +-
 lib/ts/Layout.cc                                   |   11 +-
 lib/ts/List.h                                      |    3 +-
 lib/ts/MMH.h                                       |    3 +-
 lib/ts/Makefile.am                                 |   16 +-
 lib/ts/MimeTable.h                                 |    2 +-
 lib/ts/ParseRules.h                                |    5 +-
 lib/ts/RawHashTable.cc                             |    1 -
 lib/ts/Regression.cc                               |    3 +-
 lib/ts/Resource.cc                                 |    2 +-
 lib/ts/SimpleTokenizer.h                           |    1 -
 lib/ts/TestHttpHeader.cc                           |    1 -
 lib/ts/TextBuffer.cc                               |    2 -
 lib/ts/Tokenizer.cc                                |    2 -
 lib/ts/Trie.h                                      |    2 +-
 lib/ts/Version.cc                                  |    2 -
 lib/ts/ink_aiocb.h                                 |    6 +-
 lib/ts/ink_apidefs.h                               |    4 +
 lib/ts/ink_args.cc                                 |    1 -
 lib/ts/ink_assert.cc                               |    3 +-
 lib/ts/ink_assert.h                                |    7 +-
 lib/ts/ink_atomic.h                                |    2 +-
 lib/ts/ink_auth_api.h                              |    2 +-
 lib/ts/ink_base64.cc                               |    2 -
 lib/ts/ink_bool.h                                  |   77 -
 lib/ts/ink_code.cc                                 |    1 -
 lib/ts/ink_config.h.in                             |    3 +
 lib/ts/ink_defs.cc                                 |   59 +-
 lib/ts/ink_defs.h                                  |  109 +-
 lib/ts/ink_error.h                                 |    9 -
 lib/ts/ink_file.cc                                 |   17 +
 lib/ts/ink_file.h                                  |    6 +
 lib/ts/ink_hash_table.cc                           |    1 -
 lib/ts/ink_hrtime.cc                               |    9 +-
 lib/ts/ink_llqueue.h                               |    2 -
 lib/ts/ink_lockfile.h                              |    2 +-
 lib/ts/ink_memory.cc                               |    8 +-
 lib/ts/ink_memory.h                                |   14 +
 lib/ts/ink_mutex.cc                                |   11 +-
 lib/ts/ink_mutex.h                                 |    3 +-
 lib/ts/ink_port.h                                  |   91 -
 lib/ts/ink_queue.cc                                |   54 +-
 lib/ts/ink_queue.h                                 |   34 +-
 lib/ts/ink_queue_ext.cc                            |   33 +-
 lib/ts/ink_queue_utils.cc                          |    3 +-
 lib/ts/ink_rand.h                                  |    2 +-
 lib/ts/ink_res_init.cc                             |   10 +-
 lib/ts/ink_res_mkquery.cc                          |   11 +-
 lib/ts/ink_resolver.h                              |   12 +-
 lib/ts/ink_resource.cc                             |   14 +-
 lib/ts/ink_resource.h                              |    3 +-
 lib/ts/ink_sock.cc                                 |    2 -
 lib/ts/ink_sock.h                                  |    2 +-
 lib/ts/ink_sprintf.cc                              |    1 -
 lib/ts/ink_stack_trace.cc                          |    4 +-
 lib/ts/ink_stack_trace.h                           |    2 +-
 lib/ts/ink_string++.cc                             |    1 -
 lib/ts/ink_string.cc                               |    4 +-
 lib/ts/ink_string.h                                |    6 +-
 lib/ts/ink_syslog.cc                               |    4 -
 lib/ts/ink_thread.cc                               |    1 -
 lib/ts/ink_thread.h                                |    4 +-
 lib/ts/ink_time.cc                                 |  649 +--
 lib/ts/ink_time.h                                  |   86 +-
 lib/ts/ink_unused.h                                |   80 -
 lib/ts/libts.h                                     |    4 -
 lib/ts/llqueue.cc                                  |    1 -
 lib/ts/lockfile.cc                                 |    2 +-
 lib/ts/mkdfa.c                                     |    4 -
 lib/ts/test_Map.cc                                 |    2 +-
 lib/ts/test_Vec.cc                                 |    2 +-
 lib/ts/test_atomic.cc                              |    3 +-
 lib/ts/test_freelist.cc                            |    5 +-
 lib/tsconfig/Makefile.am                           |    4 +-
 lib/tsconfig/TsConfigGrammar.y                     |    3 +-
 lib/tsconfig/TsErrataUtil.cc                       |    7 +-
 lib/tsconfig/TsValue.cc                            |    3 +-
 lib/tsconfig/test-tsconfig.cc                      |    2 +-
 lib/wccp/Wccp.h                                    |    2 +-
 lib/wccp/WccpEndPoint.cc                           |   10 +-
 lib/wccp/WccpMsg.cc                                |    4 +-
 lib/wccp/WccpStatic.cc                             |    5 +-
 mgmt/AddConfigFilesHere.cc                         |    3 -
 mgmt/Alarms.h                                      |    3 +-
 mgmt/FileManager.cc                                |    2 +-
 mgmt/LocalManager.cc                               |   17 +-
 mgmt/LocalManager.h                                |    4 +-
 mgmt/Main.cc                                       |  101 +-
 mgmt/Main.h                                        |    5 -
 mgmt/Makefile.am                                   |    4 +-
 mgmt/MgmtDefs.h                                    |    2 +-
 mgmt/MultiFile.cc                                  |    3 +-
 mgmt/ProcessManager.cc                             |    6 +-
 mgmt/ProcessManager.h                              |   19 +-
 mgmt/ProxyConfig.h                                 |    5 +-
 mgmt/RecordsConfig.cc                              |   61 +-
 mgmt/Rollback.h                                    |    3 +-
 mgmt/api/CfgContextUtils.cc                        |   70 +-
 mgmt/api/CfgContextUtils.h                         |    2 +-
 mgmt/api/CoreAPI.cc                                |   17 +-
 mgmt/api/CoreAPI.h                                 |    2 +-
 mgmt/api/GenericParser.h                           |    1 -
 mgmt/api/INKMgmtAPI.cc                             |   18 +-
 mgmt/api/NetworkUtilsDefs.h                        |    3 +-
 mgmt/api/NetworkUtilsLocal.h                       |    2 +-
 mgmt/api/TSControlMain.cc                          |   20 +-
 mgmt/api/TSControlMain.h                           |    2 +-
 mgmt/api/include/mgmtapi.h                         |    5 +-
 mgmt/api/remote/APITestCliRemote.cc                |    5 +-
 mgmt/api/remote/CoreAPIRemote.cc                   |    9 +-
 mgmt/api/remote/NetworkUtilsRemote.cc              |    3 +-
 mgmt/api/remote/NetworkUtilsRemote.h               |    4 +-
 mgmt/cli/CliCreateCommands.cc                      |    2 +-
 mgmt/cli/CliMgmtUtils.cc                           |    2 +-
 mgmt/cli/CliMgmtUtils.h                            |    2 +-
 mgmt/cli/ConfigCmd.cc                              |   36 +-
 mgmt/cli/TrafficLine.cc                            |   19 +-
 mgmt/cli/UtilCmds.cc                               |    1 +
 mgmt/cli/cliAppInit.cc                             |   10 +-
 mgmt/cli/cliMain.cc                                |    3 +-
 mgmt/cli/cliParseArg.cc                            |   33 +-
 mgmt/cli/createArgument.cc                         |    2 +-
 mgmt/cli/createArgument.h                          |    2 +-
 mgmt/cli/createCommand.cc                          |    2 +-
 mgmt/cli/definitions.h                             |    3 -
 mgmt/cli/hashtable.cc                              |    1 +
 mgmt/cli/processArgument.cc                        |    1 +
 mgmt/cluster/ClusterCom.cc                         |   59 +-
 mgmt/cluster/ClusterCom.h                          |    2 +-
 mgmt/cluster/VMap.cc                               |  343 +-
 mgmt/cluster/VMap.h                                |   13 +-
 mgmt/preparse/IPRange.cc                           |    2 -
 mgmt/preparse/IPRange.h                            |    2 +-
 mgmt/preparse/SocksParser.cc                       |    1 -
 mgmt/stats/StatProcessor.cc                        |   12 +-
 mgmt/stats/StatProcessor.h                         |    2 +-
 mgmt/stats/StatType.cc                             |  455 +-
 mgmt/stats/StatType.h                              |   58 +-
 mgmt/tools/ConfigAPI.cc                            |    6 +-
 mgmt/tools/ConfigAPI.h                             |    4 -
 mgmt/tools/SysAPI.cc                               |   24 +-
 mgmt/tools/SysAPI.h                                |    4 -
 mgmt/utils/EnvBlock.cc                             |    1 -
 mgmt/utils/ExpandingArray.cc                       |    1 -
 mgmt/utils/ExpandingArray.h                        |    2 -
 mgmt/utils/Makefile.am                             |    2 -
 mgmt/utils/MgmtSchema.h                            |    2 -
 mgmt/utils/MgmtUtils.cc                            |    8 +-
 mgmt/utils/MgmtUtils.h                             |    1 -
 mgmt/utils/WebMgmtUtils.cc                         |   43 +
 mgmt/utils/WebMgmtUtils.h                          |    3 +-
 mgmt/utils/XmlUtils.cc                             |    1 +
 mgmt/web2/WebCompatibility.h                       |    2 +-
 mgmt/web2/WebGlobals.h                             |    1 -
 mgmt/web2/WebHttp.cc                               |    2 -
 mgmt/web2/WebHttpMessage.cc                        |    3 +-
 mgmt/web2/WebHttpMessage.h                         |    1 -
 mgmt/web2/WebOverview.cc                           |  870 +--
 mgmt/web2/WebOverview.h                            |   39 +-
 mgmt/web2/WebUtils.cc                              |    1 -
 plugins/conf_remap/Makefile.am                     |    5 +-
 plugins/conf_remap/conf_remap.cc                   |   11 +-
 plugins/experimental/authproxy/Makefile.am         |    8 +-
 plugins/experimental/authproxy/authproxy.cc        |   36 +-
 plugins/experimental/authproxy/utils.h             |    2 +-
 .../experimental/buffer_upload/buffer_upload.cc    |    2 +-
 plugins/experimental/cacheurl/Makefile.am          |    5 +-
 plugins/experimental/cacheurl/README               |   25 -
 plugins/experimental/cacheurl/README.rst           |   86 +
 plugins/experimental/cacheurl/cacheurl.c           |  228 +-
 plugins/experimental/channel_stats/Makefile.am     |    5 +-
 .../experimental/channel_stats/channel_stats.cc    |   56 +-
 plugins/experimental/channel_stats/debug_macros.h  |    6 +-
 plugins/experimental/combo_handler/README          |   84 -
 .../experimental/combo_handler/combo_handler.cc    |  883 --
 plugins/experimental/custom_redirect/Makefile.am   |    6 +-
 .../custom_redirect/custom_redirect.cc             |    4 +-
 plugins/experimental/esi/Makefile.am               |   36 +-
 plugins/experimental/esi/README                    |    3 +-
 plugins/experimental/esi/README.combo              |   84 +
 plugins/experimental/esi/combo_handler.cc          |  843 ++
 plugins/experimental/esi/esi.cc                    | 1805 ++++
 .../esi/fetcher/HttpDataFetcherImpl.cc             |   66 +-
 .../experimental/esi/fetcher/HttpDataFetcherImpl.h |   10 +-
 plugins/experimental/esi/lib/DocNode.cc            |    8 +-
 plugins/experimental/esi/lib/DocNode.h             |    4 +-
 plugins/experimental/esi/lib/EsiGzip.cc            |  163 +
 plugins/experimental/esi/lib/EsiGzip.h             |   60 +
 plugins/experimental/esi/lib/EsiProcessor.cc       |  210 +
 plugins/experimental/esi/lib/EsiProcessor.h        |    9 +
 plugins/experimental/esi/lib/FailureInfo.h         |    2 +-
 .../experimental/esi/lib/SpecialIncludeHandler.h   |    1 +
 plugins/experimental/esi/lib/Variables.cc          |    2 +-
 plugins/experimental/esi/plugin.cc                 | 1688 ---
 plugins/experimental/esi/serverIntercept.cc        |    4 +-
 .../experimental/esi/test/TestHandlerManager.cc    |    2 +-
 plugins/experimental/geoip_acl/lulu.h              |   14 +-
 plugins/experimental/gzip/Makefile.am              |    5 +-
 plugins/experimental/gzip/gzip.cc                  |   17 +-
 plugins/experimental/gzip/misc.cc                  |   14 +-
 plugins/experimental/gzip/misc.h                   |    2 -
 plugins/experimental/header_rewrite/Makefile.am    |   24 +-
 plugins/experimental/header_rewrite/condition.cc   |    4 -
 plugins/experimental/header_rewrite/condition.h    |    3 -
 plugins/experimental/header_rewrite/conditions.cc  |   18 +-
 plugins/experimental/header_rewrite/conditions.h   |   11 +-
 plugins/experimental/header_rewrite/factory.cc     |    3 -
 plugins/experimental/header_rewrite/factory.h      |    3 -
 .../experimental/header_rewrite/header_rewrite.cc  |    8 +-
 plugins/experimental/header_rewrite/lulu.h         |   15 +-
 plugins/experimental/header_rewrite/matcher.cc     |    4 -
 plugins/experimental/header_rewrite/matcher.h      |   53 +-
 plugins/experimental/header_rewrite/operator.cc    |    4 -
 plugins/experimental/header_rewrite/operator.h     |    3 -
 plugins/experimental/header_rewrite/operators.cc   |    4 -
 plugins/experimental/header_rewrite/operators.h    |    5 +-
 plugins/experimental/header_rewrite/parser.cc      |    3 -
 plugins/experimental/header_rewrite/parser.h       |    4 -
 plugins/experimental/header_rewrite/resources.cc   |    4 -
 plugins/experimental/header_rewrite/resources.h    |    4 -
 plugins/experimental/header_rewrite/ruleset.cc     |    3 -
 plugins/experimental/header_rewrite/ruleset.h      |    4 -
 plugins/experimental/header_rewrite/statement.cc   |    3 -
 plugins/experimental/header_rewrite/statement.h    |    5 +-
 plugins/experimental/header_rewrite/value.h        |    3 -
 plugins/experimental/hipes/hipes.cc                |    6 +-
 plugins/experimental/lua/Makefile.am               |   11 +-
 plugins/experimental/lua/hook.cc                   |   12 +-
 plugins/experimental/lua/lapi.cc                   |    6 +-
 plugins/experimental/lua/lconfig.cc                |    6 +-
 plugins/experimental/lua/lutil.cc                  |    8 +-
 plugins/experimental/lua/lutil.h                   |    9 +-
 plugins/experimental/lua/remap.cc                  |   11 +-
 plugins/experimental/lua/state.cc                  |    6 +-
 plugins/experimental/metalink/Makefile.am          |    5 +-
 plugins/experimental/metalink/metalink.cc          |   25 +-
 plugins/experimental/rfc5861/Makefile.am           |    5 +-
 plugins/experimental/rfc5861/rfc5861.c             |    9 +-
 plugins/experimental/spdy/Makefile.am              |   12 +-
 plugins/experimental/spdy/http.cc                  |    4 +-
 plugins/experimental/spdy/lib/base/logging.h       |    7 -
 plugins/experimental/spdy/lib/spdy/message.cc      |   32 +-
 plugins/experimental/spdy/protocol.cc              |    6 +-
 plugins/experimental/spdy/spdy.cc                  |   12 +-
 plugins/experimental/spdy/stream.cc                |    4 +-
 plugins/experimental/tcp_info/Makefile.am          |    7 +-
 plugins/experimental/tcp_info/tcp_info.cc          |    4 +-
 plugins/header_filter/Makefile.am                  |    6 +-
 plugins/header_filter/header_filter.cc             |    6 +-
 plugins/header_filter/lulu.h                       |   11 +-
 plugins/libloader/libloader.c                      |   85 +
 plugins/regex_remap/Makefile.am                    |    6 +-
 plugins/regex_remap/regex_remap.cc                 |   11 +-
 plugins/stats_over_http/Makefile.am                |    5 +-
 plugins/stats_over_http/stats_over_http.c          |    8 +-
 proxy/AbstractBuffer.cc                            |    1 -
 proxy/CacheControl.cc                              |    3 +-
 proxy/ControlBase.cc                               |   11 +-
 proxy/ControlMatcher.cc                            |    1 -
 proxy/ControlMatcher.h                             |    2 +-
 proxy/CoreUtils.cc                                 |    1 -
 proxy/DiagsConfig.cc                               |    4 +-
 proxy/Error.cc                                     |    3 -
 proxy/ICP.cc                                       |    3 -
 proxy/ICPProcessor.cc                              |    2 -
 proxy/ICPStats.cc                                  |    2 -
 proxy/InkAPI.cc                                    |   49 +-
 proxy/InkAPITest.cc                                |    2 +-
 proxy/InkAPITestTool.cc                            |    3 -
 proxy/Main.cc                                      |  201 +-
 proxy/Makefile.am                                  |   95 +-
 proxy/MuxVC.cc                                     |  187 +-
 proxy/ParentSelection.cc                           |    4 -
 proxy/Plugin.cc                                    |   64 +-
 proxy/Plugin.h                                     |    2 +-
 proxy/PluginDB.cc                                  |  205 -
 proxy/PluginDB.h                                   |   65 -
 proxy/PluginVC.cc                                  |   25 +-
 proxy/Prefetch.cc                                  |    8 +-
 proxy/ReverseProxy.cc                              |    1 -
 proxy/ReverseProxy.h                               |    2 +-
 proxy/StatSystem.cc                                |    4 +-
 proxy/TestClock.cc                                 |    1 -
 proxy/TestClusterHash.cc                           |    2 -
 proxy/TestDNS.cc                                   |    1 -
 proxy/TestHook.cc                                  |  513 -
 proxy/TestPreProc.cc                               |    2 -
 proxy/TestProxy.cc                                 |   19 -
 proxy/TestRegex.cc                                 |    1 -
 proxy/TestSimpleProxy.cc                           |    1 -
 proxy/UglyLogStubs.cc                              |    3 -
 proxy/Update.cc                                    |    2 +-
 proxy/api/ts/experimental.h                        |    4 +
 proxy/api/ts/ts.h.in                               |    4 -
 proxy/config/Makefile.am                           |    1 -
 .../body_factory/default/response#bad_version      |    2 +-
 proxy/config/mgr.cnf.default                       |    9 -
 proxy/config/records.config.default.in             |    3 +
 proxy/config/vaddrs.config.default                 |   11 +-
 proxy/congest/Congestion.cc                        |    2 +-
 proxy/congest/CongestionDB.cc                      |    2 -
 proxy/hdrs/HTTP.cc                                 |   45 +-
 proxy/hdrs/HTTP.h                                  |  135 +-
 proxy/hdrs/HdrHeap.h                               |    5 +-
 proxy/hdrs/HdrTSOnly.cc                            |    8 +-
 proxy/hdrs/HdrTest.cc                              |    3 +-
 proxy/hdrs/HdrToken.cc                             |    6 +-
 proxy/hdrs/HdrToken.h                              |   31 +-
 proxy/hdrs/HdrUtils.cc                             |    2 +-
 proxy/hdrs/HttpCompat.h                            |    1 -
 proxy/hdrs/MIME.cc                                 |   79 +-
 proxy/hdrs/MIME.h                                  |    3 +-
 proxy/hdrs/URL.cc                                  |   11 +-
 proxy/hdrs/URL.h                                   |   74 +-
 proxy/http/HttpBodyFactory.cc                      |    8 +-
 proxy/http/HttpBodyFactory.h                       |   21 +-
 proxy/http/HttpClientSession.cc                    |    2 +-
 proxy/http/HttpConfig.cc                           |    3 -
 proxy/http/HttpConfig.h                            |    3 -
 proxy/http/HttpDebugNames.cc                       |    1 -
 proxy/http/HttpProxyServerMain.cc                  |   49 -
 proxy/http/HttpSM.cc                               |  241 +-
 proxy/http/HttpServerSession.h                     |    4 +-
 proxy/http/HttpTransact.cc                         |  623 +-
 proxy/http/HttpTransact.h                          |   19 +-
 proxy/http/HttpTransactCache.cc                    |   70 +-
 proxy/http/HttpTransactHeaders.cc                  |   28 +-
 proxy/http/HttpTransactHeaders.h                   |    2 +-
 proxy/http/HttpTunnel.cc                           |   11 +-
 proxy/http/HttpUpdateTester.cc                     |    4 +-
 proxy/http/TestHttpTransact.cc                     |    1 -
 proxy/http/TestUrl.cc                              |    1 -
 proxy/http/remap/RemapPlugins.cc                   |    4 +-
 proxy/http/remap/RemapProcessor.cc                 |    4 +-
 proxy/http/remap/UrlMapping.cc                     |    2 +-
 proxy/http/remap/UrlMappingPathIndex.h             |    9 +
 proxy/http/test_socket_close.cc                    |    1 -
 proxy/http/testheaders.cc                          |    1 -
 proxy/logcat.cc                                    |   15 +-
 proxy/logging/Log.cc                               |    6 +-
 proxy/logging/LogAccess.cc                         |   50 +-
 proxy/logging/LogAccess.h                          |    2 -
 proxy/logging/LogAccessHttp.cc                     |   62 +-
 proxy/logging/LogAccessHttp.h                      |    4 +-
 proxy/logging/LogAccessTest.cc                     |    1 -
 proxy/logging/LogBuffer.cc                         |   11 +-
 proxy/logging/LogBuffer.h                          |    6 +-
 proxy/logging/LogCollationClientSM.cc              |    2 +-
 proxy/logging/LogConfig.cc                         |   96 +-
 proxy/logging/LogConfig.h                          |   30 +-
 proxy/logging/LogField.cc                          |    2 +-
 proxy/logging/LogFieldAliasMap.h                   |    2 +-
 proxy/logging/LogFile.cc                           |   17 +-
 proxy/logging/LogFilter.cc                         |    2 +-
 proxy/logging/LogFormat.cc                         |    2 -
 proxy/logging/LogObject.cc                         |   40 +-
 proxy/logging/LogSock.cc                           |    2 -
 proxy/logging/LogStandalone.cc                     |    8 +-
 proxy/logging/LogUtils.cc                          |    7 +-
 proxy/logstats.cc                                  |  100 +-
 proxy/sac.cc                                       |    7 +-
 proxy/signals.cc                                   |    6 +-
 proxy/tests/logstats.blog                          |  Bin 0 -> 14976 bytes
 proxy/tests/logstats.json                          |  243 +
 proxy/tests/logstats.summary                       |  164 +
 proxy/tests/test_logstats_json                     |   28 +
 proxy/tests/test_logstats_summary                  |   29 +
 tools/Makefile.am                                  |   39 +-
 tools/http_load/Makefile                           |   52 -
 tools/http_load/http_load.c                        |   84 +-
 tools/http_load/timers.c                           |    6 +-
 tools/http_load/version.h                          |    8 -
 tools/jtest/Makefile                               |    7 -
 tools/jtest/jtest.cc                               | 8387 +++++++--------
 tools/tstop/.gitignore                             |    1 +
 tools/tstop/README                                 |    4 +
 tools/tstop/stats.h                                |  393 +
 tools/tstop/tstop.cc                               |  373 +
 tools/tsxs.in                                      |    5 +-
 567 files changed, 16505 insertions(+), 17338 deletions(-)
----------------------------------------------------------------------



[12/50] git commit: TS-1853 Fix formatting in logstats to be consistenly 2 decimals

Posted by jp...@apache.org.
TS-1853 Fix formatting in logstats to be consistenly 2 decimals


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

Branch: refs/heads/sphinx-docs
Commit: a8981a71ab369bbe603923a52161c8eff7249c3a
Parents: 824fd64
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Apr 26 09:36:45 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Apr 26 09:44:59 2013 -0600

----------------------------------------------------------------------
 CHANGES                      |    2 ++
 proxy/logstats.cc            |   13 ++++++-------
 proxy/tests/logstats.summary |   20 ++++++++++----------
 3 files changed, 18 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a8981a71/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index c21c558..9f48947 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1853] Fix formatting in logstats to be consistenly 2 decimals.
+
   *) [TS-1852] Fix missing AC_PROG_SED on CentOS 5.9.
 
   *) [TS-1717] Fix the static build as much as possible.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a8981a71/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index 9789316..e99b2e1 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -1797,24 +1797,23 @@ format_elapsed_header()
 inline void
 format_elapsed_line(const char *desc, const ElapsedStats &stat, bool json=false)
 {
-  static char buf[64];
-
   if (json) {
     std::cout << "    " << '"' << desc << "\" : " << "{ ";
     std::cout << "\"min\": \"" << stat.min << "\", ";
     std::cout << "\"max\": \"" << stat.max << "\", ";
     std::cout << "\"avg\": \"" << std::setiosflags(ios::fixed) << std::setprecision(2) << stat.avg << "\", ";
-    std::cout << "\"dev\": \"" << std::setiosflags(ios::fixed) << std::setprecision(2) << stat.stddev << "\" }," << std::endl;
+    std::cout << "\"dev\": \"" << std::setiosflags(ios::fixed) << std::setprecision(2) << stat.stddev << "\" },";
+    std::cout << std::endl;
   } else {
     std::cout << std::left << std::setw(24) << desc;
     std::cout << std::right << std::setw(7);
     format_int(stat.min);
     std::cout << std::right << std::setw(13);
     format_int(stat.max);
-    snprintf(buf, sizeof(buf), "%17.3f", stat.avg);
-    std::cout << std::right << buf;
-    snprintf(buf, sizeof(buf), "%17.3f", stat.stddev);
-    std::cout << std::right << buf << std::endl;
+
+    std::cout << std::right << std::setw(17) << std::setiosflags(ios::fixed) << std::setprecision(2) << stat.avg;
+    std::cout << std::right << std::setw(17) << std::setiosflags(ios::fixed) << std::setprecision(2) << stat.stddev;
+    std::cout << std::endl;
   }
 }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a8981a71/proxy/tests/logstats.summary
----------------------------------------------------------------------
diff --git a/proxy/tests/logstats.summary b/proxy/tests/logstats.summary
index 21f7fe3..f27077c 100644
--- a/proxy/tests/logstats.summary
+++ b/proxy/tests/logstats.summary
@@ -147,16 +147,16 @@ other                                      0      0.00%      0.00KB      0.00%
 
 Elapsed time stats          Min          Max              Avg    Std Deviation
 ------------------------------------------------------------------------------
-Cache hit                     0            0            0.000            0.000
-Cache hit IMS                 0            0            0.000            0.000
-Cache hit refresh             0            0            0.000            0.000
-Cache hit other               0            0            0.000            0.000
-Cache hit total               0            0            0.000            0.000
-Cache miss                   88        1,059          449.643          199.972
-Cache miss IMS                0            0            0.000            0.000
-Cache miss refresh          168          491          278.800          117.469
-Cache miss other              0            0            0.000            0.000
-Cache miss total             88        1,059          423.758          199.431
+Cache hit                     0            0             0.00             0.00
+Cache hit IMS                 0            0             0.00             0.00
+Cache hit refresh             0            0             0.00             0.00
+Cache hit other               0            0             0.00             0.00
+Cache hit total               0            0             0.00             0.00
+Cache miss                   88        1,059           449.64           199.97
+Cache miss IMS                0            0             0.00             0.00
+Cache miss refresh          168          491           278.80           117.47
+Cache miss other              0            0             0.00             0.00
+Cache miss total             88        1,059           423.76           199.43
 
 ______________________________________________________________________________
 


[10/50] git commit: TS-1820 Fix a few includes to load properly.

Posted by jp...@apache.org.
TS-1820 Fix a few includes to load properly.


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

Branch: refs/heads/sphinx-docs
Commit: 870fe0eec8c5a55635cb595d722c8b1e13de1353
Parents: 1d34e40
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Apr 25 19:32:34 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Apr 25 19:32:34 2013 -0600

----------------------------------------------------------------------
 lib/tsconfig/TsConfigGrammar.y |    2 +-
 lib/tsconfig/TsErrataUtil.cc   |    4 ++--
 lib/tsconfig/TsValue.cc        |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/870fe0ee/lib/tsconfig/TsConfigGrammar.y
----------------------------------------------------------------------
diff --git a/lib/tsconfig/TsConfigGrammar.y b/lib/tsconfig/TsConfigGrammar.y
index 2eec64d..d33eb46 100644
--- a/lib/tsconfig/TsConfigGrammar.y
+++ b/lib/tsconfig/TsConfigGrammar.y
@@ -32,7 +32,7 @@
 # define YYFREE free
 
 # include "TsConfigParseEvents.h"
-# include "ink_defs.h"
+# include "ts/ink_defs.h"
 
 // Types we need for the lexer.
 typedef void* yyscan_t;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/870fe0ee/lib/tsconfig/TsErrataUtil.cc
----------------------------------------------------------------------
diff --git a/lib/tsconfig/TsErrataUtil.cc b/lib/tsconfig/TsErrataUtil.cc
index bbb879e..7e8b77b 100644
--- a/lib/tsconfig/TsErrataUtil.cc
+++ b/lib/tsconfig/TsErrataUtil.cc
@@ -28,8 +28,8 @@
 # include <stdarg.h>
 # include <errno.h>
 # include <TsErrataUtil.h>
-# include "ink_string.h"
-# include "ink_defs.h"
+# include "ts/ink_string.h"
+# include "ts/ink_defs.h"
 
 namespace ts { namespace msg {
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/870fe0ee/lib/tsconfig/TsValue.cc
----------------------------------------------------------------------
diff --git a/lib/tsconfig/TsValue.cc b/lib/tsconfig/TsValue.cc
index 6f97617..d7c1db1 100644
--- a/lib/tsconfig/TsValue.cc
+++ b/lib/tsconfig/TsValue.cc
@@ -23,7 +23,7 @@
 
 # include "TsValue.h"
 # include "TsBuilder.h"
-# include "ink_defs.h"
+# include "ts/ink_defs.h"
 
 # include <TsErrataUtil.h>
 # include <sys/stat.h>


[14/50] git commit: Replace SIZE() with COUNTOF() and countof()

Posted by jp...@apache.org.
Replace SIZE() with COUNTOF() and countof()


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

Branch: refs/heads/sphinx-docs
Commit: 1617f7620e652623779c28e29685f0f264190da5
Parents: 207ac9a
Author: James Peach <jp...@apache.org>
Authored: Fri Apr 26 10:49:20 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Apr 26 10:53:17 2013 -0700

----------------------------------------------------------------------
 CHANGES                          |    2 ++
 iocore/cache/Cache.cc            |    5 ++---
 iocore/cluster/ClusterHandler.cc |    2 +-
 iocore/cluster/P_ClusterCache.h  |    2 +-
 iocore/dns/DNS.cc                |    6 +++---
 iocore/net/NetVCTest.cc          |    2 +-
 iocore/net/P_NetVCTest.h         |    2 +-
 lib/ts/ink_defs.h                |   14 +++++++++++---
 mgmt/cli/TrafficLine.cc          |    2 +-
 mgmt/cli/cliMain.cc              |    3 +--
 proxy/Main.cc                    |    7 +++----
 proxy/StatSystem.cc              |    4 ++--
 proxy/logcat.cc                  |    5 ++---
 proxy/logstats.cc                |    8 +++-----
 proxy/sac.cc                     |    4 +---
 15 files changed, 35 insertions(+), 33 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9f48947..e13b24a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1856] Replace SIZE() macro with COUNTOF() and countof().
+
   *) [TS-1853] Fix formatting in logstats to be consistenly 2 decimals.
 
   *) [TS-1852] Fix missing AC_PROG_SED on CentOS 5.9.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 9676291..bc273d3 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -859,7 +859,7 @@ CacheProcessor::cacheInitialized()
             break;
         }
       }
-      // let us cocalate the Size
+      // let us calculate the Size
       if (cache_config_ram_cache_size == AUTO_SIZE_RAM_CACHE) {
         Debug("cache_init", "CacheProcessor::cacheInitialized - cache_config_ram_cache_size == AUTO_SIZE_RAM_CACHE");
         for (i = 0; i < gnvol; i++) {
@@ -1125,7 +1125,6 @@ Vol::init(char *s, off_t blocks, off_t dir_skip, bool clear)
   len = blocks * STORE_BLOCK_SIZE;
   ink_assert(len <= MAX_VOL_SIZE);
   skip = dir_skip;
-  int i;
   prev_recover_pos = 0;
 
   // successive approximation, directory/meta data eats up some storage
@@ -1167,7 +1166,7 @@ Vol::init(char *s, off_t blocks, off_t dir_skip, bool clear)
   init_info->vol_aio[2].aiocb.aio_offset = bs;
   init_info->vol_aio[3].aiocb.aio_offset = bs + footer_offset;
 
-  for (i = 0; i < 4; i++) {
+  for (unsigned i = 0; i < countof(init_info->vol_aio); i++) {
     AIOCallback *aio = &(init_info->vol_aio[i]);
     aio->aiocb.aio_fildes = fd;
     aio->aiocb.aio_buf = &(init_info->vol_h_f[i * STORE_BLOCK_SIZE]);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/iocore/cluster/ClusterHandler.cc
----------------------------------------------------------------------
diff --git a/iocore/cluster/ClusterHandler.cc b/iocore/cluster/ClusterHandler.cc
index 6e4c5ca..770aa89 100644
--- a/iocore/cluster/ClusterHandler.cc
+++ b/iocore/cluster/ClusterHandler.cc
@@ -34,7 +34,7 @@
 // Global Data
 /*************************************************************************/
 // Initialize clusterFunction[] size
-int SIZE_clusterFunction = SIZE(clusterFunction);
+unsigned SIZE_clusterFunction = countof(clusterFunction);
 
 // hook for testing
 ClusterFunction *ptest_ClusterFunction = NULL;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/iocore/cluster/P_ClusterCache.h
----------------------------------------------------------------------
diff --git a/iocore/cluster/P_ClusterCache.h b/iocore/cluster/P_ClusterCache.h
index 9fc001f..f885689 100644
--- a/iocore/cluster/P_ClusterCache.h
+++ b/iocore/cluster/P_ClusterCache.h
@@ -866,7 +866,7 @@ ClusterFunctionDescriptor clusterFunction[]
 #endif
 
 ;
-extern int SIZE_clusterFunction;        // clusterFunction[] entries
+extern unsigned SIZE_clusterFunction;        // clusterFunction[] entries
 
 //////////////////////////////////////////////////////////////
 // Map from Cluster Function code to send queue priority

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/iocore/dns/DNS.cc
----------------------------------------------------------------------
diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
index 2d99eea..3593cd4 100644
--- a/iocore/dns/DNS.cc
+++ b/iocore/dns/DNS.cc
@@ -569,7 +569,7 @@ DNSHandler::retry_named(int ndx, ink_hrtime t, bool reopen)
   char buffer[MAX_DNS_PACKET_LEN];
   Debug("dns", "trying to resolve '%s' from DNS connection, ndx %d", try_server_names[try_servers], ndx);
   int r = _ink_res_mkquery(m_res, try_server_names[try_servers], T_A, buffer);
-  try_servers = (try_servers + 1) % SIZE(try_server_names);
+  try_servers = (try_servers + 1) % countof(try_server_names);
   ink_assert(r >= 0);
   if (r >= 0) {                 // looking for a bounce
     int res = socketManager.send(con[ndx].fd, buffer, r, 0);
@@ -597,7 +597,7 @@ DNSHandler::try_primary_named(bool reopen)
     if (local_num_entries < DEFAULT_NUM_TRY_SERVER)
       try_servers = (try_servers + 1) % local_num_entries;
     else
-      try_servers = (try_servers + 1) % SIZE(try_server_names);
+      try_servers = (try_servers + 1) % countof(try_server_names);
     ink_assert(r >= 0);
     if (r >= 0) {               // looking for a bounce
       int res = socketManager.send(con[0].fd, buffer, r, 0);
@@ -1421,7 +1421,7 @@ dns_process(DNSHandler *handler, HostEnt *buf, int len)
     // e->qname_len, no ?
     if (local_num_entries >= DEFAULT_NUM_TRY_SERVER) {
       if ((attempt_num_entries % 50) == 0) {
-        try_servers = (try_servers + 1) % SIZE(try_server_names);
+        try_servers = (try_servers + 1) % countof(try_server_names);
         ink_strlcpy(try_server_names[try_servers], e->qname, MAXDNAME);
         memset(&try_server_names[try_servers][strlen(e->qname)], 0, 1);
         attempt_num_entries = 0;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/iocore/net/NetVCTest.cc
----------------------------------------------------------------------
diff --git a/iocore/net/NetVCTest.cc b/iocore/net/NetVCTest.cc
index 8903e72..55844f7 100644
--- a/iocore/net/NetVCTest.cc
+++ b/iocore/net/NetVCTest.cc
@@ -95,7 +95,7 @@ NVC_test_def netvc_tests_def[] = {
   {"overflow", 50, 50, 0, 35000, 1024, 35, EVENT_NONE, VC_EVENT_WRITE_COMPLETE}
 
 };
-int num_netvc_tests = SIZE(netvc_tests_def);
+const unsigned num_netvc_tests = countof(netvc_tests_def);
 
 
 NetVCTest::NetVCTest():

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/iocore/net/P_NetVCTest.h
----------------------------------------------------------------------
diff --git a/iocore/net/P_NetVCTest.h b/iocore/net/P_NetVCTest.h
index a950f2d..14f4ea1 100644
--- a/iocore/net/P_NetVCTest.h
+++ b/iocore/net/P_NetVCTest.h
@@ -69,7 +69,7 @@ struct NVC_test_def
 };
 
 extern NVC_test_def netvc_tests_def[];
-extern int num_netvc_tests;
+extern const unsigned num_netvc_tests;
 
 class NetTestDriver:public Continuation
 {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/lib/ts/ink_defs.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_defs.h b/lib/ts/ink_defs.h
index 5df5dcc..7aa4c10 100644
--- a/lib/ts/ink_defs.h
+++ b/lib/ts/ink_defs.h
@@ -85,9 +85,17 @@
 // interpreted as 32 bits
 #define NULL_PTR static_cast<void*>(0)
 
-/* Some popular defines
-*/
-#define SIZE(x) (sizeof(x)/sizeof((x)[0]))
+// Determine the element count for an array.
+#define COUNTOF(x) ((unsigned)(sizeof(x)/sizeof((x)[0])))
+
+#ifdef __cplusplus
+template<typename T, unsigned N>
+static inline unsigned
+countof(const T (&)[N]) {
+  return N;
+}
+#endif
+
 #define SOCKOPT_ON ((char*)&on)
 #define SOCKOPT_OFF ((char*)&off)
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/mgmt/cli/TrafficLine.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/TrafficLine.cc b/mgmt/cli/TrafficLine.cc
index 16c6a2f..4c318ea 100644
--- a/mgmt/cli/TrafficLine.cc
+++ b/mgmt/cli/TrafficLine.cc
@@ -190,7 +190,7 @@ main(int argc, char **argv)
   };
 
   // Process command line arguments and dump into variables
-  process_args(argument_descriptions, SIZE(argument_descriptions), argv);
+  process_args(argument_descriptions, countof(argument_descriptions), argv);
 
   // check for the version number request
   if (VersionFlag) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/mgmt/cli/cliMain.cc
----------------------------------------------------------------------
diff --git a/mgmt/cli/cliMain.cc b/mgmt/cli/cliMain.cc
index 11d242f..671eba8 100644
--- a/mgmt/cli/cliMain.cc
+++ b/mgmt/cli/cliMain.cc
@@ -64,11 +64,10 @@ main(int argc, char *argv[])
     {"version", 'V', "Print Version Id", "T", &version_flag, NULL, NULL}
   };
 
-  int n_argument_descriptions = SIZE(argument_descriptions);
   NOWARN_UNUSED(argc);
 
   // Process command line arguments and dump into variables
-  process_args(argument_descriptions, n_argument_descriptions, argv);
+  process_args(argument_descriptions, countof(argument_descriptions), argv);
 
   // check for the version number request
   if (version_flag) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 9d04841..793add0 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -243,7 +243,6 @@ static const ArgumentDescription argument_descriptions[] = {
    NULL, NULL},
   {"help", 'h', "HELP!", NULL, NULL, NULL, usage},
 };
-static const unsigned n_argument_descriptions = SIZE(argument_descriptions);
 
 //
 // Initialize operating system related information/services
@@ -707,7 +706,7 @@ static int
 cmd_index(char *p)
 {
   p += strspn(p, " \t");
-  for (unsigned c = 0; c < SIZE(commands); c++) {
+  for (unsigned c = 0; c < countof(commands); c++) {
     const char *l = commands[c].n;
     while (l) {
       const char *s = strchr(l, '/');
@@ -729,7 +728,7 @@ cmd_help(char *cmd)
   printf("HELP\n\n");
   cmd = skip(cmd, true);
   if (!cmd) {
-    for (unsigned i = 0; i < SIZE(commands); i++) {
+    for (unsigned i = 0; i < countof(commands); i++) {
       printf("%15s  %s\n", commands[i].n, commands[i].d);
     }
   } else {
@@ -1336,7 +1335,7 @@ main(int argc, char **argv)
   ink_strlcpy(management_directory, Layout::get()->sysconfdir, sizeof(management_directory));
   chdir_root(); // change directory to the install root of traffic server.
 
-  process_args(argument_descriptions, n_argument_descriptions, argv);
+  process_args(argument_descriptions, countof(argument_descriptions), argv);
 
   // Check for version number request
   if (version_flag) {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/proxy/StatSystem.cc
----------------------------------------------------------------------
diff --git a/proxy/StatSystem.cc b/proxy/StatSystem.cc
index 480dfc9..f52bd57 100644
--- a/proxy/StatSystem.cc
+++ b/proxy/StatSystem.cc
@@ -167,12 +167,12 @@ static int
 persistent_stat(int i)
 {
 #ifndef DEFAULT_PERSISTENT
-  for (int j = 0; j < (int) SIZE(persistent_stats); j++)
+  for (unsigned j = 0; j < countof(persistent_stats); j++)
     if (persistent_stats[j] == i)
       return 1;
   return 0;
 #else
-  for (int j = 0; j < (int) SIZE(non_persistent_stats); j++)
+  for (unsigned j = 0; j < countof(non_persistent_stats); j++)
     if (non_persistent_stats[j] == i)
       return 0;
   return 1;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/proxy/logcat.cc
----------------------------------------------------------------------
diff --git a/proxy/logcat.cc b/proxy/logcat.cc
index eab1a8d..fe9bd3e 100644
--- a/proxy/logcat.cc
+++ b/proxy/logcat.cc
@@ -77,7 +77,6 @@ static const ArgumentDescription argument_descriptions[] = {
   {"elf2", '2', "Convert to Extended2 Logging Format", "T", &elf2_flag, NULL,
    NULL}
 };
-static const int n_argument_descriptions = SIZE(argument_descriptions);
 
 static const char *USAGE_LINE = "Usage: " PROGRAM_NAME " [-o output-file | -a] [-CEhS"
 #ifdef DEBUG
@@ -241,7 +240,7 @@ main(int /* argc ATS_UNUSED */, char *argv[])
   // process command-line arguments
   //
   output_file[0] = 0;
-  process_args(argument_descriptions, n_argument_descriptions, argv, USAGE_LINE);
+  process_args(argument_descriptions, countof(argument_descriptions), argv, USAGE_LINE);
 
   // check for the version number request
   //
@@ -252,7 +251,7 @@ main(int /* argc ATS_UNUSED */, char *argv[])
   // check for help request
   //
   if (help) {
-    usage(argument_descriptions, n_argument_descriptions, USAGE_LINE);
+    usage(argument_descriptions, countof(argument_descriptions), USAGE_LINE);
     _exit(NO_ERROR);
   }
   // check that only one of the -o and -a options was specified

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/proxy/logstats.cc
----------------------------------------------------------------------
diff --git a/proxy/logstats.cc b/proxy/logstats.cc
index e99b2e1..dc5815a 100644
--- a/proxy/logstats.cc
+++ b/proxy/logstats.cc
@@ -658,8 +658,6 @@ static ArgumentDescription argument_descriptions[] = {
   {"version", 'V', "Print Version Id", "T", &cl.version, NULL, NULL},
 };
 
-static int n_argument_descriptions = SIZE(argument_descriptions);
-
 static const char *USAGE_LINE =
   "Usage: " PROGRAM_NAME " [-f logfile] [-o origin[,...]] [-O originfile] [-m minhits] [-inshv]";
 
@@ -667,7 +665,7 @@ void
 CommandLineArgs::parse_arguments(char** argv)
 {
   // process command-line arguments
-  process_args(argument_descriptions, n_argument_descriptions, argv, USAGE_LINE);
+  process_args(argument_descriptions, countof(argument_descriptions), argv, USAGE_LINE);
 
   // Process as "CGI" ?
   if (strstr(argv[0], ".cgi") || cgi) {
@@ -720,7 +718,7 @@ CommandLineArgs::parse_arguments(char** argv)
 
   // check for help request
   if (help) {
-    usage(argument_descriptions, n_argument_descriptions, USAGE_LINE);
+    usage(argument_descriptions, countof(argument_descriptions), USAGE_LINE);
     _exit(0);
   }
 }
@@ -2302,7 +2300,7 @@ main(int /* argc ATS_UNUSED */, char *argv[])
     fs.open(cl.origin_file, std::ios::in);
     if (!fs.is_open()) {
       std::cerr << "can't read " << cl.origin_file << std::endl;
-      usage(argument_descriptions, n_argument_descriptions, USAGE_LINE);
+      usage(argument_descriptions, countof(argument_descriptions), USAGE_LINE);
       _exit(0);
     }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1617f762/proxy/sac.cc
----------------------------------------------------------------------
diff --git a/proxy/sac.cc b/proxy/sac.cc
index 11f9f43..1925113 100644
--- a/proxy/sac.cc
+++ b/proxy/sac.cc
@@ -70,8 +70,6 @@ ArgumentDescription argument_descriptions[] = {
 #endif
   {"help", 'h', "HELP!", NULL, NULL, NULL, usage},
 };
-int n_argument_descriptions = SIZE(argument_descriptions);
-
 
 /*-------------------------------------------------------------------------
   main
@@ -90,7 +88,7 @@ main(int /* argc ATS_UNUSED */, char *argv[])
   // take care of command-line arguments
   //
   snprintf(configDirectoryType, sizeof(configDirectoryType), "S%d", PATH_NAME_MAX - 1);
-  process_args(argument_descriptions, n_argument_descriptions, argv);
+  process_args(argument_descriptions, countof(argument_descriptions), argv);
 
   // Get log directory
   ink_strlcpy(system_log_dir, Layout::get()->logdir, sizeof(system_log_dir));


[47/50] git commit: TS-1872 More robust compiler detection

Posted by jp...@apache.org.
TS-1872 More robust compiler detection

we add autoconf-archive's ax_compiler_vendor to more robustly detect
which compiler we're dealing with.

(For varying interpretations of robustness when dealing with autoconf)


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

Branch: refs/heads/sphinx-docs
Commit: c400c88485c748b1d811d98336df668eb83169be
Parents: 634cb66
Author: Igor Galić <i....@brainsware.org>
Authored: Fri May 3 09:41:46 2013 +0200
Committer: Igor Galić <i....@brainsware.org>
Committed: Fri May 3 09:41:46 2013 +0200

----------------------------------------------------------------------
 build/ax_compiler_vendor.m4 |   84 ++++++++++++++++++++++++++++++++++++++
 configure.ac                |   16 ++++---
 2 files changed, 93 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c400c884/build/ax_compiler_vendor.m4
----------------------------------------------------------------------
diff --git a/build/ax_compiler_vendor.m4 b/build/ax_compiler_vendor.m4
new file mode 100644
index 0000000..73e32ea
--- /dev/null
+++ b/build/ax_compiler_vendor.m4
@@ -0,0 +1,84 @@
+# ===========================================================================
+#    http://www.gnu.org/software/autoconf-archive/ax_compiler_vendor.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_COMPILER_VENDOR
+#
+# DESCRIPTION
+#
+#   Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun,
+#   hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft,
+#   watcom, etc. The vendor is returned in the cache variable
+#   $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Steven G. Johnson <st...@alum.mit.edu>
+#   Copyright (c) 2008 Matteo Frigo
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 11
+
+AC_DEFUN([AX_COMPILER_VENDOR],
+[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor,
+  [# note: don't check for gcc first since some other compilers define __GNUC__
+  vendors="intel:     __ICC,__ECC,__INTEL_COMPILER
+           ibm:       __xlc__,__xlC__,__IBMC__,__IBMCPP__
+           pathscale: __PATHCC__,__PATHSCALE__
+           clang:     __clang__
+           gnu:       __GNUC__
+           sun:       __SUNPRO_C,__SUNPRO_CC
+           hp:        __HP_cc,__HP_aCC
+           dec:       __DECC,__DECCXX,__DECC_VER,__DECCXX_VER
+           borland:   __BORLANDC__,__TURBOC__
+           comeau:    __COMO__
+           cray:      _CRAYC
+           kai:       __KCC
+           lcc:       __LCC__
+           sgi:       __sgi,sgi
+           microsoft: _MSC_VER
+           metrowerks: __MWERKS__
+           watcom:    __WATCOMC__
+           portland:  __PGI
+           unknown:   UNKNOWN"
+  for ventest in $vendors; do
+    case $ventest in
+      *:) vendor=$ventest; continue ;;
+      *)  vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;;
+    esac
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[
+      #if !($vencpp)
+        thisisanerror;
+      #endif
+    ])], [break])
+  done
+  ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1`
+ ])
+])

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c400c884/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 911e053..fce8b72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -521,6 +521,8 @@ AC_PROG_CPP
 AC_PROG_CXXCPP
 AM_PROG_AS
 
+AX_COMPILER_VENDOR
+
 CFLAGS="${_ts_saved_CFLAGS}"
 CXXFLAGS="${_ts_saved_CXXFLAGS}"
 
@@ -697,12 +699,12 @@ AS_IF([test "x${has_optimizer_flags}" = "xno"],
 
 AM_CONDITIONAL([BUILD_HAVE_LIBCXX], [ false ])
 
-base_cc=`basename $CC`
+base_cc=$ax_cv_c_compiler_vendor
 
 case $host_os_def in
   linux)
     case $base_cc in
-    *icc*)
+    *intel*)
       # -Wall goes crazy, so turned these specific checks off for now:
       #
       #  111 is "statement is unrecahable"
@@ -730,7 +732,7 @@ case $host_os_def in
       release_opt="-g $common_opt $optimizing_flags -fno-strict-aliasing -Werror -Qunused-arguments"
       cxx_opt="-Wno-invalid-offsetof -Werror -Qunused-arguments"
       ;;
-    *) # gcc
+    *) # gnu
       # This is useful for finding odd conversions
       #    common_opt="-pipe -Wall -Werror -Wconversion -Wno-sign-conversion"
       ts_am_common_flags="-Wunused-parameter"
@@ -753,7 +755,7 @@ case $host_os_def in
       # clang on Darwin needs to use libc++ for any C++11 code.
       AM_CONDITIONAL([BUILD_HAVE_LIBCXX], [ true ])
       ;;
-    *) # gcc
+    *) # gnu
       common_opt="-pipe -Wall -Werror -Wno-deprecated-declarations"
       debug_opt="$common_opt"
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"
@@ -772,7 +774,7 @@ case $host_os_def in
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"
       cxx_opt="-Wno-invalid-offsetof -Qunused-arguments"
       ;;
-    *) # gcc
+    *) # gnu
       common_opt="-pipe -Wall -Werror"
       debug_opt="-ggdb3 $common_opt"
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"
@@ -782,7 +784,7 @@ case $host_os_def in
     TS_ADDTO(LDFLAGS, [-L/usr/local/lib])
     ;; # freebsd|kfreebsd)
   solaris)
-    if test "x${base_cc}" = "xcc"; then
+    if test "x${base_cc}" = "xsun"; then
       # TODO: If we no longer support SunStudio, should this code go away?
       common_opt="-mt -D__WORDSIZE=64" # FIXME: arch should be detected
       debug_opt="-g $common_opt"
@@ -796,7 +798,7 @@ case $host_os_def in
       if test "$solaris_use_stlport4" != yes; then
         postdeps_CXX="-library=Crun"
       fi
-    else # gcc
+    else # gnu
       common_opt="-pipe -Wall -Werror"
       debug_opt="-ggdb3 $common_opt"
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"


[09/50] git commit: TS-1820 - Better fix for handling additional warning flags.

Posted by jp...@apache.org.
TS-1820 - Better fix for handling additional warning flags.


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

Branch: refs/heads/sphinx-docs
Commit: 1d34e40e5ea1db645c8090289842bf8decb3fa17
Parents: ba1be0b
Author: Alan M. Carroll <amc@chocobo.(none)>
Authored: Thu Apr 25 18:17:16 2013 -0700
Committer: Alan M. Carroll <amc@chocobo.(none)>
Committed: Thu Apr 25 18:17:16 2013 -0700

----------------------------------------------------------------------
 configure.ac                          |    8 +++++++-
 lib/cpp11api/Makefile.am              |    2 +-
 lib/tsconfig/Makefile.am              |    5 ++---
 plugins/experimental/spdy/Makefile.am |    2 +-
 4 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1d34e40e/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 0f955ae..5789276 100644
--- a/configure.ac
+++ b/configure.ac
@@ -728,7 +728,8 @@ case $host_os in
     *) # gcc
       # This is useful for finding odd conversions
       #    common_opt="-pipe -Wall -Werror -Wconversion -Wno-sign-conversion"
-      common_opt="-pipe -Wall -Werror -Wunused-parameter"
+      ts_am_common_flags="-Wunused-parameter"
+      common_opt="-pipe -Wall -Werror"
       debug_opt="-ggdb3 $common_opt"
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"
       cxx_opt="-Wno-invalid-offsetof"
@@ -809,6 +810,11 @@ cc_oflag_dbg=$debug_opt
 cxx_oflag_opt="$release_opt $cxx_opt $cxx_rel"
 cxx_oflag_dbg="$debug_opt $cxx_opt $cxx_dbg"
 
+AM_CFLAGS="$ts_am_common_flags"
+AM_CXXFLAGS="$ts_am_common_flags"
+AC_SUBST(AM_CFLAGS)
+AC_SUBST(AM_CXXFLAGS)
+
 AC_SUBST([FLEX_CFLAGS], $flex_cflags)
 
 SHARED_CFLAGS=-fPIC

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1d34e40e/lib/cpp11api/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/cpp11api/Makefile.am b/lib/cpp11api/Makefile.am
index 3a5fde2..0aab9ed 100644
--- a/lib/cpp11api/Makefile.am
+++ b/lib/cpp11api/Makefile.am
@@ -23,7 +23,7 @@ AM_CPPFLAGS = -I$(top_builddir)/proxy/api/ts
 if BUILD_HAVE_CXX_11
 
 if BUILD_HAVE_LIBCXX
-AM_CXXFLAGS = -stdlib=libc++
+AM_CXXFLAGS += -stdlib=libc++
 endif
 
 lib_LTLIBRARIES = libatscpp11api.la

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1d34e40e/lib/tsconfig/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/tsconfig/Makefile.am b/lib/tsconfig/Makefile.am
index be89743..caa0392 100644
--- a/lib/tsconfig/Makefile.am
+++ b/lib/tsconfig/Makefile.am
@@ -19,13 +19,12 @@
 lib_LTLIBRARIES = libtsconfig.la
 noinst_PROGRAMS = test-tsconfig
 libtsconfig_la_LDFLAGS = -no-undefined -version-info @TS_LIBTOOL_VERSION@
-CFLAGS = @CFLAGS@ @FLEX_CFLAGS@
 
+AM_CFLAGS += @FLEX_CFLAGS@
 AM_YFLAGS = --yacc -d -p tsconfig
 
 AM_CPPFLAGS = \
-  -I$(top_srcdir)/lib \
-  -I$(top_srcdir)/lib/ts
+  -I$(top_srcdir)/lib 
 
 BUILT_SOURCES = \
   TsConfigGrammar.c TsConfigGrammar.h TsConfigGrammar.hpp \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1d34e40e/plugins/experimental/spdy/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/Makefile.am b/plugins/experimental/spdy/Makefile.am
index 298d9f4..440a9f6 100644
--- a/plugins/experimental/spdy/Makefile.am
+++ b/plugins/experimental/spdy/Makefile.am
@@ -26,7 +26,7 @@ AM_CPPFLAGS += \
   -I$(srcdir)/lib
 
 if BUILD_HAVE_LIBCXX
-AM_CXXFLAGS = -stdlib=libc++
+AM_CXXFLAGS += -stdlib=libc++
 endif
 
 spdy_la_SOURCES =  \


[05/50] git commit: TS-1852: fix missing AC_PROG_SED on CentOS 5.9

Posted by jp...@apache.org.
TS-1852: fix missing AC_PROG_SED on CentOS 5.9


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

Branch: refs/heads/sphinx-docs
Commit: 16df6a2a0c9e9ccec2d699aa8817935559be6df1
Parents: 9c2b7ec
Author: James Peach <jp...@apache.org>
Authored: Thu Apr 25 09:54:58 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu Apr 25 09:55:19 2013 -0700

----------------------------------------------------------------------
 CHANGES      |    2 ++
 configure.ac |   19 +++++++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/16df6a2a/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index b2c319b..c21c558 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1852] Fix missing AC_PROG_SED on CentOS 5.9.
+
   *) [TS-1717] Fix the static build as much as possible.
 
   *) [TS-1851] Turn HostDBInfo back into a POD type.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/16df6a2a/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index efa003b..9f2ed72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -577,13 +577,18 @@ if test "x$enable_ccache" = "xyes"; then
     fi
 fi
 
-dnl AC_PROG_SED is only avaliable in recent autoconf versions.
-dnl Use AC_CHECK_PROG instead if AC_PROG_SED is not present.
-ifdef([AC_PROG_SED],
-      [AC_PROG_SED],
-      [AC_CHECK_PROG(SED, sed, sed)])
+dnl AC_PROG_SED is only available from version 2.6 (released in 2003). CentosOS
+dnl 5.9 still has an ancient version, but we have macros that require
+dnl AC_PROG_SED. The actual AC_PROG_SED macro does functional checks, but here
+dnl we define a trivial local version for times when we are running on
+dnl obsoldete autoconf.
+ifdef([AC_PROG_SED], [], [
+  AC_DEFUN([AC_PROG_SED], [
+    AC_CHECK_PROG(SED, sed, sed)
+  ])
+])
 
-dnl Same with AM_PROG_AR, but it doesn't seem to be needed in older versions.
+dnl AM_PROG_AR is not always available, but it doesn't seem to be needed in older versions.
 ifdef([AM_PROG_AR],
       [AM_PROG_AR])
 
@@ -592,6 +597,7 @@ AC_PROG_CPP
 AC_PROG_CXXCPP
 AM_PROG_AS
 AC_PROG_AWK
+AC_PROG_SED
 AC_PROG_LN_S
 AC_PROG_INSTALL
 AC_PROG_LIBTOOL
@@ -599,6 +605,7 @@ AC_CHECK_PROG(RM, rm, rm)
 AC_CHECK_PROG(ASCPP, cpp, cpp)
 AC_CHECK_TOOL(AR, ar, ar)
 AC_ISC_POSIX
+
 # Do bison check by hand because we must do a version check.
 # Use YACC because it makes autotools shut up.
 BISON_MAJOR=2


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

Posted by jp...@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/d186ae37
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/d186ae37
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/d186ae37

Branch: refs/heads/sphinx-docs
Commit: d186ae374470c02af6028729d58b40cf53b3e4ce
Parents: 9c4fa96 ddce361
Author: Uri Shachar <us...@apache.org>
Authored: Sun Apr 28 14:51:56 2013 +0300
Committer: Uri Shachar <us...@apache.org>
Committed: Sun Apr 28 14:51:56 2013 +0300

----------------------------------------------------------------------
 plugins/experimental/esi/lib/FailureInfo.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------



[04/50] git commit: FreeBSD requires gmake, so let's say that. Also fix a typo.

Posted by jp...@apache.org.
FreeBSD requires gmake, so let's say that. Also fix a typo.


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

Branch: refs/heads/sphinx-docs
Commit: 9c2b7ecc37771c4f68f33ad206968bb8e5e9fe91
Parents: 1b92b8b
Author: Daniel Gruno <hu...@apache.org>
Authored: Thu Apr 25 10:59:24 2013 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Thu Apr 25 10:59:24 2013 +0200

----------------------------------------------------------------------
 INSTALL |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c2b7ecc/INSTALL
----------------------------------------------------------------------
diff --git a/INSTALL b/INSTALL
index fdee9b3..4792883 100644
--- a/INSTALL
+++ b/INSTALL
@@ -11,18 +11,18 @@ BUILD AND INSTALLATION
 Configure & Build from source:
     $ autoreconf -i  # generate the configure script and Makefile.in files
 
-On Linux, OSX and FreeBSD:
+On Linux, OSX:
     $ ./configure [--prefix=PREFIX]
     $ make
 
-On OpenSolaris:
+On OpenSolaris and FreeBSD:
     $ ./configure [--prefix=PREFIX]
     $ gmake
 
 To install:
     $ sudo make install
 
-* Building on FreeBSD required GNU make. This is the preferred make
+* Building on FreeBSD requires GNU make. This is the preferred make
   on all platforms.
 
 * Replace PREFIX with the filesystem path under which Traffic Server


[35/50] git commit: Document some changes

Posted by jp...@apache.org.
Document some changes


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

Branch: refs/heads/sphinx-docs
Commit: 22958d4815bf2427328ae28b4ca88a1522454dea
Parents: d1bb9ed
Author: Daniel Gruno <hu...@apache.org>
Authored: Mon Apr 29 00:39:26 2013 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Mon Apr 29 00:39:26 2013 +0200

----------------------------------------------------------------------
 CHANGES |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/22958d48/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 8691daf..9959ec1 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,8 @@
                                                          -*- coding: utf-8 -*-
   Changes with Apache Traffic Server 3.3.3
 
-
+  *) [TS-1858] Fix redefinition of timersub on Solaris
+  
   *) [TS-1860] cacheurl doesn't compile on platforms with pcre/pcre.h
    (e.g. solaris).
 


[13/50] git commit: reverse my stupid change

Posted by jp...@apache.org.
reverse my stupid change

this may prevent some strange crashing.


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

Branch: refs/heads/sphinx-docs
Commit: 207ac9a66149af5551814b4964a22bc16cdf3461
Parents: a8981a7
Author: Zhao Yongming <mi...@gmail.com>
Authored: Sat Apr 27 00:38:25 2013 +0800
Committer: Zhao Yongming <mi...@gmail.com>
Committed: Sat Apr 27 00:38:35 2013 +0800

----------------------------------------------------------------------
 proxy/logging/LogAccess.cc |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/207ac9a6/proxy/logging/LogAccess.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index 3f60bf6..df1e1b5 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -380,14 +380,15 @@ LogAccess::marshal_proxy_host_name(char *buf)
 
   if (machine) {
     str = machine->hostname;
-    len = LogAccess::strlen(str);
+  }
 
-    if (buf) {
-      marshal_str(buf, str, len);
-      return len;
-    }
+  len = LogAccess::strlen(str);
+
+  if (buf) {
+    marshal_str(buf, str, len);
   }
-  return 0;
+
+  return len;
 }
 
 /*-------------------------------------------------------------------------


[07/50] git commit: TS-1820: Clean up unused arguments. This provides a fix for flex generated files.

Posted by jp...@apache.org.
TS-1820: Clean up unused arguments. This provides a fix for flex generated files.


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

Branch: refs/heads/sphinx-docs
Commit: 2273d2aa9e6d538d29adc6b498e5de88e19c4e3a
Parents: 16df6a2
Author: Alan M. Carroll <amc@chocobo.(none)>
Authored: Thu Apr 25 15:44:33 2013 -0700
Committer: Alan M. Carroll <amc@chocobo.(none)>
Committed: Thu Apr 25 15:44:33 2013 -0700

----------------------------------------------------------------------
 configure.ac             |    6 +++++-
 lib/tsconfig/Makefile.am |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2273d2aa/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 9f2ed72..0f955ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -728,10 +728,12 @@ case $host_os in
     *) # gcc
       # This is useful for finding odd conversions
       #    common_opt="-pipe -Wall -Werror -Wconversion -Wno-sign-conversion"
-      common_opt="-pipe -Wall -Werror -Wno-error=unused-parameter -Wunused-parameter"
+      common_opt="-pipe -Wall -Werror -Wunused-parameter"
       debug_opt="-ggdb3 $common_opt"
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"
       cxx_opt="-Wno-invalid-offsetof"
+      # Special options for flex generated .c files
+      flex_cflags="-Wno-unused-parameter"
       ;;
     esac
     ;; # linux*)
@@ -807,6 +809,8 @@ cc_oflag_dbg=$debug_opt
 cxx_oflag_opt="$release_opt $cxx_opt $cxx_rel"
 cxx_oflag_dbg="$debug_opt $cxx_opt $cxx_dbg"
 
+AC_SUBST([FLEX_CFLAGS], $flex_cflags)
+
 SHARED_CFLAGS=-fPIC
 SHARED_LDFLAGS=-shared
 SHARED_CXXFLAGS=-fPIC

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2273d2aa/lib/tsconfig/Makefile.am
----------------------------------------------------------------------
diff --git a/lib/tsconfig/Makefile.am b/lib/tsconfig/Makefile.am
index 7864472..be89743 100644
--- a/lib/tsconfig/Makefile.am
+++ b/lib/tsconfig/Makefile.am
@@ -19,6 +19,7 @@
 lib_LTLIBRARIES = libtsconfig.la
 noinst_PROGRAMS = test-tsconfig
 libtsconfig_la_LDFLAGS = -no-undefined -version-info @TS_LIBTOOL_VERSION@
+CFLAGS = @CFLAGS@ @FLEX_CFLAGS@
 
 AM_YFLAGS = --yacc -d -p tsconfig
 


[34/50] git commit: TS-1860 cacheurl doesn't compile on platforms with pcre/pcre.h (e.g. solaris).

Posted by jp...@apache.org.
TS-1860 cacheurl doesn't compile on platforms with pcre/pcre.h (e.g.
solaris).


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

Branch: refs/heads/sphinx-docs
Commit: d1bb9ed9e1f12de3f97c0c5101e848c96e2a18da
Parents: 854c6c1
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sun Apr 28 13:54:53 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sun Apr 28 13:54:53 2013 -0600

----------------------------------------------------------------------
 CHANGES                                  |    3 +++
 plugins/experimental/cacheurl/cacheurl.c |    9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d1bb9ed9/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index b1a039e..8691daf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1860] cacheurl doesn't compile on platforms with pcre/pcre.h
+   (e.g. solaris).
+
   *) [TS-1729] Fix channel_stats to compile on various Unixen. Note that this
    is still IPV4 only.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d1bb9ed9/plugins/experimental/cacheurl/cacheurl.c
----------------------------------------------------------------------
diff --git a/plugins/experimental/cacheurl/cacheurl.c b/plugins/experimental/cacheurl/cacheurl.c
index 4d330ed..fff57a8 100644
--- a/plugins/experimental/cacheurl/cacheurl.c
+++ b/plugins/experimental/cacheurl/cacheurl.c
@@ -23,9 +23,16 @@
  */
 
 #include <stdio.h>
-#include <pcre.h>
 #include <string.h>
 
+#include "ink_config.h"
+
+#ifdef HAVE_PCRE_PCRE_H
+#include <pcre/pcre.h>
+#else
+#include <pcre.h>
+#endif
+
 #include "ts/ts.h"
 #include "ts/remap.h"
 #include "ink_defs.h"


[30/50] git commit: Explicitly initialize cbtable ptr to NULL

Posted by jp...@apache.org.
Explicitly initialize cbtable ptr to NULL


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

Branch: refs/heads/sphinx-docs
Commit: 9c4fa9602c5a4c7623a82b09f06734ce10d3ee9d
Parents: 05fe0f5
Author: Uri Shachar <us...@apache.org>
Authored: Sun Apr 28 14:47:39 2013 +0300
Committer: Uri Shachar <us...@apache.org>
Committed: Sun Apr 28 14:50:16 2013 +0300

----------------------------------------------------------------------
 mgmt/ProcessManager.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9c4fa960/mgmt/ProcessManager.cc
----------------------------------------------------------------------
diff --git a/mgmt/ProcessManager.cc b/mgmt/ProcessManager.cc
index e68660a..2340e83 100644
--- a/mgmt/ProcessManager.cc
+++ b/mgmt/ProcessManager.cc
@@ -72,7 +72,7 @@ startProcessManager(void *arg)
 }                               /* End startProcessManager */
 
 ProcessManager::ProcessManager(bool rlm, char *mpath):
-BaseManager(), require_lm(rlm), mgmt_sync_key(0), local_manager_sockfd(0)
+BaseManager(), require_lm(rlm), mgmt_sync_key(0), local_manager_sockfd(0), cbtable(NULL)
 {
   NOWARN_UNUSED(mpath);
   ink_strlcpy(pserver_path, Layout::get()->runtimedir, sizeof(pserver_path));


[45/50] git commit: fix the long standing typo

Posted by jp...@apache.org.
fix the long standing typo


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

Branch: refs/heads/sphinx-docs
Commit: 0bcdca5ac4dbc58fdd63a5d23124d3b6913edf69
Parents: 2d419fc
Author: Zhao Yongming <mi...@gmail.com>
Authored: Thu May 2 11:44:44 2013 -0400
Committer: Zhao Yongming <mi...@gmail.com>
Committed: Thu May 2 11:44:44 2013 -0400

----------------------------------------------------------------------
 .../body_factory/default/response#bad_version      |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/0bcdca5a/proxy/config/body_factory/default/response#bad_version
----------------------------------------------------------------------
diff --git a/proxy/config/body_factory/default/response#bad_version b/proxy/config/body_factory/default/response#bad_version
index 64c7e68..210c82d 100644
--- a/proxy/config/body_factory/default/response#bad_version
+++ b/proxy/config/body_factory/default/response#bad_version
@@ -8,7 +8,7 @@
 <HR>
 
 <FONT FACE="Helvetica,Arial"><B>
-Description: The web server "<EM>%<shm></EM>" is using an unsupported
+Description: The web server "<EM>%<shn></EM>" is using an unsupported
 version of the HTTP protocol.
 </B></FONT>
 <HR>


[42/50] git commit: Depending on the layout, tsxs might need

Posted by jp...@apache.org.
Depending on the layout, tsxs might need


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

Branch: refs/heads/sphinx-docs
Commit: 54b532b6471a0133efcd54df2ab37dab43690cdf
Parents: 23279f0
Author: James Peach <jp...@apache.org>
Authored: Mon Apr 29 16:29:02 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Apr 29 16:29:02 2013 -0700

----------------------------------------------------------------------
 tools/tsxs.in |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/54b532b6/tools/tsxs.in
----------------------------------------------------------------------
diff --git a/tools/tsxs.in b/tools/tsxs.in
index 056c88f..38fb25f 100755
--- a/tools/tsxs.in
+++ b/tools/tsxs.in
@@ -19,6 +19,7 @@
 host="@HOST_GUESS@"
 prefix="@prefix@"
 exec_prefix="@exec_prefix@"
+libdir="@libdir@"
 INSTALLDIR=`eval echo "@libexecdir@"`
 INCLUDEDIR=`eval echo "@includedir@"`
 CPPFLAGS="$CPPFLAGS -I$INCLUDEDIR"


[40/50] git commit: TS-1864 Illumos / OmniOS needs -m64 with gcc to compile properly on 64-bit platforms. We also only support ATS on 64-bit Illumos.

Posted by jp...@apache.org.
TS-1864 Illumos / OmniOS needs -m64 with gcc to compile properly on
64-bit platforms. We also only support ATS on 64-bit Illumos.


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

Branch: refs/heads/sphinx-docs
Commit: 8a6a2487c577fe9434cf032cf30949635e5f2e13
Parents: 08ca473
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Apr 29 13:50:57 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Apr 29 13:50:57 2013 -0600

----------------------------------------------------------------------
 CHANGES      |    3 +++
 configure.ac |    2 +-
 2 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8a6a2487/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index d0a6473..b17ba48 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1864] Illumos / OmniOS needs -m64 with gcc to compile properly on
+   64-bit platforms. We also only support ATS on 64-bit Illumos.
+
   *) [TS-1811] Make the HostDB sizes variable on the SRV enabled config.
    This restores compatibility with HostDB's prior to v3.3.1.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8a6a2487/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 8d48401..e45d67c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -771,7 +771,7 @@ case $host_os in
         postdeps_CXX="-library=Crun"
       fi
     else # gcc
-      common_opt="-pipe -Wall -Werror"
+      common_opt="-pipe -Wall -Werror -m64"
       debug_opt="-ggdb3 $common_opt"
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"
       cxx_opt="-Wno-invalid-offsetof"


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

Posted by jp...@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/ba1be0b3
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/ba1be0b3
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/ba1be0b3

Branch: refs/heads/sphinx-docs
Commit: ba1be0b39f84eb42a63edd9d93e301ead5c95d11
Parents: 2273d2a b3e3f0e
Author: Alan M. Carroll <amc@chocobo.(none)>
Authored: Thu Apr 25 15:47:07 2013 -0700
Committer: Alan M. Carroll <amc@chocobo.(none)>
Committed: Thu Apr 25 15:47:07 2013 -0700

----------------------------------------------------------------------
 lib/ts/ink_defs.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



[49/50] git commit: TS-1770 Unable to create remap rule for SSL sites when accessed as a forward proxy.

Posted by jp...@apache.org.
TS-1770 Unable to create remap rule for SSL sites when accessed as a
forward proxy.


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

Branch: refs/heads/sphinx-docs
Commit: 16099e8541abc266cca0220fefb85fb904cdf48b
Parents: 8650d81
Author: Mark Harrison <mark at mivok dot net>
Authored: Fri May 3 15:51:07 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri May 3 15:51:07 2013 -0600

----------------------------------------------------------------------
 CHANGES                                |    3 +++
 proxy/http/remap/UrlMappingPathIndex.h |    9 +++++++++
 2 files changed, 12 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/16099e85/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 362fcd0..7fb4676 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1770]  Unable to create remap rule for SSL sites when accessed as a
+   forward proxy. Author: Mark Harrison.
+
   *) [TS-1867] The combo_handler plugin crashes when receiving non-200 responses.
     Author: Conan Wang <co...@gmail.com>
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/16099e85/proxy/http/remap/UrlMappingPathIndex.h
----------------------------------------------------------------------
diff --git a/proxy/http/remap/UrlMappingPathIndex.h b/proxy/http/remap/UrlMappingPathIndex.h
index d6dfc6f..b631385 100644
--- a/proxy/http/remap/UrlMappingPathIndex.h
+++ b/proxy/http/remap/UrlMappingPathIndex.h
@@ -72,6 +72,15 @@ private:
   inline UrlMappingTrie *
   _GetTrie(URL *url, int &idx, int port, bool search = true) const {
     idx = url->scheme_get_wksidx();
+    // If the scheme is empty (e.g. because of a CONNECT method), guess it
+    // based on port
+    if (idx == -1) {
+        if (port == 80) {
+            idx = URL_WKSIDX_HTTP;
+        } else {
+            idx = URL_WKSIDX_HTTPS;
+        }
+    }
     UrlMappingGroup::const_iterator group_iter;
     if (search) { // normal search
       group_iter = m_tries.find(UrlMappingTrieKey(idx, port));


[28/50] git commit: Make more of the core compile on OmniOS.

Posted by jp...@apache.org.
Make more of the core compile on OmniOS.


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

Branch: refs/heads/sphinx-docs
Commit: 05fe0f56eb3c0005c2fd4e49b339fe105aeaaef3
Parents: 714a28f
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sat Apr 27 22:39:11 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sat Apr 27 22:39:11 2013 -0600

----------------------------------------------------------------------
 mgmt/Main.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/05fe0f56/mgmt/Main.cc
----------------------------------------------------------------------
diff --git a/mgmt/Main.cc b/mgmt/Main.cc
index 2a0d3d1..ae2e757 100644
--- a/mgmt/Main.cc
+++ b/mgmt/Main.cc
@@ -98,7 +98,7 @@ static int fds_limit;
 //       Thsis should just be #if defined(solaris)
 #if !defined(linux) && !defined(freebsd) && !defined(darwin)
 static void SignalHandler(int sig, siginfo_t * t, void *f);
-void SignalAlrmHandler(int sig, siginfo_t * t, void *f);
+static void SignalAlrmHandler(int sig, siginfo_t * t, void *f);
 #else
 static void SignalHandler(int sig);
 static void SignalAlrmHandler(int sig);


[23/50] git commit: Revert "Make Store::n_disks unsigned"

Posted by jp...@apache.org.
Revert "Make Store::n_disks unsigned"

This reverts commit 0dc121c1fec369691c7fcafa807ea8b50b2f766e.


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

Branch: refs/heads/sphinx-docs
Commit: 880bca9bf9aaeb264ac6335d947b1d9f3299103f
Parents: 8e60b9d
Author: James Peach <jp...@apache.org>
Authored: Sat Apr 27 16:32:00 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Apr 27 16:32:00 2013 -0700

----------------------------------------------------------------------
 iocore/cache/Cache.cc  |    3 ++-
 iocore/cache/I_Store.h |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/880bca9b/iocore/cache/Cache.cc
----------------------------------------------------------------------
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 580d49b..bc273d3 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -597,6 +597,7 @@ CacheProcessor::start_internal(int flags)
   start_internal_flags = flags;
   clear = !!(flags & PROCESSOR_RECONFIGURE) || auto_clear_flag;
   fix = !!(flags & PROCESSOR_FIX);
+  int i;
   start_done = 0;
   int diskok = 1;
 
@@ -609,7 +610,7 @@ CacheProcessor::start_internal(int flags)
   ink_aio_set_callback(new AIO_Callback_handler());
   Span *sd;
   config_volumes.read_config_file();
-  for (unsigned i = 0; i < theCacheStore.n_disks; i++) {
+  for (i = 0; i < theCacheStore.n_disks; i++) {
     sd = theCacheStore.disk[i];
     char path[PATH_NAME_MAX];
     int opts = DEFAULT_CACHE_OPTIONS;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/880bca9b/iocore/cache/I_Store.h
----------------------------------------------------------------------
diff --git a/iocore/cache/I_Store.h b/iocore/cache/I_Store.h
index 32b24c4..55ea839 100644
--- a/iocore/cache/I_Store.h
+++ b/iocore/cache/I_Store.h
@@ -162,7 +162,7 @@ struct Store
   Store();
   ~Store();
 
-  unsigned n_disks;
+  int n_disks;
   Span **disk;
 
   //


[16/50] git commit: TS-1856 Remove the countof() template from SPDY plugin, and make it compile properly with ink_defs.h included.

Posted by jp...@apache.org.
TS-1856 Remove the countof() template from SPDY plugin, and
make it compile properly with ink_defs.h included.


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

Branch: refs/heads/sphinx-docs
Commit: 1250c7cf8018a3e7695c5790f3bb23ca094ec2c2
Parents: cec4cf1
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Apr 26 14:58:23 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Apr 26 14:58:23 2013 -0600

----------------------------------------------------------------------
 lib/ts/ink_defs.h                            |    4 ++--
 plugins/experimental/lua/lapi.cc             |    6 ++++--
 plugins/experimental/lua/lconfig.cc          |    6 ++++--
 plugins/experimental/lua/lutil.cc            |    6 ++++--
 plugins/experimental/lua/lutil.h             |    8 --------
 plugins/experimental/lua/remap.cc            |    6 ++++--
 plugins/experimental/lua/state.cc            |    6 ++++--
 plugins/experimental/spdy/lib/base/logging.h |    4 ----
 8 files changed, 22 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1250c7cf/lib/ts/ink_defs.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_defs.h b/lib/ts/ink_defs.h
index 7aa4c10..fb71b37 100644
--- a/lib/ts/ink_defs.h
+++ b/lib/ts/ink_defs.h
@@ -86,14 +86,14 @@
 #define NULL_PTR static_cast<void*>(0)
 
 // Determine the element count for an array.
-#define COUNTOF(x) ((unsigned)(sizeof(x)/sizeof((x)[0])))
-
 #ifdef __cplusplus
 template<typename T, unsigned N>
 static inline unsigned
 countof(const T (&)[N]) {
   return N;
 }
+#else
+#  define countof(x) ((unsigned)(sizeof(x)/sizeof((x)[0])))
 #endif
 
 #define SOCKOPT_ON ((char*)&on)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1250c7cf/plugins/experimental/lua/lapi.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/lapi.cc b/plugins/experimental/lua/lapi.cc
index 52274a2..c284429 100644
--- a/plugins/experimental/lua/lapi.cc
+++ b/plugins/experimental/lua/lapi.cc
@@ -16,8 +16,10 @@
   limitations under the License.
 */
 
-#include <ts/ts.h>
-#include <ts/remap.h>
+#include "ts/ts.h"
+#include "ts/remap.h"
+#include "ink_defs.h"
+
 #include <string.h>
 #include "lapi.h"
 #include "lutil.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1250c7cf/plugins/experimental/lua/lconfig.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/lconfig.cc b/plugins/experimental/lua/lconfig.cc
index 69b1571..292829a 100644
--- a/plugins/experimental/lua/lconfig.cc
+++ b/plugins/experimental/lua/lconfig.cc
@@ -16,8 +16,10 @@
   limitations under the License.
 */
 
-#include <ts/ts.h>
-#include <ts/remap.h>
+#include "ts/ts.h"
+#include "ts/remap.h"
+#include "ink_defs.h"
+
 #include "lapi.h"
 #include "lutil.h"
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1250c7cf/plugins/experimental/lua/lutil.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/lutil.cc b/plugins/experimental/lua/lutil.cc
index dfe1783..6971fb7 100644
--- a/plugins/experimental/lua/lutil.cc
+++ b/plugins/experimental/lua/lutil.cc
@@ -16,8 +16,10 @@
   limitations under the License.
 */
 
-#include <ts/ts.h>
-#include <ts/remap.h>
+#include "ts/ts.h"
+#include "ts/remap.h"
+#include "ink_defs.h"
+
 #include "lapi.h"
 #include "lutil.h"
 #include <pthread.h>

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1250c7cf/plugins/experimental/lua/lutil.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/lutil.h b/plugins/experimental/lua/lutil.h
index 1e2e8e2..4f20424 100644
--- a/plugins/experimental/lua/lutil.h
+++ b/plugins/experimental/lua/lutil.h
@@ -28,9 +28,6 @@
 // Global argument index for TSHttpSsnArgGet and TSHttpTxnArgGet.
 extern int LuaHttpArgIndex;
 
-#define unlikely(x) __builtin_expect(!!(x), 0)
-#define likely(x)   __builtin_expect(!!(x), 1)
-
 #define LuaLogDebug(fmt, ...) do { \
     if (unlikely(TSIsDebugTagSet("lua"))) { \
         TSDebug("lua", "%s: " fmt, __func__, ##__VA_ARGS__); \
@@ -84,9 +81,4 @@ void LuaSetConstantField(lua_State * lua, const char * name, const char * value)
 lua_State * LuaNewState();
 lua_State * LuaPluginNewState(void);
 
-template <typename T, unsigned N> unsigned
-countof(const T (&)[N]) {
-  return N;
-}
-
 #endif // LUA_LUTIL_H_

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1250c7cf/plugins/experimental/lua/remap.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/remap.cc b/plugins/experimental/lua/remap.cc
index 1911c64..76590d8 100644
--- a/plugins/experimental/lua/remap.cc
+++ b/plugins/experimental/lua/remap.cc
@@ -16,8 +16,10 @@
   limitations under the License.
 */
 
-#include <ts/ts.h>
-#include <ts/remap.h>
+#include "ts/ts.h"
+#include "ts/remap.h"
+#include "ink_defs.h"
+
 #include "lapi.h"
 #include "lutil.h"
 #include "state.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1250c7cf/plugins/experimental/lua/state.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/state.cc b/plugins/experimental/lua/state.cc
index a40ce51..596322d 100644
--- a/plugins/experimental/lua/state.cc
+++ b/plugins/experimental/lua/state.cc
@@ -16,8 +16,10 @@
   limitations under the License.
 */
 
-#include <ts/ts.h>
-#include <ts/remap.h>
+#include "ts/ts.h"
+#include "ts/remap.h"
+#include "ink_defs.h"
+
 #include "state.h"
 #include "hook.h"
 #include "lutil.h"

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1250c7cf/plugins/experimental/spdy/lib/base/logging.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/lib/base/logging.h b/plugins/experimental/spdy/lib/base/logging.h
index 0c8541f..a4c065a 100644
--- a/plugins/experimental/spdy/lib/base/logging.h
+++ b/plugins/experimental/spdy/lib/base/logging.h
@@ -34,10 +34,6 @@ void TSError(const char *, ...)
 int TSIsDebugTagSet(const char*);
 }
 
-template <typename T, unsigned N> unsigned countof(const T(&)[N]) {
-    return N;
-}
-
 template <typename T> std::string stringof(const T&);
 #define cstringof(x) stringof(x).c_str()
 


[32/50] git commit: TS-1729 Fix channel_stats to compile on various Unixen. Note that this is still IPV4 only.

Posted by jp...@apache.org.
TS-1729 Fix channel_stats to compile on various Unixen. Note that this
is still IPV4 only.


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

Branch: refs/heads/sphinx-docs
Commit: 8ba444a605b5ff1769d2d8d493d7fc1e5686c8c7
Parents: d186ae3
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sun Apr 28 12:48:58 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sun Apr 28 12:48:58 2013 -0600

----------------------------------------------------------------------
 CHANGES                                            |    3 +
 .../experimental/channel_stats/channel_stats.cc    |   40 +++++++--------
 2 files changed, 22 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8ba444a6/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 76200e2..b1a039e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1729] Fix channel_stats to compile on various Unixen. Note that this
+   is still IPV4 only.
+
   *) [TS-1839] We fail "make test" on some platforms, due to install
    directory missing.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8ba444a6/plugins/experimental/channel_stats/channel_stats.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/channel_stats/channel_stats.cc b/plugins/experimental/channel_stats/channel_stats.cc
index d6b7724..de5f757 100644
--- a/plugins/experimental/channel_stats/channel_stats.cc
+++ b/plugins/experimental/channel_stats/channel_stats.cc
@@ -112,39 +112,37 @@ typedef struct intercept_state_t
 } intercept_state;
 
 struct private_seg_t {
-  struct in_addr net;
-  struct in_addr mask;
+  const in_addr_t net;
+  const in_addr_t mask;
 };
 
 // don't put inet_addr("255.255.255.255"), see BUGS in 'man 3 inet_addr'
 static struct private_seg_t private_segs[] = {
-  {{inet_addr("10.0.0.0")}, {inet_addr("255.0.0.0")}},
-  {{inet_addr("127.0.0.0")}, {inet_addr("255.0.0.0")}},
-  {{inet_addr("172.16.0.0")}, {inet_addr("255.240.0.0")}},
-  {{inet_addr("192.168.0.0")}, {inet_addr("255.255.0.0")}}
+  {inet_addr("10.0.0.0"), inet_addr("255.0.0.0")},
+  {inet_addr("127.0.0.0"), inet_addr("255.0.0.0")},
+  {inet_addr("172.16.0.0"), inet_addr("255.240.0.0")},
+  {inet_addr("192.168.0.0"), inet_addr("255.255.0.0")}
 };
+
 static int num_private_segs = sizeof(private_segs) / sizeof(private_seg_t);
 
 // all parameters are in network byte order
-static int
-is_in_net (const struct in_addr * addr,
-           const struct in_addr * netaddr,
-           const struct in_addr * netmask)
+static bool
+is_in_net(const in_addr_t addr,
+          const in_addr_t netaddr,
+          const in_addr_t netmask)
 {
-   if ((addr->s_addr & netmask->s_addr) == (netaddr->s_addr & netmask->s_addr))
-      return 1;
-   return 0;
+  return (addr & netmask) == (netaddr & netmask);
 }
 
-static int
-is_private_ip(const struct in_addr * addr)
+static bool
+is_private_ip(const in_addr_t addr)
 {
-  int i;
-  for (i = 0; i < num_private_segs; i++) {
-    if (is_in_net(addr, &private_segs[i].net, &private_segs[i].mask))
-      return 1;
+  for (int i = 0; i < num_private_segs; i++) {
+    if (is_in_net(addr, private_segs[i].net, private_segs[i].mask))
+      return true;
   }
-  return 0;
+  return false;
 }
 
 static int handle_event(TSCont contp, TSEvent event, void *edata);
@@ -321,7 +319,7 @@ handle_read_req(TSCont /* contp ATS_UNUSED */, TSHttpTxn txnp)
   client_addr = (struct sockaddr *) TSHttpTxnClientAddrGet(txnp);
   if (client_addr->sa_family == AF_INET) {
     client_addr4 = (struct sockaddr_in *) client_addr;
-    if (!is_private_ip(&client_addr4->sin_addr)) {
+    if (!is_private_ip(client_addr4->sin_addr.s_addr)) {
       client_ip = (char *) TSmalloc(INET_ADDRSTRLEN);
       inet_ntop(AF_INET, &client_addr4->sin_addr, client_ip, INET_ADDRSTRLEN);
       debug_api("%s is not a private IP, request denied", client_ip);


[48/50] git commit: TS-1867: combo_handler crashes with non-200 responses

Posted by jp...@apache.org.
TS-1867: combo_handler crashes with non-200 responses

combo_handler crashes when combining non-200 response from upstream.


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

Branch: refs/heads/sphinx-docs
Commit: 8650d81f725af40bd2143485922cfa34a8eec33a
Parents: c400c88
Author: Conan Wang <co...@gmail.com>
Authored: Fri May 3 12:47:20 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri May 3 12:48:35 2013 -0700

----------------------------------------------------------------------
 CHANGES                                            |    3 +++
 plugins/experimental/esi/combo_handler.cc          |    2 +-
 .../esi/fetcher/HttpDataFetcherImpl.cc             |    2 +-
 .../experimental/esi/fetcher/HttpDataFetcherImpl.h |   10 ++++++----
 4 files changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8650d81f/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 648df17..362fcd0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1867] The combo_handler plugin crashes when receiving non-200 responses.
+    Author: Conan Wang <co...@gmail.com>
+
   *) [TS-1838] Improve configure.ac to recognize compiler setup better.
 
   *) [TS-1865] Support DESTDIR in tsxs.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8650d81f/plugins/experimental/esi/combo_handler.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/combo_handler.cc b/plugins/experimental/esi/combo_handler.cc
index 90b9290..89a8fd6 100644
--- a/plugins/experimental/esi/combo_handler.cc
+++ b/plugins/experimental/esi/combo_handler.cc
@@ -711,7 +711,7 @@ prepareResponse(InterceptData &int_data, ByteBlockList &body_blocks, string &res
     bool got_expires_time = false;
     for (StringList::iterator iter = int_data.creq.file_urls.begin(); iter != int_data.creq.file_urls.end();
          ++iter) {
-      if (int_data.fetcher->getData(*iter, resp_data)) {
+      if (int_data.fetcher->getData(*iter, resp_data) && resp_data.status == TS_HTTP_STATUS_OK) {
         body_blocks.push_back(ByteBlock(resp_data.content, resp_data.content_len));
         if (!got_content_type) {
           got_content_type = getContentType(resp_data.bufp, resp_data.hdr_loc, resp_header_fields);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8650d81f/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc b/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc
index 157257e..427437d 100644
--- a/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc
+++ b/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.cc
@@ -273,7 +273,7 @@ HttpDataFetcherImpl::getData(const string &url, ResponseData &resp_data) const
     return false;
   }
 
-  resp_data.set(req_data.body, req_data.body_len, req_data.bufp, req_data.hdr_loc);
+  resp_data.set(req_data.body, req_data.body_len, req_data.bufp, req_data.hdr_loc, req_data.resp_status);
   TSDebug(_debug_tag, "[%s] Found data for URL [%s] of size %d starting with [%.5s]",
            __FUNCTION__, url.data(), req_data.body_len, req_data.body);
   return true;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8650d81f/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.h b/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.h
index 8864d74..29dccaa 100644
--- a/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.h
+++ b/plugins/experimental/esi/fetcher/HttpDataFetcherImpl.h
@@ -65,9 +65,10 @@ public:
     int content_len;
     TSMBuffer bufp;
     TSMLoc hdr_loc;
-    ResponseData() { set(0, 0, 0, 0); }
-    inline void set(const char *c, int clen, TSMBuffer b, TSMLoc loc);
-    void clear() { set(0, 0, 0, 0); }
+    TSHttpStatus status;
+    ResponseData() { set(0, 0, 0, 0, TS_HTTP_STATUS_NONE); }
+    inline void set(const char *c, int clen, TSMBuffer b, TSMLoc loc, TSHttpStatus s);
+    void clear() { set(0, 0, 0, 0, TS_HTTP_STATUS_NONE); }
   };
 
   bool getData(const std::string &url, ResponseData &resp_data) const;
@@ -136,11 +137,12 @@ private:
 };
 
 inline void
-HttpDataFetcherImpl::ResponseData::set(const char *c, int clen, TSMBuffer b, TSMLoc loc) {
+HttpDataFetcherImpl::ResponseData::set(const char *c, int clen, TSMBuffer b, TSMLoc loc, TSHttpStatus s) {
   content = c;
   content_len = clen;
   bufp = b;
   hdr_loc = loc;
+  status = s;
 }
 
 #endif


[15/50] git commit: TS-1856: fix unsigned comparison warnings

Posted by jp...@apache.org.
TS-1856: fix unsigned comparison warnings


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

Branch: refs/heads/sphinx-docs
Commit: cec4cf1d2dd70f5e834811b3159c67c7761f9afe
Parents: 1617f76
Author: James Peach <jp...@apache.org>
Authored: Fri Apr 26 11:17:47 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Fri Apr 26 11:17:47 2013 -0700

----------------------------------------------------------------------
 proxy/PluginVC.cc |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/cec4cf1d/proxy/PluginVC.cc
----------------------------------------------------------------------
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 5c56200..e00397f 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -1213,8 +1213,8 @@ public:
   int main_handler(int event, void *data);
 
 private:
-  int i;
-  int completions_received;
+  unsigned i;
+  unsigned completions_received;
 };
 
 PVCTestDriver::PVCTestDriver():
@@ -1245,8 +1245,8 @@ void
 PVCTestDriver::run_next_test()
 {
 
-  int a_index = i * 2;
-  int p_index = a_index + 1;
+  unsigned a_index = i * 2;
+  unsigned p_index = a_index + 1;
 
   if (p_index >= num_netvc_tests) {
     // We are done - // FIX - PASS or FAIL?


[19/50] git commit: include ink_defs.h so that likely/unlikely will expand on CentOS 5.

Posted by jp...@apache.org.
include ink_defs.h so that likely/unlikely will expand on CentOS 5.


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

Branch: refs/heads/sphinx-docs
Commit: f7917f8e8a9452a4d899bdd3982529fcf46cd256
Parents: 254daf1
Author: Daniel Gruno <hu...@apache.org>
Authored: Sat Apr 27 12:25:42 2013 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Sat Apr 27 12:25:42 2013 +0200

----------------------------------------------------------------------
 plugins/experimental/lua/lutil.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/f7917f8e/plugins/experimental/lua/lutil.h
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/lutil.h b/plugins/experimental/lua/lutil.h
index 4f20424..90818d3 100644
--- a/plugins/experimental/lua/lutil.h
+++ b/plugins/experimental/lua/lutil.h
@@ -24,6 +24,7 @@
 #include <string>
 #include <memory>
 #include <pthread.h>
+#include "ink_defs.h"
 
 // Global argument index for TSHttpSsnArgGet and TSHttpTxnArgGet.
 extern int LuaHttpArgIndex;


[46/50] git commit: Reorder Linux AIO autoconf detection

Posted by jp...@apache.org.
Reorder Linux AIO autoconf detection

Keep the checking message near the result so that it is not interleaved
with unrelated junk.


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

Branch: refs/heads/sphinx-docs
Commit: 634cb6622bc786813f8d05ef7550e58ce8bd804b
Parents: 0bcdca5
Author: James Peach <jp...@apache.org>
Authored: Thu May 2 15:33:29 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Thu May 2 15:33:29 2013 -0700

----------------------------------------------------------------------
 configure.ac |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/634cb662/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index b4c629a..911e053 100644
--- a/configure.ac
+++ b/configure.ac
@@ -411,18 +411,6 @@ fi
 TS_ARG_ENABLE_VAR([use], [reclaimable_freelist])
 AC_SUBST(use_reclaimable_freelist)
 
-#
-# If the OS is linux, we can use the '--enable-linux-native-aio' option to
-# replace the aio thread mode. Effective only on the linux system.
-#
-
-AC_MSG_CHECKING([whether to enable Linux native AIO])
-AC_ARG_ENABLE([linux-native-aio],
-  [AS_HELP_STRING([--enable-linux-native-aio], [enable native Linux AIO support @<:@default=no@:>@])],
-  [enable_linux_native_aio="${enableval}"],
-  [enable_linux_native_aio=no]
-)
-
 # Configure how many stats to allocate for plugins. Default is 512.
 #
 AC_ARG_WITH([max-api-stats],
@@ -1208,6 +1196,18 @@ AS_IF([test "x$enable_posix_cap" != "xno"],
 )
 AC_SUBST(use_posix_cap)
 
+#
+# If the OS is linux, we can use the '--enable-linux-native-aio' option to
+# replace the aio thread mode. Effective only on the linux system.
+#
+
+AC_MSG_CHECKING([whether to enable Linux native AIO])
+AC_ARG_ENABLE([linux-native-aio],
+  [AS_HELP_STRING([--enable-linux-native-aio], [enable native Linux AIO support @<:@default=no@:>@])],
+  [enable_linux_native_aio="${enableval}"],
+  [enable_linux_native_aio=no]
+)
+
 AS_IF([test "x$enable_linux_native_aio" = "xyes"], [
   if test $host_os_def  != "linux"; then
     AC_MSG_ERROR([Linux native AIO can only be enabled on Linux systems])


[39/50] git commit: TS-1811 Make the HostDB sizes variable on the SRV enabled config.

Posted by jp...@apache.org.
TS-1811 Make the HostDB sizes variable on the SRV enabled config.


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

Branch: refs/heads/sphinx-docs
Commit: 08ca473d05a59718d80de5aca7cf17aef1064d6d
Parents: 7e417c4
Author: Leif Hedstrom <zw...@apache.org>
Authored: Fri Apr 19 10:35:09 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Apr 29 12:23:22 2013 -0600

----------------------------------------------------------------------
 CHANGES                                |    3 +
 iocore/hostdb/HostDB.cc                |   10 ++--
 iocore/hostdb/MultiCache.cc            |    9 ++--
 iocore/hostdb/P_HostDBProcessor.h      |   65 ++++++++++++++-------------
 mgmt/RecordsConfig.cc                  |    2 +-
 proxy/Main.cc                          |    2 +-
 proxy/config/records.config.default.in |    2 +-
 proxy/http/HttpConfig.cc               |    3 -
 proxy/http/HttpConfig.h                |    3 -
 proxy/http/HttpSM.cc                   |    3 +-
 proxy/http/HttpTransact.cc             |    3 -
 11 files changed, 52 insertions(+), 53 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index b99556e..d0a6473 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1811] Make the HostDB sizes variable on the SRV enabled config.
+   This restores compatibility with HostDB's prior to v3.3.1.
+
   *) [TS-1843] Detect and link libhwloc on Ubuntu.
 
   *) [TS-1858] Fix redefinition of timersub on Solaris.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/iocore/hostdb/HostDB.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index 6221885..51f58a4 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -65,6 +65,7 @@ unsigned int hostdb_serve_stale_but_revalidate = 0;
 char hostdb_filename[PATH_NAME_MAX + 1] = DEFAULT_HOST_DB_FILENAME;
 int hostdb_size = DEFAULT_HOST_DB_SIZE;
 int hostdb_sync_frequency = 120;
+int hostdb_srv_enabled = 0;
 int hostdb_disable_reverse_lookup = 0;
 
 ClassAllocator<HostDBContinuation> hostDBContAllocator("hostDBContAllocator");
@@ -379,7 +380,7 @@ HostDBCache::start(int flags)
   Store *hostDBStore;
   Span *hostDBSpan;
   char storage_path[PATH_NAME_MAX + 1];
-  int storage_size = 0;
+  int storage_size = 33554432; // 32MB default
 
   bool reconfigure = ((flags & PROCESSOR_RECONFIGURE) ? true : false);
   bool fix = ((flags & PROCESSOR_FIX) ? true : false);
@@ -390,12 +391,12 @@ HostDBCache::start(int flags)
   REC_ReadConfigInt32(hostdb_enable, "proxy.config.hostdb");
   REC_ReadConfigString(hostdb_filename, "proxy.config.hostdb.filename", PATH_NAME_MAX);
   REC_ReadConfigInt32(hostdb_size, "proxy.config.hostdb.size");
+  REC_ReadConfigInt32(hostdb_srv_enabled, "proxy.config.srv_enabled");
   REC_ReadConfigString(storage_path, "proxy.config.hostdb.storage_path", PATH_NAME_MAX);
   REC_ReadConfigInt32(storage_size, "proxy.config.hostdb.storage_size");
 
   if (storage_path[0] != '/') {
-    Layout::relative_to(storage_path, PATH_NAME_MAX,
-                        system_root_dir, storage_path);
+    Layout::relative_to(storage_path, PATH_NAME_MAX, system_root_dir, storage_path);
   }
 
   Debug("hostdb", "Storage path is %s", storage_path);
@@ -418,8 +419,7 @@ HostDBCache::start(int flags)
     Note("reconfiguring host database");
 
     char p[PATH_NAME_MAX + 1];
-    Layout::relative_to(p, PATH_NAME_MAX,
-                        system_config_directory, "internal/hostdb.config");
+    Layout::relative_to(p, PATH_NAME_MAX, system_config_directory, "internal/hostdb.config");
     if (unlink(p) < 0)
       Debug("hostdb", "unable to unlink %s", p);
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/iocore/hostdb/MultiCache.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/MultiCache.cc b/iocore/hostdb/MultiCache.cc
index 00af859..1691940 100644
--- a/iocore/hostdb/MultiCache.cc
+++ b/iocore/hostdb/MultiCache.cc
@@ -566,8 +566,8 @@ MultiCacheBase::open(Store *s, const char *config_filename, char *db_filename, i
   // Set up cache
   {
     Store tStore;
-    int res = read_config(config_filename, tStore, t_db_filename,
-                          &t_db_size, &t_db_buckets);
+    int res = read_config(config_filename, tStore, t_db_filename, &t_db_size, &t_db_buckets);
+
     ink_assert(store_verify(&tStore));
     if (res < 0)
       goto LfailRead;
@@ -581,7 +581,6 @@ MultiCacheBase::open(Store *s, const char *config_filename, char *db_filename, i
         goto LfailMap;
       clear();
     } else {
-
       // don't know how to rebuild from this problem
       ink_assert(!db_filename || !strcmp(t_db_filename, db_filename));
       if (!db_filename)
@@ -599,6 +598,7 @@ MultiCacheBase::open(Store *s, const char *config_filename, char *db_filename, i
 
       // Try to get back our storage
       Store diff;
+
       s->try_realloc(cStore, diff);
       if (diff.n_disks && !reconfigure)
         goto LfailConfig;
@@ -606,8 +606,8 @@ MultiCacheBase::open(Store *s, const char *config_filename, char *db_filename, i
       // Do we need to do a reconfigure?
       if (diff.n_disks || change) {
         // find a new store to old the amount of space we need
-
         int delta = change;
+
         if (diff.n_disks)
           delta += diff.total_blocks();
 
@@ -674,6 +674,7 @@ MultiCacheBase::open(Store *s, const char *config_filename, char *db_filename, i
       }
     }
   }
+
   if (store)
     ink_assert(store_verify(store));
 Lcontinue:

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/iocore/hostdb/P_HostDBProcessor.h
----------------------------------------------------------------------
diff --git a/iocore/hostdb/P_HostDBProcessor.h b/iocore/hostdb/P_HostDBProcessor.h
index 1920c2e..94da9bf 100644
--- a/iocore/hostdb/P_HostDBProcessor.h
+++ b/iocore/hostdb/P_HostDBProcessor.h
@@ -30,6 +30,38 @@
 
 #include "I_HostDBProcessor.h"
 
+//
+// Data
+//
+
+extern int hostdb_enable;
+extern int hostdb_migrate_on_demand;
+extern int hostdb_cluster;
+extern int hostdb_cluster_round_robin;
+extern int hostdb_lookup_timeout;
+extern int hostdb_insert_timeout;
+extern int hostdb_re_dns_on_reload;
+
+// 0 = obey, 1 = ignore, 2 = min(X,ttl), 3 = max(X,ttl)
+enum
+  { TTL_OBEY, TTL_IGNORE, TTL_MIN, TTL_MAX };
+extern int hostdb_ttl_mode;
+
+extern unsigned int hostdb_current_interval;
+extern unsigned int hostdb_ip_stale_interval;
+extern unsigned int hostdb_ip_timeout_interval;
+extern unsigned int hostdb_ip_fail_timeout_interval;
+extern int hostdb_size;
+extern int hostdb_srv_enabled;
+extern char hostdb_filename[PATH_NAME_MAX + 1];
+
+//extern int hostdb_timestamp;
+extern int hostdb_sync_frequency;
+extern int hostdb_disable_reverse_lookup;
+
+// Static configuration information
+extern HostDBCache hostDB;
+
 /** Host DB record mark.
 
     The records in the host DB are de facto segregated by roughly the
@@ -175,7 +207,8 @@ struct HostDBCache: public MultiCache<HostDBInfo>
   }
 
   // This accounts for an average of 2 HostDBInfo per DNS cache (for round-robin etc.)
-  virtual size_t estimated_heap_bytes_per_entry() const { return sizeof(HostDBInfo) * 2 + 512; }
+  // In addition, we can do a padding for additional SRV records storage.
+  virtual size_t estimated_heap_bytes_per_entry() const { return sizeof(HostDBInfo) * 2 + 512 * hostdb_srv_enabled; }
 
   Queue<HostDBContinuation, Continuation::Link_link> pending_dns[MULTI_CACHE_PARTITIONS];
   Queue<HostDBContinuation, Continuation::Link_link> &pending_dns_for_hash(INK_MD5 & md5);
@@ -498,36 +531,6 @@ HostDBContinuation():
   }
 };
 
-//
-// Data
-//
-
-extern int hostdb_enable;
-extern int hostdb_migrate_on_demand;
-extern int hostdb_cluster;
-extern int hostdb_cluster_round_robin;
-extern int hostdb_lookup_timeout;
-extern int hostdb_insert_timeout;
-extern int hostdb_re_dns_on_reload;
-
-// 0 = obey, 1 = ignore, 2 = min(X,ttl), 3 = max(X,ttl)
-enum
-{ TTL_OBEY, TTL_IGNORE, TTL_MIN, TTL_MAX };
-extern int hostdb_ttl_mode;
-
-extern unsigned int hostdb_current_interval;
-extern unsigned int hostdb_ip_stale_interval;
-extern unsigned int hostdb_ip_timeout_interval;
-extern unsigned int hostdb_ip_fail_timeout_interval;
-extern int hostdb_size;
-extern char hostdb_filename[PATH_NAME_MAX + 1];
-
-extern int hostdb_sync_frequency;
-extern int hostdb_disable_reverse_lookup;
-
-// Static configuration information
-extern HostDBCache hostDB;
-
 //extern Queue<HostDBContinuation>  remoteHostDBQueue[MULTI_CACHE_PARTITIONS];
 
 inline unsigned int

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/mgmt/RecordsConfig.cc
----------------------------------------------------------------------
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 6735615..3c9071a 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -146,7 +146,7 @@ RecordElement RecordsConfig[] = {
   //# Support for SRV records
   //#
   //##############################################################################
-  {RECT_CONFIG, "proxy.config.srv_enabled", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
+  {RECT_CONFIG, "proxy.config.srv_enabled", RECD_INT, "0", RECU_RESTART_TS, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
   ,
 
   //##############################################################################

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 793add0..219cd8c 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -427,7 +427,7 @@ cmd_list(char *cmd)
   // show hostdb size
 
 #ifndef INK_NO_HOSTDB
-  int h_size = 0;
+  int h_size = 120000;
   TS_ReadConfigInteger(h_size, "proxy.config.hostdb.size");
   printf("Host Database size:\t%d\n", h_size);
 #endif

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/proxy/config/records.config.default.in
----------------------------------------------------------------------
diff --git a/proxy/config/records.config.default.in b/proxy/config/records.config.default.in
index 7b39d07..f09ffe2 100644
--- a/proxy/config/records.config.default.in
+++ b/proxy/config/records.config.default.in
@@ -396,7 +396,7 @@ CONFIG proxy.config.dns.validate_query_name INT 0
    # note that in order to increase hostdb.size, hostdb.storage_size should
    # also be increase. These are best guesses, you will have to monitor this.
 CONFIG proxy.config.hostdb.size INT 120000
-CONFIG proxy.config.hostdb.storage_size INT 200M
+CONFIG proxy.config.hostdb.storage_size INT 32M
    # ttl modes:
    #   0 = obey
    #   1 = ignore

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/proxy/http/HttpConfig.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.cc b/proxy/http/HttpConfig.cc
index 8793e6f..21f6fd0 100644
--- a/proxy/http/HttpConfig.cc
+++ b/proxy/http/HttpConfig.cc
@@ -1351,9 +1351,6 @@ HttpConfig::startup()
   // Stat Page Info
   HttpEstablishStaticConfigByte(c.enable_http_info, "proxy.config.http.enable_http_info");
 
-  // Support SRV records
-  HttpEstablishStaticConfigLongLong(c.srv_enabled, "proxy.config.srv_enabled");
-
   //##############################################################################
   //#
   //# Redirection

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/proxy/http/HttpConfig.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpConfig.h b/proxy/http/HttpConfig.h
index 494fc60..024154d 100644
--- a/proxy/http/HttpConfig.h
+++ b/proxy/http/HttpConfig.h
@@ -771,8 +771,6 @@ public:
   //  rather it is the time skew which the manager observes
   int32_t cluster_time_delta;
 
-  MgmtInt srv_enabled;          /* added by: ebalsa */
-
   //##############################################################################
   //#
   //# Redirection
@@ -955,7 +953,6 @@ HttpConfigParams::HttpConfigParams()
     default_buffer_water_mark(0),
     enable_http_info(0),
     cluster_time_delta(0),
-    srv_enabled(0),
     redirection_enabled(1),
     number_of_redirections(0),
     post_copy_size(2048),

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index db3a415..38a489f 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -418,7 +418,8 @@ HttpSM::init()
   t_state.cache_info.config.cache_vary_default_other = t_state.http_config_param->cache_vary_default_other;
 
   t_state.init();
-  t_state.srv_lookup = HttpConfig::m_master.srv_enabled;
+  t_state.srv_lookup = hostdb_srv_enabled;
+
   // Added to skip dns if the document is in cache. DNS will be forced if there is a ip based ACL in
   // cache control or parent.config or if the doc_in_cache_skip_dns is disabled or if http caching is disabled
   // TODO: This probably doesn't honor this as a per-transaction overridable config.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/08ca473d/proxy/http/HttpTransact.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 663a114..61fcf77 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -3527,9 +3527,6 @@ HttpTransact::handle_response_from_server(State* s)
     if (is_request_retryable(s) && s->current.attempts < max_connect_retries) {
       // If this is a round robin DNS entry & we're tried configured
       //    number of times, we should try another node
-
-      //bool use_srv_records = HttpConfig::m_master.srv_enabled;
-
       if (DNSLookupInfo::OS_ADDR_TRY_CLIENT == s->dns_info.os_addr_style) {
         // attempt was based on client supplied server address. Try again
         // using HostDB.


[02/50] git commit: TS-1851: Remove HostDBInfo constructor so it becomes a POD

Posted by jp...@apache.org.
TS-1851: Remove HostDBInfo constructor so it becomes a POD

Somewhere down the line HostDBInfo grew enough constructor complexity
that it became a non-POD type. The allocation treats it like a POD
type, so we should make sure that the compiler agrees.

Rename HostDBRoundRobin::n to HostDBRoundRobin::rrcount. Remove
unused HostDBInfo::set_from


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

Branch: refs/heads/sphinx-docs
Commit: 2915206c73f08dcb9d262dfa0f19967f20eaabdf
Parents: bb2fcaa
Author: James Peach <jp...@apache.org>
Authored: Wed Apr 3 15:36:53 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Wed Apr 24 16:31:06 2013 -0700

----------------------------------------------------------------------
 CHANGES                           |    2 +
 iocore/dns/DNS.cc                 |    2 +-
 iocore/dns/SRV.h                  |    6 ++--
 iocore/hostdb/HostDB.cc           |   44 ++++++++++++++------------
 iocore/hostdb/I_HostDBProcessor.h |   52 +++++---------------------------
 iocore/hostdb/P_HostDBProcessor.h |    8 ++--
 proxy/http/HttpSM.cc              |    2 +-
 proxy/http/HttpTransact.h         |    2 +-
 8 files changed, 44 insertions(+), 74 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index d75f00d..9720edb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1851] Turn HostDBInfo back into a POD type.
+
   *) [TS-1850] Improve SSL certificate error reporting.
 
   *) [TS-1848] Fix MIMEHdr::field_value_set_int64() wrapper.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/iocore/dns/DNS.cc
----------------------------------------------------------------------
diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
index 3efd938..2d99eea 100644
--- a/iocore/dns/DNS.cc
+++ b/iocore/dns/DNS.cc
@@ -1360,7 +1360,7 @@ dns_process(DNSHandler *handler, HostEnt *buf, int len)
     ink_assert(buf->srv_hosts.srv_host_count == 0 && buf->srv_hosts.srv_hosts_length == 0);
     buf->srv_hosts.srv_host_count = 0;
     buf->srv_hosts.srv_hosts_length = 0;
-    int &num_srv = buf->srv_hosts.srv_host_count;
+    unsigned& num_srv = buf->srv_hosts.srv_host_count;
     int rname_len = -1;
 
     //

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/iocore/dns/SRV.h
----------------------------------------------------------------------
diff --git a/iocore/dns/SRV.h b/iocore/dns/SRV.h
index 4393d7e..8e3e697 100644
--- a/iocore/dns/SRV.h
+++ b/iocore/dns/SRV.h
@@ -58,11 +58,11 @@ operator<(const SRV &left, const SRV &right)
 
 struct SRVHosts
 {
-  int srv_host_count;
-  int srv_hosts_length;
+  unsigned srv_host_count;
+  unsigned srv_hosts_length;
   SRV hosts[HOST_DB_MAX_ROUND_ROBIN_INFO];
 
-   ~SRVHosts()
+  ~SRVHosts()
   {
   }
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/iocore/hostdb/HostDB.cc
----------------------------------------------------------------------
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index 52075d6..6221885 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -82,7 +82,7 @@ HostDBInfo::srvname(HostDBRoundRobin *rr)
 {
   if (!is_srv || !data.srv.srv_offset)
     return NULL;
-  ink_assert(this - rr->info >= 0 && this - rr->info < rr->n && data.srv.srv_offset < rr->length);
+  ink_assert(this - rr->info >= 0 && this - rr->info < rr->rrcount && data.srv.srv_offset < rr->length);
   return (char *) rr + data.srv.srv_offset;
 }
 
@@ -239,8 +239,8 @@ HostDBCache::rebuild_callout(HostDBInfo * e, RebuildMC & r)
     HostDBRoundRobin *rr = (HostDBRoundRobin *) ptr(&e->app.rr.offset, r.partition);
     if (!rr)
       return corrupt_debugging_callout(e, r);
-    if (rr->n > HOST_DB_MAX_ROUND_ROBIN_INFO || rr->n <= 0 ||
-        rr->good > HOST_DB_MAX_ROUND_ROBIN_INFO || rr->good <= 0 || rr->good > rr->n)
+    if (rr->rrcount > HOST_DB_MAX_ROUND_ROBIN_INFO || rr->rrcount <= 0 ||
+        rr->good > HOST_DB_MAX_ROUND_ROBIN_INFO || rr->good <= 0 || rr->good > rr->rrcount)
       return corrupt_debugging_callout(e, r);
     for (int i = 0; i < rr->good; i++) {
       if (!valid_heap_pointer(((char *) &rr->info[i + 1]) - 1))
@@ -601,7 +601,7 @@ reply_to_cont(Continuation * cont, HostDBInfo * ar, bool is_srv = false)
         goto Lerror;
       }
       ip_text_buffer ipb;
-      Debug("hostdb", "RR of %d with %d good, 1st IP = %s", r->rr()->n, r->rr()->good, ats_ip_ntop(r->ip(), ipb, sizeof ipb));
+      Debug("hostdb", "RR of %d with %d good, 1st IP = %s", r->rr()->rrcount, r->rr()->good, ats_ip_ntop(r->ip(), ipb, sizeof ipb));
     }
 
     cont->handleEvent(is_srv ? EVENT_SRV_LOOKUP : EVENT_HOST_DB_LOOKUP, r);
@@ -1045,7 +1045,7 @@ do_setby(HostDBInfo * r, HostDBApplicationInfo * app, const char *hostname, IpAd
   if (rr) {
     if (is_srv) {
       uint32_t key = makeHostHash(hostname);
-      for (int i = 0; i < rr->n; i++) {
+      for (int i = 0; i < rr->rrcount; i++) {
         if (key == rr->info[i].data.srv.key && !strcmp(hostname, rr->info[i].srvname(rr))) {
           Debug("hostdb", "immediate setby for %s", hostname);
           rr->info[i].app.allotment.application1 = app->allotment.application1;
@@ -1054,7 +1054,7 @@ do_setby(HostDBInfo * r, HostDBApplicationInfo * app, const char *hostname, IpAd
         }
       }
     } else
-      for (int i = 0; i < rr->n; i++) {
+      for (int i = 0; i < rr->rrcount; i++) {
         if (rr->info[i].ip() == ip) {
           Debug("hostdb", "immediate setby for %s", hostname ? hostname : "<addr>");
           rr->info[i].app.allotment.application1 = app->allotment.application1;
@@ -1389,7 +1389,7 @@ static int
 restore_info(HostDBInfo * r, HostDBInfo * old_r, HostDBInfo & old_info, HostDBRoundRobin * old_rr_data)
 {
   if (old_rr_data) {
-    for (int j = 0; j < old_rr_data->n; j++)
+    for (int j = 0; j < old_rr_data->rrcount; j++)
       if (ats_ip_addr_eq(old_rr_data->info[j].ip(), r->ip())) {
         r->app = old_rr_data->info[j].app;
         return true;
@@ -1459,7 +1459,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt * e)
     HostDBRoundRobin *old_rr_data = old_r ? old_r->rr() : NULL;
 #ifdef DEBUG
     if (old_rr_data) {
-      for (int i = 0; i < old_rr_data->n; ++i) {
+      for (int i = 0; i < old_rr_data->rrcount; ++i) {
         if (old_r->md5_high != old_rr_data->info[i].md5_high ||
             old_r->md5_low != old_rr_data->info[i].md5_low ||
             old_r->md5_low_low != old_rr_data->info[i].md5_low_low)
@@ -1522,11 +1522,13 @@ HostDBContinuation::dnsEvent(int event, HostEnt * e)
     ink_assert(!r || (r->app.allotment.application1 == 0 && r->app.allotment.application2 == 0));
 
     if (rr) {
-      int s = HostDBRoundRobin::size(n, e->srv_hosts.srv_hosts_length);
-      HostDBRoundRobin *rr_data = (HostDBRoundRobin *) hostDB.alloc(&r->app.rr.offset, s);
-      Debug("hostdb", "allocating %d bytes for %d RR at %p %d", s, n, rr_data, r->app.rr.offset);
+      const int rrsize = HostDBRoundRobin::size(n, e->srv_hosts.srv_hosts_length);
+      HostDBRoundRobin *rr_data = (HostDBRoundRobin *) hostDB.alloc(&r->app.rr.offset, rrsize);
+
+      Debug("hostdb", "allocating %d bytes for %d RR at %p %d", rrsize, n, rr_data, r->app.rr.offset);
+
       if (rr_data) {
-        rr_data->length = s;
+        rr_data->length = rrsize;
         int i = 0, ii = 0;
         if (is_srv()) {
           int skip = 0;
@@ -1550,6 +1552,8 @@ HostDBContinuation::dnsEvent(int event, HostEnt * e)
           for (i = 0; i < n; ++i) {
             SRV *t = q[i];
             HostDBInfo& item = rr_data->info[i];
+
+            memset(&item, 0, sizeof(item));
             item.round_robin = 0;
             item.reverse_dns = 0;
             item.is_srv = 1;
@@ -1558,7 +1562,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt * e)
             item.data.srv.srv_port = t->port;
             item.data.srv.key = t->key;
 
-            ink_assert (skip + (int) t->host_len <= e->srv_hosts.srv_hosts_length);
+            ink_assert((skip + t->host_len) <= e->srv_hosts.srv_hosts_length);
 
             memcpy(pos + skip, t->host, t->host_len);
             item.data.srv.srv_offset = (pos - (char *) rr_data) + skip;
@@ -1574,13 +1578,13 @@ HostDBContinuation::dnsEvent(int event, HostEnt * e)
             item.app.allotment.application2 = 0;
             Debug("dns_srv", "inserted SRV RR record [%s] into HostDB with TTL: %d seconds", t->host, ttl_seconds);
           }
-          rr_data->good = rr_data->n = n;
+          rr_data->good = rr_data->rrcount = n;
           rr_data->current = 0;
 
           // restore
           if (old_rr_data) {
-            for (i = 0; i < rr_data->n; ++i) {
-              for (ii = 0; ii < old_rr_data->n; ++ii) {
+            for (i = 0; i < rr_data->rrcount; ++i) {
+              for (ii = 0; ii < old_rr_data->rrcount; ++ii) {
                 if (rr_data->info[i].data.srv.key == old_rr_data->info[ii].data.srv.key) {
                   char *new_host = rr_data->info[i].srvname(rr_data);
                   char *old_host = old_rr_data->info[ii].srvname(old_rr_data);
@@ -1610,7 +1614,7 @@ HostDBContinuation::dnsEvent(int event, HostEnt * e)
               ++i;
             }
           }
-          rr_data->good = rr_data->n = n;
+          rr_data->good = rr_data->rrcount = n;
           rr_data->current = 0;
         }
       } else {
@@ -2233,7 +2237,7 @@ HostDBInfo::rr()
 
   HostDBRoundRobin *r = (HostDBRoundRobin *) hostDB.ptr(&app.rr.offset, hostDB.ptr_to_partition((char *) this));
 
-  if (r && (r->n > HOST_DB_MAX_ROUND_ROBIN_INFO || r->n <= 0 || r->good > HOST_DB_MAX_ROUND_ROBIN_INFO || r->good <= 0)) {
+  if (r && (r->rrcount > HOST_DB_MAX_ROUND_ROBIN_INFO || r->rrcount <= 0 || r->good > HOST_DB_MAX_ROUND_ROBIN_INFO || r->good <= 0)) {
     ink_assert(!"bad round-robin");
     return NULL;
   }
@@ -2359,12 +2363,12 @@ struct ShowHostDB: public ShowCont
         HostDBRoundRobin *rr_data = r->rr();
         if (rr_data) {
           CHECK_SHOW(show("<table border=1>\n"));
-          CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n", "Total", rr_data->n));
+          CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n", "Total", rr_data->rrcount));
           CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n", "Good", rr_data->good));
           CHECK_SHOW(show("<tr><td>%s</td><td>%d</td></tr>\n", "Current", rr_data->current));
           CHECK_SHOW(show("</table>\n"));
 
-          for (int i = 0; i < rr_data->n; i++)
+          for (int i = 0; i < rr_data->rrcount; i++)
             showOne(&rr_data->info[i], true, event, e);
         }
       }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/iocore/hostdb/I_HostDBProcessor.h
----------------------------------------------------------------------
diff --git a/iocore/hostdb/I_HostDBProcessor.h b/iocore/hostdb/I_HostDBProcessor.h
index 9029d80..a1fd949 100644
--- a/iocore/hostdb/I_HostDBProcessor.h
+++ b/iocore/hostdb/I_HostDBProcessor.h
@@ -217,25 +217,6 @@ struct HostDBInfo
   }
 
 
-  /**
-    These are the only fields which will be inserted into the
-    database. Any new user fields must be added to this function.
-
-  */
-  void set_from(HostDBInfo const& that)
-  {
-    memcpy(&data, &that.data, sizeof data);
-    ip_timestamp = that.ip_timestamp;
-    ip_timeout_interval = that.ip_timeout_interval;
-    is_srv = that.is_srv;
-    round_robin = that.round_robin;
-    reverse_dns = that.reverse_dns;
-
-    app.allotment.application1 = that.app.allotment.application1;
-    app.allotment.application2 = that.app.allotment.application2;
-  }
-
-
   //
   // Private
   //
@@ -321,32 +302,13 @@ struct HostDBInfo
   bool match(INK_MD5 &, int, int);
   int heap_size();
   int *heap_offset_ptr();
-
-HostDBInfo()
-  : ip_timestamp(0)
-  , ip_timeout_interval(0)
-  , full(0)
-  , backed(0)
-  , deleted(0)
-  , hits(0)
-  , is_srv(0)
-  , round_robin(0)
-  , reverse_dns(0)
-  , md5_low_low(0)
-  , md5_low(0), md5_high(0) {
-    app.allotment.application1 = 0;
-    app.allotment.application2 = 0;
-    ats_ip_invalidate(ip());
-
-    return;
-  }
 };
 
 
 struct HostDBRoundRobin
 {
   /** Total number (to compute space used). */
-  short n;
+  short rrcount;
 
   /** Number which have not failed a connect. */
   short good;
@@ -355,12 +317,14 @@ struct HostDBRoundRobin
   unsigned short length;
   ink_time_t timed_rr_ctime;
 
-  HostDBInfo info[1];
+  HostDBInfo info[];
 
-  static int size(int nn, int srv_len = 0)
+  // Return the allocation size of a HostDBRoundRobin struct suitable for storing
+  // "count" HostDBInfo records.
+  static unsigned size(unsigned count, unsigned srv_len = 0)
   {
-    ink_assert(nn > 0);
-    return INK_ALIGN((int) (sizeof(HostDBRoundRobin) + (nn-1) * sizeof(HostDBInfo) + srv_len), 8);
+    ink_assert(count > 0);
+    return INK_ALIGN((sizeof(HostDBRoundRobin) + (count * sizeof(HostDBInfo)) + srv_len), 8);
   }
 
   /** Find the index of @a addr in member @a info.
@@ -378,7 +342,7 @@ struct HostDBRoundRobin
   HostDBInfo *select_best_http(sockaddr const* client_ip, ink_time_t now, int32_t fail_window);
   HostDBInfo *select_best_srv(char *target, InkRand *rand, ink_time_t now, int32_t fail_window);
   HostDBRoundRobin()
-    : n(0), good(0), current(0), length(0), timed_rr_ctime(0)
+    : rrcount(0), good(0), current(0), length(0), timed_rr_ctime(0)
   { }
 
 };

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/iocore/hostdb/P_HostDBProcessor.h
----------------------------------------------------------------------
diff --git a/iocore/hostdb/P_HostDBProcessor.h b/iocore/hostdb/P_HostDBProcessor.h
index 9691392..1920c2e 100644
--- a/iocore/hostdb/P_HostDBProcessor.h
+++ b/iocore/hostdb/P_HostDBProcessor.h
@@ -184,7 +184,7 @@ struct HostDBCache: public MultiCache<HostDBInfo>
 
 inline int
 HostDBRoundRobin::index_of(sockaddr const* ip) {
-  bool bad = (n <= 0 || n > HOST_DB_MAX_ROUND_ROBIN_INFO || good <= 0 || good > HOST_DB_MAX_ROUND_ROBIN_INFO);
+  bool bad = (rrcount <= 0 || rrcount > HOST_DB_MAX_ROUND_ROBIN_INFO || good <= 0 || good > HOST_DB_MAX_ROUND_ROBIN_INFO);
   if (bad) {
     ink_assert(!"bad round robin size");
     return -1;
@@ -220,7 +220,7 @@ HostDBRoundRobin::select_next(sockaddr const* ip) {
 
 inline HostDBInfo *
 HostDBRoundRobin::find_target(const char *target) {
-  bool bad = (n <= 0 || n > HOST_DB_MAX_ROUND_ROBIN_INFO || good <= 0 || good > HOST_DB_MAX_ROUND_ROBIN_INFO);
+  bool bad = (rrcount <= 0 || rrcount > HOST_DB_MAX_ROUND_ROBIN_INFO || good <= 0 || good > HOST_DB_MAX_ROUND_ROBIN_INFO);
   if (bad) {
     ink_assert(!"bad round robin size");
     return NULL;
@@ -237,7 +237,7 @@ HostDBRoundRobin::find_target(const char *target) {
 inline HostDBInfo *
 HostDBRoundRobin::select_best_http(sockaddr const* client_ip, ink_time_t now, int32_t fail_window)
 {
-  bool bad = (n <= 0 || n > HOST_DB_MAX_ROUND_ROBIN_INFO || good <= 0 || good > HOST_DB_MAX_ROUND_ROBIN_INFO);
+  bool bad = (rrcount <= 0 || rrcount > HOST_DB_MAX_ROUND_ROBIN_INFO || good <= 0 || good > HOST_DB_MAX_ROUND_ROBIN_INFO);
 
   if (bad) {
     ink_assert(!"bad round robin size");
@@ -314,7 +314,7 @@ HostDBRoundRobin::select_best_http(sockaddr const* client_ip, ink_time_t now, in
 inline HostDBInfo *
 HostDBRoundRobin::select_best_srv(char *target, InkRand *rand, ink_time_t now, int32_t fail_window)
 {
-  bool bad = (n <= 0 || n > HOST_DB_MAX_ROUND_ROBIN_INFO || good <= 0 || good > HOST_DB_MAX_ROUND_ROBIN_INFO);
+  bool bad = (rrcount <= 0 || rrcount > HOST_DB_MAX_ROUND_ROBIN_INFO || good <= 0 || good > HOST_DB_MAX_ROUND_ROBIN_INFO);
 
   if (bad) {
     ink_assert(!"bad round robin size");

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/proxy/http/HttpSM.cc
----------------------------------------------------------------------
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index 300b890..db3a415 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -2026,7 +2026,7 @@ HttpSM::process_hostdb_info(HostDBInfo * r)
       // set the srv target`s last_failure
       if (t_state.dns_info.srv_lookup_success) {
         uint32_t last_failure = 0xFFFFFFFF;
-        for (int i = 0; i < rr->n && last_failure != 0; ++i) {
+        for (int i = 0; i < rr->rrcount && last_failure != 0; ++i) {
           if (last_failure > rr->info[i].app.http_data.last_failure)
             last_failure = rr->info[i].app.http_data.last_failure;
         }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2915206c/proxy/http/HttpTransact.h
----------------------------------------------------------------------
diff --git a/proxy/http/HttpTransact.h b/proxy/http/HttpTransact.h
index 2e53b2d..21383fe 100644
--- a/proxy/http/HttpTransact.h
+++ b/proxy/http/HttpTransact.h
@@ -1035,7 +1035,6 @@ public:
         next_hop_scheme(scheme),
         orig_scheme(scheme),
         method(0),
-        host_db_info(),
         cause_of_death_errno(-UNKNOWN_INTERNAL_ERROR),
         client_request_time(UNDEFINED_TIME),
         request_sent_time(UNDEFINED_TIME),
@@ -1116,6 +1115,7 @@ public:
 
       memset(return_xbuf, 0, sizeof(return_xbuf));
       memset(user_args, 0, sizeof(user_args));
+      memset(&host_db_info, 0, sizeof(host_db_info));
     }
 
     void


[03/50] git commit: TS-1717: static library build fails with duplicate symbols

Posted by jp...@apache.org.
TS-1717: static library build fails with duplicate symbols

Fix the static build as much as possible. Add common plugin build
variables so we don't repeat automake fragments everywhere.


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

Branch: refs/heads/sphinx-docs
Commit: 1b92b8b3cbd8519e2305827755e9dbc267732e77
Parents: 2915206
Author: James Peach <jp...@apache.org>
Authored: Wed Mar 20 16:42:15 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Wed Apr 24 20:43:53 2013 -0700

----------------------------------------------------------------------
 CHANGES                                            |    2 +
 build/plugins.mk                                   |   37 ++++++++
 example/Makefile.am                                |   10 +--
 example/cache-scan/cache-scan.cc                   |    1 -
 lib/records/P_RecCore.h                            |    2 +
 lib/records/RecCore.cc                             |    2 +-
 lib/records/RecUtils.cc                            |    3 -
 lib/ts/ink_defs.h                                  |    2 +-
 mgmt/Main.cc                                       |   65 ++++++---------
 mgmt/Main.h                                        |    5 -
 mgmt/utils/MgmtUtils.cc                            |    3 +
 plugins/conf_remap/Makefile.am                     |    6 +-
 plugins/experimental/authproxy/Makefile.am         |    8 +--
 plugins/experimental/cacheurl/Makefile.am          |    7 +-
 plugins/experimental/channel_stats/Makefile.am     |    6 +-
 .../experimental/channel_stats/channel_stats.cc    |    1 -
 plugins/experimental/custom_redirect/Makefile.am   |    6 +-
 plugins/experimental/esi/Makefile.am               |   25 +++---
 plugins/experimental/esi/esi.cc                    |    1 +
 plugins/experimental/gzip/Makefile.am              |    6 +-
 plugins/experimental/header_rewrite/Makefile.am    |   24 ++++--
 plugins/experimental/lua/Makefile.am               |   13 +--
 plugins/experimental/metalink/Makefile.am          |    7 +-
 plugins/experimental/rfc5861/Makefile.am           |    6 +-
 plugins/experimental/spdy/Makefile.am              |   12 +--
 plugins/experimental/tcp_info/Makefile.am          |    7 +-
 plugins/header_filter/Makefile.am                  |    6 +-
 plugins/regex_remap/Makefile.am                    |    6 +-
 plugins/stats_over_http/Makefile.am                |    6 +-
 proxy/Main.cc                                      |    4 -
 proxy/logcat.cc                                    |    8 +-
 proxy/logging/LogStandalone.cc                     |    8 +-
 tools/jtest/jtest.cc                               |    5 +-
 33 files changed, 145 insertions(+), 165 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9720edb..b2c319b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1717] Fix the static build as much as possible.
+
   *) [TS-1851] Turn HostDBInfo back into a POD type.
 
   *) [TS-1850] Improve SSL certificate error reporting.

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/build/plugins.mk
----------------------------------------------------------------------
diff --git a/build/plugins.mk b/build/plugins.mk
new file mode 100644
index 0000000..c284405
--- /dev/null
+++ b/build/plugins.mk
@@ -0,0 +1,37 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+# plugins.mk: Common automake build variables for Traffic Server plugins.
+
+TS_PLUGIN_LDFLAGS = \
+  -module \
+  -shared \
+  -avoid-version
+
+TS_PLUGIN_CPPFLAGS = \
+  -D__STDC_LIMIT_MACROS=1 \
+  -D__STDC_FORMAT_MACROS=1 \
+  -I$(top_builddir)/proxy/api \
+  -I$(top_srcdir)/proxy/api \
+  -I$(top_builddir)/lib/ts \
+  -I$(top_srcdir)/lib/ts
+
+# Provide a default AM_CPPFLAGS. Automake handles this correctly, but libtool
+# throws an error if we try to do the same with AM_LDFLAGS. Hence, we provide
+# TS_PLUGIN variables that can be used to construct the necessary automake
+# syntax.
+AM_CPPFLAGS = $(TS_PLUGIN_CPPFLAGS)
+pkglibdir = $(pkglibexecdir)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/example/Makefile.am
----------------------------------------------------------------------
diff --git a/example/Makefile.am b/example/Makefile.am
index b10e1d5..e0939e0 100644
--- a/example/Makefile.am
+++ b/example/Makefile.am
@@ -14,15 +14,9 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-pkglibdir = ${pkglibexecdir}
+include $(top_srcdir)/build/plugins.mk
 
-AM_CPPFLAGS = \
-    -I$(top_srcdir)/proxy/api \
-    -I$(top_builddir)/proxy/api \
-    -I$(top_srcdir)/lib/ts \
-    -I$(top_builddir)/lib/ts
-    
-AM_LDFLAGS = -module -avoid-version -shared
+AM_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 
 noinst_LTLIBRARIES = \
 	add-header.la \

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/example/cache-scan/cache-scan.cc
----------------------------------------------------------------------
diff --git a/example/cache-scan/cache-scan.cc b/example/cache-scan/cache-scan.cc
index b45dac5..efde358 100644
--- a/example/cache-scan/cache-scan.cc
+++ b/example/cache-scan/cache-scan.cc
@@ -32,7 +32,6 @@
 
 #include "ts/ts.h"
 #include "ts/experimental.h"
-
 #include "ink_defs.h"
 
 static TSCont global_contp;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/lib/records/P_RecCore.h
----------------------------------------------------------------------
diff --git a/lib/records/P_RecCore.h b/lib/records/P_RecCore.h
index fda9b13..6d3633d 100644
--- a/lib/records/P_RecCore.h
+++ b/lib/records/P_RecCore.h
@@ -43,6 +43,8 @@ extern int g_num_update[];
 extern RecModeT g_mode_type;
 extern RecTree *g_records_tree;
 
+extern Diags *g_diags;
+
 // records.config items
 extern const char *g_rec_config_fpath;
 extern LLQ *g_rec_config_contents_llq;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/lib/records/RecCore.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecCore.cc b/lib/records/RecCore.cc
index ce9818e..5a09e0a 100644
--- a/lib/records/RecCore.cc
+++ b/lib/records/RecCore.cc
@@ -179,7 +179,7 @@ RecCoreInit(RecModeT mode_type, Diags *_diags)
   }
 
   // set our diags
-  ink_atomic_swap(&g_diags, _diags);
+  RecSetDiags(_diags);
 
   g_records_tree = new RecTree(NULL);
   g_num_records = 0;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/lib/records/RecUtils.cc
----------------------------------------------------------------------
diff --git a/lib/records/RecUtils.cc b/lib/records/RecUtils.cc
index 84e036a..fb5c81a 100644
--- a/lib/records/RecUtils.cc
+++ b/lib/records/RecUtils.cc
@@ -26,9 +26,6 @@
 #include "P_RecCore.h"
 #include "P_RecTree.h"
 
-// diags defined in RecCore.cc
-extern Diags *g_diags;
-
 //-------------------------------------------------------------------------
 // RecAlloc
 //-------------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/lib/ts/ink_defs.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_defs.h b/lib/ts/ink_defs.h
index 8d00f07..4f5439b 100644
--- a/lib/ts/ink_defs.h
+++ b/lib/ts/ink_defs.h
@@ -29,7 +29,7 @@
 #include <stddef.h>
 
 #ifdef HAVE_STDINT_H
-#define __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
 # include <stdint.h>
 #else
 // TODO: Add "standard" int types?

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/mgmt/Main.cc
----------------------------------------------------------------------
diff --git a/mgmt/Main.cc b/mgmt/Main.cc
index 895ea06..2a0d3d1 100644
--- a/mgmt/Main.cc
+++ b/mgmt/Main.cc
@@ -71,16 +71,15 @@ FileManager *configFiles;
 StatProcessor *statProcessor;   // Statistics Processors
 AppVersionInfo appVersionInfo;  // Build info for this application
 
-inkcoreapi Diags *diags;
-inkcoreapi DiagsConfig *diagsConfig;
-char debug_tags[1024] = "";
-char action_tags[1024] = "";
 int diags_init = 0;
-bool proxy_on = true;
-bool forceProcessRecordsSnap = false;
 
-bool schema_on = false;
-char *schema_path = NULL;
+static inkcoreapi DiagsConfig *diagsConfig;
+static char debug_tags[1024] = "";
+static char action_tags[1024] = "";
+static bool proxy_on = true;
+
+static bool schema_on = false;
+static char *schema_path = NULL;
 
 // TODO: Check if really need those
 char system_root_dir[PATH_NAME_MAX + 1];
@@ -91,27 +90,25 @@ char system_log_dir[PATH_NAME_MAX + 1];
 char mgmt_path[PATH_NAME_MAX + 1];
 
 // By default, set the current directory as base
-const char *ts_base_dir = ".";
-const char *recs_conf = "records.config";
+static const char *recs_conf = "records.config";
 
-int fds_limit;
+static int fds_limit;
 
-typedef void (*PFV) (int);
 // TODO: Use positive instead negative selection
 //       Thsis should just be #if defined(solaris)
 #if !defined(linux) && !defined(freebsd) && !defined(darwin)
-void SignalHandler(int sig, siginfo_t * t, void *f);
+static void SignalHandler(int sig, siginfo_t * t, void *f);
 void SignalAlrmHandler(int sig, siginfo_t * t, void *f);
 #else
-void SignalHandler(int sig);
-void SignalAlrmHandler(int sig);
+static void SignalHandler(int sig);
+static void SignalAlrmHandler(int sig);
 #endif
 
-volatile int sigHupNotifier = 0;
-volatile int sigUsr2Notifier = 0;
-void SigChldHandler(int sig);
+static volatile int sigHupNotifier = 0;
+static volatile int sigUsr2Notifier = 0;
+static void SigChldHandler(int sig);
 
-void
+static void
 check_lockfile()
 {
   char lockfile[PATH_NAME_MAX];
@@ -175,7 +172,7 @@ check_lockfile()
 }
 
 
-void
+static void
 initSignalHandlers()
 {
   struct sigaction sigHandler, sigChldHandler, sigAlrmHandler;
@@ -324,7 +321,7 @@ init_dirs(bool use_librecords = true)
 
 }
 
-void
+static void
 chdir_root()
 {
 
@@ -367,7 +364,7 @@ set_process_limits(int fds_throttle)
 }
 
 #if TS_HAS_WCCP
-void
+static void
 Errata_Logger(ts::Errata const& err) {
   size_t n;
   static size_t const SIZE = 4096;
@@ -385,7 +382,7 @@ Errata_Logger(ts::Errata const& err) {
   }
 }
 
-void
+static void
 Init_Errata_Logging() {
   ts::Errata::registerSink(&Errata_Logger);
 }
@@ -845,10 +842,10 @@ main(int argc, char **argv)
 
 
 #if !defined(linux) && !defined(freebsd) && !defined(darwin)
-void
+static void
 SignalAlrmHandler(int sig, siginfo_t * t, void *c)
 #else
-void
+static void
 SignalAlrmHandler(int sig)
 #endif
 {
@@ -878,10 +875,10 @@ SignalAlrmHandler(int sig)
 
 
 #if !defined(linux) && !defined(freebsd) && !defined(darwin)
-void
+static void
 SignalHandler(int sig, siginfo_t * t, void *c)
 #else
-void
+static void
 SignalHandler(int sig)
 #endif
 {
@@ -962,24 +959,12 @@ SignalHandler(int sig)
 //    waitpid() blocks until all child are transformed into
 //    zombies which is bad for us
 //
-void
+static void
 SigChldHandler(int sig)
 {
   NOWARN_UNUSED(sig);
 }
 
-// void SigHupHandler(int sig,...)
-//
-//  Records that a sigHup was sent so that we can reread our
-//    config files on the next run through the main loop
-void
-SigHupHandler(int sig, ...)
-{
-  ink_assert(sig == SIGHUP);
-  Debug("lm", "[SigHupHandler] hup caught\n");
-  sigHupNotifier = 1;
-}                               /* End SigHupHandler */
-
 void
 printUsage()
 {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/mgmt/Main.h
----------------------------------------------------------------------
diff --git a/mgmt/Main.h b/mgmt/Main.h
index 19434fb..f4b393e 100644
--- a/mgmt/Main.h
+++ b/mgmt/Main.h
@@ -46,11 +46,6 @@ extern AppVersionInfo appVersionInfo;
 
 // Global strings
 extern char mgmt_path[];
-extern const char *recs_conf;
-//extern char *lm_conf;
-
-// Root of Traffic Server
-extern const char *ts_base_dir;
 
 // Global variable to replace ifdef MGMT_LAUNCH_PROXY so that
 // we can turn on/off proxy launch at runtime to facilitate

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/mgmt/utils/MgmtUtils.cc
----------------------------------------------------------------------
diff --git a/mgmt/utils/MgmtUtils.cc b/mgmt/utils/MgmtUtils.cc
index 2011540..05cd022 100644
--- a/mgmt/utils/MgmtUtils.cc
+++ b/mgmt/utils/MgmtUtils.cc
@@ -33,7 +33,10 @@
 #include "../../proxy/Main.h"
 #endif
 
+#if defined(LOCAL_MANAGER) || defined(PROCESS_MANAGER)
+// diags_init defined in mgmt/Main.cc.
 extern int diags_init;
+#endif
 
 static int use_syslog = 0;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/conf_remap/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/conf_remap/Makefile.am b/plugins/conf_remap/Makefile.am
index 9042800..48843d3 100644
--- a/plugins/conf_remap/Makefile.am
+++ b/plugins/conf_remap/Makefile.am
@@ -14,10 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-    -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
+include $(top_srcdir)/build/plugins.mk
 
-pkglibdir = ${pkglibexecdir}
 pkglib_LTLIBRARIES = conf_remap.la
 conf_remap_la_SOURCES = conf_remap.cc
-conf_remap_la_LDFLAGS = -module -avoid-version -shared
+conf_remap_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/authproxy/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/authproxy/Makefile.am b/plugins/experimental/authproxy/Makefile.am
index 81604ee..844511a 100644
--- a/plugins/experimental/authproxy/Makefile.am
+++ b/plugins/experimental/authproxy/Makefile.am
@@ -14,13 +14,9 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-pkglibdir = ${pkglibexecdir}
-
-AM_CPPFLAGS = \
-  -I$(top_builddir)/proxy/api \
-  -I$(top_srcdir)/proxy/api
+include $(top_srcdir)/build/plugins.mk
 
 pkglib_LTLIBRARIES = authproxy.la
 authproxy_la_SOURCES = authproxy.cc utils.cc utils.h
-authproxy_la_LDFLAGS = -module -avoid-version -shared
+authproxy_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/cacheurl/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/cacheurl/Makefile.am b/plugins/experimental/cacheurl/Makefile.am
index cca749f..bd1e5a3 100644
--- a/plugins/experimental/cacheurl/Makefile.am
+++ b/plugins/experimental/cacheurl/Makefile.am
@@ -14,11 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-     -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
-
-pkglibdir = ${pkglibexecdir}
+include $(top_srcdir)/build/plugins.mk
 
 pkglib_LTLIBRARIES = cacheurl.la
 cacheurl_la_SOURCES = cacheurl.c
-cacheurl_la_LDFLAGS = -avoid-version -module -shared
+cacheurl_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/channel_stats/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/channel_stats/Makefile.am b/plugins/experimental/channel_stats/Makefile.am
index 6438ce0..032a8b2 100644
--- a/plugins/experimental/channel_stats/Makefile.am
+++ b/plugins/experimental/channel_stats/Makefile.am
@@ -14,10 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-     -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
+include $(top_srcdir)/build/plugins.mk
 
-pkglibdir = ${pkglibexecdir}
 pkglib_LTLIBRARIES = channel_stats.la
 channel_stats_la_SOURCES = channel_stats.cc
-channel_stats_la_LDFLAGS = -module -avoid-version -shared
+channel_stats_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/channel_stats/channel_stats.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/channel_stats/channel_stats.cc b/plugins/experimental/channel_stats/channel_stats.cc
index 09d7152..d6b7724 100644
--- a/plugins/experimental/channel_stats/channel_stats.cc
+++ b/plugins/experimental/channel_stats/channel_stats.cc
@@ -16,7 +16,6 @@
   limitations under the License.
 */
 
-
 #include "ink_platform.h"
 #include "ink_defs.h"
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/custom_redirect/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/custom_redirect/Makefile.am b/plugins/experimental/custom_redirect/Makefile.am
index 1b03088..302244f 100644
--- a/plugins/experimental/custom_redirect/Makefile.am
+++ b/plugins/experimental/custom_redirect/Makefile.am
@@ -14,11 +14,9 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-              -I$(top_srcdir)/lib/ts -I$(top_builddir)/lib/ts
+include $(top_srcdir)/build/plugins.mk
 
-pkglibdir = ${pkglibexecdir}
 pkglib_LTLIBRARIES = custom_redirect.la
 custom_redirect_la_SOURCES = custom_redirect.cc
-custom_redirect_la_LDFLAGS = -module -avoid-version -shared
+custom_redirect_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/esi/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/Makefile.am b/plugins/experimental/esi/Makefile.am
index b103dd0..9c796ed 100644
--- a/plugins/experimental/esi/Makefile.am
+++ b/plugins/experimental/esi/Makefile.am
@@ -14,17 +14,14 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-pkglibdir = ${pkglibexecdir}
+include $(top_srcdir)/build/plugins.mk
 
-
-AM_CXXFLAGS = \
+AM_CPPFLAGS += \
   -I$(srcdir)/lib \
   -I$(srcdir)/fetcher \
-  -I$(srcdir)/test \
-  -I$(top_builddir)/proxy/api \
-  -I$(top_srcdir)/proxy/api \
-  -I$(top_builddir)/lib/ts \
-  -I$(top_srcdir)/lib/ts \
+  -I$(srcdir)/test
+
+AM_CXXFLAGS = \
   -Wno-deprecated
 
 pkglib_LTLIBRARIES = esi.la combo_handler.la
@@ -68,21 +65,21 @@ combo_handler_la_SOURCES = \
 	fetcher/HttpDataFetcherImpl.cc
 
 esi_la_LIBADD = libesi.la
-esi_la_LDFLAGS = -module -avoid-version -shared
+esi_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 
 combo_handler_la_LIBADD = libesi.la
 combo_handler_la_LDFLAGS = -module -avoid-version -shared
 
 docnode_test_SOURCES = test/docnode_test.cc test/print_funcs.cc
-docnode_test_LDADD = libesi.la  @LIBDL@ -lz -lpthread
+docnode_test_LDADD = libesi.la  @LIBDL@ -lz @LIBTHREAD@
 parser_test_SOURCES = test/parser_test.cc test/print_funcs.cc
-parser_test_LDADD = libesi.la  @LIBDL@ -lz -lpthread
+parser_test_LDADD = libesi.la  @LIBDL@ -lz @LIBTHREAD@
 processor_test_SOURCES = test/processor_test.cc test/HandlerMap.cc test/StubIncludeHandler.cc test/print_funcs.cc
-processor_test_LDADD = libtest.la  @LIBDL@ -lz -lpthread
+processor_test_LDADD = libtest.la  @LIBDL@ -lz @LIBTHREAD@
 utils_test_SOURCES = test/utils_test.cc test/print_funcs.cc
-utils_test_LDADD = libesi.la  @LIBDL@ -lz -lpthread
+utils_test_LDADD = libesi.la  @LIBDL@ -lz @LIBTHREAD@
 vars_test_SOURCES = test/vars_test.cc test/print_funcs.cc
-vars_test_LDADD = libesi.la @LIBDL@ -lz -lpthread
+vars_test_LDADD = libesi.la @LIBDL@ -lz @LIBTHREAD@
 
 TESTS = $(check_PROGRAMS)
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/esi/esi.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/esi/esi.cc b/plugins/experimental/esi/esi.cc
index ec13b5e..994f5f0 100644
--- a/plugins/experimental/esi/esi.cc
+++ b/plugins/experimental/esi/esi.cc
@@ -20,6 +20,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
  */
+
 #include "ink_defs.h"   
 
 #include <stdio.h>

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/gzip/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/gzip/Makefile.am b/plugins/experimental/gzip/Makefile.am
index f3fec21..3c7861b 100644
--- a/plugins/experimental/gzip/Makefile.am
+++ b/plugins/experimental/gzip/Makefile.am
@@ -14,10 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-    -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
-pkglibdir = ${pkglibexecdir}
+include $(top_srcdir)/build/plugins.mk
 
 pkglib_LTLIBRARIES = gzip.la
 gzip_la_SOURCES = gzip.cc configuration.cc misc.cc
-gzip_la_LDFLAGS = -avoid-version -module -shared
+gzip_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/header_rewrite/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/header_rewrite/Makefile.am b/plugins/experimental/header_rewrite/Makefile.am
index 80d77f0..bef7840 100644
--- a/plugins/experimental/header_rewrite/Makefile.am
+++ b/plugins/experimental/header_rewrite/Makefile.am
@@ -14,18 +14,26 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-pkglibdir = ${pkglibexecdir}
+include $(top_srcdir)/build/plugins.mk
 
 if BUILD_HAVE_BOOST
 
-AM_CPPFLAGS = $(BOOST_CPPFLAGS) \
-	      -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-              -I$(top_srcdir)/lib/ts -I$(top_builddir)/lib/ts
-
-AM_LDFLAGS = $(BOOST_LDFLAGS)
+AM_CPPFLAGS += $(BOOST_CPPFLAGS)
 
 pkglib_LTLIBRARIES = header_rewrite.la
-header_rewrite_la_SOURCES = condition.cc conditions.cc factory.cc header_rewrite.cc matcher.cc operator.cc operators.cc parser.cc regex_helper.cc resources.cc ruleset.cc statement.cc
-header_rewrite_la_LDFLAGS = -module -avoid-version -shared
+header_rewrite_la_SOURCES = \
+  condition.cc \
+  conditions.cc \
+  factory.cc \
+  header_rewrite.cc \
+  matcher.cc \
+  operator.cc \
+  operators.cc \
+  parser.cc \
+  regex_helper.cc \
+  resources.cc \
+  ruleset.cc \
+  statement.cc
+header_rewrite_la_LDFLAGS = $(BOOST_LDFLAGS) $(TS_PLUGIN_LDFLAGS)
 
 endif

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/lua/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/Makefile.am b/plugins/experimental/lua/Makefile.am
index 736e176..0a41390 100644
--- a/plugins/experimental/lua/Makefile.am
+++ b/plugins/experimental/lua/Makefile.am
@@ -14,7 +14,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-pkglibdir = ${pkglibexecdir}
+include $(top_srcdir)/build/plugins.mk
 
 if BUILD_LUA_SUPPORT
 
@@ -23,16 +23,13 @@ if BUILD_LUA_SUPPORT
 # (/opt/local/include) headers, then we need to make sure that we don't end up
 # building with the Lua headers but linking LuaJIT.
 lua_la_CPPFLAGS = \
-  ${LUA_CFLAGS} \
-  -I$(top_builddir)/proxy/api \
-  -I$(top_srcdir)/proxy/api \
-  -I$(top_builddir)/lib/ts \
-  -I$(top_srcdir)/lib/ts
+  $(LUA_CFLAGS) \
+  $(AM_CPPFLAGS)
 
 pkglib_LTLIBRARIES = lua.la
 
-lua_la_LIBADD = ${LUA_LIBS}
+lua_la_LIBADD = $(LUA_LIBS)
 lua_la_SOURCES = remap.cc plugin.cc lapi.cc lutil.cc lconfig.cc hook.cc state.cc
-lua_la_LDFLAGS = -module -avoid-version -shared
+lua_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 
 endif

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/metalink/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/metalink/Makefile.am b/plugins/experimental/metalink/Makefile.am
index 707c25a..490c980 100644
--- a/plugins/experimental/metalink/Makefile.am
+++ b/plugins/experimental/metalink/Makefile.am
@@ -14,11 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-    -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
-
-pkglibdir = ${pkglibexecdir}
+include $(top_srcdir)/build/plugins.mk
 
 pkglib_LTLIBRARIES = metalink.la
 metalink_la_SOURCES = metalink.cc
-metalink_la_LDFLAGS = -avoid-version -module -shared
+metalink_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/rfc5861/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/rfc5861/Makefile.am b/plugins/experimental/rfc5861/Makefile.am
index ad7ab17..d878858 100644
--- a/plugins/experimental/rfc5861/Makefile.am
+++ b/plugins/experimental/rfc5861/Makefile.am
@@ -14,10 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-    -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
+include $(top_srcdir)/build/plugins.mk
 
-pkglibdir = ${pkglibexecdir}
 pkglib_LTLIBRARIES = rfc5861.la
 rfc5861_la_SOURCES = rfc5861.c
-rfc5861_la_LDFLAGS = -module -avoid-version -shared
+rfc5861_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/spdy/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/spdy/Makefile.am b/plugins/experimental/spdy/Makefile.am
index 8fc28f5..298d9f4 100644
--- a/plugins/experimental/spdy/Makefile.am
+++ b/plugins/experimental/spdy/Makefile.am
@@ -14,7 +14,7 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-pkglibdir = ${pkglibexecdir}
+include $(top_srcdir)/build/plugins.mk
 
 if BUILD_HAVE_CXX_11
 
@@ -22,12 +22,8 @@ pkglib_LTLIBRARIES = spdy.la
 lib_LTLIBRARIES = libspdy.la
 check_PROGRAMS = zstream_test
 
-AM_CPPFLAGS = \
-  -I$(srcdir)/lib \
-  -I$(top_builddir)/lib/ts \
-  -I$(top_srcdir)/lib/ts \
-  -I$(top_builddir)/proxy/api \
-  -I$(top_srcdir)/proxy/api
+AM_CPPFLAGS += \
+  -I$(srcdir)/lib
 
 if BUILD_HAVE_LIBCXX
 AM_CXXFLAGS = -stdlib=libc++
@@ -47,7 +43,7 @@ libspdy_la_SOURCES = \
   lib/spdy/zstream.cc
 
 spdy_la_LIBADD = libspdy.la
-spdy_la_LDFLAGS = -module -avoid-version -shared
+spdy_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 
 zstream_test_SOURCES = tests/zstream_test.cc tests/stubs.cc
 zstream_test_LDADD = libspdy.la -lz

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/experimental/tcp_info/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/experimental/tcp_info/Makefile.am b/plugins/experimental/tcp_info/Makefile.am
index d200ad2..7e6e5f1 100644
--- a/plugins/experimental/tcp_info/Makefile.am
+++ b/plugins/experimental/tcp_info/Makefile.am
@@ -14,16 +14,13 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-pkglibdir = ${pkglibexecdir}
-
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-              -I$(top_srcdir)/lib/ts -I$(top_builddir)/lib/ts
+include $(top_srcdir)/build/plugins.mk
 
 if BUILD_TCPINFO_PLUGIN
 
 pkglib_LTLIBRARIES = tcp_info.la
 tcp_info_la_SOURCES = tcp_info.cc
-tcp_info_la_LDFLAGS = -module -avoid-version -shared
+tcp_info_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)
 
 endif
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/header_filter/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/header_filter/Makefile.am b/plugins/header_filter/Makefile.am
index b86777a..fc752bd 100644
--- a/plugins/header_filter/Makefile.am
+++ b/plugins/header_filter/Makefile.am
@@ -14,10 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-              -I$(top_srcdir)/lib/ts -I$(top_builddir)/lib/ts
+include $(top_srcdir)/build/plugins.mk
 
-pkglibdir = ${pkglibexecdir}
 pkglib_LTLIBRARIES = header_filter.la
 header_filter_la_SOURCES = header_filter.cc rules.cc
-header_filter_la_LDFLAGS = -module -avoid-version -shared
+header_filter_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/regex_remap/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/regex_remap/Makefile.am b/plugins/regex_remap/Makefile.am
index 08acecf..5a696cb 100644
--- a/plugins/regex_remap/Makefile.am
+++ b/plugins/regex_remap/Makefile.am
@@ -14,10 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-              -I$(top_srcdir)/lib/ts -I$(top_builddir)/lib/ts
+include $(top_srcdir)/build/plugins.mk
 
-pkglibdir = ${pkglibexecdir}
 pkglib_LTLIBRARIES = regex_remap.la
 regex_remap_la_SOURCES = regex_remap.cc
-regex_remap_la_LDFLAGS = -module -avoid-version -shared
+regex_remap_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/plugins/stats_over_http/Makefile.am
----------------------------------------------------------------------
diff --git a/plugins/stats_over_http/Makefile.am b/plugins/stats_over_http/Makefile.am
index f624567..a9c04d7 100644
--- a/plugins/stats_over_http/Makefile.am
+++ b/plugins/stats_over_http/Makefile.am
@@ -14,10 +14,8 @@
 #  See the License for the specific language governing permissions and
 #  limitations under the License.
 
-AM_CPPFLAGS = -I$(top_builddir)/proxy/api -I$(top_srcdir)/proxy/api \
-    -I$(top_builddir)/lib/ts -I$(top_srcdir)/lib/ts
+include $(top_srcdir)/build/plugins.mk
 
-pkglibdir = ${pkglibexecdir}
 pkglib_LTLIBRARIES = stats_over_http.la
 stats_over_http_la_SOURCES = stats_over_http.c
-stats_over_http_la_LDFLAGS = -module -avoid-version -shared
+stats_over_http_la_LDFLAGS = $(TS_PLUGIN_LDFLAGS)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/proxy/Main.cc
----------------------------------------------------------------------
diff --git a/proxy/Main.cc b/proxy/Main.cc
index 8f64bb5..9d04841 100644
--- a/proxy/Main.cc
+++ b/proxy/Main.cc
@@ -157,10 +157,8 @@ static char error_tags[1024] = "";
 static char action_tags[1024] = "";
 static int show_statistics = 0;
 static int history_info_enabled = 1;
-//inkcoreapi Diags *diags = NULL;
 static inkcoreapi DiagsConfig *diagsConfig = NULL;
 HttpBodyFactory *body_factory = NULL;
-static int diags_init = 0;             // used by process manager
 
 static char vingid_flag[255] = "";
 
@@ -1371,7 +1369,6 @@ main(int argc, char **argv)
   // re-start it again, TS will crash.
   diagsConfig = NEW(new DiagsConfig(error_tags, action_tags, false));
   diags = diagsConfig->diags;
-  diags_init = 1;
   diags->prefix_str = "Server ";
   if (is_debug_tag_set("diags"))
     diags->dump();
@@ -1433,7 +1430,6 @@ main(int argc, char **argv)
   diagsConfig = NEW(new DiagsConfig(error_tags, action_tags, true));
   diags = diagsConfig->diags;
   RecSetDiags(diags);
-  diags_init = 1;
   diags->prefix_str = "Server ";
   if (is_debug_tag_set("diags"))
     diags->dump();

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/proxy/logcat.cc
----------------------------------------------------------------------
diff --git a/proxy/logcat.cc b/proxy/logcat.cc
index 71a02c1..eab1a8d 100644
--- a/proxy/logcat.cc
+++ b/proxy/logcat.cc
@@ -60,7 +60,7 @@ static char output_file[1024];
 extern int CacheClusteringEnabled;
 int auto_clear_cache_flag = 0;
 
-ArgumentDescription argument_descriptions[] = {
+static const ArgumentDescription argument_descriptions[] = {
 
   {"output_file", 'o', "Specify output file", "S1023", &output_file, NULL, NULL},
   {"auto_filenames", 'a', "Automatically generate output names",
@@ -77,7 +77,7 @@ ArgumentDescription argument_descriptions[] = {
   {"elf2", '2', "Convert to Extended2 Logging Format", "T", &elf2_flag, NULL,
    NULL}
 };
-int n_argument_descriptions = SIZE(argument_descriptions);
+static const int n_argument_descriptions = SIZE(argument_descriptions);
 
 static const char *USAGE_LINE = "Usage: " PROGRAM_NAME " [-o output-file | -a] [-CEhS"
 #ifdef DEBUG
@@ -87,7 +87,7 @@ static const char *USAGE_LINE = "Usage: " PROGRAM_NAME " [-o output-file | -a] [
 
 
 
-int
+static int
 process_file(int in_fd, int out_fd)
 {
   char buffer[MAX_LOGBUFFER_SIZE];
@@ -185,7 +185,7 @@ process_file(int in_fd, int out_fd)
   }
 }
 
-int
+static int
 open_output_file(char *output_file)
 {
   int file_desc = 0;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/proxy/logging/LogStandalone.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogStandalone.cc b/proxy/logging/LogStandalone.cc
index ba0f6d2..7bcffea 100644
--- a/proxy/logging/LogStandalone.cc
+++ b/proxy/logging/LogStandalone.cc
@@ -42,9 +42,7 @@
 // Needs LibRecordsConfigInit()
 #include "RecordsConfig.h"
 
-#define LOG_ReadConfigString REC_ReadConfigString
-
-#define HttpBodyFactory		int
+class HttpBodyFactory;
 
 // globals the rest of the system depends on
 extern int fds_limit;
@@ -69,7 +67,7 @@ char action_tags[1024] = "";
 char command_string[512] = "";
 
 
-Diags *diags = NULL;
+//Diags *diags = NULL;
 DiagsConfig *diagsConfig = NULL;
 HttpBodyFactory *body_factory = NULL;
 AppVersionInfo appVersionInfo;
@@ -130,7 +128,7 @@ initialize_process_manager()
 
   pmgmt->reconfigure();
 
-  LOG_ReadConfigString(system_config_directory, "proxy.config.config_dir", PATH_NAME_MAX);
+  REC_ReadConfigString(system_config_directory, "proxy.config.config_dir", PATH_NAME_MAX);
 
   //
   // Define version info records

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1b92b8b3/tools/jtest/jtest.cc
----------------------------------------------------------------------
diff --git a/tools/jtest/jtest.cc b/tools/jtest/jtest.cc
index 19042fc..621ee48 100644
--- a/tools/jtest/jtest.cc
+++ b/tools/jtest/jtest.cc
@@ -45,7 +45,10 @@
 #include <limits.h>
 #include <sys/mman.h>
 
-#define __STDC_FORMAT_MACROS
+#ifndef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS 1
+#endif
+
 #include <inttypes.h>
 
 #include <time.h>


[11/50] git commit: Cast result as int to avoid error about conversion from double to int

Posted by jp...@apache.org.
Cast result as int to avoid error about conversion from double to int


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

Branch: refs/heads/sphinx-docs
Commit: 824fd6411494be06fc8e4c10604b92a9d164015c
Parents: 870fe0e
Author: Daniel Gruno <hu...@apache.org>
Authored: Fri Apr 26 15:35:39 2013 +0200
Committer: Daniel Gruno <hu...@apache.org>
Committed: Fri Apr 26 15:35:39 2013 +0200

----------------------------------------------------------------------
 tools/jtest/jtest.cc |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/824fd641/tools/jtest/jtest.cc
----------------------------------------------------------------------
diff --git a/tools/jtest/jtest.cc b/tools/jtest/jtest.cc
index 621ee48..b589d1a 100644
--- a/tools/jtest/jtest.cc
+++ b/tools/jtest/jtest.cc
@@ -3050,7 +3050,7 @@ static int get_zipf(double v) {
   if (zipf_bucket_size == 1)
     return m;
   double x = zipf_table[m], y = zipf_table[m+1];
-  m += (v - x) / (y - x);
+  m += static_cast<int> ((v - x) / (y - x));
   return m;
 }
 


[44/50] git commit: TS-1838 Improve the compiler handling a bit in configure.ac.

Posted by jp...@apache.org.
TS-1838 Improve the compiler handling a bit in configure.ac.


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

Branch: refs/heads/sphinx-docs
Commit: 2d419fc979fdd476e8ae5d96b0053c20b95fbe9c
Parents: d8c5262
Author: Leif Hedstrom <zw...@apache.org>
Authored: Tue Apr 30 23:11:01 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Tue Apr 30 23:12:59 2013 -0700

----------------------------------------------------------------------
 CHANGES      |    2 ++
 configure.ac |   21 ++++++++++-----------
 2 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d419fc9/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index dd1321b..648df17 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1838] Improve configure.ac to recognize compiler setup better.
+
   *) [TS-1865] Support DESTDIR in tsxs.
 
   *) [TS-1864] Illumos / OmniOS needs -m64 with gcc to compile properly on

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/2d419fc9/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 7f2c313..b4c629a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -551,15 +551,6 @@ fi
 
 AC_LANG_POP()
 
-# Check for ccache (if explicitly enabled)
-if test "x$enable_ccache" = "xyes"; then
-    AC_CHECK_PROG([CCACHE],[ccache],[ccache],[])
-    if test "x${CCACHE}" = "xccache"; then
-	CC="$CCACHE $CC"
-	CXX="$CCACHE $CXX"
-    fi
-fi
-
 dnl AC_PROG_SED is only available from version 2.6 (released in 2003). CentosOS
 dnl 5.9 still has an ancient version, but we have macros that require
 dnl AC_PROG_SED. The actual AC_PROG_SED macro does functional checks, but here
@@ -719,7 +710,7 @@ AS_IF([test "x${has_optimizer_flags}" = "xno"],
 AM_CONDITIONAL([BUILD_HAVE_LIBCXX], [ false ])
 
 base_cc=`basename $CC`
-# These are shortcuts used in combination for the compiler options below
+
 case $host_os_def in
   linux)
     case $base_cc in
@@ -767,7 +758,7 @@ case $host_os_def in
   darwin)
     case $base_cc in
     *clang*)
-      common_opt="-pipe -Wall -Werror -Wno-deprecated-declarations"
+      common_opt="-pipe -Wall -Werror -Wno-deprecated-declarations -Qunused-arguments"
       debug_opt="$common_opt"
       release_opt="-g $common_opt $optimizing_flags -fno-strict-aliasing"
       cxx_opt="-Wno-invalid-offsetof"
@@ -960,6 +951,14 @@ AC_ARG_WITH([cpp11api],
 AC_MSG_RESULT([$cpp11api])
 AM_CONDITIONAL([BUILD_CPP11API], [test "$cpp11api" = yes])
 
+# Check for ccache (if explicitly enabled)
+if test "x$enable_ccache" = "xyes"; then
+    AC_CHECK_PROG([CCACHE],[ccache],[ccache],[])
+    if test "x${CCACHE}" = "xccache"; then
+	CC="$CCACHE $CC"
+	CXX="$CCACHE $CXX"
+    fi
+fi
 
 # -----------------------------------------------------------------------------
 # 4. CHECK FOR LIBRARIES


[41/50] git commit: TS-1865: support DESTDIR in tsxs

Posted by jp...@apache.org.
TS-1865: support DESTDIR in tsxs


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

Branch: refs/heads/sphinx-docs
Commit: 23279f097ef0de928999408b832b1371312eafb4
Parents: 8a6a248
Author: James Peach <jp...@apache.org>
Authored: Mon Apr 29 15:28:52 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Mon Apr 29 15:28:52 2013 -0700

----------------------------------------------------------------------
 CHANGES       |    2 ++
 tools/tsxs.in |    4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/23279f09/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index b17ba48..dd1321b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@
   Changes with Apache Traffic Server 3.3.3
 
 
+  *) [TS-1865] Support DESTDIR in tsxs.
+
   *) [TS-1864] Illumos / OmniOS needs -m64 with gcc to compile properly on
    64-bit platforms. We also only support ATS on 64-bit Illumos.
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/23279f09/tools/tsxs.in
----------------------------------------------------------------------
diff --git a/tools/tsxs.in b/tools/tsxs.in
index c8fa01a..056c88f 100755
--- a/tools/tsxs.in
+++ b/tools/tsxs.in
@@ -191,8 +191,8 @@ if [ -n "$OBJ" ]; then
 	if [ -r "$OBJ" ]; then
 		if [ "$INSTALL" = "1" ]; then
 			echo "  installing $OBJ -> $INSTALLDIR/$OBJ"
-			cp $OBJ $INSTALLDIR/$OBJ
-			chmod 0755 $INSTALLDIR/$OBJ
+			cp $OBJ ${DESTDIR}${INSTALLDIR}/${OBJ}
+			chmod 0755 ${DESTDIR}${INSTALLDIR}/${OBJ}
 		fi
 	else
 		echo "No $OBJ"


[27/50] git commit: TS-1820 Fix a build problem on Solaris.

Posted by jp...@apache.org.
TS-1820 Fix a build problem on Solaris.


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

Branch: refs/heads/sphinx-docs
Commit: 714a28f580ffbd4e4e556427c283bf36220315c1
Parents: 011e6ce
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sat Apr 27 22:27:39 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sat Apr 27 22:27:39 2013 -0600

----------------------------------------------------------------------
 iocore/net/Connection.cc |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/714a28f5/iocore/net/Connection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/Connection.cc b/iocore/net/Connection.cc
index 15ad2af..74f1def 100644
--- a/iocore/net/Connection.cc
+++ b/iocore/net/Connection.cc
@@ -135,7 +135,8 @@ Connection::close()
 }
 
 static int
-add_http_filter(int /* fd ATS_UNUSED */) {
+add_http_filter(int fd ATS_UNUSED)
+{
   int err = -1;
 #if defined(SOL_FILTER) && defined(FIL_ATTACH)
   err = setsockopt(fd, SOL_FILTER, FIL_ATTACH, "httpfilt", 9);


[37/50] git commit: TS-1861 Build fails with reclaimable freelist enabled

Posted by jp...@apache.org.
TS-1861 Build fails with reclaimable freelist enabled


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

Branch: refs/heads/sphinx-docs
Commit: 54e9a1efae3e8a3bbd82ef7331cd90c31d309ef5
Parents: f7ed0f6
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Apr 29 09:05:14 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Apr 29 09:05:45 2013 -0600

----------------------------------------------------------------------
 CHANGES                 |    5 ++++-
 lib/ts/ink_queue_ext.cc |   21 ++++++---------------
 2 files changed, 10 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/54e9a1ef/CHANGES
----------------------------------------------------------------------
diff --git a/CHANGES b/CHANGES
index 9959ec1..dbb5fd0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,8 +1,11 @@
                                                          -*- coding: utf-8 -*-
   Changes with Apache Traffic Server 3.3.3
 
+
   *) [TS-1858] Fix redefinition of timersub on Solaris
-  
+
+  *) [TS-1861] Build fails with reclaimable freelist enabled.
+
   *) [TS-1860] cacheurl doesn't compile on platforms with pcre/pcre.h
    (e.g. solaris).
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/54e9a1ef/lib/ts/ink_queue_ext.cc
----------------------------------------------------------------------
diff --git a/lib/ts/ink_queue_ext.cc b/lib/ts/ink_queue_ext.cc
index a89bdd9..7ceaa1c 100644
--- a/lib/ts/ink_queue_ext.cc
+++ b/lib/ts/ink_queue_ext.cc
@@ -40,6 +40,7 @@
 #include "ink_error.h"
 #include "ink_assert.h"
 #include "ink_resource.h"
+#include "ink_stack_trace.h"
 #include "ink_queue_ext.h"
 
 #if TS_USE_RECLAIMABLE_FREELIST
@@ -74,34 +75,24 @@ static inline pthread_t thread_id(void)
 
   return tid?tid:(tid = pthread_self());
 }
-#define THREAD_ID thread_id()
 #define MAX_CHUNK_BYTE_SIZE (page_size << 8)
 
 /*
  * For debug
  */
-#if 1
 #define show_info(tag, f, pCache) \
   __show_info(stdout, __FILE__, __LINE__, tag, f, pCache)
-#else
-#define show_info(tag, f, pCache) \
-  __silent(__FILE__, __LINE__, tag, f, pCache)
-#endif
 #define error_info(tag, f, pCache) \
   __show_info(stderr, __FILE__, __LINE__, tag, f, pCache)
 
 static inline void
-__silent(const char *file, int line,
-         const char *tag, InkFreeList *f, InkThreadCache *pCache) {}
-
-static inline void
 __show_info(FILE *fp, const char *file, int line,
             const char *tag, InkFreeList *f, InkThreadCache *pCache)
 {
 
   fprintf(fp, "[%lx:%02u][%s:%05d][%s] %6.2fM t:%-8uf:%-4u m:%-4u avg:%-6.1f"
           " M:%-4u csbase:%-4u csize:%-4u tsize:%-6u cbsize:%u\n",
-         (long)THREAD_ID, f->thread_cache_idx, file, line, tag,
+         (long)thread_id(), f->thread_cache_idx, file, line, tag,
          ((double)total_mem_in_byte/1024/1024),
          pCache->nr_total,
          pCache->nr_free,
@@ -243,7 +234,7 @@ ink_chunk_create(InkFreeList *f, InkThreadCache *pCache)
   type_size = f->type_size;
   chunk_size = f->chunk_size;
 
-  pChunk->tid = THREAD_ID;
+  pChunk->tid = thread_id();
   pChunk->head = chunk_addr;
   pChunk->type_size = type_size;
   pChunk->chunk_size = chunk_size;
@@ -280,7 +271,7 @@ ink_chunk_delete(InkFreeList *f, InkThreadCache *pCache, InkChunkInfo *pChunk)
   pCache->nr_free_chunks--;
 
   if (unlikely(munmap(chunk_addr, f->chunk_byte_size))) {
-    ink_stack_trace_dump()();
+    ink_stack_trace_dump();
     ink_fatal(1, "Failed to munmap %u bytes, %s", f->chunk_byte_size, strerror(errno));
   }
 
@@ -423,7 +414,7 @@ refresh_average_info(InkThreadCache *pCache)
 }
 
 static inline bool
-need_to_reclaim(InkFreeList *f, InkThreadCache *pCache, pthread_t tid)
+need_to_reclaim(InkFreeList *f, InkThreadCache *pCache)
 {
   if (!cfg_enable_reclaim)
     return false;
@@ -568,7 +559,7 @@ reclaimable_freelist_new(InkFreeList *f)
     if ((pNextCache = ThreadCaches[i]) == NULL)
       continue;
 
-    if (need_to_reclaim(pNextCache->f, pNextCache, THREAD_ID)) {
+    if (need_to_reclaim(pNextCache->f, pNextCache)) {
       if (cfg_debug_filter & 0x1)
         show_info("F", pNextCache->f, pNextCache);
 


[33/50] git commit: TS-1732 Do an ugly const_cast to work around an anomaly on Solaris. On linux, this cast is a "no-op", since the struct option is sane and the compile with convert it back to a const char*. Always doing the const_cast avoids #ifdef's t

Posted by jp...@apache.org.
TS-1732 Do an ugly const_cast to work around an anomaly on Solaris.
On linux, this cast is a "no-op", since the struct option is sane
and the compile with convert it back to a const char*. Always doing
the const_cast avoids #ifdef's to maintain.


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

Branch: refs/heads/sphinx-docs
Commit: 854c6c18b524c749b437d18009e2b13c78cbc5ce
Parents: 8ba444a
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sun Apr 28 13:49:31 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sun Apr 28 13:49:31 2013 -0600

----------------------------------------------------------------------
 plugins/experimental/authproxy/authproxy.cc |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/854c6c18/plugins/experimental/authproxy/authproxy.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/authproxy/authproxy.cc b/plugins/experimental/authproxy/authproxy.cc
index 4254879..b46d3d6 100644
--- a/plugins/experimental/authproxy/authproxy.cc
+++ b/plugins/experimental/authproxy/authproxy.cc
@@ -706,12 +706,15 @@ AuthProxyGlobalHook(TSCont /* cont ATS_UNUSED */, TSEvent event, void * edata)
 static AuthOptions *
 AuthParseOptions(int argc, const char ** argv)
 {
+  // The const_cast<> here is magic to work around a flaw in the definition of struct option
+  // on some platforms (e.g. Solaris / Illumos). On sane platforms (e.g. linux), it'll get
+  // automatically casted back to the const char*, as the struct is defined in <getopt.h>.
     static const struct option longopt[] =
     {
-        { "auth-host", required_argument, 0, 'h' },
-        { "auth-port", required_argument, 0, 'p' },
-        { "auth-transform", required_argument, 0, 't' },
-        { "force-cacheability", no_argument, 0, 'c' },
+        { const_cast<char *>("auth-host"), required_argument, 0, 'h' },
+        { const_cast<char *>("auth-port"), required_argument, 0, 'p' },
+        { const_cast<char *>("auth-transform"), required_argument, 0, 't' },
+        { const_cast<char *>("force-cacheability"), no_argument, 0, 'c' },
         {0, 0, 0, 0 }
     };
 
@@ -760,6 +763,7 @@ AuthParseOptions(int argc, const char ** argv)
 
     return options;
 }
+#undef LONGOPT_OPTION_CAST
 
 void
 TSPluginInit(int argc, const char *argv[])


[20/50] git commit: Remove unused typedef to make Lua compile

Posted by jp...@apache.org.
Remove unused typedef to make Lua compile


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

Branch: refs/heads/sphinx-docs
Commit: a58b8ec57898cff3839b76990e7eca92e75074cf
Parents: f7917f8
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sat Apr 27 09:59:34 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sat Apr 27 09:59:37 2013 -0600

----------------------------------------------------------------------
 plugins/experimental/lua/hook.cc |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a58b8ec5/plugins/experimental/lua/hook.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/hook.cc b/plugins/experimental/lua/hook.cc
index e4a4e4e..4572910 100644
--- a/plugins/experimental/lua/hook.cc
+++ b/plugins/experimental/lua/hook.cc
@@ -125,8 +125,6 @@ struct inline_tuple
 
   static void * allocate(const first_type first, const second_type second) {
 #if defined(INLINE_LUA_HOOK_REFERENCE)
-    typedef char __size_check[sizeof(this_type) == sizeof(void *) ? 0 : -1];
-
     this_type obj;
     obj.first() = first;
     obj.second() = second;


[43/50] git commit: TS-1864 Rearrange some of the autoconf code, order matters

Posted by jp...@apache.org.
TS-1864 Rearrange some of the autoconf code, order matters


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

Branch: refs/heads/sphinx-docs
Commit: d8c5262331e0654097640982100f43731e7e8f6d
Parents: 54b532b
Author: Leif Hedstrom <zw...@apache.org>
Authored: Mon Apr 29 17:00:51 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Mon Apr 29 22:07:27 2013 -0600

----------------------------------------------------------------------
 configure.ac |  178 ++++++++++++++++++++++++++---------------------------
 1 files changed, 87 insertions(+), 91 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d8c52623/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index e45d67c..7f2c313 100644
--- a/configure.ac
+++ b/configure.ac
@@ -529,6 +529,9 @@ _ts_saved_CXXFLAGS="${CXXFLAGS}"
 
 AC_PROG_CC
 AC_PROG_CXX
+AC_PROG_CPP
+AC_PROG_CXXCPP
+AM_PROG_AS
 
 CFLAGS="${_ts_saved_CFLAGS}"
 CXXFLAGS="${_ts_saved_CXXFLAGS}"
@@ -568,14 +571,57 @@ ifdef([AC_PROG_SED], [], [
   ])
 ])
 
+
+# Various OS specific setup. Note that on Solaris, 32-bit is always the
+# default, even on a box that with 64-bit architecture.
+# This also sets up a "normalized" variable and define $host_os_def.
+defer_accept=1
+case $host_os in
+  linux*)
+    host_os_def="linux"
+    defer_accept=45
+    EXTRA_CXX_LDFLAGS="-rdynamic"
+    ;;
+  darwin*)
+    host_os_def="darwin"
+    ;;
+  freebsd*)
+    host_os_def="freebsd"
+    EXTRA_CXX_LDFLAGS="-rdynamic"
+    TS_ADDTO(CPPFLAGS, [-I/usr/local/include])
+    ;;
+  kfreebsd*)
+    host_os_def="freebsd"
+    EXTRA_CXX_LDFLAGS="-rdynamic"
+    TS_ADDTO(CPPFLAGS, [-I/usr/local/include])
+    TS_ADDTO(CPPFLAGS, [-Dkfreebsd])
+    ;;
+  openbsd*)
+    host_os_def="openbsd"
+    ;;
+  solaris*)
+    host_os_def="solaris"
+    case "`isalist`" in
+      *amd64*)
+        TS_ADDTO(CFLAGS, -m64)
+        TS_ADDTO(CXXFLAGS, -m64)
+        ;;
+    esac
+    ;;
+  *)
+    EXTRA_CXX_LDFLAGS="-rdynamic"
+    host_os_def=unknown
+    ;;
+esac
+
+TS_ADDTO(CPPFLAGS, [-D$host_os_def])
+AC_SUBST(defer_accept)
+
+
 dnl AM_PROG_AR is not always available, but it doesn't seem to be needed in older versions.
 ifdef([AM_PROG_AR],
       [AM_PROG_AR])
 
-
-AC_PROG_CPP
-AC_PROG_CXXCPP
-AM_PROG_AS
 AC_PROG_AWK
 AC_PROG_SED
 AC_PROG_LN_S
@@ -674,10 +720,10 @@ AM_CONDITIONAL([BUILD_HAVE_LIBCXX], [ false ])
 
 base_cc=`basename $CC`
 # These are shortcuts used in combination for the compiler options below
-case $host_os in
-  linux*)
+case $host_os_def in
+  linux)
     case $base_cc in
-    icc)
+    *icc*)
       # -Wall goes crazy, so turned these specific checks off for now:
       #
       #  111 is "statement is unrecahable"
@@ -700,7 +746,7 @@ case $host_os in
       release_opt="-g $common_opt $optimization_flags -axsse4.2 -fno-strict-aliasing"
       cxx_opt="-Wno-invalid-offsetof"
       ;;
-    clang)
+    *clang*)
       debug_opt="-ggdb3 $common_opt -Werror -Qunused-arguments"
       release_opt="-g $common_opt $optimizing_flags -fno-strict-aliasing -Werror -Qunused-arguments"
       cxx_opt="-Wno-invalid-offsetof -Werror -Qunused-arguments"
@@ -717,10 +763,10 @@ case $host_os in
       flex_cflags="-Wno-unused-parameter"
       ;;
     esac
-    ;; # linux*)
-  darwin*)
+    ;; # linux)
+  darwin)
     case $base_cc in
-    clang)
+    *clang*)
       common_opt="-pipe -Wall -Werror -Wno-deprecated-declarations"
       debug_opt="$common_opt"
       release_opt="-g $common_opt $optimizing_flags -fno-strict-aliasing"
@@ -738,10 +784,10 @@ case $host_os in
     # ToDo: This seems semi-kludgy, but useful for MacPort's I think.
     TS_ADDTO(CPPFLAGS, [-I/opt/local/include])
     TS_ADDTO(LDFLAGS, [-L/opt/local/lib])
-    ;; # darwin*)
-  freebsd*|kfreebsd*)
+    ;; # darwin)
+  freebsd|kfreebsd)
     case $base_cc in
-    clang)
+    *clang*)
       common_opt="-pipe -Wall -Werror -Qunused-arguments"
       debug_opt="-ggdb3 $common_opt"
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"
@@ -755,10 +801,11 @@ case $host_os in
       ;;
     esac
     TS_ADDTO(LDFLAGS, [-L/usr/local/lib])
-    ;;
-  solaris*)
+    ;; # freebsd|kfreebsd)
+  solaris)
     if test "x${base_cc}" = "xcc"; then
-      common_opt="-mt -m64 -D__WORDSIZE=64" # FIXME: arch should be detected
+      # TODO: If we no longer support SunStudio, should this code go away?
+      common_opt="-mt -D__WORDSIZE=64" # FIXME: arch should be detected
       debug_opt="-g $common_opt"
       release_opt="-g $common_opt $optimizing_flags"
       cxx_opt="-library=stlport4"
@@ -771,11 +818,11 @@ case $host_os in
         postdeps_CXX="-library=Crun"
       fi
     else # gcc
-      common_opt="-pipe -Wall -Werror -m64"
+      common_opt="-pipe -Wall -Werror"
       debug_opt="-ggdb3 $common_opt"
       release_opt="-g $common_opt $optimizing_flags -feliminate-unused-debug-symbols -fno-strict-aliasing"
       cxx_opt="-Wno-invalid-offsetof"
-    fi
+    fi # solaris)
     ;;
   *)
     common_opt="-pipe -Wall -Werror"
@@ -802,26 +849,27 @@ SHARED_LDFLAGS=-shared
 SHARED_CXXFLAGS=-fPIC
 SHARED_CXXLINKFLAGS=-shared
 
-dnl Checks for pointer size
-AC_CHECK_SIZEOF(void*, 4)
+#
+# _Here_ is where we go ahead and add the _optimizations_ to already
+#  existing CFLAGS/CXXFLAGS if some special values had been set.
+#
+if test "x${enable_debug}" = "xyes"; then
+  TS_ADDTO(CFLAGS, [${cc_oflag_dbg}])
+  TS_ADDTO(CXXFLAGS, [${cxx_oflag_dbg}])
+  TS_ADDTO(CPPFLAGS, [-DDEBUG -D_DEBUG])
+else
+  TS_ADDTO(CFLAGS, [${cc_oflag_opt}])
+  TS_ADDTO(CXXFLAGS, [${cxx_oflag_opt}])
+fi
+
+# Checks for pointer size
+AC_CHECK_SIZEOF([void*])
 if test "x$ac_cv_sizeof_voidp" == "x"; then
   AC_ERROR([Cannot determine size of void*])
 fi
 AC_SUBST(ac_cv_sizeof_voidp)
 
 
-# Checks for TCP defer accept
-case $host_os in
-  linux*)
-    defer_accept=45
-    ;;
-  *)
-    defer_accept=1
-    ;;
-esac
-AC_SUBST(defer_accept)
-
-
 #
 # Here are all the extra linux-specific C(XX)FLAGS additions and
 # so forth.
@@ -890,52 +938,10 @@ fi
 TS_ADDTO(CPPFLAGS, [-D_GNU_SOURCE])
 TS_ADDTO(CPPFLAGS, [-D_REENTRANT])
 
-case $host_os in
-  linux*)
-    EXTRA_CXX_LDFLAGS="-rdynamic"
-    host_os_def=linux
-    ;;
-  darwin*)
-    host_os_def=darwin
-    ;;
-  freebsd*)
-    EXTRA_CXX_LDFLAGS="-rdynamic"
-    host_os_def=freebsd
-    ;;
-  kfreebsd*)
-    EXTRA_CXX_LDFLAGS="-rdynamic"
-    host_os_def=freebsd
-    TS_ADDTO(CPPFLAGS, [-Dkfreebsd])
-    ;;
-  solaris*)
-    host_os_def=solaris
-    ;;
-  openbsd*)
-    host_os_def=openbsd
-    ;;
-  *)
-    EXTRA_CXX_LDFLAGS="-rdynamic"
-    host_os_def=unknown
-   ;;
-esac
-TS_ADDTO(CPPFLAGS, [-D$host_os_def])
 
 AC_MSG_NOTICE([Build for host OS: $host_os, arch: $host_cpu, optimization: $host_os_def])
 
 #
-# _Here_ is where we go ahead and add the _optimizations_ to already
-#  existing CFLAGS/CXXFLAGS if some special values had been set.
-#
-if test "x${enable_debug}" = "xyes"; then
-  TS_ADDTO(CFLAGS, [${cc_oflag_dbg}])
-  TS_ADDTO(CXXFLAGS, [${cxx_oflag_dbg}])
-  TS_ADDTO(CPPFLAGS, [-DDEBUG -D_DEBUG])
-else
-  TS_ADDTO(CFLAGS, [${cc_oflag_opt}])
-  TS_ADDTO(CXXFLAGS, [${cxx_oflag_opt}])
-fi
-
-#
 # Note:  These are site-specific macro's that do various tests
 #         on the selected compilers.  There was some tunning
 #         associated with our not wanting to use GNU for _everything_.
@@ -1023,20 +1029,11 @@ SC_PATH_TCLCONFIG
 SC_LOAD_TCLCONFIG
 
 # expect tclConfig.sh to populate TCL_LIB_FLAG and TCL_INCLUDE_SPEC
-case $host_os in
-  darwin*)
+if test "$host_os_def" == "darwin"; then
     TCL_LIB_SPEC="-ltcl" # OSX fails to populate this variable
-    ;;
-  *)
-   ;;
-esac
+fi
 AC_SUBST([LIBTCL],[$TCL_LIB_SPEC])
 
-case $host_os in
-  freebsd*|kfreebsd*)
-    TS_ADDTO(CPPFLAGS, [-I/usr/local/include])
-    ;;
-esac
 
 if test "x${TCL_INCLUDE_SPEC}" != "x-I/usr/include"; then
    TS_ADDTO(CPPFLAGS, [$TCL_INCLUDE_SPEC])
@@ -1213,10 +1210,9 @@ AS_IF([test "x$enable_posix_cap" != "xno"],
 AC_SUBST(use_posix_cap)
 
 AS_IF([test "x$enable_linux_native_aio" = "xyes"], [
-  case $host_os in
-    linux*) ;;
-    *) AC_MSG_ERROR([Linux native AIO can only be enabled on Linux systems])
-  esac
+  if test $host_os_def  != "linux"; then
+    AC_MSG_ERROR([Linux native AIO can only be enabled on Linux systems])
+  fi
 
   AC_CHECK_HEADERS([libaio.h], [],
     [AC_MSG_ERROR([Linux native AIO requires libaio.h])]
@@ -1310,7 +1306,7 @@ AC_MSG_RESULT([$enable_lua_support])
 # On Darwin LuaJIT requires magic link options, otherwise it will crash in luaL_openlibs() at startup. See
 # http://luajit.org/install.html.
 case $host_os in
-  darwin*)
+  darwin)
     if test "x${have_luajit}" = "xyes"; then
       LUA_LUAJIT_LDFLAGS="-Wl,-pagezero_size,10000 -Wl,-image_base,100000000"
     fi


[24/50] git commit: Revert "Remove unused typedef to make Lua compile"

Posted by jp...@apache.org.
Revert "Remove unused typedef to make Lua compile"

This reverts commit a58b8ec57898cff3839b76990e7eca92e75074cf.


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

Branch: refs/heads/sphinx-docs
Commit: 8e12350728b1070afff046cc6745cceddf5d7ec0
Parents: 880bca9
Author: Leif Hedstrom <zw...@apache.org>
Authored: Sat Apr 27 19:11:05 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Sat Apr 27 19:11:05 2013 -0600

----------------------------------------------------------------------
 plugins/experimental/lua/hook.cc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8e123507/plugins/experimental/lua/hook.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/lua/hook.cc b/plugins/experimental/lua/hook.cc
index 4572910..e4a4e4e 100644
--- a/plugins/experimental/lua/hook.cc
+++ b/plugins/experimental/lua/hook.cc
@@ -125,6 +125,8 @@ struct inline_tuple
 
   static void * allocate(const first_type first, const second_type second) {
 #if defined(INLINE_LUA_HOOK_REFERENCE)
+    typedef char __size_check[sizeof(this_type) == sizeof(void *) ? 0 : -1];
+
     this_type obj;
     obj.first() = first;
     obj.second() = second;


[22/50] git commit: RedHat-derived systems need gcc-c++

Posted by jp...@apache.org.
RedHat-derived systems need gcc-c++


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

Branch: refs/heads/sphinx-docs
Commit: 8e60b9d6bec5fef4645a37704f4da09d558dafbb
Parents: 0dc121c
Author: James Peach <jp...@apache.org>
Authored: Sat Apr 27 16:10:33 2013 -0700
Committer: James Peach <jp...@apache.org>
Committed: Sat Apr 27 16:10:33 2013 -0700

----------------------------------------------------------------------
 contrib/manifests/redhat.pp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8e60b9d6/contrib/manifests/redhat.pp
----------------------------------------------------------------------
diff --git a/contrib/manifests/redhat.pp b/contrib/manifests/redhat.pp
index 6bb1f28..739c38f 100644
--- a/contrib/manifests/redhat.pp
+++ b/contrib/manifests/redhat.pp
@@ -16,7 +16,7 @@
 
 # Base ATS build dependencies.
 package {[
-    'gcc', 'automake', 'autoconf', 'libtool', 'pkgconfig',
+    'gcc', 'gcc-c++', 'automake', 'autoconf', 'libtool', 'pkgconfig',
     'openssl-devel', 'tcl-devel', 'expat-devel', 'pcre-devel',
     'ncurses-devel', 'libcurl-devel', 'libaio-devel',
     'hwloc-devel', 'libcap-devel', 'bison', 'flex', 'make',


[18/50] git commit: Fix for CentOS autotools problem.

Posted by jp...@apache.org.
Fix for CentOS autotools problem.


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

Branch: refs/heads/sphinx-docs
Commit: 254daf196f9c182ff6e4dd3a53eb8ab0b31fefe5
Parents: dba01eb
Author: Alan M. Carroll <am...@network-geographics.com>
Authored: Fri Apr 26 22:25:00 2013 -0700
Committer: Alan M. Carroll <am...@network-geographics.com>
Committed: Fri Apr 26 22:26:12 2013 -0700

----------------------------------------------------------------------
 configure.ac |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/254daf19/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 5789276..6e7549a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -423,26 +423,6 @@ AC_ARG_ENABLE([linux-native-aio],
   [enable_linux_native_aio=no]
 )
 
-AS_IF([test "x$enable_linux_native_aio" = "xyes"], [
-  case $host_os in
-    linux*) ;;
-    *) AC_MSG_ERROR([Linux native AIO can only be enabled on Linux systems])
-  esac
-
-  AC_CHECK_HEADERS([libaio.h], [],
-    [AC_MSG_ERROR([Linux native AIO requires libaio.h])]
-  )
-
-  AC_SEARCH_LIBS([io_submit], [aio], [],
-    [AC_MSG_ERROR([Linux native AIO requires libaio])]
-  )
-
-])
-
-AC_MSG_RESULT([$enable_linux_native_aio])
-TS_ARG_ENABLE_VAR([use], [linux_native_aio])
-AC_SUBST(use_linux_native_aio)
-
 # Configure how many stats to allocate for plugins. Default is 512.
 #
 AC_ARG_WITH([max-api-stats],
@@ -1232,6 +1212,26 @@ AS_IF([test "x$enable_posix_cap" != "xno"],
 )
 AC_SUBST(use_posix_cap)
 
+AS_IF([test "x$enable_linux_native_aio" = "xyes"], [
+  case $host_os in
+    linux*) ;;
+    *) AC_MSG_ERROR([Linux native AIO can only be enabled on Linux systems])
+  esac
+
+  AC_CHECK_HEADERS([libaio.h], [],
+    [AC_MSG_ERROR([Linux native AIO requires libaio.h])]
+  )
+
+  AC_SEARCH_LIBS([io_submit], [aio], [],
+    [AC_MSG_ERROR([Linux native AIO requires libaio])]
+  )
+
+])
+
+AC_MSG_RESULT([$enable_linux_native_aio])
+TS_ARG_ENABLE_VAR([use], [linux_native_aio])
+AC_SUBST(use_linux_native_aio)
+
 # Check for hwloc library.
 # If we don't find it, disable checking for header.
 use_hwloc=0


[06/50] git commit: TS-1820 Make it compile on FC19/20.

Posted by jp...@apache.org.
TS-1820 Make it compile on FC19/20.


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

Branch: refs/heads/sphinx-docs
Commit: b3e3f0e06e842136d6dc29e602769f9d68dc1aea
Parents: 16df6a2
Author: Leif Hedstrom <zw...@apache.org>
Authored: Thu Apr 25 13:46:00 2013 -0600
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Thu Apr 25 13:46:00 2013 -0600

----------------------------------------------------------------------
 lib/ts/ink_defs.h |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b3e3f0e0/lib/ts/ink_defs.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_defs.h b/lib/ts/ink_defs.h
index 4f5439b..5df5dcc 100644
--- a/lib/ts/ink_defs.h
+++ b/lib/ts/ink_defs.h
@@ -29,14 +29,18 @@
 #include <stddef.h>
 
 #ifdef HAVE_STDINT_H
-#define __STDC_LIMIT_MACROS 1
+# ifndef __STDC_LIMIT_MACROS
+#  define __STDC_LIMIT_MACROS 1
+# endif
 # include <stdint.h>
 #else
 // TODO: Add "standard" int types?
 #endif
 
 #ifdef HAVE_INTTYPES_H
-# define __STDC_FORMAT_MACROS 1
+# ifndef __STDC_FORMAT_MACROS
+#  define __STDC_FORMAT_MACROS 1
+# endif
 # include <inttypes.h>
 #else
 // TODO: add PRI*64 stuff?