trafficserver git commit: Update the missing releases

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/master e393e68cc -> 4f98ae2b5


Update the missing releases


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

Branch: refs/heads/master
Commit: 4f98ae2b510044b9fe270af066f57421cf9e1a62
Parents: e393e68
Author: Leif Hedstrom 
Authored: Tue Jan 12 22:27:31 2016 -0800
Committer: Leif Hedstrom 
Committed: Tue Jan 12 22:27:31 2016 -0800

--
 STATUS | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/4f98ae2b/STATUS
--
diff --git a/STATUS b/STATUS
index 6a55e89..b8b8141 100644
--- a/STATUS
+++ b/STATUS
@@ -8,6 +8,11 @@ The current version of this file can be found at:
 
 Release history:
 
+6.1.0   : Released on Jan 18th, 2016
+6.0.0   : Released on Sep 21th, 2015
+
+5.3.2   : Released on Sep 13th, 2015
+5.3.1   : Released on Jul 4th, 2015
 5.3.0   : Released on May 13th, 2015
 5.2.1   : Released on Mar 30th, 2015
 5.2.0   : Released on Jan 8th, 2015



trafficserver git commit: Update the missing releases

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x b94f35d86 -> bb5601598


Update the missing releases

(cherry picked from commit 4f98ae2b510044b9fe270af066f57421cf9e1a62)


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

Branch: refs/heads/6.1.x
Commit: bb5601598067bc4d58f9812fb83ce63cb1338527
Parents: b94f35d
Author: Leif Hedstrom 
Authored: Tue Jan 12 22:27:31 2016 -0800
Committer: Leif Hedstrom 
Committed: Tue Jan 12 22:27:45 2016 -0800

--
 STATUS | 5 +
 1 file changed, 5 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb560159/STATUS
--
diff --git a/STATUS b/STATUS
index 6a55e89..b8b8141 100644
--- a/STATUS
+++ b/STATUS
@@ -8,6 +8,11 @@ The current version of this file can be found at:
 
 Release history:
 
+6.1.0   : Released on Jan 18th, 2016
+6.0.0   : Released on Sep 21th, 2015
+
+5.3.2   : Released on Sep 13th, 2015
+5.3.1   : Released on Jul 4th, 2015
 5.3.0   : Released on May 13th, 2015
 5.2.1   : Released on Mar 30th, 2015
 5.2.0   : Released on Jan 8th, 2015



trafficserver git commit: Updated CHANGES after Jira cleanup

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x abeb61b36 -> b94f35d86


Updated CHANGES after Jira cleanup


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

Branch: refs/heads/6.1.x
Commit: b94f35d867da54f08d6fe18ce8e6323f5ab01a07
Parents: abeb61b
Author: Leif Hedstrom 
Authored: Tue Jan 12 22:16:38 2016 -0800
Committer: Leif Hedstrom 
Committed: Tue Jan 12 22:16:38 2016 -0800

--
 CHANGES | 55 +++
 1 file changed, 23 insertions(+), 32 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b94f35d8/CHANGES
--
diff --git a/CHANGES b/CHANGES
index 973b9b6..5370784 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,19 +1,15 @@
 Changes with Apache Traffic Server 6.1.0
 
 Bug:
-  *) [TS-2118] memcached plugin is in the source tree but does not build
   *) [TS-3234] "crc" field shows "TCP_REFRESH_HIT" though ATS dosen't cache
-  *) [TS-3363] core dump in HttpSM::handle_server_setup_error when handling 
inactivity timer expiry
   *) [TS-3490] mysql_remap Plugin compile fails on Mac OS X 10.10
   *) [TS-3710] Crash in TLS with 6.0.0, related to the session cleanup 
additions
   *) [TS-3740] header_rewrite plugin: set-redirect doesn't work with 
SEND_RESPONSE_HDR_HOOK
   *) [TS-3777] TSHttpConnect and POST request does not fire 
TS_VCONN_READ_COMPLETE nor TS_VCONN_EOS
   *) [TS-3792] Pointing proxy.config.dns.resolv_conf at an empty (or 
nonexistant) file causes segmentation faults on first DNS q...
   *) [TS-3797] Crashes due to cross-thread race conditions
-  *) [TS-3809] Corrupt debug log messages LogFormat::parse_format_string
   *) [TS-3813] Correct responses when half-closed stream receive frames
   *) [TS-3815] traffic_ctl should filter record searches
-  *) [TS-3821] Segmentation fault possibly due leaks in atscppapi
   *) [TS-3841] LogAccess.cc assert failed when enabling custom log and 
stats_over_http plugin
   *) [TS-3847] Rejects Dynamic Table Size if it does not appear at the 
beginning of the first header block
   *) [TS-3848] ATS runs without cache or partial cache on disk errors
@@ -28,7 +24,6 @@ Bug:
   *) [TS-3888] Initialize memory if our buffer is big enough
   *) [TS-3894] Missing NULL checks in HttpSM::handle_server_setup_error
   *) [TS-3901] Leaking connections from HttpSessionManager
-  *) [TS-3905] proxy.config.http.keep_alive_no_activity_timeout_out is not used
   *) [TS-3908] Build warning in WCCP
   *) [TS-3912] 200 OK returned on successful conditional request if 
Last-Modified header not present in stored response
   *) [TS-3916] garbled configure output in OpenSSL checks
@@ -44,22 +39,20 @@ Bug:
   *) [TS-3952] SSLNetVConnection::free crashes when "nh" is not initialized
   *) [TS-3953] When closing a connection from the active queue it uses the 
keep-alive queue
   *) [TS-3954] Latency with SPDY/HTTP/2 when chunking disabled (not default 
setting)
-  *) [TS-3956] Header_rewrite applies strange logic with = operator and 
whitespace
-  *) [TS-3957] Core dump from SpdyClientSession::state_session_start
-  *) [TS-3958] HTTP/2 coredump with NULL FetchSM
+  *) [TS-3956] header_rewrite applies strange logic with = operator and 
whitespace
+  *) [TS-3957] core dump from SpdyClientSession::state_session_start
+  *) [TS-3958] HTTP/2 core dump with NULL FetchSM
   *) [TS-3960] traffic_line -x doesn't reload SSL certs content
   *) [TS-3962] CID 1325824:(USE_AFTER_FREE) in malloc_bulkfree()
   *) [TS-3963] Response headers are not completely transferred when over 4KB
   *) [TS-3964] Stat for total time spent for HTTP/2 is 0
   *) [TS-3969] NetHandler::mainNetEvent always output DEBUG info "Unhandled 
epoll event" for EVENTIO_READ
-  *) [TS-3970] Core in PluginVC
   *) [TS-3975] ESI plugin missing TSPluginRegister
   *) [TS-3982] ESI logs debug output using TSError
   *) [TS-3984] CID 1328817:  Resource leaks  (CTOR_DTOR_LEAK) in multiplexer 
plugin
   *) [TS-3989] ET_NET 0 did not set CPU affinity
   *) [TS-3990] CID 1332248:(NEGATIVE_RETURNS) in lib/ts/ink_queue.cc 
(freelist)
   *) [TS-3991] Coredump seen on plugins written using CPP API
-  *) [TS-3998] Disable h2c upgrades (for now)
   *) [TS-4003] CID 1338381 & 1022062: in traffic_cop
   *) [TS-4004] ASAN crash while running regression test Cache_vol
   *) [TS-4005] Disable freelist command line option fails under ASAN
@@ -70,14 +63,10 @@ Bug:
   *) [TS-4013] coredump in diag debug
   *) [TS-4019] Headers passed via HTTP/2 should be validated before passing to 
FetchSM
   *) [TS-4028] Does not delete old TrackerCon

trafficserver git commit: TS-4081 Adds --pristine to use pristine URL on escalation

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x e0a77b271 -> abeb61b36


TS-4081 Adds --pristine to use pristine URL on escalation

This closes #418

(cherry picked from commit e393e68cc83e66d3a430f850cb113fb2e5b4dde8)


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

Branch: refs/heads/6.1.x
Commit: abeb61b36caf3c4970eb83e497c70c2b61ac9cff
Parents: e0a77b2
Author: Leif Hedstrom 
Authored: Wed Dec 16 17:47:55 2015 -0700
Committer: Leif Hedstrom 
Committed: Tue Jan 12 17:27:58 2016 -0800

--
 plugins/experimental/escalate/escalate.cc | 96 --
 1 file changed, 61 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/abeb61b3/plugins/experimental/escalate/escalate.cc
