[trafficserver] branch 9.0.x updated: Add a new log tag % AppVersionInfo.BldNumStr

2020-04-08 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 1ba3e68  Add a new log tag % AppVersionInfo.BldNumStr
1ba3e68 is described below

commit 1ba3e68d16771a92876fc151fe430313729d7e5f
Author: Masa Sekimura 
AuthorDate: Fri Nov 18 23:34:35 2016 +

Add a new log tag % AppVersionInfo.BldNumStr

TS-5051

(cherry picked from commit 9bd8abb51984861801af03310869424db244b778)
---
 proxy/http/unit_tests/unit_test_main.cc |  5 +
 proxy/logging/Log.cc|  5 +
 proxy/logging/LogAccess.cc  | 15 +++
 proxy/logging/LogAccess.h   |  1 +
 4 files changed, 26 insertions(+)

diff --git a/proxy/http/unit_tests/unit_test_main.cc 
b/proxy/http/unit_tests/unit_test_main.cc
index 6aed3a6..6217bda 100644
--- a/proxy/http/unit_tests/unit_test_main.cc
+++ b/proxy/http/unit_tests/unit_test_main.cc
@@ -22,4 +22,9 @@
  */
 
 #define CATCH_CONFIG_MAIN
+
 #include "catch.hpp"
+
+#include "tscore/I_Version.h"
+
+AppVersionInfo appVersionInfo;
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 9f39ea9..42f8dc3 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -902,6 +902,11 @@ Log::init_fields()
   global_field_list.add(field, false);
   field_symbol_hash.emplace("ctpd", field);
 
+  field = new LogField("version_build_number", "vbn", LogField::STRING, 
&LogAccess::marshal_version_build_number,
+   (LogField::UnmarshalFunc)&LogAccess::unmarshal_str);
+  global_field_list.add(field, false);
+  field_symbol_hash.emplace("vbn", field);
+
   init_status |= FIELDS_INITIALIZED;
 }
 
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index 6e3aac4..32b2e19 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -30,6 +30,8 @@
 #include "LogFormat.h"
 #include "LogBuffer.h"
 
+extern AppVersionInfo appVersionInfo;
+
 char INVALID_STR[] = "!INVALID_STR!";
 
 #define HIDDEN_CONTENT_TYPE "@Content-Type"
@@ -1300,6 +1302,19 @@ LogAccess::marshal_client_sni_server_name(char *buf)
   -*/
 
 int
