[trafficserver] branch 9.0.x updated: Updated ChangeLog

2020-02-21 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 baa5a7b  Updated ChangeLog
baa5a7b is described below

commit baa5a7b6059c4846ca805d66d067bca7704857f7
Author: Leif Hedstrom 
AuthorDate: Fri Feb 21 17:11:40 2020 -0700

Updated ChangeLog
---
 CHANGELOG-9.0.0 | 20 
 1 file changed, 20 insertions(+)

diff --git a/CHANGELOG-9.0.0 b/CHANGELOG-9.0.0
index 84199f3..c43fcd3 100644
--- a/CHANGELOG-9.0.0
+++ b/CHANGELOG-9.0.0
@@ -366,6 +366,7 @@ Changes with Apache Traffic Server 9.0.0
   #5141 - Need to pop messages from queue
   #5142 - UrlRewrite: separate constructor and configuration loading for 
testability
   #5144 - Fix AcidPtr test
+  #5149 - Add nullptr check on ConfigProcessor::release()
   #5150 - Augment wildcard_match to allow underscore in domain name
   #5151 - Updates to the STATUS file
   #5152 - Test acid ptr persistence
@@ -888,8 +889,27 @@ Changes with Apache Traffic Server 9.0.0
   #6329 - Fixed build issues on macOS after 0-RTT merge
   #6332 - Fixes Issue #6321 caused when 
proxy.config.http.no_dns_just_forward_to_parent
   #6339 - Fixes an issue where NextHopSelectionStrategy did not implement a 
parent check.
+  #6340 - Add header rewrite test to make sure we are not injecting end of 
rule char
   #6343 - Fixes an assertion failure when 
proxy.config.http.no_dns_just_forward_to_parent is enabled
   #6346 - Fix heap-use-after-free on Http2Stream::destroy()
+  #6347 - Fix localstatedir and runtimedir for Debian layout
+  #6358 - Add header guard - issue #6357
   #6372 - Change alloca usage to malloc/free
+  #6373 - Change bitfields to be unsigned explicitly
+  #6374 - Add exception to throw since there is no context and could cause a 
crash
+  #6376 - Update inactive_timeout_at in Http2Stream::signal_read_event()
   #6378 - Remove trailing white space from json formatter
+  #6380 - Remove unnecesary HttpSM handler call with VC_EVENT_ERROR
   #6392 - Free TSMgmtString after using it.
+  #6396 - Avoid cross-thread mutex conflicts
+  #6397 - Ensure that extra data beyond the chunked body is not tunneled
+  #6403 - Fix for lua plugin coredump problem during reload
+  #6406 - Auto port select slow_post test
+  #6409 - Another option to fix potential HTTP/2 vio stall
+  #6410 - Change gold files to be less restrictive 
+  #6419 - URI Sig Null Check for Clang Warning
+  #6420 - Syntax Error fixed in URI sig Plugin
+  #6431 - #6428 Clear stale captive_action during Cache read retry - WIP (in 
test)
+  #6435 - Fixed chunked_encoding test to work with OpenSSL 1.0.2
+  #6440 - Cleaned up smuggle-client
+  #6446 - Avoid a weird name collision between HRW and tscore



[trafficserver] branch 9.0.x updated: Another option to fix potential HTTP/2 vio stall

2020-02-21 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 a8c5152  Another option to fix potential HTTP/2 vio stall
a8c5152 is described below

commit a8c51521ee7c043500f78cc58ee813445cd3b20f
Author: Susan Hinrichs 
AuthorDate: Mon Feb 10 23:27:55 2020 +

Another option to fix potential HTTP/2 vio stall

(cherry picked from commit 87e79069f07daf17f54958de1d1f9d4198ccc266)
---
 proxy/http2/Http2Stream.cc | 69 +-
 proxy/http2/Http2Stream.h  |  4 ++-
 2 files changed, 34 insertions(+), 39 deletions(-)

diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index 6b6b695..639eebf 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -73,7 +73,13 @@ Http2Stream::main_event_handler(int event, void *edata)
 
   Event *e = static_cast(edata);
   reentrancy_count++;
