[trafficserver] branch master updated (1119944 -> f78c723)

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

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


from 1119944  Including stdexcept
 add f78c723  Fix localstatedir and runtimedir for Debian layout

No new revisions were added by this update.

Summary of changes:
 config.layout | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[trafficserver] branch master updated (e281fd6 -> 1119944)

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

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


from e281fd6  Ensure that extra data beyond the chunked body is not tunneled
 add bc0946e  Removing throw since there is no context and could cause a 
crash
 add 6e034f0  Change to use throw std::runtime_error instead of removal
 add 1119944  Including stdexcept

No new revisions were added by this update.

Summary of changes:
 plugins/experimental/stream_editor/stream_editor.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)



[trafficserver] branch 7.1.x updated: Fix chunked processing

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

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


The following commit(s) were added to refs/heads/7.1.x by this push:
 new 3b6dc41  Fix chunked processing
3b6dc41 is described below

commit 3b6dc411c2321d55003c6b7151211e3cd51ceb49
Author: Susan Hinrichs 
AuthorDate: Wed Feb 5 19:17:50 2020 +

Fix chunked processing
---
 iocore/net/UnixNetVConnection.cc |   2 +-
 proxy/ProxyClientSession.h   |   6 ++
 proxy/ProxyClientTransaction.h   |   6 ++
 proxy/http/Http1ClientSession.h  |   6 ++
 proxy/http/HttpTransact.cc   |   3 +-
 proxy/http/HttpTunnel.cc | 160 ---
 proxy/http/HttpTunnel.h  |   1 +
 7 files changed, 122 insertions(+), 62 deletions(-)

diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index a30200b..7cc2363 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -985,7 +985,7 @@ UnixNetVConnection::load_buffer_and_write(int64_t towrite, 
MIOBufferAccessor 
 try_to_write  = 0;
 
 while (niov < NET_MAX_IOV) {
-  int64_t wavail = towrite - total_written;
+  int64_t wavail = towrite - total_written - try_to_write;
   int64_t len= tmp_reader->block_read_avail();
 
   // Check if we have done this block.
diff --git a/proxy/ProxyClientSession.h b/proxy/ProxyClientSession.h
index 22190e6..32100e3 100644
--- a/proxy/ProxyClientSession.h
+++ b/proxy/ProxyClientSession.h
@@ -65,6 +65,12 @@ public:
 
   virtual NetVConnection *get_netvc() const = 0;
 
+  virtual bool
+  is_chunked_encoding_supported() const
+  {
+return false;
+  }
+
   virtual int get_transact_count() const = 0;
 
   virtual const char *get_protocol_string() const = 0;
diff --git a/proxy/ProxyClientTransaction.h b/proxy/ProxyClientTransaction.h
index 5398c9e..1656700 100644
--- a/proxy/ProxyClientTransaction.h
+++ b/proxy/ProxyClientTransaction.h
@@ -244,6 +244,12 @@ public:
 return parent ? parent->populate_protocol(result, size) : 0;
   }
 
+  virtual bool
+  is_chunked_encoding_supported() const
+  {
+return parent ? parent->is_chunked_encoding_supported() : false;
+  }
+
   virtual const char *
   protocol_contains(ts::StringView tag_prefix) const
   {
diff --git a/proxy/http/Http1ClientSession.h b/proxy/http/Http1ClientSession.h
index 37a626e..8f9e20b 100644
--- a/proxy/http/Http1ClientSession.h
+++ b/proxy/http/Http1ClientSession.h
@@ -168,6 +168,12 @@ public:
 return "http";
   }
 
+  bool
+  is_chunked_encoding_supported() const override
+  {
+return true;
+  }
+
 private:
   Http1ClientSession(Http1ClientSession &);
 
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 073587d..156441d 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -7103,8 +7103,7 @@ HttpTransact::handle_response_keep_alive_headers(State 
*s, HTTPVersion ver, HTTP
 // check that the client is HTTP 1.1 and the conf allows chunking or the 
client
 // protocol unchunks before returning to the user agent (i.e. is http/2)
 if (s->client_info.http_version == HTTPVersion(1, 1) &&
-(s->txn_conf->chunking_enabled == 1 ||
- (s->state_machine->plugin_tag && 
(!strncmp(s->state_machine->plugin_tag, "http/2", 6 &&
+(s->txn_conf->chunking_enabled == 1 && 
s->state_machine->ua_session->is_chunked_encoding_supported()) &&
 // if we're not sending a body, don't set a chunked header regardless 
of server response
 !is_response_body_precluded(s->hdr_info.client_response.status_get(), 
s->method) &&
 // we do not need chunked encoding for internal error messages
diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index aa5d1a0..561c55e 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -899,11 +899,10 @@ HttpTunnel::producer_run(HttpTunnelProducer *p)
 consumer_n = (producer_n = INT64_MAX);
   }
 
-  // Do the IO on the consumers first so
-  //  data doesn't disappear out from
-  //  under the tunnel
   ink_release_assert(p->num_consumers > 0);
-  for (c = p->consumer_list.head; c;) {
+  // At least set up the consumer readers first so the data
+  // doesn't disappear out from under the tunnel
+  for (c = p->consumer_list.head; c; c = c->link.next) {
 // Create a reader for each consumer.  The reader allows
 // us to implement skip bytes
 if (c->vc_type == HT_CACHE_WRITE) {
@@ -934,45 +933,6 @@ HttpTunnel::producer_run(HttpTunnelProducer *p)
   ink_assert(c->skip_bytes <= c->buffer_reader->read_avail());
   c->buffer_reader->consume(c->skip_bytes);
 }
-int64_t c_write = consumer_n;
-
-// INKqa05109 - if we don't know the length leave it at
-//  INT64_MAX or else the cache may bounce the write
-//  because it thinks the document is too big.  INT64_MAX
-//  is a special case for the max 

[trafficserver] branch 8.0.x updated: Fix chunked processing

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

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


The following commit(s) were added to refs/heads/8.0.x by this push:
 new 60e0a8c  Fix chunked processing
60e0a8c is described below

commit 60e0a8ce23d390b851873e020483d6f75e857158
Author: Susan Hinrichs 
AuthorDate: Wed Feb 5 19:15:36 2020 +

Fix chunked processing
---
 iocore/net/UnixNetVConnection.cc |   2 +-
 proxy/http/HttpTransact.cc   |   5 +-
 proxy/http/HttpTunnel.cc | 160 ---
 proxy/http/HttpTunnel.h  |   1 +
 4 files changed, 105 insertions(+), 63 deletions(-)

diff --git a/iocore/net/UnixNetVConnection.cc b/iocore/net/UnixNetVConnection.cc
index 3d76002..135b0b5 100644
--- a/iocore/net/UnixNetVConnection.cc
+++ b/iocore/net/UnixNetVConnection.cc
@@ -933,7 +933,7 @@ UnixNetVConnection::load_buffer_and_write(int64_t towrite, 
MIOBufferAccessor 
 try_to_write  = 0;
 
 while (niov < NET_MAX_IOV) {
-  int64_t wavail = towrite - total_written;
+  int64_t wavail = towrite - total_written - try_to_write;
   int64_t len= tmp_reader->block_read_avail();
 
   // Check if we have done this block.
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index e78fdd9..c0ddf77 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -6806,9 +6806,8 @@ HttpTransact::handle_response_keep_alive_headers(State 
*s, HTTPVersion ver, HTTP
 
 // check that the client is HTTP 1.1 and the conf allows chunking or the 
client
 // protocol unchunks before returning to the user agent (i.e. is http/2)
-if (s->client_info.http_version == HTTPVersion(1, 1) &&
-(s->txn_conf->chunking_enabled == 1 ||
- (s->state_machine->plugin_tag && 
(!strncmp(s->state_machine->plugin_tag, "http/2", 6 &&
+if (s->client_info.http_version == HTTPVersion(1, 1) && 
s->txn_conf->chunking_enabled == 1 &&
+s->state_machine->ua_txn->is_chunked_encoding_supported() &&
 // if we're not sending a body, don't set a chunked header regardless 
of server response
 !is_response_body_precluded(s->hdr_info.client_response.status_get(), 
s->method) &&
 // we do not need chunked encoding for internal error messages
diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index 84634c3..bcdb695 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -871,10 +871,9 @@ HttpTunnel::producer_run(HttpTunnelProducer *p)
 consumer_n = (producer_n = INT64_MAX);
   }
 
-  // Do the IO on the consumers first so
-  //  data doesn't disappear out from
-  //  under the tunnel
-  for (c = p->consumer_list.head; c;) {
+  // At least set up the consumer readers first so the data
+  // doesn't disappear out from under the tunnel
+  for (c = p->consumer_list.head; c; c = c->link.next) {
 // Create a reader for each consumer.  The reader allows
 // us to implement skip bytes
 if (c->vc_type == HT_CACHE_WRITE) {
@@ -905,45 +904,6 @@ HttpTunnel::producer_run(HttpTunnelProducer *p)
   ink_assert(c->skip_bytes <= c->buffer_reader->read_avail());
   c->buffer_reader->consume(c->skip_bytes);
 }
-int64_t c_write = consumer_n;
-
-// INKqa05109 - if we don't know the length leave it at
-//  INT64_MAX or else the cache may bounce the write
-//  because it thinks the document is too big.  INT64_MAX
-//  is a special case for the max document size code
-//  in the cache
-if (c_write != INT64_MAX) {
-  c_write -= c->skip_bytes;
-}
-// Fix for problems with not chunked content being chunked and
-// not sending the entire data.  The content length grows when
-// it is being chunked.
-if (p->do_chunking == true) {
-  c_write = INT64_MAX;
-}
-
-if (c_write == 0) {
-  // Nothing to do, call back the cleanup handlers
-  c->write_vio = nullptr;
-  consumer_handler(VC_EVENT_WRITE_COMPLETE, c);
-} else {
-  // In the client half close case, all the data that will be sent
-  // from the client is already in the buffer.  Go ahead and set
-  // the amount to read since we know it.  We will forward the FIN
-  // to the server on VC_EVENT_WRITE_COMPLETE.
-  if (p->vc_type == HT_HTTP_CLIENT) {
-ProxyClientTransaction *ua_vc = static_cast(p->vc);
-if (ua_vc->get_half_close_flag()) {
-  c_write  = c->buffer_reader->read_avail();
-  p->alive = false;
-  p->handler_state = HTTP_SM_POST_SUCCESS;
-}
-  }
-  c->write_vio = c->vc->do_io_write(this, c_write, c->buffer_reader);
-  ink_assert(c_write > 0);
-}
-
-c = c->link.next;
   }
 
   // YTS Team, yamsat Plugin
@@ -1003,7 +963,56 @@ HttpTunnel::producer_run(HttpTunnelProducer *p)
   producer_n = 0;
 }
   }
+  for (c = p->consumer_list.head; c; c = 

[trafficserver] branch 9.0.x updated: Updated ChangeLog

2020-02-05 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 d429de0  Updated ChangeLog
d429de0 is described below

commit d429de0a5658e21f9672a4ae92e1e42d8ba8b0b1
Author: Leif Hedstrom 
AuthorDate: Wed Feb 5 14:49:41 2020 -0700

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

diff --git a/CHANGELOG-9.0.0 b/CHANGELOG-9.0.0
index 0e0dad4..84199f3 100644
--- a/CHANGELOG-9.0.0
+++ b/CHANGELOG-9.0.0
@@ -884,7 +884,12 @@ Changes with Apache Traffic Server 9.0.0
   #6323 - Fix strict round robin cur_index increment
   #6324 - Fixes clang-format issues
   #6325 - Fixes typo in TLS Bridge illustration
+  #6328 - Document the order of the X-Cache header
   #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.
   #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()
+  #6372 - Change alloca usage to malloc/free
+  #6378 - Remove trailing white space from json formatter
+  #6392 - Free TSMgmtString after using it.



[trafficserver] branch master updated (544d29b -> e281fd6)

2020-02-05 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 544d29b  Free TSMgmtString after using it.
 add e281fd6  Ensure that extra data beyond the chunked body is not tunneled

No new revisions were added by this update.

Summary of changes:
 iocore/net/UnixNetVConnection.cc   |   2 +-
 proxy/http/HttpTransact.cc |   1 +
 proxy/http/HttpTunnel.cc   | 160 +
 proxy/http/HttpTunnel.h|   1 +
 .../gold_tests/chunked_encoding/case4.sh   |   6 +-
 .../chunked_encoding/chunked_encoding.test.py  |  30 +++-
 .../chunked_encoding/{server3.sh => server4.sh}|   0
 tests/gold_tests/chunked_encoding/smuggle-client.c | 124 
 8 files changed, 259 insertions(+), 65 deletions(-)
 copy example/plugins/Makefile.am => tests/gold_tests/chunked_encoding/case4.sh 
(90%)
 copy tests/gold_tests/chunked_encoding/{server3.sh => server4.sh} (100%)
 create mode 100644 tests/gold_tests/chunked_encoding/smuggle-client.c



[trafficserver] branch 9.0.x updated: Fix heap-use-after-free on Http2Stream::destroy()

2020-02-05 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 170cabe  Fix heap-use-after-free on Http2Stream::destroy()
170cabe is described below

commit 170cabe81932feb39f46a9462e1e423a92d4dca9
Author: Masaori Koshiba 
AuthorDate: Mon Jan 27 13:36:01 2020 +0900

Fix heap-use-after-free on Http2Stream::destroy()

(cherry picked from commit ca6747102646080fe03046384488150ce93143d9)
---
 proxy/http2/Http2Stream.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index ecbec35..f3519c3 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -757,6 +757,8 @@ Http2Stream::destroy()
 
   // Safe to initiate SSN_CLOSE if this is the last stream
   if (_proxy_ssn) {
+cid = _proxy_ssn->connection_id();
+
 Http2ClientSession *h2_proxy_ssn = static_cast(_proxy_ssn);
 SCOPED_MUTEX_LOCK(lock, h2_proxy_ssn->connection_state.mutex, 
this_ethread());
 // Make sure the stream is removed from the stream list and priority tree
@@ -766,7 +768,7 @@ Http2Stream::destroy()
 // Update session's stream counts, so it accurately goes into keep-alive 
state
 h2_proxy_ssn->connection_state.release_stream(this);
 
-cid = _proxy_ssn->connection_id();
+// Do not access `_proxy_ssn` in below. It might be freed by 
`release_stream`.
   }
 
   // Clean up the write VIO in case of inactivity timeout



[trafficserver] branch 9.0.x updated: Change alloca usage to malloc/free

2020-02-05 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 fb7abd5  Change alloca usage to malloc/free
fb7abd5 is described below

commit fb7abd5222ab5c60d973a6f8c925b7963a554abe
Author: Evan Zelkowitz 
AuthorDate: Wed Jan 29 14:13:41 2020 -0700

Change alloca usage to malloc/free

This code is in a while(true) loop, so every time the manager receives a 
message it is expanding the stack more and more, since it never exits traffic 
manager could end up blowing its stack if it receives enough messages.  
Changing to allocate on each message and free when done

Addresses issue #6351

(cherry picked from commit 614bbe0a4efdb121df4da7f83049bdaa628bb1d8)
---
 mgmt/LocalManager.cc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mgmt/LocalManager.cc b/mgmt/LocalManager.cc
index 09c9c1c..652ff47 100644
--- a/mgmt/LocalManager.cc
+++ b/mgmt/LocalManager.cc
@@ -406,7 +406,7 @@ LocalManager::pollMgmtProcessServer()
 
 // read the message
 if ((res = mgmt_read_pipe(watched_process_fd, reinterpret_cast(_hdr), sizeof(MgmtMessageHdr))) > 0) {
-  MgmtMessageHdr *mh_full = static_cast(alloca(sizeof(MgmtMessageHdr) + mh_hdr.data_len));
+  MgmtMessageHdr *mh_full = static_cast(malloc(sizeof(MgmtMessageHdr) + mh_hdr.data_len));
   memcpy(mh_full, _hdr, sizeof(MgmtMessageHdr));
   char *data_raw = reinterpret_cast(mh_full) + 
sizeof(MgmtMessageHdr);
   if ((res = mgmt_read_pipe(watched_process_fd, data_raw, 
mh_hdr.data_len)) > 0) {
@@ -414,6 +414,7 @@ LocalManager::pollMgmtProcessServer()
   } else if (res < 0) {
 mgmt_fatal(0, "[LocalManager::pollMgmtProcessServer] Error in read 
(errno: %d)\n", -res);
   }
+  free(mh_full);
 } else if (res < 0) {
   mgmt_fatal(0, "[LocalManager::pollMgmtProcessServer] Error in read 
(errno: %d)\n", -res);
 }



[trafficserver] branch 9.0.x updated: Add compressible content-types example and 1Kb min

2020-02-05 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 97fd3f0  Add compressible content-types example and 1Kb min
97fd3f0 is described below

commit 97fd3f06b39007f6c9f2219a1d8eecb79ec8bee6
Author: Miles Libbey 
AuthorDate: Tue Jan 28 18:04:59 2020 -0700

Add compressible content-types example and 1Kb min

(cherry picked from commit 72c18f641f3641c8eb67ae79da6bd3e32ab5146b)
---
 doc/admin-guide/plugins/compress.en.rst | 21 +
 1 file changed, 21 insertions(+)

diff --git a/doc/admin-guide/plugins/compress.en.rst 
b/doc/admin-guide/plugins/compress.en.rst
index a355d33..41cf6a6 100644
--- a/doc/admin-guide/plugins/compress.en.rst
+++ b/doc/admin-guide/plugins/compress.en.rst
@@ -76,6 +76,8 @@ With no further options, this will enable the following 
default behavior:
 
 *  Disable flush (flush compressed content to client).
 
+* Only objects greater than 1Kb will be compressed
+
 Alternatively, a configuration may be specified (shown here using the sample
 configuration provided with the plugin's source)::
 
@@ -216,6 +218,25 @@ might create a configuration with the following options::
[bar.example.com]
enabled false
 
+   # A reasonable list of content-types that are compressible
+   compressible-content-type text/*
+   compressible-content-type *font*
+   compressible-content-type *javascript
+   compressible-content-type *json
+   compressible-content-type *ml;*
+   compressible-content-type *mpegURL
+   compressible-content-type *mpegurl
+   compressible-content-type *otf
+   compressible-content-type *ttf
+   compressible-content-type *type
+   compressible-content-type *xml
+   compressible-content-type application/eot
+   compressible-content-type application/pkix-crl
+   compressible-content-type application/x-httpd-cgi
+   compressible-content-type application/x-perl
+   compressible-content-type image/vnd.microsoft.icon
+   compressible-content-type image/x-icon
+
 Assuming the above options are in a file at 
``/etc/trafficserver/compress.config``
 the plugin would be enabled for |TS| in :file:`plugin.config` as::
 



[trafficserver] branch 9.0.x updated: Document the order of the X-Cache header

2020-02-05 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 05caec1  Document the order of the X-Cache header
05caec1 is described below

commit 05caec19465e85fbb35d2dff81ed1526cd9981c7
Author: Miles Libbey 
AuthorDate: Thu Jan 16 09:21:43 2020 -0800

Document the order of the X-Cache header

(cherry picked from commit b67060751ed8b62a437c14ff545f1bb71ef53ec7)
---
 doc/admin-guide/plugins/xdebug.en.rst | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/admin-guide/plugins/xdebug.en.rst 
b/doc/admin-guide/plugins/xdebug.en.rst
index 16e358d..d023076 100644
--- a/doc/admin-guide/plugins/xdebug.en.rst
+++ b/doc/admin-guide/plugins/xdebug.en.rst
@@ -78,7 +78,7 @@ X-Cache-Key
 key is being used.
 
 X-Cache
-The ``X-Cache`` header contains the results of any cache lookup.
+The ``X-Cache`` header contains the results of any cache lookups.
 
 ==  ===
 Value   Description
@@ -90,6 +90,10 @@ X-Cache
 skipped The cache lookup was skipped.
 ==  ===
 
+If a request goes through multiple proxies, each one prepends its X-Cache 
header content
+at the beginning of the existing X-Cache header. As a result, the order is 
reversed from
+the Via: header.
+
 X-Cache-Generation
   The cache generation ID for this transaction, as specified by the
   :ts:cv:`proxy.config.http.cache.generation` configuration variable.



[trafficserver] branch 9.0.x updated: Remove trailing white space from json formatter

2020-02-05 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 14b877c  Remove trailing white space from json formatter
14b877c is described below

commit 14b877c72bd5122aa719a18df5022d34ee03b51f
Author: Masaori Koshiba 
AuthorDate: Fri Jan 31 08:20:40 2020 +0900

Remove trailing white space from json formatter

(cherry picked from commit 9836b0bbb4c36e2c1c70a57a7cfe66276ac9c0ba)
---
 tests/gold_tests/h2/httpbin.test.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/gold_tests/h2/httpbin.test.py 
b/tests/gold_tests/h2/httpbin.test.py
index d77fcc2..11d4a51 100644
--- a/tests/gold_tests/h2/httpbin.test.py
+++ b/tests/gold_tests/h2/httpbin.test.py
@@ -80,7 +80,7 @@ Test.Disk.File(os.path.join(ts.Variables.LOGDIR, 
'access.log'), exists=True, con
 
 # TODO: when httpbin 0.8.0 or later is released, remove below json pretty 
print hack
 json_printer = '''
-python -c "import sys,json; print(json.dumps(json.load(sys.stdin), indent=2))"
+python -c "import sys,json; print(json.dumps(json.load(sys.stdin), indent=2, 
separators=(',', ': ')))"
 '''
 
 # 



[trafficserver] 02/02: Change header validation

2020-02-05 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 ae3136ce7c62a4e5d21f6889c9cd69adc55a95c1
Author: ZeddYu Lu 
AuthorDate: Tue Feb 4 11:20:13 2020 -0800

Change header validation

(cherry picked from commit 5830bc72611e85e7a31098ce86710242f29076dc)
---
 proxy/hdrs/HTTP.cc | 24 +++-
 1 file changed, 11 insertions(+), 13 deletions(-)

diff --git a/proxy/hdrs/HTTP.cc b/proxy/hdrs/HTTP.cc
index 7c18f91..7f0dc82 100644
--- a/proxy/hdrs/HTTP.cc
+++ b/proxy/hdrs/HTTP.cc
@@ -1114,20 +1114,18 @@ http_parser_parse_req(HTTPParser *parser, HdrHeap 
*heap, HTTPHdrImpl *hh, const
 
 end= real_end;
 parser->m_parsing_http = false;
-
-ParseResult ret =
-  mime_parser_parse(>m_mime_parser, heap, hh->m_fields_impl, 
start, end, must_copy_strings, eof, max_hdr_field_size);
-// If we're done with the main parse do some validation
-if (ret == PARSE_RESULT_DONE) {
-  ret = validate_hdr_host(hh); // check HOST header
-}
-if (ret == PARSE_RESULT_DONE) {
-  ret = validate_hdr_content_length(heap, hh);
-}
-return ret;
   }
 
-  return mime_parser_parse(>m_mime_parser, heap, hh->m_fields_impl, 
start, end, must_copy_strings, eof, max_hdr_field_size);
+  ParseResult ret =
+mime_parser_parse(>m_mime_parser, heap, hh->m_fields_impl, start, 
end, must_copy_strings, eof, max_hdr_field_size);
+  // If we're done with the main parse do some validation
+  if (ret == PARSE_RESULT_DONE) {
+ret = validate_hdr_host(hh); // check HOST header
+  }
+  if (ret == PARSE_RESULT_DONE) {
+ret = validate_hdr_content_length(heap, hh);
+  }
+  return ret;
 }
 
 ParseResult
@@ -1179,7 +1177,7 @@ validate_hdr_content_length(HdrHeap *heap, HTTPHdrImpl 
*hh)
 if (mime_hdr_field_find(hh->m_fields_impl, MIME_FIELD_TRANSFER_ENCODING, 
MIME_LEN_TRANSFER_ENCODING) != nullptr) {
   // Delete all Content-Length headers
   Debug("http", "Transfer-Encoding header and Content-Length headers the 
request, removing all Content-Length headers");
-  mime_hdr_field_delete(heap, hh->m_fields_impl, content_length_field);
+  mime_hdr_field_delete(heap, hh->m_fields_impl, content_length_field, 
true);
   return PARSE_RESULT_DONE;
 }
 



[trafficserver] 01/02: Fixed how we handle uknown schemes

2020-02-05 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 8b00e56de8beb4b26544f3283f69017950cf5d17
Author: Bryan Call 
AuthorDate: Thu Jan 30 10:42:00 2020 -0800

Fixed how we handle uknown schemes

(cherry picked from commit c20a369fa93b22b492e6aed8bee1da5fa4af1cab)
---
 proxy/hdrs/HdrTest.cc | 101 +++---
 proxy/hdrs/URL.cc |  49 +---
 2 files changed, 108 insertions(+), 42 deletions(-)

diff --git a/proxy/hdrs/HdrTest.cc b/proxy/hdrs/HdrTest.cc
index b0f84d3..cb767dc 100644
--- a/proxy/hdrs/HdrTest.cc
+++ b/proxy/hdrs/HdrTest.cc
@@ -230,44 +230,100 @@ HdrTest::test_url()
 // Start with an easy one...
 "http://trafficserver.apache.org/index.html;,
 
-// "cheese://bogosity", This fails, but it's not clear it should 
work...
-
-"some.place", "some.place/", "http://some.place;, "http://some.place/;, 
"http://some.place/path;,
-"http://some.place/path;params;, "http://some.place/path;params?query;, 
"http://some.place/path;params?query#fragment;,
-"http://some.place/path?query#fragment;, "http://some.place/path#fragment;,
+"cheese://bogosity",
+
+"some.place",
+"some.place/",
+"http://some.place;,
+"http://some.place/;,
+"http://some.place/path;,
+"http://some.place/path;params;,
+"http://some.place/path;params?query;,
+"http://some.place/path;params?query#fragment;,
+"http://some.place/path?query#fragment;,
+"http://some.place/path#fragment;,
 
-"some.place:80", "some.place:80/", "http://some.place:80;, 
"http://some.place:80/;,
+"some.place:80",
+"some.place:80/",
+"http://some.place:80;,
+"http://some.place:80/;,
 
-"foo@some.place:80", "foo@some.place:80/", "http://foo@some.place:80;, 
"http://foo@some.place:80/;,
+"foo@some.place:80",
+"foo@some.place:80/",
+"http://foo@some.place:80;,
+"http://foo@some.place:80/;,
 
-"foo:bar@some.place:80", "foo:bar@some.place:80/", 
"http://foo:bar@some.place:80;, "http://foo:bar@some.place:80/;,
+"foo:bar@some.place:80",
+"foo:bar@some.place:80/",
+"http://foo:bar@some.place:80;,
+"http://foo:bar@some.place:80/;,
 
 // Some address stuff
-"http://172.16.28.101;, "http://172.16.28.101:8080;, "http://[::];, 
"http://[::1];, "http://[fc01:172:16:28::101];,
-"http://[fc01:172:16:28::101]:80;, 
"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101];,
-"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101]:8080;, 
"http://172.16.28.101/some/path;, "http://172.16.28.101:8080/some/path;,
-"http://[::1]/some/path;, "http://[fc01:172:16:28::101]/some/path;, 
"http://[fc01:172:16:28::101]:80/some/path;,
-"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101]/some/path;, 
"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101]:8080/some/path;,
-"http://172.16.28.101/;, 
"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101]:8080/;,
-
-"foo:bar@some.place", "foo:bar@some.place/", "http://foo:bar@some.place;, 
"http://foo:bar@some.place/;,
-"http://foo:bar@[::1]:8080/;, "http://foo@[::1];,
-
-"mms://sm02.tsqa.example.com/0102rally.asf", 
"pnm://foo:bar@some.place:80/path;params?query#fragment",
-"rtsp://foo:bar@some.place:80/path;params?query#fragment", 
"rtspu://foo:bar@some.place:80/path;params?query#fragment",
+"http://172.16.28.101;,
+"http://172.16.28.101:8080;,
+"http://[::];,
+"http://[::1];,
+"http://[fc01:172:16:28::101];,
+"http://[fc01:172:16:28::101]:80;,
+"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101];,
+"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101]:8080;,
+"http://172.16.28.101/some/path;,
+"http://172.16.28.101:8080/some/path;,
+"http://[::1]/some/path;,
+"http://[fc01:172:16:28::101]/some/path;,
+"http://[fc01:172:16:28::101]:80/some/path;,
+"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101]/some/path;,
+"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101]:8080/some/path;,
+"http://172.16.28.101/;,
+"http://[fc01:172:16:28:BAAD:BEEF:DEAD:101]:8080/;,
+
+// "foo:@some.place", TODO - foo:@some.place is change to foo@some.place 
in the test
+"foo:bar@some.place",
+"foo:bar@some.place/",
+"http://foo:bar@some.place;,
+"http://foo:bar@some.place/;,
+"http://foo:bar@[::1]:8080/;,
+"http://foo@[::1];,
+
+"mms://sm02.tsqa.example.com/0102rally.asf",
+"pnm://foo:bar@some.place:80/path;params?query#fragment",
+"rtsp://foo:bar@some.place:80/path;params?query#fragment",
+"rtspu://foo:bar@some.place:80/path;params?query#fragment",
 
"/finance/external/cbsm/*http://cbs.marketwatch.com/archive/19990713/news/current/net.htx?source=blq/yhoo=yhoo;,
-"http://a.b.com/xx.jpg?newpath=http://bob.dave.com"};
+"http://a.b.com/xx.jpg?newpath=http://bob.dave.com;,
+
+"ht-tp://a.b.com",
+"ht+tp://a.b.com",
+"ht.tp://a.b.com",
+
+"h1ttp://a.b.com",
+

[trafficserver] branch 9.0.x updated (bb2054b -> ae3136c)

2020-02-05 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 bb2054b  Free TSMgmtString after using it.
 new 8b00e56  Fixed how we handle uknown schemes
 new ae3136c  Change header validation

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:
 proxy/hdrs/HTTP.cc|  24 ++--
 proxy/hdrs/HdrTest.cc | 101 +++---
 proxy/hdrs/URL.cc |  49 +---
 3 files changed, 119 insertions(+), 55 deletions(-)



[trafficserver] branch 9.0.x updated: Free TSMgmtString after using it.

2020-02-05 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 bb2054b  Free TSMgmtString after using it.
bb2054b is described below

commit bb2054bc24b9ec4f446bf6e89fdf2bb735360f81
Author: David Calavera 
AuthorDate: Tue Feb 4 13:23:50 2020 -0800

Free TSMgmtString after using it.

Fixes memory leak.

Signed-off-by: David Calavera 
(cherry picked from commit 544d29bde833a5cad673bb3ccf344f3da8bec387)
---
 plugins/compress/misc.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/plugins/compress/misc.cc b/plugins/compress/misc.cc
index 5770844..4bf579c 100644
--- a/plugins/compress/misc.cc
+++ b/plugins/compress/misc.cc
@@ -142,6 +142,7 @@ init_hidden_header_name()
 hidden_header_name = static_cast(TSmalloc(hidden_header_name_len + 1));
 hidden_header_name[hidden_header_name_len] = 0;
 sprintf(hidden_header_name, "x-accept-encoding-%s", result);
+TSfree(result);
   }
   return hidden_header_name;
 }



[trafficserver] branch master updated (c20a369 -> 544d29b)

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

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


from c20a369  Fixed how we handle uknown schemes
 add 544d29b  Free TSMgmtString after using it.

No new revisions were added by this update.

Summary of changes:
 plugins/compress/misc.cc | 1 +
 1 file changed, 1 insertion(+)