--
diff --git a/plugins/experimental/escalate/escalate.cc 
b/plugins/experimental/escalate/escalate.cc
index 0a249c6..4a9b1c0 100644
--- a/plugins/experimental/escalate/escalate.cc
+++ b/plugins/experimental/escalate/escalate.cc
@@ -53,7 +53,7 @@ struct EscalationState {
 
   typedef std::map StatusMapType;
 
-  EscalationState()
+  EscalationState() : use_pristine(false)
   {
 cont = TSContCreate(EscalateResponse, NULL);
 TSContDataSet(cont, this);
@@ -63,9 +63,25 @@ struct EscalationState {
 
   TSCont cont;
   StatusMapType status_map;
+  bool use_pristine;
 };
 
 
+// Little helper function, to update the Host portion of a URL, and stringify 
the result.
+// Returns the URL string, and updates url_len with the length.
+char *
+MakeEscalateUrl(TSMBuffer mbuf, TSMLoc url, const char *host, size_t host_len, 
int &url_len)
+{
+  char *url_str = NULL;
+
+  // Update the request URL with the new Host to try.
+  TSUrlHostSet(mbuf, url, host, host_len);
+  url_str = TSUrlStringGet(mbuf, url, &url_len);
+  TSDebug(PLUGIN_NAME, "Setting new URL to %.*s", url_len, url_str);
+
+  return url_str;
+}
+
 
//
 // Main continuation for the plugin, examining an origin response for a 
potential retry.
 //
@@ -110,15 +126,20 @@ EscalateResponse(TSCont cont, TSEvent event, void *edata)
 url_len = entry->second.target.size();
 TSDebug(PLUGIN_NAME, "Setting new URL to %.*s", url_len, url_str);
   } else if (EscalationState::RETRY_HOST == entry->second.type) {
-if (TS_SUCCESS == TSHttpTxnClientReqGet(txn, &mbuf, &hdrp)) {
-  if (TS_SUCCESS == TSHttpHdrUrlGet(mbuf, hdrp, &url)) {
-// Update the request URL with the new Host to try.
-TSUrlHostSet(mbuf, url, entry->second.target.c_str(), 
entry->second.target.size());
-url_str = TSUrlStringGet(mbuf, url, &url_len);
-TSDebug(PLUGIN_NAME, "Setting new Host: to %.*s", url_len, url_str);
+if (es->use_pristine) {
+  if (TS_SUCCESS == TSHttpTxnPristineUrlGet(txn, &mbuf, &url)) {
+url_str = MakeEscalateUrl(mbuf, url, entry->second.target.c_str(), 
entry->second.target.size(), url_len);
+printf("STRING is %.*s\n", url_len, url_str);
+  }
+} else {
+  if (TS_SUCCESS == TSHttpTxnClientReqGet(txn, &mbuf, &hdrp)) {
+if (TS_SUCCESS == TSHttpHdrUrlGet(mbuf, hdrp, &url)) {
+  url_str = MakeEscalateUrl(mbuf, url, entry->second.target.c_str(), 
entry->second.target.size(), url_len);
+  printf("Old code STRING is %.*s\n", url_len, url_str);
+}
+// Release the request MLoc
+TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdrp);
   }
-  // Release the request MLoc
-  TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdrp);
 }
   }
 
@@ -151,38 +172,43 @@ TSRemapNewInstance(int argc, char *argv[], void 
**instance, char *errbuf, int er
   for (int i = 2; i < argc; ++i) {
 char *sep, *token, *save;
 
-// Each token should be a status code then a URL, separated by ':'.
-sep = strchr(argv[i], ':');
-if (sep == NULL) {
-  snprintf(errbuf, errbuf_size, "malformed status:target config: %s", 
argv[i]);
-  goto fail;
-}
+// Ugly, but we set the precedence before with non-command line parsing of 
args
+if (0 == strncasecmp(argv[i], "--pristine", 10)) {
+  es->use_pristine = true;
+} else {
+  // Each token should be a status code then a URL, separated by ':'.
+  sep = strchr(argv[i], ':');
+  if (sep == NULL) {
+snprintf(errbuf, errbuf_size, "malformed status:target config: %s", 
argv[i]);
+goto fail;
+  }
 
-*sep = '\0';
-++sep; // Skip over the ':' (which is now \0)
+  *sep = '\0';
+  ++sep; // Skip over the ':' (which 

trafficserver git commit: TS-4081 Adds --pristine to use pristine URL on escalation

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/master 15a14e191 -> e393e68cc


TS-4081 Adds --pristine to use pristine URL on escalation

This closes #418


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

Branch: refs/heads/master
Commit: e393e68cc83e66d3a430f850cb113fb2e5b4dde8
Parents: 15a14e1
Author: Leif Hedstrom 
Authored: Wed Dec 16 17:47:55 2015 -0700
Committer: Leif Hedstrom 
Committed: Tue Jan 12 17:21:06 2016 -0800

--
 plugins/experimental/escalate/escalate.cc | 96 --
 1 file changed, 61 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e393e68c/plugins/experimental/escalate/escalate.cc
--
diff --git a/plugins/experimental/escalate/escalate.cc 
b/plugins/experimental/escalate/escalate.cc
index 0a249c6..4a9b1c0 100644
--- a/plugins/experimental/escalate/escalate.cc
+++ b/plugins/experimental/escalate/escalate.cc
@@ -53,7 +53,7 @@ struct EscalationState {
 
   typedef std::map StatusMapType;
 
-  EscalationState()
+  EscalationState() : use_pristine(false)
   {
 cont = TSContCreate(EscalateResponse, NULL);
 TSContDataSet(cont, this);
@@ -63,9 +63,25 @@ struct EscalationState {
 
   TSCont cont;
   StatusMapType status_map;
+  bool use_pristine;
 };
 
 
+// Little helper function, to update the Host portion of a URL, and stringify 
the result.
+// Returns the URL string, and updates url_len with the length.
+char *
+MakeEscalateUrl(TSMBuffer mbuf, TSMLoc url, const char *host, size_t host_len, 
int &url_len)
+{
+  char *url_str = NULL;
+
+  // Update the request URL with the new Host to try.
+  TSUrlHostSet(mbuf, url, host, host_len);
+  url_str = TSUrlStringGet(mbuf, url, &url_len);
+  TSDebug(PLUGIN_NAME, "Setting new URL to %.*s", url_len, url_str);
+
+  return url_str;
+}
+
 
//
 // Main continuation for the plugin, examining an origin response for a 
potential retry.
 //
@@ -110,15 +126,20 @@ EscalateResponse(TSCont cont, TSEvent event, void *edata)
 url_len = entry->second.target.size();
 TSDebug(PLUGIN_NAME, "Setting new URL to %.*s", url_len, url_str);
   } else if (EscalationState::RETRY_HOST == entry->second.type) {
-if (TS_SUCCESS == TSHttpTxnClientReqGet(txn, &mbuf, &hdrp)) {
-  if (TS_SUCCESS == TSHttpHdrUrlGet(mbuf, hdrp, &url)) {
-// Update the request URL with the new Host to try.
-TSUrlHostSet(mbuf, url, entry->second.target.c_str(), 
entry->second.target.size());
-url_str = TSUrlStringGet(mbuf, url, &url_len);
-TSDebug(PLUGIN_NAME, "Setting new Host: to %.*s", url_len, url_str);
+if (es->use_pristine) {
+  if (TS_SUCCESS == TSHttpTxnPristineUrlGet(txn, &mbuf, &url)) {
+url_str = MakeEscalateUrl(mbuf, url, entry->second.target.c_str(), 
entry->second.target.size(), url_len);
+printf("STRING is %.*s\n", url_len, url_str);
+  }
+} else {
+  if (TS_SUCCESS == TSHttpTxnClientReqGet(txn, &mbuf, &hdrp)) {
+if (TS_SUCCESS == TSHttpHdrUrlGet(mbuf, hdrp, &url)) {
+  url_str = MakeEscalateUrl(mbuf, url, entry->second.target.c_str(), 
entry->second.target.size(), url_len);
+  printf("Old code STRING is %.*s\n", url_len, url_str);
+}
+// Release the request MLoc
+TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdrp);
   }
-  // Release the request MLoc
-  TSHandleMLocRelease(mbuf, TS_NULL_MLOC, hdrp);
 }
   }
 
@@ -151,38 +172,43 @@ TSRemapNewInstance(int argc, char *argv[], void 
**instance, char *errbuf, int er
   for (int i = 2; i < argc; ++i) {
 char *sep, *token, *save;
 
-// Each token should be a status code then a URL, separated by ':'.
-sep = strchr(argv[i], ':');
-if (sep == NULL) {
-  snprintf(errbuf, errbuf_size, "malformed status:target config: %s", 
argv[i]);
-  goto fail;
-}
+// Ugly, but we set the precedence before with non-command line parsing of 
args
+if (0 == strncasecmp(argv[i], "--pristine", 10)) {
+  es->use_pristine = true;
+} else {
+  // Each token should be a status code then a URL, separated by ':'.
+  sep = strchr(argv[i], ':');
+  if (sep == NULL) {
+snprintf(errbuf, errbuf_size, "malformed status:target config: %s", 
argv[i]);
+goto fail;
+  }
 
-*sep = '\0';
-++sep; // Skip over the ':' (which is now \0)
+  *sep = '\0';
+  ++sep; // Skip over the ':' (which is now \0)
 
-// OK, we have a valid status/URL pair.
-Escal

trafficserver git commit: TS-4122: document proxy.config.http.response_via_str

2016-01-12 Thread jpeach
Repository: trafficserver
Updated Branches:
  refs/heads/master 1d860f66f -> 15a14e191


TS-4122: document proxy.config.http.response_via_str

This closes #414.


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

Branch: refs/heads/master
Commit: 15a14e1912b15baf4be21a2aa832ea43ec701ff6
Parents: 1d860f6
Author: Hiroaki Nakamura 
Authored: Mon Jan 11 16:07:37 2016 +0900
Committer: James Peach 
Committed: Tue Jan 12 17:18:44 2016 -0800

--
 doc/admin-guide/files/records.config.en.rst | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/15a14e19/doc/admin-guide/files/records.config.en.rst
--
diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index 6d73e7e..40a2d20 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -710,6 +710,12 @@ Value Effect
 
The ``Via`` header string can be decoded with the `Via Decoder Ring 
`_.
 
+.. ts:cv:: CONFIG proxy.config.http.response_via_str STRING 
ApacheTrafficServer/${PACKAGE_VERSION}
+   :reloadable:
+   :overridable:
+
+   Set the server and version string in the ``Via`` response header to the 
client which is inserted when the value of 
:ts:cv:`proxy.config.http.insert_response_via_str` is not ``0``.  Note that the 
actual default value is defined with ``"ApacheTrafficServer/" PACKAGE_VERSION`` 
in a C++ source code, and you must write such as ``ApacheTrafficServer/6.0.0`` 
if you really set a value with the version in :file:`records.config` file. If 
you want to hide the version, you can set this value to ``ApacheTrafficServer``.
+
 .. ts:cv:: CONFIG proxy.config.http.send_100_continue_response INT 0
:reloadable:
 



trafficserver git commit: Clang-format fix

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x 909a7902f -> e0a77b271


Clang-format fix

(cherry picked from commit a0081119c19b4401d87ba70c21cc0870142fc847)


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

Branch: refs/heads/6.1.x
Commit: e0a77b27113fe32408aaefdc922034641153491f
Parents: 909a790
Author: shinrich 
Authored: Tue Jan 12 16:44:16 2016 -0600
Committer: Leif Hedstrom 
Committed: Tue Jan 12 17:13:13 2016 -0800

--
 iocore/cache/CachePages.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/e0a77b27/iocore/cache/CachePages.cc
--
diff --git a/iocore/cache/CachePages.cc b/iocore/cache/CachePages.cc
index f0bec19..d841f70 100644
--- a/iocore/cache/CachePages.cc
+++ b/iocore/cache/CachePages.cc
@@ -126,7 +126,7 @@ struct ShowCache : public ShowCont {
   q = strstr(p, "%0D%0A" /* \r\n */); // we used this in the JS to 
separate urls
   if (!q)
 q = t;
-  ink_strlcpy(show_cache_urlstrs[s], p, q ? q - p + 1: 
sizeof(show_cache_urlstrs[s]));
+  ink_strlcpy(show_cache_urlstrs[s], p, q ? q - p + 1 : 
sizeof(show_cache_urlstrs[s]));
   p = q + 6; // +6 ==> strlen(%0D%0A)
 }
   }



[2/2] trafficserver git commit: TS-4121: document proxy.config.http.request_via_str

2016-01-12 Thread jpeach
TS-4121: document proxy.config.http.request_via_str

This closes #413.
 Please enter the commit message for your changes. Lines starting


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

Branch: refs/heads/master
Commit: 1d860f66f565f19ec681057a6dbdabe45d32c42c
Parents: 9b15e3d
Author: Hiroaki Nakamura 
Authored: Mon Jan 11 16:11:14 2016 +0900
Committer: James Peach 
Committed: Tue Jan 12 17:16:04 2016 -0800

--
 doc/admin-guide/files/records.config.en.rst | 6 ++
 1 file changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/1d860f66/doc/admin-guide/files/records.config.en.rst
--
diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index 8d980b5..6d73e7e 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -685,6 +685,12 @@ Value Effect
 
The ``Via`` header string can be decoded with the `Via Decoder Ring 
`_.
 
+.. ts:cv:: CONFIG proxy.config.http.request_via_str STRING 
ApacheTrafficServer/${PACKAGE_VERSION}
+   :reloadable:
+   :overridable:
+
+   Set the server and version string in the ``Via`` request header to the 
origin server which is inserted when the value of 
:ts:cv:`proxy.config.http.insert_request_via_str` is not ``0``.  Note that the 
actual default value is defined with ``"ApacheTrafficServer/" PACKAGE_VERSION`` 
in a C++ source code, and you must write such as ``ApacheTrafficServer/6.0.0`` 
if you really set a value with the version in :file:`records.config` file. If 
you want to hide the version, you can set this value to ``ApacheTrafficServer``.
+
 .. ts:cv:: CONFIG proxy.config.http.insert_response_via_str INT 0
:reloadable:
:overridable:



[1/2] trafficserver git commit: TS-4120: proxy.config.http.response_server_str default value includes version

2016-01-12 Thread jpeach
Repository: trafficserver
Updated Branches:
  refs/heads/master 48c23ec74 -> 1d860f66f


TS-4120: proxy.config.http.response_server_str default value includes version

This closes #412.


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

Branch: refs/heads/master
Commit: 9b15e3d8aae3b890928765c23247bcd96d4332c2
Parents: 48c23ec
Author: Hiroaki Nakamura 
Authored: Mon Jan 11 12:56:25 2016 +0900
Committer: James Peach 
Committed: Tue Jan 12 17:15:59 2016 -0800

--
 doc/admin-guide/files/records.config.en.rst | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/9b15e3d8/doc/admin-guide/files/records.config.en.rst
--
diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index 3109b3d..8d980b5 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -732,12 +732,11 @@ Value Effect
-  ``0`` no ``Age`` header is added
-  ``1`` the ``Age`` header is added
 
-.. ts:cv:: CONFIG proxy.config.http.response_server_str STRING ATS/
+.. ts:cv:: CONFIG proxy.config.http.response_server_str STRING 
ATS/${PACKAGE_VERSION}
:reloadable:
:overridable:
 
-   The Server: string that ATS will insert in a response header (if requested, 
see above). Note that the current version number is
-   always appended to this string.
+   The Server: string that ATS will insert in a response header (if requested, 
see above). Note that the actual default value is defined with ``"ATS/" 
PACKAGE_VERSION`` in a C++ source code, and you must write such as 
``ATS/6.0.0`` if you really set a value with the version in 
:file:`records.config` file. If you want to hide the version, you can set this 
value to ``ATS``.
 
 .. ts:cv:: CONFIG proxy.config.http.enable_url_expandomatic INT 0
:reloadable:



trafficserver git commit: TS-4113: add value 4 to proxy.config.http.cache.cache_responses_to_cookies

2016-01-12 Thread jpeach
Repository: trafficserver
Updated Branches:
  refs/heads/master d7657f965 -> 48c23ec74


TS-4113: add value 4 to proxy.config.http.cache.cache_responses_to_cookies

This closes #411.


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

Branch: refs/heads/master
Commit: 48c23ec742f173e79793597cedea3ac970807cff
Parents: d7657f9
Author: Hiroaki Nakamura 
Authored: Mon Jan 11 12:32:36 2016 +0900
Committer: James Peach 
Committed: Tue Jan 12 17:11:29 2016 -0800

--
 doc/admin-guide/files/records.config.en.rst | 1 +
 1 file changed, 1 insertion(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/48c23ec7/doc/admin-guide/files/records.config.en.rst
--
diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index 51f14f5..3109b3d 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -1422,6 +1422,7 @@ Cache Control
-  ``1`` = cache for any content-type
-  ``2`` = cache only for image types
-  ``3`` = cache for all but text content-types
+   -  ``4`` = cache for all but text content-types except OS response without 
"Set-Cookie" or with "Cache-Control: public"
 
 .. ts:cv:: CONFIG proxy.config.http.cache.ignore_authentication INT 0
:overridable:



[1/2] trafficserver git commit: doc: add config file for Transifex Client

2016-01-12 Thread jpeach
Repository: trafficserver
Updated Branches:
  refs/heads/master 8261460fc -> d7657f965


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/d7657f96/doc/.tx/config
--
diff --git a/doc/.tx/config b/doc/.tx/config
new file mode 100644
index 000..9b5ca65
--- /dev/null
+++ b/doc/.tx/config
@@ -0,0 +1,2209 @@
+[main]
+host = https://www.transifex.com
+type = PO
+
+[apache-traffic-server-6x.index]
+file_filter = locale//LC_MESSAGES/index.po
+source_file = _build/locale/pot/index.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuring-traffic-server_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/configuring-traffic-server.en.po
+source_file = _build/locale/pot/admin-guide/configuring-traffic-server.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--index_en]
+file_filter = locale//LC_MESSAGES/admin-guide/index.en.po
+source_file = _build/locale/pot/admin-guide/index.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--introduction_en]
+file_filter = locale//LC_MESSAGES/admin-guide/introduction.en.po
+source_file = _build/locale/pot/admin-guide/introduction.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--transparent-proxy_en]
+file_filter = locale//LC_MESSAGES/admin-guide/transparent-proxy.en.po
+source_file = _build/locale/pot/admin-guide/transparent-proxy.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuration--cache-basics_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/configuration/cache-basics.en.po
+source_file = _build/locale/pot/admin-guide/configuration/cache-basics.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuration--explicit-forward-proxying_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/configuration/explicit-forward-proxying.en.po
+source_file = 
_build/locale/pot/admin-guide/configuration/explicit-forward-proxying.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuration--hierachical-caching_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/configuration/hierachical-caching.en.po
+source_file = 
_build/locale/pot/admin-guide/configuration/hierachical-caching.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuration--index_en]
+file_filter = locale//LC_MESSAGES/admin-guide/configuration/index.en.po
+source_file = _build/locale/pot/admin-guide/configuration/index.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuration--multi-server-caches_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/configuration/multi-server-caches.en.po
+source_file = 
_build/locale/pot/admin-guide/configuration/multi-server-caches.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuration--redirecting-http-requests_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/configuration/redirecting-http-requests.en.po
+source_file = 
_build/locale/pot/admin-guide/configuration/redirecting-http-requests.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuration--session-protocol_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/configuration/session-protocol.en.po
+source_file = 
_build/locale/pot/admin-guide/configuration/session-protocol.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--configuration--transparent-forward-proxying_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/configuration/transparent-forward-proxying.en.po
+source_file = 
_build/locale/pot/admin-guide/configuration/transparent-forward-proxying.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--files--cache_config_en]
+file_filter = locale//LC_MESSAGES/admin-guide/files/cache.config.en.po
+source_file = _build/locale/pot/admin-guide/files/cache.config.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--files--congestion_config_en]
+file_filter = 
locale//LC_MESSAGES/admin-guide/files/congestion.config.en.po
+source_file = _build/locale/pot/admin-guide/files/congestion.config.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--files--hosting_config_en]
+file_filter = locale//LC_MESSAGES/admin-guide/files/hosting.config.en.po
+source_file = _build/locale/pot/admin-guide/files/hosting.config.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--files--icp_config_en]
+file_filter = locale//LC_MESSAGES/admin-guide/files/icp.config.en.po
+source_file = _build/locale/pot/admin-guide/files/icp.config.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--files--index_en]
+file_filter = locale//LC_MESSAGES/admin-guide/files/index.en.po
+source_file = _build/locale/pot/admin-guide/files/index.en.pot
+source_lang = en
+
+[apache-traffic-server-6x.admin-guide--files--ip_allow_config_en]
+file_filter = locale//LC_MESSAGES/admin-guide/files/ip_allow.config.en.po
+source_file = _build/locale/pot/admin-guide/files/ip_allow.config.en.pot
+source_lang = en
+
+[a

[2/2] trafficserver git commit: doc: add config file for Transifex Client

2016-01-12 Thread jpeach
doc: add config file for Transifex Client

This closes #406.


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

Branch: refs/heads/master
Commit: d7657f965b615c3f3a1dc41a9ed90b9d122a3dd6
Parents: 8261460
Author: Masaori Koshiba 
Authored: Wed Jan 6 17:56:04 2016 +0900
Committer: James Peach 
Committed: Tue Jan 12 17:08:10 2016 -0800

--
 doc/.tx/config | 2209 +++
 1 file changed, 2209 insertions(+)
--




trafficserver git commit: TS-4060: add JSON support consistently for traffic_layout

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x 51faf6ee9 -> 909a7902f


TS-4060: add JSON support consistently for traffic_layout

This closes #417.

(cherry picked from commit 8261460fc1e3483a3581d5318b14033f0c986b0e)


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

Branch: refs/heads/6.1.x
Commit: 909a7902f502e984a695cba9d98edd4a0834c841
Parents: 51faf6e
Author: Leif Hedstrom 
Authored: Mon Dec 7 20:39:14 2015 -0700
Committer: Leif Hedstrom 
Committed: Tue Jan 12 17:02:54 2016 -0800

--
 cmd/traffic_layout/traffic_layout.cc | 59 +++
 1 file changed, 36 insertions(+), 23 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/909a7902/cmd/traffic_layout/traffic_layout.cc
--
diff --git a/cmd/traffic_layout/traffic_layout.cc 
b/cmd/traffic_layout/traffic_layout.cc
index b561132..f5dabac 100644
--- a/cmd/traffic_layout/traffic_layout.cc
+++ b/cmd/traffic_layout/traffic_layout.cc
@@ -126,38 +126,51 @@ produce_features(bool json)
 
 
 static void
-print_var(const char *name, char *val)
+print_var(const char *name, char *value, bool json, bool free = true, bool 
last = false)
 {
-  printf("%s: %s\n", name, val);
-  ats_free(val);
+  if (json) {
+printf("\"%s\": \"%s\"%s", name, value, last ? "\n" : ",\n");
+  } else {
+printf("%s: %s\n", name, value);
+  }
+
+  if (free) {
+ats_free(value);
+  }
 }
 
 static void
-produce_layout()
+produce_layout(bool json)
 {
   Layout::create();
 
   RecProcessInit(RECM_STAND_ALONE, NULL /* diags */);
   LibRecordsConfigInit();
 
-  printf("%s: %s\n", "PREFIX", Layout::get()->prefix);
-  print_var("BINDIR", RecConfigReadBinDir());
-  print_var("SYSCONFDIR", RecConfigReadConfigDir());
-  print_var("LIBDIR", Layout::get()->libdir);
-  print_var("LOGDIR", RecConfigReadLogDir());
-  print_var("RUNTIMEDIR", RecConfigReadRuntimeDir());
-  print_var("PLUGINDIR", 
RecConfigReadPrefixPath("proxy.config.plugin.plugin_dir"));
-  print_var("INCLUDEDIR", Layout::get()->includedir);
-  print_var("SNAPSHOTDIR", RecConfigReadSnapshotDir());
-
-  print_var("records.config", RecConfigReadConfigPath(NULL, REC_CONFIG_FILE));
-  print_var("remap.config", 
RecConfigReadConfigPath("proxy.config.url_remap.filename"));
-  print_var("plugin.config", RecConfigReadConfigPath(NULL, "plugin.config"));
-  print_var("ssl_multicert.config", 
RecConfigReadConfigPath("proxy.config.ssl.server.multicert.filename"));
-  print_var("storage.config", 
RecConfigReadConfigPath("proxy.config.cache.storage_filename"));
-  print_var("hosting.config", 
RecConfigReadConfigPath("proxy.config.cache.hosting_filename"));
-  print_var("volume.config", 
RecConfigReadConfigPath("proxy.config.cache.volume_filename"));
-  print_var("ip_allow.config", 
RecConfigReadConfigPath("proxy.config.cache.ip_allow.filename"));
+  if (json) {
+printf("{\n");
+  }
+  print_var("PREFIX", Layout::get()->prefix, json, false); // Don't free this
+  print_var("BINDIR", RecConfigReadBinDir(), json);
+  print_var("SYSCONFDIR", RecConfigReadConfigDir(), json);
+  print_var("LIBDIR", Layout::get()->libdir, json, false); // Don't free this
+  print_var("LOGDIR", RecConfigReadLogDir(), json);
+  print_var("RUNTIMEDIR", RecConfigReadRuntimeDir(), json);
+  print_var("PLUGINDIR", 
RecConfigReadPrefixPath("proxy.config.plugin.plugin_dir"), json);
+  print_var("INCLUDEDIR", Layout::get()->includedir, json, false); // Dont' 
free this
+  print_var("SNAPSHOTDIR", RecConfigReadSnapshotDir(), json);
+
+  print_var("records.config", RecConfigReadConfigPath(NULL, REC_CONFIG_FILE), 
json);
+  print_var("remap.config", 
RecConfigReadConfigPath("proxy.config.url_remap.filename"), json);
+  print_var("plugin.config", RecConfigReadConfigPath(NULL, "plugin.config"), 
json);
+  print_var("ssl_multicert.config", 
RecConfigReadConfigPath("proxy.config.ssl.server.multicert.filename"), json);
+  print_var("storage.config", 
RecConfigReadConfigPath("proxy.config.cache.storage_filename"), json);
+  print_var("hosting.config", 
RecConfigReadConfigPath("proxy.config.cache.hosting_filename"), json);
+  print_var("volume.config", 
RecConfigReadConfigPath("proxy.config.cache.volume_filename"), json);
+  print_var("ip_allow.config", 
RecConfigReadConfigPath("proxy.config.cache.ip_allow.filename"), json, true, 
true);
+  if (json) {
+printf("}\n");
+  }
 }
 
 int
@@ -173,7 +186,7 @@ main(int /* argc ATS_UNUSED */, const char **argv)
   if (cl.features) {
 produce_features(0 != cl.json);
   } else {
-produce_layout();
+produce_layout(0 != cl.json);

[1/2] trafficserver git commit: TS-3072: Debug logging for single connection. Without config control. This closes #398.

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x 7e005ad6c -> 51faf6ee9


TS-3072: Debug logging for single connection. Without config control.  This 
closes #398.

(cherry picked from commit 45266942b4510f5d06f2af95ea7b8972134ad8f8)


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

Branch: refs/heads/6.1.x
Commit: 230d25584fe358a3a8005766b92a5ce0a8681eac
Parents: 7e005ad
Author: shinrich 
Authored: Tue Nov 24 15:08:44 2015 -0600
Committer: Leif Hedstrom 
Committed: Tue Jan 12 15:59:16 2016 -0800

--
 iocore/eventsystem/I_Continuation.h |  9 
 iocore/net/UnixNet.cc   |  5 ++
 lib/ts/ContFlags.cc | 71 
 lib/ts/ContFlags.h  | 93 
 lib/ts/Diags.h  |  9 
 lib/ts/Makefile.am  |  2 +
 proxy/http/HttpSM.cc|  3 ++
 7 files changed, 192 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/230d2558/iocore/eventsystem/I_Continuation.h
--
diff --git a/iocore/eventsystem/I_Continuation.h 
b/iocore/eventsystem/I_Continuation.h
index ec7c3f0..9ba78b4 100644
--- a/iocore/eventsystem/I_Continuation.h
+++ b/iocore/eventsystem/I_Continuation.h
@@ -39,6 +39,7 @@
 #include "ts/ink_platform.h"
 #include "ts/List.h"
 #include "I_Lock.h"
+#include "ts/ContFlags.h"
 
 class Continuation;
 class ContinuationQueue;
@@ -128,6 +129,12 @@ public:
   LINK(Continuation, link);
 
   /**
+Contains values for debug_override and future flags that
+needs to be thread local while this continuation is running
+  */
+  ContFlags control_flags;
+
+  /**
 Receives the event code and data for an Event.
 
 This function receives the event code and data for an event and
@@ -191,6 +198,8 @@ inline Continuation::Continuation(ProxyMutex *amutex)
 #endif
 mutex(amutex)
 {
+  // Pick up the control flags from the creating thread
+  this->control_flags.set_flags(get_cont_flags().get_flags());
 }
 
 #endif /*_Continuation_h_*/

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/230d2558/iocore/net/UnixNet.cc
--
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index 7e0948c..a96f5f5 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -510,6 +510,8 @@ NetHandler::mainNetEvent(int event, Event *e)
 #if defined(USE_EDGE_TRIGGER)
   // UnixNetVConnection *
   while ((vc = read_ready_list.dequeue())) {
+// Initialize the thread-local continuation flags
+set_cont_flags(vc->control_flags);
 if (vc->closed)
   close_UnixNetVConnection(vc, trigger_event->ethread);
 else if (vc->read.enabled && vc->read.triggered)
@@ -526,6 +528,7 @@ NetHandler::mainNetEvent(int event, Event *e)
 }
   }
   while ((vc = write_ready_list.dequeue())) {
+set_cont_flags(vc->control_flags);
 if (vc->closed)
   close_UnixNetVConnection(vc, trigger_event->ethread);
 else if (vc->write.enabled && vc->write.triggered)
@@ -543,6 +546,7 @@ NetHandler::mainNetEvent(int event, Event *e)
   }
 #else  /* !USE_EDGE_TRIGGER */
   while ((vc = read_ready_list.dequeue())) {
+diags->set_override(vc->control.debug_override);
 if (vc->closed)
   close_UnixNetVConnection(vc, trigger_event->ethread);
 else if (vc->read.enabled && vc->read.triggered)
@@ -551,6 +555,7 @@ NetHandler::mainNetEvent(int event, Event *e)
   vc->ep.modify(-EVENTIO_READ);
   }
   while ((vc = write_ready_list.dequeue())) {
+diags->set_override(vc->control.debug_override);
 if (vc->closed)
   close_UnixNetVConnection(vc, trigger_event->ethread);
 else if (vc->write.enabled && vc->write.triggered)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/230d2558/lib/ts/ContFlags.cc
--
diff --git a/lib/ts/ContFlags.cc b/lib/ts/ContFlags.cc
new file mode 100644
index 000..6f564b6
--- /dev/null
+++ b/lib/ts/ContFlags.cc
@@ -0,0 +1,71 @@
+/** @file
+
+  A brief file description
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.a

[2/2] trafficserver git commit: TS-3072: fix newer compiler warnings.

2016-01-12 Thread zwoop
TS-3072: fix newer compiler warnings.

(cherry picked from commit 7cd050790b4cc6a85becebef7438e01f267f0bd3)


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

Branch: refs/heads/6.1.x
Commit: 51faf6ee98c351a2f1b545183e463e4fcde1d38f
Parents: 230d255
Author: shinrich 
Authored: Tue Jan 12 17:50:34 2016 -0600
Committer: Leif Hedstrom 
Committed: Tue Jan 12 15:59:22 2016 -0800

--
 lib/ts/ContFlags.cc | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/51faf6ee/lib/ts/ContFlags.cc
--
diff --git a/lib/ts/ContFlags.cc b/lib/ts/ContFlags.cc
index 6f564b6..4e37e5e 100644
--- a/lib/ts/ContFlags.cc
+++ b/lib/ts/ContFlags.cc
@@ -39,33 +39,35 @@ void
 init_cont_flags()
 {
   ContFlags new_flags;
-  ink_thread_setspecific(flags_data_key, (void *)new_flags.get_flags());
+  void *val = reinterpret_cast(static_cast((new_flags.get_flags(;
+  ink_thread_setspecific(flags_data_key, val);
 }
 
 void
 set_cont_flags(const ContFlags &flags)
 {
-  ink_thread_setspecific(flags_data_key, (void *)flags.get_flags());
+  void *val = reinterpret_cast(static_cast((flags.get_flags(;
+  ink_thread_setspecific(flags_data_key, val);
 }
 
 void
 set_cont_flag(ContFlags::flags flag_bit, bool value)
 {
-  u_int64_t flags = (u_int64_t)ink_thread_getspecific(flags_data_key);
-  ContFlags new_flags(flags);
+  ContFlags 
new_flags(reinterpret_cast(ink_thread_getspecific(flags_data_key)));
   new_flags.set_flag(flag_bit, value);
-  ink_thread_setspecific(flags_data_key, (void *)new_flags.get_flags());
+  void *val = reinterpret_cast(static_cast((new_flags.get_flags(;
+  ink_thread_setspecific(flags_data_key, val);
 }
 
 ContFlags
 get_cont_flags()
 {
-  return ContFlags((u_int64_t)ink_thread_getspecific(flags_data_key));
+  return 
ContFlags(reinterpret_cast(ink_thread_getspecific(flags_data_key)));
 }
 
 bool
 get_cont_flag(ContFlags::flags flag_bit)
 {
-  ContFlags flags((u_int64_t)ink_thread_getspecific(flags_data_key));
+  ContFlags 
flags(reinterpret_cast(ink_thread_getspecific(flags_data_key)));
   return flags.get_flag(flag_bit);
 }



trafficserver git commit: TS-4060: add JSON support consistently for traffic_layout

2016-01-12 Thread jpeach
Repository: trafficserver
Updated Branches:
  refs/heads/master 8e0f81454 -> 8261460fc


TS-4060: add JSON support consistently for traffic_layout

This closes #417.


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

Branch: refs/heads/master
Commit: 8261460fc1e3483a3581d5318b14033f0c986b0e
Parents: 8e0f814
Author: Leif Hedstrom 
Authored: Mon Dec 7 20:39:14 2015 -0700
Committer: James Peach 
Committed: Tue Jan 12 16:59:43 2016 -0800

--
 cmd/traffic_layout/traffic_layout.cc | 59 +++
 1 file changed, 36 insertions(+), 23 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8261460f/cmd/traffic_layout/traffic_layout.cc
--
diff --git a/cmd/traffic_layout/traffic_layout.cc 
b/cmd/traffic_layout/traffic_layout.cc
index b561132..f5dabac 100644
--- a/cmd/traffic_layout/traffic_layout.cc
+++ b/cmd/traffic_layout/traffic_layout.cc
@@ -126,38 +126,51 @@ produce_features(bool json)
 
 
 static void
-print_var(const char *name, char *val)
+print_var(const char *name, char *value, bool json, bool free = true, bool 
last = false)
 {
-  printf("%s: %s\n", name, val);
-  ats_free(val);
+  if (json) {
+printf("\"%s\": \"%s\"%s", name, value, last ? "\n" : ",\n");
+  } else {
+printf("%s: %s\n", name, value);
+  }
+
+  if (free) {
+ats_free(value);
+  }
 }
 
 static void
-produce_layout()
+produce_layout(bool json)
 {
   Layout::create();
 
   RecProcessInit(RECM_STAND_ALONE, NULL /* diags */);
   LibRecordsConfigInit();
 
-  printf("%s: %s\n", "PREFIX", Layout::get()->prefix);
-  print_var("BINDIR", RecConfigReadBinDir());
-  print_var("SYSCONFDIR", RecConfigReadConfigDir());
-  print_var("LIBDIR", Layout::get()->libdir);
-  print_var("LOGDIR", RecConfigReadLogDir());
-  print_var("RUNTIMEDIR", RecConfigReadRuntimeDir());
-  print_var("PLUGINDIR", 
RecConfigReadPrefixPath("proxy.config.plugin.plugin_dir"));
-  print_var("INCLUDEDIR", Layout::get()->includedir);
-  print_var("SNAPSHOTDIR", RecConfigReadSnapshotDir());
-
-  print_var("records.config", RecConfigReadConfigPath(NULL, REC_CONFIG_FILE));
-  print_var("remap.config", 
RecConfigReadConfigPath("proxy.config.url_remap.filename"));
-  print_var("plugin.config", RecConfigReadConfigPath(NULL, "plugin.config"));
-  print_var("ssl_multicert.config", 
RecConfigReadConfigPath("proxy.config.ssl.server.multicert.filename"));
-  print_var("storage.config", 
RecConfigReadConfigPath("proxy.config.cache.storage_filename"));
-  print_var("hosting.config", 
RecConfigReadConfigPath("proxy.config.cache.hosting_filename"));
-  print_var("volume.config", 
RecConfigReadConfigPath("proxy.config.cache.volume_filename"));
-  print_var("ip_allow.config", 
RecConfigReadConfigPath("proxy.config.cache.ip_allow.filename"));
+  if (json) {
+printf("{\n");
+  }
+  print_var("PREFIX", Layout::get()->prefix, json, false); // Don't free this
+  print_var("BINDIR", RecConfigReadBinDir(), json);
+  print_var("SYSCONFDIR", RecConfigReadConfigDir(), json);
+  print_var("LIBDIR", Layout::get()->libdir, json, false); // Don't free this
+  print_var("LOGDIR", RecConfigReadLogDir(), json);
+  print_var("RUNTIMEDIR", RecConfigReadRuntimeDir(), json);
+  print_var("PLUGINDIR", 
RecConfigReadPrefixPath("proxy.config.plugin.plugin_dir"), json);
+  print_var("INCLUDEDIR", Layout::get()->includedir, json, false); // Dont' 
free this
+  print_var("SNAPSHOTDIR", RecConfigReadSnapshotDir(), json);
+
+  print_var("records.config", RecConfigReadConfigPath(NULL, REC_CONFIG_FILE), 
json);
+  print_var("remap.config", 
RecConfigReadConfigPath("proxy.config.url_remap.filename"), json);
+  print_var("plugin.config", RecConfigReadConfigPath(NULL, "plugin.config"), 
json);
+  print_var("ssl_multicert.config", 
RecConfigReadConfigPath("proxy.config.ssl.server.multicert.filename"), json);
+  print_var("storage.config", 
RecConfigReadConfigPath("proxy.config.cache.storage_filename"), json);
+  print_var("hosting.config", 
RecConfigReadConfigPath("proxy.config.cache.hosting_filename"), json);
+  print_var("volume.config", 
RecConfigReadConfigPath("proxy.config.cache.volume_filename"), json);
+  print_var("ip_allow.config", 
RecConfigReadConfigPath("proxy.config.cache.ip_allow.filename"), json, true, 
true);
+  if (json) {
+printf("}\n");
+  }
 }
 
 int
