You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2021/04/07 14:55:10 UTC

[trafficserver] branch 9.0.x updated (5ba803e -> 373b1e1)

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 5ba803e  Updated ChangeLog
     new 0ceccad  Do NOT kill tunnel if it has any consumer besides HT_HTTP_CLIENT (#7641)
     new 373b1e1  Make HTTP/2 Curl AuTest gold files case insensitive (#7683)

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/http/HttpSM.cc                       |  4 ++--
 proxy/http/HttpTunnel.h                    | 26 ++++++++++++++++++++++++++
 tests/gold_tests/h2/http2.test.py          |  6 ++++--
 tests/gold_tests/h2/http2_priority.test.py |  3 ++-
 tests/gold_tests/h2/httpbin.test.py        | 12 ++++++++----
 5 files changed, 42 insertions(+), 9 deletions(-)

[trafficserver] 02/02: Make HTTP/2 Curl AuTest gold files case insensitive (#7683)

Posted by zw...@apache.org.
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 373b1e117c79fbd12b857374547e51a3fec67abb
Author: Brian Neradt <br...@gmail.com>
AuthorDate: Wed Apr 7 09:47:05 2021 -0500

    Make HTTP/2 Curl AuTest gold files case insensitive (#7683)
    
    Newer versions of Curl (7.67.0) lowercase HTTP/2 field names in
    compliance with the HTTP/2 spec. Since some devs will have newer and
    some older versions of Curl, this accommodates both by making the HTTP/2
    gold files for AuTests match case-insensitively.
    
    (cherry picked from commit a8b6746d303c4fafdc2e609941750fc4c2ac9b14)
---
 tests/gold_tests/h2/http2.test.py          |  6 ++++--
 tests/gold_tests/h2/http2_priority.test.py |  3 ++-
 tests/gold_tests/h2/httpbin.test.py        | 12 ++++++++----
 3 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/tests/gold_tests/h2/http2.test.py b/tests/gold_tests/h2/http2.test.py
index a1ff957..be77c61 100644
--- a/tests/gold_tests/h2/http2.test.py
+++ b/tests/gold_tests/h2/http2.test.py
@@ -208,7 +208,8 @@ tr = Test.AddTestRun()
 tr.Processes.Default.Command = 'curl -vs -k --http2 https://127.0.0.1:{0}/huge_resp_hdrs'.format(ts.Variables.ssl_port)
 tr.Processes.Default.ReturnCode = 0
 tr.Processes.Default.Streams.stdout = "gold/http2_8_stdout.gold"
-tr.Processes.Default.Streams.stderr = "gold/http2_8_stderr.gold"
+# Different versions of curl will have different cases for HTTP/2 field names.
+tr.Processes.Default.Streams.stderr = Testers.GoldFile("gold/http2_8_stderr.gold", case_insensitive=True)
 tr.StillRunningAfter = server
 
 # Test Case 9: Header Only Response - e.g. 204
@@ -216,5 +217,6 @@ tr = Test.AddTestRun()
 tr.Processes.Default.Command = 'curl -vs -k --http2 https://127.0.0.1:{0}/status/204'.format(ts.Variables.ssl_port)
 tr.Processes.Default.ReturnCode = 0
 tr.Processes.Default.Streams.stdout = "gold/http2_9_stdout.gold"
-tr.Processes.Default.Streams.stderr = "gold/http2_9_stderr.gold"
+# Different versions of curl will have different cases for HTTP/2 field names.
+tr.Processes.Default.Streams.stderr = Testers.GoldFile("gold/http2_9_stderr.gold", case_insensitive=True)
 tr.StillRunningAfter = server
diff --git a/tests/gold_tests/h2/http2_priority.test.py b/tests/gold_tests/h2/http2_priority.test.py
index ce22cbc..b6df98e 100644
--- a/tests/gold_tests/h2/http2_priority.test.py
+++ b/tests/gold_tests/h2/http2_priority.test.py
@@ -77,5 +77,6 @@ tr.Processes.Default.TimeOut = 5
 tr.Processes.Default.StartBefore(server, ready=When.PortOpen(server.Variables.Port))
 tr.Processes.Default.StartBefore(Test.Processes.ts)
 tr.Processes.Default.Streams.stdout = "gold/priority_0_stdout.gold"
-tr.Processes.Default.Streams.stderr = "gold/priority_0_stderr.gold"
+# Different versions of curl will have different cases for HTTP/2 field names.
+tr.Processes.Default.Streams.stderr = Testers.GoldFile("gold/priority_0_stderr.gold", case_insensitive=True)
 tr.StillRunningAfter = server
diff --git a/tests/gold_tests/h2/httpbin.test.py b/tests/gold_tests/h2/httpbin.test.py
index 453e4b4..87bbfae 100644
--- a/tests/gold_tests/h2/httpbin.test.py
+++ b/tests/gold_tests/h2/httpbin.test.py
@@ -94,7 +94,8 @@ test_run.Processes.Default.ReturnCode = 0
 test_run.Processes.Default.StartBefore(httpbin, ready=When.PortOpen(httpbin.Variables.Port))
 test_run.Processes.Default.StartBefore(Test.Processes.ts)
 test_run.Processes.Default.Streams.stdout = "gold/httpbin_0_stdout.gold"
-test_run.Processes.Default.Streams.stderr = "gold/httpbin_0_stderr.gold"
+# Different versions of curl will have different cases for HTTP/2 field names.
+test_run.Processes.Default.Streams.stderr = Testers.GoldFile("gold/httpbin_0_stderr.gold", case_insensitive=True)
 test_run.StillRunningAfter = httpbin
 
 # Test Case 1: Empty response body
@@ -102,7 +103,8 @@ test_run = Test.AddTestRun()
 test_run.Processes.Default.Command = 'curl -vs -k --http2 https://127.0.0.1:{0}/bytes/0'.format(ts.Variables.ssl_port)
 test_run.Processes.Default.ReturnCode = 0
 test_run.Processes.Default.Streams.stdout = "gold/httpbin_1_stdout.gold"
-test_run.Processes.Default.Streams.stderr = "gold/httpbin_1_stderr.gold"
+# Different versions of curl will have different cases for HTTP/2 field names.
+test_run.Processes.Default.Streams.stderr = Testers.GoldFile("gold/httpbin_1_stderr.gold", case_insensitive=True)
 test_run.StillRunningAfter = httpbin
 
 # Test Case 2: Chunked
@@ -111,7 +113,8 @@ test_run.Processes.Default.Command = 'curl -vs -k --http2 https://127.0.0.1:{0}/
     ts.Variables.ssl_port)
 test_run.Processes.Default.ReturnCode = 0
 test_run.Processes.Default.Streams.stdout = "gold/httpbin_2_stdout.gold"
-test_run.Processes.Default.Streams.stderr = "gold/httpbin_2_stderr.gold"
+# Different versions of curl will have different cases for HTTP/2 field names.
+test_run.Processes.Default.Streams.stderr = Testers.GoldFile("gold/httpbin_2_stderr.gold", case_insensitive=True)
 test_run.StillRunningAfter = httpbin
 
 # Test Case 3: Expect 100-Continue
@@ -120,7 +123,8 @@ test_run.Processes.Default.Command = "curl -vs -k --http2 https://127.0.0.1:{0}/
     ts.Variables.ssl_port, json_printer)
 test_run.Processes.Default.ReturnCode = 0
 test_run.Processes.Default.Streams.stdout = "gold/httpbin_3_stdout.gold"
-test_run.Processes.Default.Streams.stderr = "gold/httpbin_3_stderr.gold"
+# Different versions of curl will have different cases for HTTP/2 field names.
+test_run.Processes.Default.Streams.stderr = Testers.GoldFile("gold/httpbin_3_stderr.gold", case_insensitive=True)
 test_run.StillRunningAfter = httpbin
 
 

[trafficserver] 01/02: Do NOT kill tunnel if it has any consumer besides HT_HTTP_CLIENT (#7641)

Posted by zw...@apache.org.
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 0ceccad534b34af1694627689725541268ef304f
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Fri Apr 2 07:56:13 2021 +0900

    Do NOT kill tunnel if it has any consumer besides HT_HTTP_CLIENT (#7641)
    
    (cherry picked from commit 270ca6e84eba758e44c9b2a15046eaa7b8af8d8a)
---
 proxy/http/HttpSM.cc    |  4 ++--
 proxy/http/HttpTunnel.h | 26 ++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index aa88ede..1fa9ef7 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -901,9 +901,9 @@ HttpSM::state_watch_for_client_abort(int event, void *data)
    * client.
    */
   case VC_EVENT_EOS: {
-    // We got an early EOS.
+    // We got an early EOS. If the tunnal has cache writer, don't kill it for background fill.
     NetVConnection *netvc = ua_txn->get_netvc();
-    if (ua_txn->allow_half_open()) {
+    if (ua_txn->allow_half_open() || tunnel.has_consumer_besides_client()) {
       if (netvc) {
         netvc->do_io_shutdown(IO_SHUTDOWN_READ);
       }
diff --git a/proxy/http/HttpTunnel.h b/proxy/http/HttpTunnel.h
index c6aa9fc..7774e2c 100644
--- a/proxy/http/HttpTunnel.h
+++ b/proxy/http/HttpTunnel.h
@@ -282,6 +282,7 @@ public:
   }
   bool is_tunnel_alive() const;
   bool has_cache_writer() const;
+  bool has_consumer_besides_client() const;
 
   HttpTunnelProducer *add_producer(VConnection *vc, int64_t nbytes, IOBufferReader *reader_start, HttpProducerHandler sm_handler,
                                    HttpTunnelType_t vc_type, const char *name);
@@ -514,6 +515,31 @@ HttpTunnel::has_cache_writer() const
   return false;
 }
 
+/**
+   Return false if there is only a consumer for client
+ */
+inline bool
+HttpTunnel::has_consumer_besides_client() const
+{
+  bool res = true;
+
+  for (const auto &consumer : consumers) {
+    if (!consumer.alive) {
+      continue;
+    }
+
+    if (consumer.vc_type == HT_HTTP_CLIENT) {
+      res = false;
+      continue;
+    } else {
+      res = true;
+      break;
+    }
+  }
+
+  return res;
+}
+
 inline bool
 HttpTunnelConsumer::is_downstream_from(VConnection *vc)
 {