-  if (e == cross_thread_event) {
+  if (e == _read_vio_event) {
+this->signal_read_event(e->callback_event);
+return 0;
+  } else if (e == _write_vio_event) {
+this->signal_write_event(e->callback_event);
+return 0;
+  } else if (e == cross_thread_event) {
 cross_thread_event = nullptr;
   } else if (e == active_event) {
 event= VC_EVENT_ACTIVE_TIMEOUT;
@@ -95,25 +101,9 @@ Http2Stream::main_event_handler(int event, void *edata)
   case VC_EVENT_ACTIVE_TIMEOUT:
   case VC_EVENT_INACTIVITY_TIMEOUT:
 if (_sm && read_vio.ntodo() > 0) {
-  MUTEX_TRY_LOCK(lock, read_vio.mutex, this_ethread());
-  if (lock.is_locked()) {
-read_vio.cont->handleEvent(event, _vio);
-  } else {
-if (this->_read_vio_event) {
-  this->_read_vio_event->cancel();
-}
-this->_read_vio_event = this_ethread()->schedule_imm(read_vio.cont, 
event, _vio);
-  }
+  this->signal_read_event(event);
 } else if (_sm && write_vio.ntodo() > 0) {
-  MUTEX_TRY_LOCK(lock, write_vio.mutex, this_ethread());
-  if (lock.is_locked()) {
-write_vio.cont->handleEvent(event, _vio);
-  } else {
-if (this->_write_vio_event) {
-  this->_write_vio_event->cancel();
-}
-this->_write_vio_event = this_ethread()->schedule_imm(write_vio.cont, 
event, _vio);
-  }
+  this->signal_write_event(event);
 }
 break;
   case VC_EVENT_WRITE_READY:
@@ -121,15 +111,7 @@ Http2Stream::main_event_handler(int event, void *edata)
 inactive_timeout_at = Thread::get_hrtime() + inactive_timeout;
 if (e->cookie == _vio) {
   if (write_vio.mutex && write_vio.cont && this->_sm) {
-MUTEX_TRY_LOCK(lock, write_vio.mutex, this_ethread());
-if (lock.is_locked()) {
-  write_vio.cont->handleEvent(event, _vio);
-} else {
-  if (this->_write_vio_event) {
-this->_write_vio_event->cancel();
-  }
-  this->_write_vio_event = 
this_ethread()->schedule_imm(write_vio.cont, event, _vio);
-}
+this->signal_write_event(event);
   }
 } else {
   update_write_request(write_vio.get_reader(), INT64_MAX, true);
@@ -140,15 +122,7 @@ Http2Stream::main_event_handler(int event, void *edata)
 inactive_timeout_at = Thread::get_hrtime() + inactive_timeout;
 if (e->cookie == _vio) {
   if (read_vio.mutex && read_vio.cont && this->_sm) {
-MUTEX_TRY_LOCK(lock, read_vio.mutex, this_ethread());
-if (lock.is_locked()) {
-  read_vio.cont->handleEvent(event, _vio);
-} else {
-  if (this->_read_vio_event) {
-this->_read_vio_event->cancel();
-  }
-  this->_read_vio_event = this_ethread()->schedule_imm(read_vio.cont, 
event, _vio);
-}
+signal_read_event(event);
   }
 } else {
   this->update_read_request(INT64_MAX, true);
@@ -670,7 +644,26 @@ Http2Stream::signal_read_event(int event)
 if (this->_read_vio_event) {
   this->_read_vio_event->cancel();
 }
-this->_read_vio_event = this_ethread()->schedule_imm(read_vio.cont, event, 
_vio);
+this->_read_vio_event = this_ethread()->schedule_in(this, retry_delay, 
event, _vio);
+  }
+}
+
+void
+Http2Stream::signal_write_event(int event)
+{
+  if (this->write_vio.cont == nullptr || this->write_vio.cont->mutex == 
nullptr || this->write_vio.op == VIO::NONE) {
+return;
+  }
+
+  MUTEX_TRY_LOCK(lock, write_vio.cont->mutex, this_ethread());
+  if (lock.is_locked()) {
+inactive_timeout_at = Thread::get_hrtime() + inactive_timeout;
+this->write_vio.cont->handleEvent(event, >write_vio);
+  } else {
+if (this->_write_vio_event) {
+  this->_write_vio_event->cancel();
+}
+this->_write_vio_event = this_ethread()->schedule_in(this, retry_delay, 
event, _vio);
   }
 }
 
diff --git a/proxy/http2/Http2Stream.h b/proxy/http2/Http2Stream.h
index 

[trafficserver] branch 9.0.x updated (25289e9 -> 31bb1e7)

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

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


from 25289e9  Avoid a weird name collision between HRW and tscore (#6446)
 new a886e93  Adding max line length configuration documentation.
 new 31bb1e7  Move log line length configuration to records.config docs.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/admin-guide/files/records.config.en.rst | 37 +
 doc/admin-guide/logging/formatting.en.rst   | 11 +
 2 files changed, 48 insertions(+)



[trafficserver] 02/02: Move log line length configuration to records.config docs.

2020-02-21 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

commit 31bb1e7bb6cbc5cf1eda0ce296973a7d7521237e
Author: bneradt 
AuthorDate: Mon Feb 17 16:36:19 2020 +

Move log line length configuration to records.config docs.

(cherry picked from commit a10526d9a0f634066e65e24cb285b1ff10724e71)
---
 doc/admin-guide/files/records.config.en.rst | 37 +
 doc/admin-guide/logging/formatting.en.rst   | 35 ++-
 2 files changed, 44 insertions(+), 28 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index 9bef21f..ed736d7 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -2916,6 +2916,43 @@ Logging Configuration
:file:`logging.yaml` configuration file. If this is a relative
path, |TS| loads it relative to the ``SYSCONFDIR`` directory.
 
+.. ts:cv:: CONFIG proxy.config.log.max_line_size INT 9216
+   :units: bytes
+
+   This controls the maximum line length for ``ASCII`` formatted log entries.
+   This applies to ``ASCII_PIPE`` and ``ASCII`` file logs, *unless*
+   :ts:cv:`proxy.config.log.ascii_buffer_size` is also specified and the value
+   of ``ascii_buffer_size`` is larger than ``max_line_size``: in that case,
+   ``max_line_size`` only applies to ``ASCII_PIPE`` logs while
+   ``ascii_buffer_size`` will apply to ``ASCII`` (non-pipe) log files.
+
+.. ts:cv:: CONFIG proxy.config.log.ascii_buffer_size INT 36864
+   :units: bytes
+
+   This controls the maximum line length for ``ASCII`` formatted log entries
+   that are non-pipe log files. If this value is smaller than
+   :ts:cv:`proxy.config.log.max_line_size`, then the latter will be used for
+   both ``ASCII`` and ``ASCII_PIPE`` log files. If both ``max_line_size`` and
+   ``ascii_buffer_size`` are set, then ``max_line_size`` will be used for
+   ``ASCII_PIPE`` logs while ``ascii_buffer_size`` will be used for ``ASCII``
+   (non-pipe) log files.  This all might seem complicated, but just keep in
+   mind that the intention of ``ascii_buffer_size`` is to simply provide a way
+   for the user to configure different ``ASCII`` and ``ASCII_PIPE`` maximum
+   line lengths.
+
+.. ts:cv:: CONFIG proxy.config.log.log_buffer_size INT 9216
+   :reloadable:
+   :units: bytes
+
+   This is an orthogonal mechanism from :ts:cv:`proxy.config.log.max_line_size`
+   and :ts:cv:`proxy.config.log.ascii_buffer_size` for limiting line length
+   size by constraining the log entry buffer to a particular amount of memory.
+   Unlike the above two configurations, ``log_buffer_size`` applies to both
+   binary and ``ASCII`` log file entries.  For ``ASCII`` log files, if a 
maximum
+   log size is set via both the above mechanisms and by ``log_buffer_size``,
+   then the smaller of the two configurations will be applied to the line
+   length.
+
 Diagnostic Logging Configuration
 
 
diff --git a/doc/admin-guide/logging/formatting.en.rst 
b/doc/admin-guide/logging/formatting.en.rst
index 9f095ab..8fa5edd 100644
--- a/doc/admin-guide/logging/formatting.en.rst
+++ b/doc/admin-guide/logging/formatting.en.rst
@@ -800,34 +800,13 @@ cquuh Client Request Unmapped URL host from the client 
request.
 Line Length
 ===
 
-The maximum line size for a log entry can be configured via the following 
parameters:
-
-- :ts:cv:`proxy.config.log.max_line_size`: This controls the maximum line
-  length for ASCII formatted log entries. This applies to ``ASCII_PIPE`` and
-  ``ASCII`` file logs, *unless* :ts:cv:`proxy.config.log.ascii_buffer_size` is
-  also specified and the value of :ts:cv:`ascii_buffer_size` is larger than
-  :ts:cv:`max_line_size`: in that case, :ts:cv:`max_line_size` only applies to
-  ``ASCII_PIPE`` logs while :ts:cv:`ascii_buffer_size` will apply to ``ASCII``
-  (non-pipe) log files.
-
-- :ts:cv:`proxy.config.log.ascii_buffer_size`: This controls the maximum line
-  length for ASCII formatted log entries that are non-pipe log files. If this
-  value is smaller than :ts:cv:`proxy.config.log.max_line_size`, then the
-  latter will be used for both ``ASCII`` and ``ASCII_PIPE`` log files. If both
-  :ts:cv:`max_line_size` and :ts:cv:`ascii_buffer_size` are set, then
-  :ts:cv:`max_line_size` will be used for ``ASCII_PIPE`` logs while
-  :ts:cv:`ascii_buffer_size` will be used for ``ASCII`` (non-pipe) log files.
-  This all might seem complicated, but just keep in mind that the intention of
-  :ts:cv:`ascii_buffer_size` is to simply provide a way for the user to
-  configure different ``ASCII`` and ``ASCII_PIPE`` maximum line lengths.
-
-- :ts:cv:`proxy.config.log.log_buffer_size`: This is an orthogonal mechanism
-  for limiting line length size by constraining the log entry buffer to a
-  particular amount of memory. Unlike the above two 

[trafficserver] 01/02: Adding max line length configuration documentation.

2020-02-21 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

commit a886e93e9e765190521f4e9ebdedd173dffd6ea3
Author: bneradt 
AuthorDate: Mon Jan 6 22:54:52 2020 +

Adding max line length configuration documentation.

(cherry picked from commit 52a779c5051d6b7d5de549d6b1b24216df84a8d7)
---
 doc/admin-guide/logging/formatting.en.rst | 32 +++
 1 file changed, 32 insertions(+)

diff --git a/doc/admin-guide/logging/formatting.en.rst 
b/doc/admin-guide/logging/formatting.en.rst
index 182199c..9f095ab 100644
--- a/doc/admin-guide/logging/formatting.en.rst
+++ b/doc/admin-guide/logging/formatting.en.rst
@@ -797,6 +797,38 @@ cquup Client Request Canonical (prior to remapping) path 
component from the
 cquuh Client Request Unmapped URL host from the client request.
 = == ==
 
+Line Length
+===
+
+The maximum line size for a log entry can be configured via the following 
parameters:
+
+- :ts:cv:`proxy.config.log.max_line_size`: This controls the maximum line
+  length for ASCII formatted log entries. This applies to ``ASCII_PIPE`` and
+  ``ASCII`` file logs, *unless* :ts:cv:`proxy.config.log.ascii_buffer_size` is
+  also specified and the value of :ts:cv:`ascii_buffer_size` is larger than
+  :ts:cv:`max_line_size`: in that case, :ts:cv:`max_line_size` only applies to
+  ``ASCII_PIPE`` logs while :ts:cv:`ascii_buffer_size` will apply to ``ASCII``
+  (non-pipe) log files.
+
+- :ts:cv:`proxy.config.log.ascii_buffer_size`: This controls the maximum line
+  length for ASCII formatted log entries that are non-pipe log files. If this
+  value is smaller than :ts:cv:`proxy.config.log.max_line_size`, then the
+  latter will be used for both ``ASCII`` and ``ASCII_PIPE`` log files. If both
+  :ts:cv:`max_line_size` and :ts:cv:`ascii_buffer_size` are set, then
+  :ts:cv:`max_line_size` will be used for ``ASCII_PIPE`` logs while
+  :ts:cv:`ascii_buffer_size` will be used for ``ASCII`` (non-pipe) log files.
+  This all might seem complicated, but just keep in mind that the intention of
+  :ts:cv:`ascii_buffer_size` is to simply provide a way for the user to
+  configure different ``ASCII`` and ``ASCII_PIPE`` maximum line lengths.
+
+- :ts:cv:`proxy.config.log.log_buffer_size`: This is an orthogonal mechanism
+  for limiting line length size by constraining the log entry buffer to a
+  particular amount of memory. Unlike the above two configurations,
+  :ts:cv:`log_buffer_size` applies to both binary and ASCII log file entries.
+  For ASCII log files, if a maximum log size is set via the above mechanisms
+  and by :ts:cv:`log_buffer_size`, then the smaller of the two configurations
+  will be applied to the line length.
+
 Log Field Slicing
 =
 



[trafficserver] branch master updated (a10526d -> 2df57f9)

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

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


from a10526d  Move log line length configuration to records.config docs.
 add 2df57f9  Avoid a weird name collision between HRW and tscore (#6446)

No new revisions were added by this update.

Summary of changes:
 plugins/header_rewrite/header_rewrite_test.cc | 4 ++--
 plugins/header_rewrite/parser.cc  | 2 +-
 plugins/header_rewrite/parser.h   | 8 
 plugins/header_rewrite/value.cc   | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)



[trafficserver] branch 9.0.x updated: Avoid a weird name collision between HRW and tscore (#6446)

2020-02-21 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 25289e9  Avoid a weird name collision between HRW and tscore (#6446)
25289e9 is described below

commit 25289e941740638e5cb45084184a85761555d90d
Author: Leif Hedstrom 
AuthorDate: Fri Feb 21 15:33:16 2020 -0800

Avoid a weird name collision between HRW and tscore (#6446)

(cherry picked from commit 2df57f927f78b6a66c9fbf72c426fca9b6bd4722)
---
 plugins/header_rewrite/header_rewrite_test.cc | 4 ++--
 plugins/header_rewrite/parser.cc  | 2 +-
 plugins/header_rewrite/parser.h   | 8 
 plugins/header_rewrite/value.cc   | 2 +-
 4 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/plugins/header_rewrite/header_rewrite_test.cc 
b/plugins/header_rewrite/header_rewrite_test.cc
index cd032f2..704c68d 100644
--- a/plugins/header_rewrite/header_rewrite_test.cc
+++ b/plugins/header_rewrite/header_rewrite_test.cc
@@ -69,10 +69,10 @@ public:
   bool res;
 };
 
-class SimpleTokenizerTest : public SimpleTokenizer
+class SimpleTokenizerTest : public HRWSimpleTokenizer
 {
 public:
-  SimpleTokenizerTest(const std::string ) : SimpleTokenizer(line), 
res(true)
+  SimpleTokenizerTest(const std::string ) : HRWSimpleTokenizer(line), 
res(true)
   {
 std::cout << "Finished tokenizer test: " << line << std::endl;
   }
diff --git a/plugins/header_rewrite/parser.cc b/plugins/header_rewrite/parser.cc
index 7e5e40e..cb6e2c5 100644
--- a/plugins/header_rewrite/parser.cc
+++ b/plugins/header_rewrite/parser.cc
@@ -248,7 +248,7 @@ Parser::cond_is_hook(TSHttpHookID ) const
   return false;
 }
 
-SimpleTokenizer::SimpleTokenizer(const std::string _line)
+HRWSimpleTokenizer::HRWSimpleTokenizer(const std::string _line)
 {
   std::string line= original_line;
   ParserState state   = PARSER_DEFAULT;
diff --git a/plugins/header_rewrite/parser.h b/plugins/header_rewrite/parser.h
index 691a817..4b3b468 100644
--- a/plugins/header_rewrite/parser.h
+++ b/plugins/header_rewrite/parser.h
@@ -99,14 +99,14 @@ protected:
   std::vector _tokens;
 };
 
-class SimpleTokenizer
+class HRWSimpleTokenizer
 {
 public:
-  explicit SimpleTokenizer(const std::string );
+  explicit HRWSimpleTokenizer(const std::string );
 
   // noncopyable
-  SimpleTokenizer(const SimpleTokenizer &) = delete;
-  void operator=(const SimpleTokenizer &) = delete;
+  HRWSimpleTokenizer(const HRWSimpleTokenizer &) = delete;
+  void operator=(const HRWSimpleTokenizer &) = delete;
 
   const std::vector &
   get_tokens() const
diff --git a/plugins/header_rewrite/value.cc b/plugins/header_rewrite/value.cc
index fc4dcc0..e6c8ddc 100644
--- a/plugins/header_rewrite/value.cc
+++ b/plugins/header_rewrite/value.cc
@@ -44,7 +44,7 @@ Value::set_value(const std::string )
   _value = val;
 
   if (_value.find("%{") != std::string::npos) {
-SimpleTokenizer tokenizer(_value);
+HRWSimpleTokenizer tokenizer(_value);
 auto tokens = tokenizer.get_tokens();
 
 for (auto token : tokens) {



[trafficserver] branch 9.0.x updated: Cleaned up smuggle-client

2020-02-21 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 5763b6d  Cleaned up smuggle-client
5763b6d is described below

commit 5763b6d1791d6613110a17fc13d4498dcaf67dfc
Author: Bryan Call 
AuthorDate: Thu Feb 20 09:39:06 2020 -0800

Cleaned up smuggle-client

Removed unused variables
Added printf and asserts to give more information about what failed

(cherry picked from commit ac5b1a578eab7d66c57f5b67bbcc33686b7fa8c6)
---
 tests/gold_tests/chunked_encoding/smuggle-client.c | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/tests/gold_tests/chunked_encoding/smuggle-client.c 
b/tests/gold_tests/chunked_encoding/smuggle-client.c
index c064571..928db41 100644
--- a/tests/gold_tests/chunked_encoding/smuggle-client.c
+++ b/tests/gold_tests/chunked_encoding/smuggle-client.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 const char *req_and_post_buf =
   "GET / HTTP/1.1\r\nConnection: close\r\nHost: foo.com\r\nTransfer-Encoding: 
chunked\r\nContent-Length: 301\r\n\r\n0\r\n\r\nPOST "
@@ -47,9 +48,7 @@ main(int argc, char *argv[])
 {
   struct addrinfo hints;
   struct addrinfo *result, *rp;
-  int sfd, s, j;
-  size_t len;
-  ssize_t nread;
+  int sfd, s;
 
   if (argc < 3) {
 fprintf(stderr, "Usage: %s  \n", argv[0]);
@@ -58,9 +57,15 @@ main(int argc, char *argv[])
 
   const char *target  = argv[1];
   const char *target_port = argv[2];
+  printf("using address: %s and port: %s\n", target, target_port);
 
-  /* Obtain address(es) matching host/port */
+#if OPENSSL_VERSION_NUMBER < 0x1010L
+  SSL_library_init();
+#else
+  OPENSSL_init_ssl(0, NULL);
+#endif
 
+  /* Obtain address(es) matching host/port */
   memset(, 0, sizeof(struct addrinfo));
   hints.ai_family   = AF_UNSPEC;   /* Allow IPv4 or IPv6 */
   hints.ai_socktype = SOCK_STREAM; /* Datagram socket */
@@ -94,12 +99,13 @@ main(int argc, char *argv[])
   }
 
   SSL_CTX *client_ctx = SSL_CTX_new(SSLv23_client_method());
-  SSL *ssl= SSL_new(client_ctx);
+  assert(client_ctx != NULL);
+  SSL *ssl = SSL_new(client_ctx);
+  assert(ssl != NULL);
 
   SSL_set_fd(ssl, sfd);
-  int ret = SSL_connect(ssl);
-  int read_count  = 0;
-  int write_count = 1;
+  int ret = SSL_connect(ssl);
+  assert(ret == 1);
 
   printf("Send request\n");
   if ((ret = SSL_write(ssl, req_and_post_buf, strlen(req_and_post_buf))) <= 0) 
{



[trafficserver] branch master updated: Move log line length configuration to records.config docs.

2020-02-21 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new a10526d  Move log line length configuration to records.config docs.
a10526d is described below

commit a10526d9a0f634066e65e24cb285b1ff10724e71
Author: bneradt 
AuthorDate: Mon Feb 17 16:36:19 2020 +

Move log line length configuration to records.config docs.
---
 doc/admin-guide/files/records.config.en.rst | 37 +
 doc/admin-guide/logging/formatting.en.rst   | 35 ++-
 2 files changed, 44 insertions(+), 28 deletions(-)

diff --git a/doc/admin-guide/files/records.config.en.rst 
b/doc/admin-guide/files/records.config.en.rst
index dc8fdfa..a415b56 100644
--- a/doc/admin-guide/files/records.config.en.rst
+++ b/doc/admin-guide/files/records.config.en.rst
@@ -2916,6 +2916,43 @@ Logging Configuration
:file:`logging.yaml` configuration file. If this is a relative
path, |TS| loads it relative to the ``SYSCONFDIR`` directory.
 
+.. ts:cv:: CONFIG proxy.config.log.max_line_size INT 9216
+   :units: bytes
+
+   This controls the maximum line length for ``ASCII`` formatted log entries.
+   This applies to ``ASCII_PIPE`` and ``ASCII`` file logs, *unless*
+   :ts:cv:`proxy.config.log.ascii_buffer_size` is also specified and the value
+   of ``ascii_buffer_size`` is larger than ``max_line_size``: in that case,
+   ``max_line_size`` only applies to ``ASCII_PIPE`` logs while
+   ``ascii_buffer_size`` will apply to ``ASCII`` (non-pipe) log files.
+
+.. ts:cv:: CONFIG proxy.config.log.ascii_buffer_size INT 36864
+   :units: bytes
+
+   This controls the maximum line length for ``ASCII`` formatted log entries
+   that are non-pipe log files. If this value is smaller than
+   :ts:cv:`proxy.config.log.max_line_size`, then the latter will be used for
+   both ``ASCII`` and ``ASCII_PIPE`` log files. If both ``max_line_size`` and
+   ``ascii_buffer_size`` are set, then ``max_line_size`` will be used for
+   ``ASCII_PIPE`` logs while ``ascii_buffer_size`` will be used for ``ASCII``
+   (non-pipe) log files.  This all might seem complicated, but just keep in
+   mind that the intention of ``ascii_buffer_size`` is to simply provide a way
+   for the user to configure different ``ASCII`` and ``ASCII_PIPE`` maximum
+   line lengths.
+
+.. ts:cv:: CONFIG proxy.config.log.log_buffer_size INT 9216
+   :reloadable:
+   :units: bytes
+
+   This is an orthogonal mechanism from :ts:cv:`proxy.config.log.max_line_size`
+   and :ts:cv:`proxy.config.log.ascii_buffer_size` for limiting line length
+   size by constraining the log entry buffer to a particular amount of memory.
+   Unlike the above two configurations, ``log_buffer_size`` applies to both
+   binary and ``ASCII`` log file entries.  For ``ASCII`` log files, if a 
maximum
+   log size is set via both the above mechanisms and by ``log_buffer_size``,
+   then the smaller of the two configurations will be applied to the line
+   length.
+
 Diagnostic Logging Configuration
 
 
diff --git a/doc/admin-guide/logging/formatting.en.rst 
b/doc/admin-guide/logging/formatting.en.rst
index 9f095ab..8fa5edd 100644
--- a/doc/admin-guide/logging/formatting.en.rst
+++ b/doc/admin-guide/logging/formatting.en.rst
@@ -800,34 +800,13 @@ cquuh Client Request Unmapped URL host from the client 
request.
 Line Length
 ===
 
-The maximum line size for a log entry can be configured via the following 
parameters:
-
-- :ts:cv:`proxy.config.log.max_line_size`: This controls the maximum line
-  length for ASCII formatted log entries. This applies to ``ASCII_PIPE`` and
-  ``ASCII`` file logs, *unless* :ts:cv:`proxy.config.log.ascii_buffer_size` is
-  also specified and the value of :ts:cv:`ascii_buffer_size` is larger than
-  :ts:cv:`max_line_size`: in that case, :ts:cv:`max_line_size` only applies to
-  ``ASCII_PIPE`` logs while :ts:cv:`ascii_buffer_size` will apply to ``ASCII``
-  (non-pipe) log files.
-
-- :ts:cv:`proxy.config.log.ascii_buffer_size`: This controls the maximum line
-  length for ASCII formatted log entries that are non-pipe log files. If this
-  value is smaller than :ts:cv:`proxy.config.log.max_line_size`, then the
-  latter will be used for both ``ASCII`` and ``ASCII_PIPE`` log files. If both
-  :ts:cv:`max_line_size` and :ts:cv:`ascii_buffer_size` are set, then
-  :ts:cv:`max_line_size` will be used for ``ASCII_PIPE`` logs while
-  :ts:cv:`ascii_buffer_size` will be used for ``ASCII`` (non-pipe) log files.
-  This all might seem complicated, but just keep in mind that the intention of
-  :ts:cv:`ascii_buffer_size` is to simply provide a way for the user to
-  configure different ``ASCII`` and ``ASCII_PIPE`` maximum line lengths.
-
-- :ts:cv:`proxy.config.log.log_buffer_size`: This is an orthogonal mechanism
-  for limiting line length size 

[trafficserver] branch master updated: Cleaned up smuggle-client

2020-02-21 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new ac5b1a5  Cleaned up smuggle-client
ac5b1a5 is described below

commit ac5b1a578eab7d66c57f5b67bbcc33686b7fa8c6
Author: Bryan Call 
AuthorDate: Thu Feb 20 09:39:06 2020 -0800

Cleaned up smuggle-client

Removed unused variables
Added printf and asserts to give more information about what failed
---
 tests/gold_tests/chunked_encoding/smuggle-client.c | 22 ++
 1 file changed, 14 insertions(+), 8 deletions(-)

diff --git a/tests/gold_tests/chunked_encoding/smuggle-client.c 
b/tests/gold_tests/chunked_encoding/smuggle-client.c
index c064571..928db41 100644
--- a/tests/gold_tests/chunked_encoding/smuggle-client.c
+++ b/tests/gold_tests/chunked_encoding/smuggle-client.c
@@ -32,6 +32,7 @@
 #include 
 #include 
 #include 
+#include 
 
 const char *req_and_post_buf =
   "GET / HTTP/1.1\r\nConnection: close\r\nHost: foo.com\r\nTransfer-Encoding: 
chunked\r\nContent-Length: 301\r\n\r\n0\r\n\r\nPOST "
@@ -47,9 +48,7 @@ main(int argc, char *argv[])
 {
   struct addrinfo hints;
   struct addrinfo *result, *rp;
-  int sfd, s, j;
-  size_t len;
-  ssize_t nread;
+  int sfd, s;
 
   if (argc < 3) {
 fprintf(stderr, "Usage: %s  \n", argv[0]);
@@ -58,9 +57,15 @@ main(int argc, char *argv[])
 
   const char *target  = argv[1];
   const char *target_port = argv[2];
+  printf("using address: %s and port: %s\n", target, target_port);
 
-  /* Obtain address(es) matching host/port */
+#if OPENSSL_VERSION_NUMBER < 0x1010L
+  SSL_library_init();
+#else
+  OPENSSL_init_ssl(0, NULL);
+#endif
 
+  /* Obtain address(es) matching host/port */
   memset(, 0, sizeof(struct addrinfo));
   hints.ai_family   = AF_UNSPEC;   /* Allow IPv4 or IPv6 */
   hints.ai_socktype = SOCK_STREAM; /* Datagram socket */
@@ -94,12 +99,13 @@ main(int argc, char *argv[])
   }
 
   SSL_CTX *client_ctx = SSL_CTX_new(SSLv23_client_method());
-  SSL *ssl= SSL_new(client_ctx);
+  assert(client_ctx != NULL);
+  SSL *ssl = SSL_new(client_ctx);
+  assert(ssl != NULL);
 
   SSL_set_fd(ssl, sfd);
-  int ret = SSL_connect(ssl);
-  int read_count  = 0;
-  int write_count = 1;
+  int ret = SSL_connect(ssl);
+  assert(ret == 1);
 
   printf("Send request\n");
   if ((ret = SSL_write(ssl, req_and_post_buf, strlen(req_and_post_buf))) <= 0) 
{



[trafficserver] branch master updated (87e7906 -> 4f84c27)

2020-02-21 Thread bcall
This is an automated email from the ASF dual-hosted git repository.

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


from 87e7906  Another option to fix potential HTTP/2 vio stall
 add 4f84c27  Cleaned up ssl-port

No new revisions were added by this update.

Summary of changes:
 tests/gold_tests/tls/ssl-post.c | 12 
 1 file changed, 4 insertions(+), 8 deletions(-)



[trafficserver] branch 9.0.x updated: Change bitfields to be unsigned explicitly (#6373)

2020-02-21 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 37aa318  Change bitfields to be unsigned explicitly (#6373)
37aa318 is described below

commit 37aa3181b81220809983795b5c16461f2c24b3c8
Author: Evan Zelkowitz 
AuthorDate: Thu Jan 30 11:32:48 2020 -0700

Change bitfields to be unsigned explicitly (#6373)

Addresses issue #6350

(cherry picked from commit bea9d089c9086859d7bbe9a983b625dfe1b1a388)
---
 plugins/lua/ts_lua_common.h| 12 ++--
 plugins/lua/ts_lua_coroutine.h |  2 +-
 plugins/lua/ts_lua_fetch.h |  4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/plugins/lua/ts_lua_common.h b/plugins/lua/ts_lua_common.h
index dba8b7d..628eb09 100644
--- a/plugins/lua/ts_lua_common.h
+++ b/plugins/lua/ts_lua_common.h
@@ -91,8 +91,8 @@ typedef struct {
   char script[TS_LUA_MAX_SCRIPT_FNAME_LENGTH];
   void *conf_vars[TS_LUA_MAX_CONFIG_VARS_COUNT];
 
-  int _first : 1; // create current instance for 1st ts_lua_main_ctx
-  int _last : 1;  // create current instance for the last ts_lua_main_ctx
+  unsigned int _first : 1; // create current instance for 1st ts_lua_main_ctx
+  unsigned int _last : 1;  // create current instance for the last 
ts_lua_main_ctx
 
   int remap;
   int states;
@@ -160,10 +160,10 @@ typedef struct {
   ts_lua_http_ctx *hctx;
 
   int64_t to_flush;
-  int reuse : 1;
-  int recv_complete : 1;
-  int send_complete : 1;
-  int all_ready : 1;
+  unsigned int reuse : 1;
+  unsigned int recv_complete : 1;
+  unsigned int send_complete : 1;
+  unsigned int all_ready : 1;
 } ts_lua_http_intercept_ctx;
 
 #define TS_LUA_RELEASE_IO_HANDLE(ih)\
diff --git a/plugins/lua/ts_lua_coroutine.h b/plugins/lua/ts_lua_coroutine.h
index 831066d..b2fb722 100644
--- a/plugins/lua/ts_lua_coroutine.h
+++ b/plugins/lua/ts_lua_coroutine.h
@@ -59,7 +59,7 @@ typedef struct async_item {
   void *data;   // private data
 
   async_clean cleanup; // cleanup function
-  int deleted : 1;
+  unsigned int deleted : 1;
 } ts_lua_async_item;
 
 ts_lua_async_item *ts_lua_async_create_item(TSCont cont, async_clean func, 
void *d, ts_lua_cont_info *ci);
diff --git a/plugins/lua/ts_lua_fetch.h b/plugins/lua/ts_lua_fetch.h
index 04c0d47..c4b600c 100644
--- a/plugins/lua/ts_lua_fetch.h
+++ b/plugins/lua/ts_lua_fetch.h
@@ -30,8 +30,8 @@ typedef struct {
   TSIOBufferReader reader;
   TSFetchSM fch;
 
-  int over : 1;
-  int failed : 1;
+  unsigned int over : 1;
+  unsigned int failed : 1;
 } ts_lua_fetch_info;
 
 typedef struct fetch_multi_info {



[trafficserver] branch 9.0.x updated: Add header rewrite test to make sure we are not injecting end of rule char (#6340)

2020-02-21 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 02556ea  Add header rewrite test to make sure we are not injecting end 
of rule char (#6340)
02556ea is described below

commit 02556eaab4f90c874601b0c0a31a70b5bd5706d5
Author: Evan Zelkowitz 
AuthorDate: Thu Jan 30 14:51:51 2020 -0700

Add header rewrite test to make sure we are not injecting end of rule char 
(#6340)

* Add header rewrite test to make sure we are not injecting end of rule
characters in to an actual header

This is a regression check for the issue fixed in #5423

(cherry picked from commit a2e77e9db166b40c19240f0a1b64d302a711b74b)
---
 .../gold/header_rewrite-l_value.gold   | 16 ++
 .../header_rewrite/header_rewrite_l_value.test.py  | 64 ++
 .../header_rewrite/rules/rule_l_value.conf | 21 +++
 3 files changed, 101 insertions(+)

diff --git 
a/tests/gold_tests/pluginTest/header_rewrite/gold/header_rewrite-l_value.gold 
b/tests/gold_tests/pluginTest/header_rewrite/gold/header_rewrite-l_value.gold
new file mode 100644
index 000..8c3cf66
--- /dev/null
+++ 
b/tests/gold_tests/pluginTest/header_rewrite/gold/header_rewrite-l_value.gold
@@ -0,0 +1,16 @@
+``
+> GET http://www.example.com``
+> Host: www.example.com``
+> User-Agent: curl/``
+> Accept: */*
+``
+< HTTP/1.1 200 OK
+< Date: ``
+< Age: ``
+< Transfer-Encoding: chunked
+< Proxy-Connection: keep-alive
+< Server: ATS/``
+< X-First: First
+< X-Last: Last
+< 
+``
diff --git 
a/tests/gold_tests/pluginTest/header_rewrite/header_rewrite_l_value.test.py 
b/tests/gold_tests/pluginTest/header_rewrite/header_rewrite_l_value.test.py
new file mode 100644
index 000..28247b0
--- /dev/null
+++ b/tests/gold_tests/pluginTest/header_rewrite/header_rewrite_l_value.test.py
@@ -0,0 +1,64 @@
+'''
+'''
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#  http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+
+Test.Summary = '''
+Test for a regression of the issue fixed in
+https://github.com/apache/trafficserver/pull/5423
+Insertion of header rewrite directives in to the output
+'''
+
+Test.ContinueOnFail = True
+# Define default ATS
+ts = Test.MakeATSProcess("ts")
+server = Test.MakeOriginServer("server")
+
+Test.testName = ""
+request_header = {"headers": "GET / HTTP/1.1\r\nHost: 
www.example.com\r\n\r\n", "timestamp": "1469733493.993", "body": ""}
+# expected response from the origin server
+response_header = {"headers": "HTTP/1.1 200 OK\r\nConnection: close\r\n\r\n", 
"timestamp": "1469733493.993", "body": ""}
+
+# add response to the server dictionary
+server.addResponse("sessionfile.log", request_header, response_header)
+ts.Disk.records_config.update({
+'proxy.config.diags.debug.enabled': 1,
+'proxy.config.diags.debug.tags': 'header.*',
+})
+
+# The following rule adds X-First and X-Last headers
+ts.Setup.CopyAs('rules/rule_l_value.conf', Test.RunDirectory)
+
+ts.Disk.plugin_config.AddLine(
+'header_rewrite.so {0}/rule_l_value.conf'.format(Test.RunDirectory)
+)
+ts.Disk.remap_config.AddLine(
+'map http://www.example.com 
http://127.0.0.1:{0}'.format(server.Variables.Port)
+)
+ts.Disk.remap_config.AddLine(
+'map http://www.example.com:8080 
http://127.0.0.1:{0}'.format(server.Variables.Port)
+)
+
+# [L] test
+tr = Test.AddTestRun("Header Rewrite End [L]")
+tr.Processes.Default.Command = 'curl --proxy 127.0.0.1:{0} 
"http://www.example.com; -H "Proxy-Connection: keep-alive" --verbose'.format(
+ts.Variables.port)
+tr.Processes.Default.ReturnCode = 0
+tr.Processes.Default.StartBefore(server, 
ready=When.PortOpen(server.Variables.Port))
+tr.Processes.Default.StartBefore(Test.Processes.ts)
+tr.Processes.Default.Streams.stderr = "gold/header_rewrite-l_value.gold"
+tr.StillRunningAfter = server
+ts.Streams.All = "gold/header_rewrite-tag.gold"
diff --git a/tests/gold_tests/pluginTest/header_rewrite/rules/rule_l_value.conf 
b/tests/gold_tests/pluginTest/header_rewrite/rules/rule_l_value.conf
new file mode 100644
index 000..e80a8e4
--- /dev/null
+++ 

[trafficserver] branch 9.0.x updated: Add header guard (#6358)

2020-02-21 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 40bb444  Add header guard (#6358)
40bb444 is described below

commit 40bb44491eed809500f398bc366d2e90e38a58d7
Author: Evan Zelkowitz 
AuthorDate: Mon Jan 27 18:33:08 2020 -0700

Add header guard (#6358)

Header guard for EnumDescriptor.h

(cherry picked from commit 0e64d36ecfea0a93ccdf9b2d2d1cc000c7273852)
---
 include/tscore/EnumDescriptor.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/tscore/EnumDescriptor.h b/include/tscore/EnumDescriptor.h
index 485a5c3..f1c4b50 100644
--- a/include/tscore/EnumDescriptor.h
+++ b/include/tscore/EnumDescriptor.h
@@ -19,6 +19,8 @@
   limitations under the License.
 */
 
+#pragma once
+
 #include 
 #include 
 



[trafficserver] branch 9.0.x updated: Syntax Error fixed in URI sig Plugin (#6420)

2020-02-21 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 4809307  Syntax Error fixed in URI sig Plugin (#6420)
4809307 is described below

commit 480930771d9245a3dac8bf62dc30383c9199da88
Author: Dylan Souza 
AuthorDate: Thu Feb 13 16:51:27 2020 -0700

Syntax Error fixed in URI sig Plugin (#6420)

(cherry picked from commit c154d40e53949a53f0cf79626868075a9d330f68)
---
 plugins/experimental/uri_signing/normalize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/experimental/uri_signing/normalize.c 
b/plugins/experimental/uri_signing/normalize.c
index 8e350bf..cd47586 100644
--- a/plugins/experimental/uri_signing/normalize.c
+++ b/plugins/experimental/uri_signing/normalize.c
@@ -218,7 +218,7 @@ normalize_uri(const char *uri, int uri_ct, char 
*normal_uri, int normal_ct)
   const char *uri_end  = uri + uri_ct;
   const char *buff_end = normal_uri + normal_ct;
 
-  if ((normal_uri == null) || (normal_uri && normal_ct < uri_ct + 1)) {
+  if ((normal_uri == NULL) || (normal_uri && normal_ct < uri_ct + 1)) {
 PluginDebug("Buffer to Normalize URI not large enough.");
 return -1;
   }



[trafficserver] branch 9.0.x updated: URI Sig Null Check for Clang Warning (#6419)

2020-02-21 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 80e8828  URI Sig Null Check for Clang Warning (#6419)
80e8828 is described below

commit 80e8828a8bc0b8a48b4c51dffcdd081887c67d06
Author: Dylan Souza 
AuthorDate: Thu Feb 13 14:39:29 2020 -0700

URI Sig Null Check for Clang Warning (#6419)

This commit adds a missing null check in the uri normalization function.
This was caught by the clang analyzer.

(cherry picked from commit 2de1c35b036a8ee63a3abf74da9344076ac45425)
---
 plugins/experimental/uri_signing/normalize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/experimental/uri_signing/normalize.c 
b/plugins/experimental/uri_signing/normalize.c
index e514111..8e350bf 100644
--- a/plugins/experimental/uri_signing/normalize.c
+++ b/plugins/experimental/uri_signing/normalize.c
@@ -218,7 +218,7 @@ normalize_uri(const char *uri, int uri_ct, char 
*normal_uri, int normal_ct)
   const char *uri_end  = uri + uri_ct;
   const char *buff_end = normal_uri + normal_ct;
 
-  if (normal_uri && normal_ct < uri_ct + 1) {
+  if ((normal_uri == null) || (normal_uri && normal_ct < uri_ct + 1)) {
 PluginDebug("Buffer to Normalize URI not large enough.");
 return -1;
   }



[trafficserver] branch 9.0.x updated: Fixed encoding test to work with OpenSSL 1.0.2

2020-02-21 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 1887c84  Fixed encoding test to work with OpenSSL 1.0.2
1887c84 is described below

commit 1887c846be8eece6b9b5d3a32b566feb49cf43dc
Author: Bryan Call 
AuthorDate: Wed Feb 19 10:00:25 2020 -0800

Fixed encoding test to work with OpenSSL 1.0.2

(cherry picked from commit aa903d9463fdbad7e28f8bd9fa0451ff765efcb3)
---
 tests/gold_tests/chunked_encoding/smuggle-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gold_tests/chunked_encoding/smuggle-client.c 
b/tests/gold_tests/chunked_encoding/smuggle-client.c
index 6b83a18..c064571 100644
--- a/tests/gold_tests/chunked_encoding/smuggle-client.c
+++ b/tests/gold_tests/chunked_encoding/smuggle-client.c
@@ -93,7 +93,7 @@ main(int argc, char *argv[])
 exit(EXIT_FAILURE);
   }
 
-  SSL_CTX *client_ctx = SSL_CTX_new(TLS_method());
+  SSL_CTX *client_ctx = SSL_CTX_new(SSLv23_client_method());
   SSL *ssl= SSL_new(client_ctx);
 
   SSL_set_fd(ssl, sfd);



[trafficserver] branch master updated: Another option to fix potential HTTP/2 vio stall

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

shinrich 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 87e7906  Another option to fix potential HTTP/2 vio stall
87e7906 is described below

commit 87e79069f07daf17f54958de1d1f9d4198ccc266
Author: Susan Hinrichs 
AuthorDate: Mon Feb 10 23:27:55 2020 +

Another option to fix potential HTTP/2 vio stall
---
 proxy/http2/Http2Stream.cc | 69 +-
 proxy/http2/Http2Stream.h  |  4 ++-
 2 files changed, 34 insertions(+), 39 deletions(-)

diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index e317c23..83722b8 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -73,7 +73,13 @@ Http2Stream::main_event_handler(int event, void *edata)
 
   Event *e = static_cast(edata);
   reentrancy_count++;
-  if (e == cross_thread_event) {
+  if (e == _read_vio_event) {
+this->signal_read_event(e->callback_event);
+return 0;
+  } else if (e == _write_vio_event) {
+this->signal_write_event(e->callback_event);
+return 0;
+  } else if (e == cross_thread_event) {
 cross_thread_event = nullptr;
   } else if (e == active_event) {
 event= VC_EVENT_ACTIVE_TIMEOUT;
@@ -95,25 +101,9 @@ Http2Stream::main_event_handler(int event, void *edata)
   case VC_EVENT_ACTIVE_TIMEOUT:
   case VC_EVENT_INACTIVITY_TIMEOUT:
 if (_sm && read_vio.ntodo() > 0) {
-  MUTEX_TRY_LOCK(lock, read_vio.mutex, this_ethread());
-  if (lock.is_locked()) {
-read_vio.cont->handleEvent(event, _vio);
-  } else {
-if (this->_read_vio_event) {
-  this->_read_vio_event->cancel();
-}
-this->_read_vio_event = this_ethread()->schedule_imm(read_vio.cont, 
event, _vio);
-  }
+  this->signal_read_event(event);
 } else if (_sm && write_vio.ntodo() > 0) {
-  MUTEX_TRY_LOCK(lock, write_vio.mutex, this_ethread());
-  if (lock.is_locked()) {
-write_vio.cont->handleEvent(event, _vio);
-  } else {
-if (this->_write_vio_event) {
-  this->_write_vio_event->cancel();
-}
-this->_write_vio_event = this_ethread()->schedule_imm(write_vio.cont, 
event, _vio);
-  }
+  this->signal_write_event(event);
 }
 break;
   case VC_EVENT_WRITE_READY:
@@ -121,15 +111,7 @@ Http2Stream::main_event_handler(int event, void *edata)
 inactive_timeout_at = Thread::get_hrtime() + inactive_timeout;
 if (e->cookie == _vio) {
   if (write_vio.mutex && write_vio.cont && this->_sm) {
-MUTEX_TRY_LOCK(lock, write_vio.mutex, this_ethread());
-if (lock.is_locked()) {
-  write_vio.cont->handleEvent(event, _vio);
-} else {
-  if (this->_write_vio_event) {
-this->_write_vio_event->cancel();
-  }
-  this->_write_vio_event = 
this_ethread()->schedule_imm(write_vio.cont, event, _vio);
-}
+this->signal_write_event(event);
   }
 } else {
   update_write_request(write_vio.get_reader(), INT64_MAX, true);
@@ -140,15 +122,7 @@ Http2Stream::main_event_handler(int event, void *edata)
 inactive_timeout_at = Thread::get_hrtime() + inactive_timeout;
 if (e->cookie == _vio) {
   if (read_vio.mutex && read_vio.cont && this->_sm) {
-MUTEX_TRY_LOCK(lock, read_vio.mutex, this_ethread());
-if (lock.is_locked()) {
-  read_vio.cont->handleEvent(event, _vio);
-} else {
-  if (this->_read_vio_event) {
-this->_read_vio_event->cancel();
-  }
-  this->_read_vio_event = this_ethread()->schedule_imm(read_vio.cont, 
event, _vio);
-}
+signal_read_event(event);
   }
 } else {
   this->update_read_request(INT64_MAX, true);
@@ -671,7 +645,26 @@ Http2Stream::signal_read_event(int event)
 if (this->_read_vio_event) {
   this->_read_vio_event->cancel();
 }
-this->_read_vio_event = this_ethread()->schedule_imm(read_vio.cont, event, 
_vio);
+this->_read_vio_event = this_ethread()->schedule_in(this, retry_delay, 
event, _vio);
+  }
+}
+
+void
+Http2Stream::signal_write_event(int event)
+{
+  if (this->write_vio.cont == nullptr || this->write_vio.cont->mutex == 
nullptr || this->write_vio.op == VIO::NONE) {
+return;
+  }
+
+  MUTEX_TRY_LOCK(lock, write_vio.cont->mutex, this_ethread());
+  if (lock.is_locked()) {
+inactive_timeout_at = Thread::get_hrtime() + inactive_timeout;
+this->write_vio.cont->handleEvent(event, >write_vio);
+  } else {
+if (this->_write_vio_event) {
+  this->_write_vio_event->cancel();
+}
+this->_write_vio_event = this_ethread()->schedule_in(this, retry_delay, 
event, _vio);
   }
 }
 
diff --git a/proxy/http2/Http2Stream.h b/proxy/http2/Http2Stream.h
index cc8bffc..df560a1 100644
--- a/proxy/http2/Http2Stream.h
+++