@@ -173,7 +186,7 @@ main(int /* argc ATS_UNUSED */, const char **argv)
   if (cl.features) {
 produce_features(0 != cl.json);
   } else {
-produce_layout();
+produce_layout(0 != cl.json);
   }
   exit(0);
 }



trafficserver git commit: TS-4107: proxy.process.ssl.total_success_handshake_count_in has wrong record type

2016-01-12 Thread jpeach
Repository: trafficserver
Updated Branches:
  refs/heads/master 7cd050790 -> 8e0f81454


TS-4107: proxy.process.ssl.total_success_handshake_count_in has wrong record 
type

proxy.process.ssl.total_success_handshake_count_in should be the
metrics generated in the core SSL code, and the old compatible name
proxy.process.ssl.total_success_handshake_count should be generated
as a custom metric. The custom metric needs to be registered in
RecordsConfig.cc but it should be of type RECT_PROCESS not RECT_NODE.

This closes #409.


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

Branch: refs/heads/master
Commit: 8e0f81454fd79cc4dde4bba17b4eb38a7f195c0d
Parents: 7cd0507
Author: James Peach 
Authored: Tue Jan 5 20:18:43 2016 -0800
Committer: James Peach 
Committed: Tue Jan 12 16:57:28 2016 -0800

--
 iocore/net/SSLUtils.cc| 2 +-
 mgmt/RecordsConfig.cc | 2 +-
 proxy/config/stats.config.xml.default | 5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8e0f8145/iocore/net/SSLUtils.cc