+LogAccess::marshal_version_build_number(char *buf)
+{
+  int len = sizeof(appVersionInfo.BldNumStr);
+  if (buf) {
+marshal_str(buf, appVersionInfo.BldNumStr, len);
+  }
+  return len;
+}
+
+/*-
+  -*/
+
+int
 LogAccess::marshal_client_host_port(char *buf)
 {
   if (buf) {
diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h
index fa83bc8..e9090d3 100644
--- a/proxy/logging/LogAccess.h
+++ b/proxy/logging/LogAccess.h
@@ -251,6 +251,7 @@ public:
   inkcoreapi int marshal_client_http_transaction_priority_dependence(char *); 
// INT
   inkcoreapi int marshal_cache_lookup_url_canon(char *);  
// STR
   inkcoreapi int marshal_client_sni_server_name(char *);  
// STR
+  inkcoreapi int marshal_version_build_number(char *);
// STR
 
   // named fields from within a http header
   //



[trafficserver] branch master updated: Add a new log tag % AppVersionInfo.BldNumStr

2020-04-08 Thread rrm
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 9bd8abb  Add a new log tag % AppVersionInfo.BldNumStr
9bd8abb is described below

commit 9bd8abb51984861801af03310869424db244b778
Author: Masa Sekimura 
AuthorDate: Fri Nov 18 23:34:35 2016 +

Add a new log tag % AppVersionInfo.BldNumStr

TS-5051
---
 proxy/http/unit_tests/unit_test_main.cc |  5 +
 proxy/logging/Log.cc|  5 +
 proxy/logging/LogAccess.cc  | 15 +++
 proxy/logging/LogAccess.h   |  1 +
 4 files changed, 26 insertions(+)

diff --git a/proxy/http/unit_tests/unit_test_main.cc 
b/proxy/http/unit_tests/unit_test_main.cc
index 6aed3a6..6217bda 100644
--- a/proxy/http/unit_tests/unit_test_main.cc
+++ b/proxy/http/unit_tests/unit_test_main.cc
@@ -22,4 +22,9 @@
  */
 
 #define CATCH_CONFIG_MAIN
+
 #include "catch.hpp"
+
+#include "tscore/I_Version.h"
+
+AppVersionInfo appVersionInfo;
diff --git a/proxy/logging/Log.cc b/proxy/logging/Log.cc
index 9f39ea9..42f8dc3 100644
--- a/proxy/logging/Log.cc
+++ b/proxy/logging/Log.cc
@@ -902,6 +902,11 @@ Log::init_fields()
   global_field_list.add(field, false);
   field_symbol_hash.emplace("ctpd", field);
 
+  field = new LogField("version_build_number", "vbn", LogField::STRING, 
&LogAccess::marshal_version_build_number,
+   (LogField::UnmarshalFunc)&LogAccess::unmarshal_str);
+  global_field_list.add(field, false);
+  field_symbol_hash.emplace("vbn", field);
+
   init_status |= FIELDS_INITIALIZED;
 }
 
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index 6e3aac4..32b2e19 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -30,6 +30,8 @@
 #include "LogFormat.h"
 #include "LogBuffer.h"
 
+extern AppVersionInfo appVersionInfo;
+
 char INVALID_STR[] = "!INVALID_STR!";
 
 #define HIDDEN_CONTENT_TYPE "@Content-Type"
@@ -1300,6 +1302,19 @@ LogAccess::marshal_client_sni_server_name(char *buf)
   -*/
 
 int
+LogAccess::marshal_version_build_number(char *buf)
+{
+  int len = sizeof(appVersionInfo.BldNumStr);
+  if (buf) {
+marshal_str(buf, appVersionInfo.BldNumStr, len);
+  }
+  return len;
+}
+
+/*-
+  -*/
+
+int
 LogAccess::marshal_client_host_port(char *buf)
 {
   if (buf) {
diff --git a/proxy/logging/LogAccess.h b/proxy/logging/LogAccess.h
index fa83bc8..e9090d3 100644
--- a/proxy/logging/LogAccess.h
+++ b/proxy/logging/LogAccess.h
@@ -251,6 +251,7 @@ public:
   inkcoreapi int marshal_client_http_transaction_priority_dependence(char *); 
// INT
   inkcoreapi int marshal_cache_lookup_url_canon(char *);  
// STR
   inkcoreapi int marshal_client_sni_server_name(char *);  
// STR
+  inkcoreapi int marshal_version_build_number(char *);
// STR
 
   // named fields from within a http header
   //



[trafficserver] branch master updated: s3_auth_v4: multiple same name fields signing fix

2020-04-08 Thread gancho
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new e892afc  s3_auth_v4: multiple same name fields signing fix
e892afc is described below

commit e892afc9b67381648017bb74be2201a856fcd19e
Author: Gancho Tenev 
AuthorDate: Mon Apr 6 23:50:01 2020 -0700

s3_auth_v4: multiple same name fields signing fix

When signing multiple header fields with the same name AWS auth v4
seems to combine them into a single field by white-space trimming the
fields' values from the beginning and end and concatinating them by
using a comma in the order they are received. If same name header
fields already contain multiple values they are considered as a single
value headers during the trimming/concatenation.

This is undocumented behavior, discovered by reverse engineering
experiments, AWS signature calculation spec is not quite clear
about this case (unspecified, see CanonicalHeaders section):

https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
---
 plugins/s3_auth/aws_auth_v4.cc |   6 +-
 plugins/s3_auth/aws_auth_v4.h  |   1 +
 plugins/s3_auth/unit_tests/test_aws_auth_v4.cc | 247 +++--
 plugins/s3_auth/unit_tests/test_aws_auth_v4.h  |   6 +-
 4 files changed, 156 insertions(+), 104 deletions(-)

diff --git a/plugins/s3_auth/aws_auth_v4.cc b/plugins/s3_auth/aws_auth_v4.cc
index 072a900..3f9aea0 100644
--- a/plugins/s3_auth/aws_auth_v4.cc
+++ b/plugins/s3_auth/aws_auth_v4.cc
@@ -385,7 +385,11 @@ getCanonicalRequestSha256Hash(TsInterface &api, bool 
signPayload, const StringSe
 const char *trimValue = trimWhiteSpaces(value, valueLen, trimValueLen);
 
 signedHeadersSet.insert(lowercaseName);
-headersMap[lowercaseName] = String(trimValue, trimValueLen);
+if (headersMap.find(lowercaseName) == headersMap.end()) {
+  headersMap[lowercaseName] = String(trimValue, trimValueLen);
+} else {
+  headersMap[lowercaseName].append(",").append(String(trimValue, 
trimValueLen));
+}
   }
 
   for (const auto &it : signedHeadersSet) {
diff --git a/plugins/s3_auth/aws_auth_v4.h b/plugins/s3_auth/aws_auth_v4.h
index aa929de..865a199 100644
--- a/plugins/s3_auth/aws_auth_v4.h
+++ b/plugins/s3_auth/aws_auth_v4.h
@@ -36,6 +36,7 @@
 typedef std::string String;
 typedef std::set StringSet;
 typedef std::map StringMap;
+typedef std::multimap HeaderMultiMap;
 
 class HeaderIterator;
 
diff --git a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc 
b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
index 4bf58af..595fe00 100644
--- a/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
+++ b/plugins/s3_auth/unit_tests/test_aws_auth_v4.cc
@@ -405,10 +405,10 @@ TEST_CASE("AWSAuthSpecByExample: GET Object", 
"[AWS][auth][SpecByExample]")
   api._host.assign("examplebucket.s3.amazonaws.com");
   api._path.assign("test.txt");
   api._query.assign("");
-  api._headers["Host"] = "examplebucket.s3.amazonaws.com";
-  api._headers["Range"]= "bytes=0-9";
-  api._headers["x-amz-content-sha256"] = 
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
-  api._headers["x-amz-date"]   = "20130524T00Z";
+  api._headers.insert(std::make_pair("Host", 
"examplebucket.s3.amazonaws.com"));
+  api._headers.insert(std::make_pair("Range", "bytes=0-9"));
+  api._headers.insert(std::make_pair("x-amz-content-sha256", 
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"));
+  api._headers.insert(std::make_pair("x-amz-date", "20130524T00Z"));
 
   const char *bench[] = {
 /* Authorization Header */
@@ -450,9 +450,9 @@ TEST_CASE("AWSAuthSpecByExample: GET Bucket Lifecycle", 
"[AWS][auth][SpecByExamp
   api._host.assign("examplebucket.s3.amazonaws.com");
   api._path.assign("");
   api._query.assign("lifecycle");
-  api._headers["Host"] = "examplebucket.s3.amazonaws.com";
-  api._headers["x-amz-content-sha256"] = 
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
-  api._headers["x-amz-date"]   = "20130524T00Z";
+  api._headers.insert(std::make_pair("Host", 
"examplebucket.s3.amazonaws.com"));
+  api._headers.insert(std::make_pair("x-amz-content-sha256", 
"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"));
+  api._headers.insert(std::make_pair("x-amz-date", "20130524T00Z"));
 
   const char *bench[] = {
 /* Authorization Header */
@@ -494,9 +494,9 @@ TEST_CASE("AWSAuthSpecByExample: Get Bucket List Objects", 
"[AWS][auth][SpecByEx
   api._host.assign("examplebucket.s3.amazonaws.com");
   api._path.assign("");
   api._query.assign("max-keys=2&prefix=J");
-  api._headers["Host"] = "examplebucket.s3.amazonaws.com";
-  api._headers["x-amz-content-sha256"] = 
"e3b0c44298fc1c14

[trafficserver] branch master updated (9035757 -> e1d13ed)

2020-04-08 Thread amc
This is an automated email from the ASF dual-hosted git repository.

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


from 9035757  Fixes a bug where the nexthop markNextHop method to mark a 
host down is not called when because the wrapper function was not used.
 add e1d13ed  Fix ASAN detected crash in test_LogUtils. This is cause by 
double linking BufferWriterFormat.cc, so don't do that.

No new revisions were added by this update.

Summary of changes:
 proxy/logging/Makefile.am  |  1 -
 proxy/logging/unit-tests/BufferWriterFormat.cc | 24 
 2 files changed, 25 deletions(-)
 delete mode 100644 proxy/logging/unit-tests/BufferWriterFormat.cc



[trafficserver] branch 9.0.x updated: Fixes a bug where the nexthop markNextHop method to mark a host down is not called when because the wrapper function was not used.

2020-04-08 Thread zwoop
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 22b877b  Fixes a bug where the nexthop markNextHop method to mark a 
host down is not called when because the wrapper function was not used.
22b877b is described below

commit 22b877b201e72d0b40f5df7d4268a59078d55bb7
Author: John Rushford 
AuthorDate: Wed Apr 8 16:38:52 2020 +

Fixes a bug where the nexthop markNextHop method
to mark a host down is not called when because
the wrapper function was not used.

(cherry picked from commit 90357576c4cbd8c172047955d385b7ba0cd62627)
---
 proxy/http/HttpTransact.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index cafab42..79d87fe 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -3603,7 +3603,7 @@ HttpTransact::handle_response_from_parent(State *s)
 //  us to mark the parent down
 if (s->current.state == CONNECTION_ERROR) {
   HTTP_INCREMENT_DYN_STAT(http_total_parent_marked_down_count);
-  s->parent_params->markParentDown(&s->parent_result, 
s->txn_conf->parent_fail_threshold, s->txn_conf->parent_retry_time);
+  markParentDown(s);
 }
 // We are done so look for another parent if any
 next_lookup = find_server_and_update_current_info(s);
@@ -3615,7 +3615,7 @@ HttpTransact::handle_response_from_parent(State *s)
   TxnDebug("http_trans", "[handle_response_from_parent] Error. No more 
retries.");
   if (s->current.state == CONNECTION_ERROR) {
 HTTP_INCREMENT_DYN_STAT(http_total_parent_marked_down_count);
-s->parent_params->markParentDown(&s->parent_result, 
s->txn_conf->parent_fail_threshold, s->txn_conf->parent_retry_time);
+markParentDown(s);
   }
   s->parent_result.result = PARENT_FAIL;
   next_lookup = HOST_NONE;



[trafficserver] branch master updated: Fixes a bug where the nexthop markNextHop method to mark a host down is not called when because the wrapper function was not used.

2020-04-08 Thread jrushford
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 9035757  Fixes a bug where the nexthop markNextHop method to mark a 
host down is not called when because the wrapper function was not used.
9035757 is described below

commit 90357576c4cbd8c172047955d385b7ba0cd62627
Author: John Rushford 
AuthorDate: Wed Apr 8 16:38:52 2020 +

Fixes a bug where the nexthop markNextHop method
to mark a host down is not called when because
the wrapper function was not used.
---
 proxy/http/HttpTransact.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 3523428..1495399 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -3621,7 +3621,7 @@ HttpTransact::handle_response_from_parent(State *s)
 //  us to mark the parent down
 if (s->current.state == CONNECTION_ERROR) {
   HTTP_INCREMENT_DYN_STAT(http_total_parent_marked_down_count);
-  s->parent_params->markParentDown(&s->parent_result, 
s->txn_conf->parent_fail_threshold, s->txn_conf->parent_retry_time);
+  markParentDown(s);
 }
 // We are done so look for another parent if any
 next_lookup = find_server_and_update_current_info(s);
@@ -3633,7 +3633,7 @@ HttpTransact::handle_response_from_parent(State *s)
   TxnDebug("http_trans", "[handle_response_from_parent] Error. No more 
retries.");
   if (s->current.state == CONNECTION_ERROR) {
 HTTP_INCREMENT_DYN_STAT(http_total_parent_marked_down_count);
-s->parent_params->markParentDown(&s->parent_result, 
s->txn_conf->parent_fail_threshold, s->txn_conf->parent_retry_time);
+markParentDown(s);
   }
   s->parent_result.result = PARENT_FAIL;
   next_lookup = HOST_NONE;



[trafficserver] branch master updated (21f6a70 -> 932b59e)

2020-04-08 Thread shinrich
This is an automated email from the ASF dual-hosted git repository.

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


from 21f6a70  Add ready checks for the microserver and ATS test instances. 
(#6625)
 add 932b59e  SNI: Add support to match/replace captured group from fqdn 
into tunnel_route. (#6613)

No new revisions were added by this update.

Summary of changes:
 doc/admin-guide/files/sni.yaml.en.rst   |  17 +
 iocore/net/P_SNIActionPerformer.h   | 107 +---
 iocore/net/P_SSLSNI.h   |   4 +-
 iocore/net/SSLSNIConfig.cc  |  49 ---
 iocore/net/SSLUtils.cc  |   7 +--
 tests/gold_tests/tls/tls_tunnel.test.py |  39 +++-
 6 files changed, 197 insertions(+), 26 deletions(-)