--
diff --git a/iocore/net/SSLUtils.cc b/iocore/net/SSLUtils.cc
index 0231a15..03d1b4e 100644
--- a/iocore/net/SSLUtils.cc
+++ b/iocore/net/SSLUtils.cc
@@ -902,7 +902,7 @@ SSLInitializeStatistics()
   // SSL handshake time
   RecRegisterRawStat(ssl_rsb, RECT_PROCESS, 
"proxy.process.ssl.total_handshake_time", RECD_INT, RECP_PERSISTENT,
  (int)ssl_total_handshake_time_stat, RecRawStatSyncSum);
-  RecRegisterRawStat(ssl_rsb, RECT_PROCESS, 
"proxy.process.ssl.total_success_handshake_count", RECD_INT, RECP_PERSISTENT,
+  RecRegisterRawStat(ssl_rsb, RECT_PROCESS, 
"proxy.process.ssl.total_success_handshake_count_in", RECD_INT, RECP_PERSISTENT,
  (int)ssl_total_success_handshake_count_in_stat, 
RecRawStatSyncCount);
   RecRegisterRawStat(ssl_rsb, RECT_PROCESS, 
"proxy.process.ssl.total_success_handshake_count_out", RECD_INT, 
RECP_PERSISTENT,
  (int)ssl_total_success_handshake_count_out_stat, 
RecRawStatSyncCount);

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8e0f8145/mgmt/RecordsConfig.cc
--
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 05d87f8..3345f2a 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -1771,7 +1771,7 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_NODE, "proxy.node.log.bytes_lost_before_written_to_disk", RECD_INT, 
"0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
-  {RECT_NODE, "proxy.process.ssl.total_success_handshake_count_in", RECD_INT, 
"0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  {RECT_PROCESS, "proxy.process.ssl.total_success_handshake_count", RECD_INT, 
"0", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
 
   //#

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8e0f8145/proxy/config/stats.config.xml.default
--
diff --git a/proxy/config/stats.config.xml.default 
b/proxy/config/stats.config.xml.default
index 430e2be..da17a2c 100644
--- a/proxy/config/stats.config.xml.default
+++ b/proxy/config/stats.config.xml.default
@@ -1946,11 +1946,12 @@
 
 
 
+
 
-
proxy.process.ssl.total_success_handshake_count_in
+
proxy.process.ssl.total_success_handshake_count
 
-proxy.process.ssl.total_success_handshake_count
+proxy.process.ssl.total_success_handshake_count_in
 
 
 



trafficserver git commit: TS-3072: fix newer compiler warnings.

2016-01-12 Thread shinrich
Repository: trafficserver
Updated Branches:
  refs/heads/master a0081119c -> 7cd050790


TS-3072: fix newer compiler warnings.


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

Branch: refs/heads/master
Commit: 7cd050790b4cc6a85becebef7438e01f267f0bd3
Parents: a008111
Author: shinrich 
Authored: Tue Jan 12 17:50:34 2016 -0600
Committer: shinrich 
Committed: Tue Jan 12 17:50:34 2016 -0600

--
 lib/ts/ContFlags.cc | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7cd05079/lib/ts/ContFlags.cc
--
diff --git a/lib/ts/ContFlags.cc b/lib/ts/ContFlags.cc
index 6f564b6..4e37e5e 100644
--- a/lib/ts/ContFlags.cc
+++ b/lib/ts/ContFlags.cc
@@ -39,33 +39,35 @@ void
 init_cont_flags()
 {
   ContFlags new_flags;
-  ink_thread_setspecific(flags_data_key, (void *)new_flags.get_flags());
+  void *val = reinterpret_cast(static_cast((new_flags.get_flags(;
+  ink_thread_setspecific(flags_data_key, val);
 }
 
 void
 set_cont_flags(const ContFlags &flags)
 {
-  ink_thread_setspecific(flags_data_key, (void *)flags.get_flags());
+  void *val = reinterpret_cast(static_cast((flags.get_flags(;
+  ink_thread_setspecific(flags_data_key, val);
 }
 
 void
 set_cont_flag(ContFlags::flags flag_bit, bool value)
 {
-  u_int64_t flags = (u_int64_t)ink_thread_getspecific(flags_data_key);
-  ContFlags new_flags(flags);
+  ContFlags 
new_flags(reinterpret_cast(ink_thread_getspecific(flags_data_key)));
   new_flags.set_flag(flag_bit, value);
-  ink_thread_setspecific(flags_data_key, (void *)new_flags.get_flags());
+  void *val = reinterpret_cast(static_cast((new_flags.get_flags(;
+  ink_thread_setspecific(flags_data_key, val);
 }
 
 ContFlags
 get_cont_flags()
 {
-  return ContFlags((u_int64_t)ink_thread_getspecific(flags_data_key));
+  return 
ContFlags(reinterpret_cast(ink_thread_getspecific(flags_data_key)));
 }
 
 bool
 get_cont_flag(ContFlags::flags flag_bit)
 {
-  ContFlags flags((u_int64_t)ink_thread_getspecific(flags_data_key));
+  ContFlags 
flags(reinterpret_cast(ink_thread_getspecific(flags_data_key)));
   return flags.get_flag(flag_bit);
 }



trafficserver git commit: Update CHANGES

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x 19ea44d0d -> 7e005ad6c


Update CHANGES


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

Branch: refs/heads/6.1.x
Commit: 7e005ad6c0cc04b08fcd7fa878dd87700b8fa206
Parents: 19ea44d
Author: Leif Hedstrom 
Authored: Tue Jan 12 14:45:11 2016 -0800
Committer: Leif Hedstrom 
Committed: Tue Jan 12 14:45:11 2016 -0800

--
 CHANGES | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7e005ad6/CHANGES
--
diff --git a/CHANGES b/CHANGES
index a08808a..973b9b6 100644
--- a/CHANGES
+++ b/CHANGES
@@ -2,10 +2,6 @@ Changes with Apache Traffic Server 6.1.0
 
 Bug:
   *) [TS-2118] memcached plugin is in the source tree but does not build
-  *) [TS-2427] xdebug: Trigger should be configurable
-  *) [TS-2523] automatically max out the listen backlog
-  *) [TS-2861] traffic_ctl option to find differences from defaults
-  *) [TS-3208] clang warnings on || 1
   *) [TS-3234] "crc" field shows "TCP_REFRESH_HIT" though ATS dosen't cache
   *) [TS-3363] core dump in HttpSM::handle_server_setup_error when handling 
inactivity timer expiry
   *) [TS-3490] mysql_remap Plugin compile fails on Mac OS X 10.10
@@ -18,6 +14,7 @@ Bug:
   *) [TS-3813] Correct responses when half-closed stream receive frames
   *) [TS-3815] traffic_ctl should filter record searches
   *) [TS-3821] Segmentation fault possibly due leaks in atscppapi
+  *) [TS-3841] LogAccess.cc assert failed when enabling custom log and 
stats_over_http plugin
   *) [TS-3847] Rejects Dynamic Table Size if it does not appear at the 
beginning of the first header block
   *) [TS-3848] ATS runs without cache or partial cache on disk errors
   *) [TS-3859] regex_remap can have pcre_study() fail on some platforms for 
simple regex
@@ -93,11 +90,16 @@ Bug:
   *) [TS-4084] Empty README.md file
   *) [TS-4089] CID 1343608, 1343607: Parent selection Coverity issues
   *) [TS-4091] [ats-multiplexer] multiplexer breaks in the presence of 
internal headers
-  *) [TS-4097] HPACK encoder doesn't handle empty value
+  *) [TS-4106] Cache Inspector fails to split multiline URLs
+  *) [TS-4111] Typo: Fix a typo in traffic_via command reference
+  *) [TS-4125] Wrong non-active conditions check
 
 Improvement:
-  *) [TS-306] enable log rotation for diags.log
+  *) [TS-306] Enable log rotation for diags.log
   *) [TS-315] Add switch to disable config file generation/runtime behavior 
changing
+  *) [TS-2427] xdebug: Trigger should be configurable
+  *) [TS-2523] Automatically max out the listen backlog
+  *) [TS-2861] traffic_ctl option to find differences from defaults
   *) [TS-3827] Cleanup code only depends on drafts of HTTP/2
   *) [TS-3833] healthecks plugin should use PATH_NAME_MAX
   *) [TS-3835] Make open_write_fail_action setting overridable and do not 
apply the setting for 3xx redirect follow.



trafficserver git commit: Clang-format fix

2016-01-12 Thread shinrich
Repository: trafficserver
Updated Branches:
  refs/heads/master 63bf16f15 -> a0081119c


Clang-format fix


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

Branch: refs/heads/master
Commit: a0081119c19b4401d87ba70c21cc0870142fc847
Parents: 63bf16f
Author: shinrich 
Authored: Tue Jan 12 16:44:16 2016 -0600
Committer: shinrich 
Committed: Tue Jan 12 16:44:16 2016 -0600

--
 iocore/cache/CachePages.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a0081119/iocore/cache/CachePages.cc
--
diff --git a/iocore/cache/CachePages.cc b/iocore/cache/CachePages.cc
index f0bec19..d841f70 100644
--- a/iocore/cache/CachePages.cc
+++ b/iocore/cache/CachePages.cc
@@ -126,7 +126,7 @@ struct ShowCache : public ShowCont {
   q = strstr(p, "%0D%0A" /* \r\n */); // we used this in the JS to 
separate urls
   if (!q)
 q = t;
-  ink_strlcpy(show_cache_urlstrs[s], p, q ? q - p + 1: 
sizeof(show_cache_urlstrs[s]));
+  ink_strlcpy(show_cache_urlstrs[s], p, q ? q - p + 1 : 
sizeof(show_cache_urlstrs[s]));
   p = q + 6; // +6 ==> strlen(%0D%0A)
 }
   }



[1/2] trafficserver git commit: TS-3072: Debug logging for single connection. Without config control. This closes #398.

2016-01-12 Thread shinrich
Repository: trafficserver
Updated Branches:
  refs/heads/master 500b3c5e0 -> 63bf16f15


TS-3072: Debug logging for single connection. Without config control.  This 
closes #398.


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

Branch: refs/heads/master
Commit: 45266942b4510f5d06f2af95ea7b8972134ad8f8
Parents: 3a8ee6b
Author: shinrich 
Authored: Tue Nov 24 15:08:44 2015 -0600
Committer: shinrich 
Committed: Tue Jan 12 16:40:25 2016 -0600

--
 iocore/eventsystem/I_Continuation.h |  9 
 iocore/net/UnixNet.cc   |  5 ++
 lib/ts/ContFlags.cc | 71 
 lib/ts/ContFlags.h  | 93 
 lib/ts/Diags.h  |  9 
 lib/ts/Makefile.am  |  2 +
 proxy/http/HttpSM.cc|  3 ++
 7 files changed, 192 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45266942/iocore/eventsystem/I_Continuation.h
--
diff --git a/iocore/eventsystem/I_Continuation.h 
b/iocore/eventsystem/I_Continuation.h
index ec7c3f0..9ba78b4 100644
--- a/iocore/eventsystem/I_Continuation.h
+++ b/iocore/eventsystem/I_Continuation.h
@@ -39,6 +39,7 @@
 #include "ts/ink_platform.h"
 #include "ts/List.h"
 #include "I_Lock.h"
+#include "ts/ContFlags.h"
 
 class Continuation;
 class ContinuationQueue;
@@ -128,6 +129,12 @@ public:
   LINK(Continuation, link);
 
   /**
+Contains values for debug_override and future flags that
+needs to be thread local while this continuation is running
+  */
+  ContFlags control_flags;
+
+  /**
 Receives the event code and data for an Event.
 
 This function receives the event code and data for an event and
@@ -191,6 +198,8 @@ inline Continuation::Continuation(ProxyMutex *amutex)
 #endif
 mutex(amutex)
 {
+  // Pick up the control flags from the creating thread
+  this->control_flags.set_flags(get_cont_flags().get_flags());
 }
 
 #endif /*_Continuation_h_*/

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45266942/iocore/net/UnixNet.cc
--
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index b3a7587..c4405ae 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -510,6 +510,8 @@ NetHandler::mainNetEvent(int event, Event *e)
 #if defined(USE_EDGE_TRIGGER)
   // UnixNetVConnection *
   while ((vc = read_ready_list.dequeue())) {
+// Initialize the thread-local continuation flags
+set_cont_flags(vc->control_flags);
 if (vc->closed)
   close_UnixNetVConnection(vc, trigger_event->ethread);
 else if (vc->read.enabled && vc->read.triggered)
@@ -526,6 +528,7 @@ NetHandler::mainNetEvent(int event, Event *e)
 }
   }
   while ((vc = write_ready_list.dequeue())) {
+set_cont_flags(vc->control_flags);
 if (vc->closed)
   close_UnixNetVConnection(vc, trigger_event->ethread);
 else if (vc->write.enabled && vc->write.triggered)
@@ -543,6 +546,7 @@ NetHandler::mainNetEvent(int event, Event *e)
   }
 #else  /* !USE_EDGE_TRIGGER */
   while ((vc = read_ready_list.dequeue())) {
+diags->set_override(vc->control.debug_override);
 if (vc->closed)
   close_UnixNetVConnection(vc, trigger_event->ethread);
 else if (vc->read.enabled && vc->read.triggered)
@@ -551,6 +555,7 @@ NetHandler::mainNetEvent(int event, Event *e)
   vc->ep.modify(-EVENTIO_READ);
   }
   while ((vc = write_ready_list.dequeue())) {
+diags->set_override(vc->control.debug_override);
 if (vc->closed)
   close_UnixNetVConnection(vc, trigger_event->ethread);
 else if (vc->write.enabled && vc->write.triggered)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45266942/lib/ts/ContFlags.cc
--
diff --git a/lib/ts/ContFlags.cc b/lib/ts/ContFlags.cc
new file mode 100644
index 000..6f564b6
--- /dev/null
+++ b/lib/ts/ContFlags.cc
@@ -0,0 +1,71 @@
+/** @file
+
+  A brief file description
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or 

[2/2] trafficserver git commit: Merge branch 'pr/398'

2016-01-12 Thread shinrich
Merge branch 'pr/398'


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

Branch: refs/heads/master
Commit: 63bf16f153594ea6f5b4a903e6ede6bd6360360a
Parents: 500b3c5 4526694
Author: shinrich 
Authored: Tue Jan 12 16:42:08 2016 -0600
Committer: shinrich 
Committed: Tue Jan 12 16:42:08 2016 -0600

--
 iocore/eventsystem/I_Continuation.h |  9 
 iocore/net/UnixNet.cc   |  5 ++
 lib/ts/ContFlags.cc | 71 
 lib/ts/ContFlags.h  | 93 
 lib/ts/Diags.h  |  9 
 lib/ts/Makefile.am  |  2 +
 proxy/http/HttpSM.cc|  3 ++
 7 files changed, 192 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/63bf16f1/iocore/net/UnixNet.cc
--



[2/2] trafficserver git commit: TS-4064: Customizable congestion control algorithms: DOCS

2016-01-12 Thread briang
TS-4064: Customizable congestion control algorithms: DOCS


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

Branch: refs/heads/master
Commit: 500b3c5e0f3642ebb42ba511340c53553f9d6be9
Parents: 038b189
Author: Brian Geffon 
Authored: Tue Jan 5 03:01:57 2016 -0800
Committer: Brian Geffon 
Committed: Tue Jan 5 03:02:29 2016 -0800

--
 doc/admin-guide/files/records.config.en.rst | 12 
 1 file changed, 12 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/500b3c5e/doc/admin-guide/files/records.config.en.rst
--
diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index d313b78..51f14f5 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -2857,6 +2857,18 @@ Sockets
   If it is set to -1, Traffic Server will automatically set this
   to a platform-specific maximum.
 
+.. ts:cv:: CONFIG  proxy.config.net.tcp_congestion_control_in STRING ""
+
+   This directive will override the congestion control algorithm for incoming
+   connections (accept sockets). On linux the allowed values are typically
+   specified in a space seperated list in 
/proc/sys/net/ipv4/tcp_allowed_congestion_control
+
+.. ts:cv:: CONFIG  proxy.config.net.tcp_congestion_control_out STRING ""
+
+   This directive will override the congestion control algorithm for outgoing 
+   connections (connect sockets). On linux the allowed values are typically
+   specified in a space seperated list in 
/proc/sys/net/ipv4/tcp_allowed_congestion_control
+
 .. ts:cv:: CONFIG proxy.config.net.sock_send_buffer_size_in INT 0
 
Sets the send buffer size for connections from the client to Traffic Server.



[1/2] trafficserver git commit: TS-4064: Customizable congestion control algorithms

2016-01-12 Thread briang
Repository: trafficserver
Updated Branches:
  refs/heads/master a70e9473c -> 500b3c5e0


TS-4064: Customizable congestion control algorithms


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

Branch: refs/heads/master
Commit: 038b189d62e8100a656e674e6ed4fd611ba32d6f
Parents: a70e947
Author: Brian Geffon 
Authored: Tue Jan 5 02:37:04 2016 -0800
Committer: Brian Geffon 
Committed: Tue Jan 5 03:02:28 2016 -0800

--
 iocore/net/I_NetVConnection.h |  3 +++
 iocore/net/P_UnixNetVConnection.h | 20 
 mgmt/RecordsConfig.cc |  4 
 proxy/PluginVC.cc |  6 ++
 proxy/PluginVC.h  |  2 ++
 proxy/http/HttpClientSession.cc   |  8 
 proxy/http/HttpServerSession.cc   |  8 
 7 files changed, 51 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/iocore/net/I_NetVConnection.h
--
diff --git a/iocore/net/I_NetVConnection.h b/iocore/net/I_NetVConnection.h
index 79e2dac..0dcda03 100644
--- a/iocore/net/I_NetVConnection.h
+++ b/iocore/net/I_NetVConnection.h
@@ -518,6 +518,9 @@ public:
   /** Set the TCP initial congestion window */
   virtual int set_tcp_init_cwnd(int init_cwnd) = 0;
 
+  /** Set the TCP congestion control algorithm */
+  virtual int set_tcp_congestion_control(const char *name, int len) = 0;
+
   /** Set local sock addr struct. */
   virtual void set_local_addr() = 0;
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/iocore/net/P_UnixNetVConnection.h
--
diff --git a/iocore/net/P_UnixNetVConnection.h 
b/iocore/net/P_UnixNetVConnection.h
index 968b0b9..5c20d13 100644
--- a/iocore/net/P_UnixNetVConnection.h
+++ b/iocore/net/P_UnixNetVConnection.h
@@ -291,6 +291,7 @@ public:
   virtual void set_local_addr();
   virtual void set_remote_addr();
   virtual int set_tcp_init_cwnd(int init_cwnd);
+  virtual int set_tcp_congestion_control(const char *name, int len);
   virtual void apply_options();
 
   friend void write_to_net_io(NetHandler *, UnixNetVConnection *, EThread *);
@@ -452,6 +453,25 @@ UnixNetVConnection::set_tcp_init_cwnd(int init_cwnd)
 #endif
 }
 
+TS_INLINE int
+UnixNetVConnection::set_tcp_congestion_control(const char *name, int len)
+{
+#ifdef TCP_CONGESTION
+  int rv = 0;
+  rv = setsockopt(con.fd, IPPROTO_TCP, TCP_CONGESTION, reinterpret_cast(const_cast(name)), len);
+  if (rv < 0) {
+Error("Unable to set TCP congestion control on socket %d to \"%.*s\", 
errno=%d (%s)", con.fd, len, name, errno,
+  strerror(errno));
+  } else {
+Debug("socket", "Setting TCP congestion control on socket [%d] to \"%.*s\" 
-> %d", con.fd, len, name, rv);
+  }
+  return rv;
+#else
+  Debug("socket", "Setting TCP congestion control %.*s is not supported on 
this platform.", len, name);
+  return -1;
+#endif
+}
+
 TS_INLINE UnixNetVConnection::~UnixNetVConnection()
 {
 }

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/mgmt/RecordsConfig.cc
--
diff --git a/mgmt/RecordsConfig.cc b/mgmt/RecordsConfig.cc
index 34e180d..05d87f8 100644
--- a/mgmt/RecordsConfig.cc
+++ b/mgmt/RecordsConfig.cc
@@ -855,6 +855,10 @@ static const RecordElement RecordsConfig[] =
   ,
   {RECT_CONFIG, "proxy.config.net.sock_option_tfo_queue_size_in", RECD_INT, 
"1", RECU_NULL, RR_NULL, RECC_NULL, NULL, RECA_NULL}
   ,
+  {RECT_CONFIG, "proxy.config.net.tcp_congestion_control_in", RECD_STRING, "", 
RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
+  {RECT_CONFIG, "proxy.config.net.tcp_congestion_control_out", RECD_STRING, 
"", RECU_DYNAMIC, RR_NULL, RECC_NULL, NULL, RECA_NULL}
+  ,
 
   
//##
   //#

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/proxy/PluginVC.cc
--
diff --git a/proxy/PluginVC.cc b/proxy/PluginVC.cc
index 25efaf9..b0a5e92 100644
--- a/proxy/PluginVC.cc
+++ b/proxy/PluginVC.cc
@@ -907,6 +907,12 @@ PluginVC::set_tcp_init_cwnd(int /* init_cwnd ATS_UNUSED */)
   return -1;
 }
 
+int
+PluginVC::set_tcp_congestion_control(const char *ATS_UNUSED, int ATS_UNUSED)
+{
+  return -1;
+}
+
 void
 PluginVC::apply_options()
 {

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/038b189d/proxy/PluginVC.h
--
diff --git a/proxy/PluginVC.h b/proxy/PluginVC.h
index b4

trafficserver git commit: TS-4106 Allow Cache Inspector to split properly on multiline URLs

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x 41964ab76 -> 19ea44d0d


TS-4106 Allow Cache Inspector to split properly on multiline URLs

Leif: This was broken in commit bd304288b55e989, and the fixes seems
to restore original behavior (while retaining the use of strlcpy() ).

This closes #401

(cherry picked from commit a70e9473cabba89861965d5ab775dbe4f20c720b)


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

Branch: refs/heads/6.1.x
Commit: 19ea44d0db1ae3697f8100909f3b3b84b158c8d8
Parents: 41964ab
Author: Hiroaki Nakamura 
Authored: Fri Jan 1 09:00:19 2016 +0900
Committer: Leif Hedstrom 
Committed: Tue Jan 12 13:47:59 2016 -0800

--
 iocore/cache/CachePages.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/19ea44d0/iocore/cache/CachePages.cc
--
diff --git a/iocore/cache/CachePages.cc b/iocore/cache/CachePages.cc
index b850f0b..f0bec19 100644
--- a/iocore/cache/CachePages.cc
+++ b/iocore/cache/CachePages.cc
@@ -126,7 +126,7 @@ struct ShowCache : public ShowCont {
   q = strstr(p, "%0D%0A" /* \r\n */); // we used this in the JS to 
separate urls
   if (!q)
 q = t;
-  ink_strlcpy(show_cache_urlstrs[s], p, sizeof(show_cache_urlstrs[s]));
+  ink_strlcpy(show_cache_urlstrs[s], p, q ? q - p + 1: 
sizeof(show_cache_urlstrs[s]));
   p = q + 6; // +6 ==> strlen(%0D%0A)
 }
   }



trafficserver git commit: TS-4106 Allow Cache Inspector to split properly on multiline URLs

2016-01-12 Thread zwoop
Repository: trafficserver
Updated Branches:
  refs/heads/master c26952d95 -> a70e9473c


TS-4106 Allow Cache Inspector to split properly on multiline URLs

Leif: This was broken in commit bd304288b55e989, and the fixes seems
to restore original behavior (while retaining the use of strlcpy() ).

This closes #401


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

Branch: refs/heads/master
Commit: a70e9473cabba89861965d5ab775dbe4f20c720b
Parents: c26952d
Author: Hiroaki Nakamura 
Authored: Fri Jan 1 09:00:19 2016 +0900
Committer: Leif Hedstrom 
Committed: Tue Jan 12 13:46:50 2016 -0800

--
 iocore/cache/CachePages.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a70e9473/iocore/cache/CachePages.cc
--
diff --git a/iocore/cache/CachePages.cc b/iocore/cache/CachePages.cc
index b850f0b..f0bec19 100644
--- a/iocore/cache/CachePages.cc
+++ b/iocore/cache/CachePages.cc
@@ -126,7 +126,7 @@ struct ShowCache : public ShowCont {
   q = strstr(p, "%0D%0A" /* \r\n */); // we used this in the JS to 
separate urls
   if (!q)
 q = t;
-  ink_strlcpy(show_cache_urlstrs[s], p, sizeof(show_cache_urlstrs[s]));
+  ink_strlcpy(show_cache_urlstrs[s], p, q ? q - p + 1: 
sizeof(show_cache_urlstrs[s]));
   p = q + 6; // +6 ==> strlen(%0D%0A)
 }
   }



[2/2] trafficserver git commit: TS-4125: wrong non-active conditions check

2016-01-12 Thread bcall
TS-4125: wrong non-active conditions check

This closes #416

(cherry picked from commit c26952d95104067d45704d6c81eb3bc038fd2282)


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

Branch: refs/heads/6.1.x
Commit: 41964ab7662741d71de46286b7db8fb9a557a60f
Parents: c35ea7f
Author: Oknet 
Authored: Tue Jan 12 09:22:26 2016 -0800
Committer: Bryan Call 
Committed: Tue Jan 12 09:23:52 2016 -0800

--
 iocore/net/UnixNet.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/41964ab7/iocore/net/UnixNet.cc
--
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index b3a7587..7e0948c 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -586,7 +586,7 @@ NetHandler::manage_active_queue()
   int total_idle_time = 0;
   int total_idle_count = 0;
   for (; vc != NULL; vc = vc_next) {
-if ((vc->next_inactivity_timeout_at > now) || 
(vc->next_activity_timeout_at > now)) {
+if ((vc->next_inactivity_timeout_at <= now) || 
(vc->next_activity_timeout_at <= now)) {
   _close_vc(vc, now, handle_event, closed, total_idle_time, 
total_idle_count);
 }
 if (max_connections_active_per_thread_in > active_queue_size) {



[1/2] trafficserver git commit: TS-3841: LogAccess.cc assert failed when enabling custom log and stats_over_http plugin

2016-01-12 Thread bcall
Repository: trafficserver
Updated Branches:
  refs/heads/6.1.x f4b33e684 -> 41964ab76


TS-3841: LogAccess.cc assert failed when enabling custom log and 
stats_over_http plugin

(cherry picked from commit 9399a76410de027092b20e0a287f315fca20257d)


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

Branch: refs/heads/6.1.x
Commit: c35ea7ff08ce9402b7e3c9bb5c522d6e5ed2ec4c
Parents: f4b33e6
Author: Bryan Call 
Authored: Mon Jan 11 17:35:50 2016 -0800
Committer: Bryan Call 
Committed: Tue Jan 12 09:23:41 2016 -0800

--
 proxy/logging/LogAccessHttp.cc | 21 +
 1 file changed, 17 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c35ea7ff/proxy/logging/LogAccessHttp.cc
--
diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc
index 68e3bff..3d12ebf 100644
--- a/proxy/logging/LogAccessHttp.cc
+++ b/proxy/logging/LogAccessHttp.cc
@@ -506,16 +506,29 @@ LogAccessHttp::marshal_client_req_unmapped_url_path(char 
*buf)
 int
 LogAccessHttp::marshal_client_req_unmapped_url_host(char *buf)
 {
-  int len = INK_MIN_ALIGN;
+  int plen = INK_MIN_ALIGN;
 
   validate_unmapped_url();
   validate_unmapped_url_path();
 
-  len = round_strlen(m_client_req_unmapped_url_host_len + 1); // +1 for eos
+  int alen = m_client_req_unmapped_url_host_len;
+  if (alen < 0) {
+alen = 0;
+  }
+
+  // calculate the the padded length only if the actual length
+  // is not zero. We don't want the padded length to be zero
+  // because marshal_mem should write the DEFAULT_STR to the
+  // buffer if str is nil, and we need room for this.
+  if (alen) {
+plen = round_strlen(alen + 1); // +1 for eos
+  }
+
   if (buf) {
-marshal_mem(buf, m_client_req_unmapped_url_host_str, 
m_client_req_unmapped_url_host_len, len);
+marshal_mem(buf, m_client_req_unmapped_url_host_str, alen, plen);
   }
-  return len;
+
+  return plen;
 }
 
 int



trafficserver git commit: TS-4125: wrong non-active conditions check

2016-01-12 Thread bcall
Repository: trafficserver
Updated Branches:
  refs/heads/master 3a8ee6ba7 -> c26952d95


TS-4125: wrong non-active conditions check

This closes #416


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

Branch: refs/heads/master
Commit: c26952d95104067d45704d6c81eb3bc038fd2282
Parents: 3a8ee6b
Author: Oknet 
Authored: Tue Jan 12 09:22:26 2016 -0800
Committer: Bryan Call 
Committed: Tue Jan 12 09:22:26 2016 -0800

--
 iocore/net/UnixNet.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/c26952d9/iocore/net/UnixNet.cc
--
diff --git a/iocore/net/UnixNet.cc b/iocore/net/UnixNet.cc
index b3a7587..7e0948c 100644
--- a/iocore/net/UnixNet.cc
+++ b/iocore/net/UnixNet.cc
@@ -586,7 +586,7 @@ NetHandler::manage_active_queue()
   int total_idle_time = 0;
   int total_idle_count = 0;
   for (; vc != NULL; vc = vc_next) {
-if ((vc->next_inactivity_timeout_at > now) || 
(vc->next_activity_timeout_at > now)) {
+if ((vc->next_inactivity_timeout_at <= now) || 
(vc->next_activity_timeout_at <= now)) {
   _close_vc(vc, now, handle_event, closed, total_idle_time, 
total_idle_count);
 }
 if (max_connections_active_per_thread_in > active_queue_size) {



Re: trafficserver git commit: [TS-4024] wire tracing enhancements. This closes #337.

2016-01-12 Thread James Peach
This doesn't look like it addresses Alan's last comment about "unifying the SSL 
error reporting logic"

> On Jan 12, 2016, at 7:48 AM, shinr...@apache.org wrote:
> 
> Repository: trafficserver
> Updated Branches:
>  refs/heads/master 9399a7641 -> bb40d788b
> 
> 
> [TS-4024] wire tracing enhancements.  This closes #337.
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/bb40d788
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/bb40d788
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/bb40d788
> 
> Branch: refs/heads/master
> Commit: bb40d788bb092670b05e3d084bc14e330e3afa96
> Parents: 9399a76
> Author: ericcarlschwartz 
> Authored: Sat Nov 14 13:26:58 2015 -0800
> Committer: shinrich 
> Committed: Tue Jan 12 09:44:00 2016 -0600
> 
> --
> iocore/net/SSLConfig.cc |  8 
> iocore/net/SSLNetVConnection.cc | 39 ++--
> mgmt/RecordsConfig.cc   |  8 
> proxy/http/HttpSM.cc| 31 ++--
> 4 files changed, 52 insertions(+), 34 deletions(-)
> --
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb40d788/iocore/net/SSLConfig.cc
> --
> diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
> index 7bb60fe..63540ce 100644
> --- a/iocore/net/SSLConfig.cc
> +++ b/iocore/net/SSLConfig.cc
> @@ -307,10 +307,10 @@ SSLConfigParams::initialize()
>   REC_ReadConfigInt32(ssl_allow_client_renegotiation, 
> "proxy.config.ssl.allow_client_renegotiation");
> 
>   // SSL Wire Trace configurations
> -  REC_ReadConfigInteger(ssl_wire_trace_enabled, 
> "proxy.config.ssl.wire_trace_enabled");
> +  REC_EstablishStaticConfigInt32(ssl_wire_trace_enabled, 
> "proxy.config.ssl.wire_trace_enabled");
>   if (ssl_wire_trace_enabled) {
> // wire trace specific source ip
> -REC_ReadConfigStringAlloc(ssl_wire_trace_addr, 
> "proxy.config.ssl.wire_trace_addr");
> +REC_EstablishStaticConfigStringAlloc(ssl_wire_trace_addr, 
> "proxy.config.ssl.wire_trace_addr");
> if (ssl_wire_trace_addr) {
>   ssl_wire_trace_ip = new IpAddr();
>   ssl_wire_trace_ip->load(ssl_wire_trace_addr);
> @@ -318,8 +318,8 @@ SSLConfigParams::initialize()
>   ssl_wire_trace_ip = NULL;
> }
> // wire trace percentage of requests
> -REC_ReadConfigInteger(ssl_wire_trace_percentage, 
> "proxy.config.ssl.wire_trace_percentage");
> -REC_ReadConfigStringAlloc(ssl_wire_trace_server_name, 
> "proxy.config.ssl.wire_trace_server_name");
> +REC_EstablishStaticConfigInt32(ssl_wire_trace_percentage, 
> "proxy.config.ssl.wire_trace_percentage");
> +REC_EstablishStaticConfigStringAlloc(ssl_wire_trace_server_name, 
> "proxy.config.ssl.wire_trace_server_name");
>   } else {
> ssl_wire_trace_addr = NULL;
> ssl_wire_trace_ip = NULL;
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb40d788/iocore/net/SSLNetVConnection.cc
> --
> diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
> index 7199efa..dc48c63 100644
> --- a/iocore/net/SSLNetVConnection.cc
> +++ b/iocore/net/SSLNetVConnection.cc
> @@ -286,12 +286,16 @@ ssl_read_from_net(SSLNetVConnection *sslvc, EThread 
> *lthread, int64_t &ret)
> Debug("ssl.error", "[SSL_NetVConnection::ssl_read_from_net] 
> SSL_ERROR_ZERO_RETURN");
> break;
>   case SSL_ERROR_SSL:
> -  default:
> -TraceIn(trace, sslvc->get_remote_addr(), sslvc->get_remote_port(), 
> "SSL Error: sslErr=%d, errno=%d", sslErr, errno);
> +  default: {
> +char buf[512];
> +unsigned long e = ERR_peek_last_error();
> +ERR_error_string_n(e, buf, sizeof(buf));
> +TraceIn(trace, sslvc->get_remote_addr(), sslvc->get_remote_port(), 
> "SSL Error: sslErr=%d, ERR_get_error=%ld (%s) errno=%d",
> +sslErr, e, buf, errno);
> event = SSL_READ_ERROR;
> ret = errno;
> SSL_CLR_ERR_INCR_DYN_STAT(sslvc, ssl_error_ssl, 
> "[SSL_NetVConnection::ssl_read_from_net]: errno=%d", errno);
> -break;
> +  } break;
>   } // switch
>   break;
> } // while( block_write_avail > 0 )
> @@ -833,11 +837,15 @@ SSLNetVConnection::load_buffer_and_write(int64_t 
> towrite, int64_t &wattempted, i
>   Debug("ssl.error", "SSL_write-SSL_ERROR_ZERO_RETURN");
>   break;
> case SSL_ERROR_SSL:
> -default:
> -  TraceOut(trace, get_remote_addr(), get_remote_port(), "SSL Error: 
> sslErr=%d, errno=%d", err, errno);
> +default: {
> +  char buf[512];
> +  unsigned long e = ERR_peek_last_error();
> +  ERR_error_string_n(e, buf, sizeof(buf));
> +  TraceIn(trace, get_remot

trafficserver git commit: TS-4024: clang-format fix.

2016-01-12 Thread shinrich
Repository: trafficserver
Updated Branches:
  refs/heads/master bb40d788b -> 3a8ee6ba7


TS-4024: clang-format fix.


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

Branch: refs/heads/master
Commit: 3a8ee6ba7a42ca125d297ac8edeeba88df8636ad
Parents: bb40d78
Author: shinrich 
Authored: Tue Jan 12 10:12:19 2016 -0600
Committer: shinrich 
Committed: Tue Jan 12 10:12:19 2016 -0600

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


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/3a8ee6ba/proxy/http/HttpSM.cc
--
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index ab97380..40bb8fe 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -5641,7 +5641,7 @@ HttpSM::attach_server_session(HttpServerSession *s)
   SSLNetVConnection *ssl_vc = dynamic_cast(client_vc);
   bool associated_connection = false;
   if (server_vc) { // if server_vc isn't a PluginVC
-if (ssl_vc) { // if incoming connection is SSL
+if (ssl_vc) {  // if incoming connection is SSL
   bool client_trace = ssl_vc->getSSLTrace();
   if (client_trace) {
 // get remote address and port to mark corresponding traces



trafficserver git commit: [TS-4024] wire tracing enhancements. This closes #337.

2016-01-12 Thread shinrich
Repository: trafficserver
Updated Branches:
  refs/heads/master 9399a7641 -> bb40d788b


[TS-4024] wire tracing enhancements.  This closes #337.


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

Branch: refs/heads/master
Commit: bb40d788bb092670b05e3d084bc14e330e3afa96
Parents: 9399a76
Author: ericcarlschwartz 
Authored: Sat Nov 14 13:26:58 2015 -0800
Committer: shinrich 
Committed: Tue Jan 12 09:44:00 2016 -0600

--
 iocore/net/SSLConfig.cc |  8 
 iocore/net/SSLNetVConnection.cc | 39 ++--
 mgmt/RecordsConfig.cc   |  8 
 proxy/http/HttpSM.cc| 31 ++--
 4 files changed, 52 insertions(+), 34 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb40d788/iocore/net/SSLConfig.cc
--
diff --git a/iocore/net/SSLConfig.cc b/iocore/net/SSLConfig.cc
index 7bb60fe..63540ce 100644
--- a/iocore/net/SSLConfig.cc
+++ b/iocore/net/SSLConfig.cc
@@ -307,10 +307,10 @@ SSLConfigParams::initialize()
   REC_ReadConfigInt32(ssl_allow_client_renegotiation, 
"proxy.config.ssl.allow_client_renegotiation");
 
   // SSL Wire Trace configurations
-  REC_ReadConfigInteger(ssl_wire_trace_enabled, 
"proxy.config.ssl.wire_trace_enabled");
+  REC_EstablishStaticConfigInt32(ssl_wire_trace_enabled, 
"proxy.config.ssl.wire_trace_enabled");
   if (ssl_wire_trace_enabled) {
 // wire trace specific source ip
-REC_ReadConfigStringAlloc(ssl_wire_trace_addr, 
"proxy.config.ssl.wire_trace_addr");
+REC_EstablishStaticConfigStringAlloc(ssl_wire_trace_addr, 
"proxy.config.ssl.wire_trace_addr");
 if (ssl_wire_trace_addr) {
   ssl_wire_trace_ip = new IpAddr();
   ssl_wire_trace_ip->load(ssl_wire_trace_addr);
@@ -318,8 +318,8 @@ SSLConfigParams::initialize()
   ssl_wire_trace_ip = NULL;
 }
 // wire trace percentage of requests
-REC_ReadConfigInteger(ssl_wire_trace_percentage, 
"proxy.config.ssl.wire_trace_percentage");
-REC_ReadConfigStringAlloc(ssl_wire_trace_server_name, 
"proxy.config.ssl.wire_trace_server_name");
+REC_EstablishStaticConfigInt32(ssl_wire_trace_percentage, 
"proxy.config.ssl.wire_trace_percentage");
+REC_EstablishStaticConfigStringAlloc(ssl_wire_trace_server_name, 
"proxy.config.ssl.wire_trace_server_name");
   } else {
 ssl_wire_trace_addr = NULL;
 ssl_wire_trace_ip = NULL;

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb40d788/iocore/net/SSLNetVConnection.cc
--
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 7199efa..dc48c63 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -286,12 +286,16 @@ ssl_read_from_net(SSLNetVConnection *sslvc, EThread 
*lthread, int64_t &ret)
 Debug("ssl.error", "[SSL_NetVConnection::ssl_read_from_net] 
SSL_ERROR_ZERO_RETURN");
 break;
   case SSL_ERROR_SSL:
-  default:
-TraceIn(trace, sslvc->get_remote_addr(), sslvc->get_remote_port(), 
"SSL Error: sslErr=%d, errno=%d", sslErr, errno);
+  default: {
+char buf[512];
+unsigned long e = ERR_peek_last_error();
+ERR_error_string_n(e, buf, sizeof(buf));
+TraceIn(trace, sslvc->get_remote_addr(), sslvc->get_remote_port(), 
"SSL Error: sslErr=%d, ERR_get_error=%ld (%s) errno=%d",
+sslErr, e, buf, errno);
 event = SSL_READ_ERROR;
 ret = errno;
 SSL_CLR_ERR_INCR_DYN_STAT(sslvc, ssl_error_ssl, 
"[SSL_NetVConnection::ssl_read_from_net]: errno=%d", errno);
-break;
+  } break;
   } // switch
   break;
 } // while( block_write_avail > 0 )
@@ -833,11 +837,15 @@ SSLNetVConnection::load_buffer_and_write(int64_t towrite, 
int64_t &wattempted, i
   Debug("ssl.error", "SSL_write-SSL_ERROR_ZERO_RETURN");
   break;
 case SSL_ERROR_SSL:
-default:
-  TraceOut(trace, get_remote_addr(), get_remote_port(), "SSL Error: 
sslErr=%d, errno=%d", err, errno);
+default: {
+  char buf[512];
+  unsigned long e = ERR_peek_last_error();
+  ERR_error_string_n(e, buf, sizeof(buf));
+  TraceIn(trace, get_remote_addr(), get_remote_port(), "SSL Error: 
sslErr=%d, ERR_get_error=%ld (%s) errno=%d", err, e, buf,
+  errno);
   r = -errno;
   SSL_CLR_ERR_INCR_DYN_STAT(this, ssl_error_ssl, "SSL_write-SSL_ERROR_SSL 
errno=%d", errno);
-  break;
+} break;
 }
 return (r);
   }
@@ -1232,10 +1240,15 @@ SSLNetVConnection::sslServerHandShakeEve