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 2017/11/07 17:47:33 UTC

[trafficserver] branch 7.1.x updated (4d6d99e -> d1fd931)

This is an automated email from the ASF dual-hosted git repository.

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


    from 4d6d99e  Revert "Revert "Added stop and close to else in failover to close a single configured connection on failover.""
     new 5cc1435  Strict checks of RFC7540 8.1.2.2.
     new c5f0fc5  TS-5057: Add 103 Early Hints support
     new d1fd931  Add flag to ignore out of bounds compile error for test

The 3 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/developer-guide/api/types/TSHttpStatus.en.rst |  2 ++
 lib/cppapi/include/atscppapi/HttpStatus.h         |  1 +
 lib/ts/Makefile.am                                |  1 +
 lib/ts/apidefs.h.in                               |  1 +
 lib/ts/mkdfa.c                                    |  1 +
 proxy/InkAPITest.cc                               | 14 +++++++++++++-
 proxy/hdrs/HTTP.cc                                |  1 +
 proxy/hdrs/HTTP.h                                 |  1 +
 proxy/http/HttpTransact.cc                        |  3 ++-
 proxy/http2/HTTP2.cc                              |  6 +++++-
 10 files changed, 28 insertions(+), 3 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].

[trafficserver] 01/03: Strict checks of RFC7540 8.1.2.2.

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 5cc14357b8ba2e5f151dc4a6a549f20844cb6824
Author: David Calavera <da...@gmail.com>
AuthorDate: Sun Nov 5 18:38:17 2017 -0800

    Strict checks of RFC7540 8.1.2.2.
    
    Treat messages with connection specific fields as malformed.
    
    It uses the same list of header fields that are removed when H1 headers
    are transformed to H2 ones:
    
    https://github.com/apache/trafficserver/blob/6dcc822baf23b1ab69c9a2609fc4f65fd9f6c10b/proxy/http2/HTTP2.cc#L570
    
    Signed-off-by: David Calavera <da...@gmail.com>
    (cherry picked from commit c3ada26c31821684cb04c1c240082fbde201b9a7)
---
 proxy/http2/HTTP2.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc
index 67af7b6..e8f7bd4 100644
--- a/proxy/http2/HTTP2.cc
+++ b/proxy/http2/HTTP2.cc
@@ -661,7 +661,11 @@ http2_decode_header_blocks(HTTPHdr *hdr, const uint8_t *buf_start, const uint32_
 
   // rfc7540,sec8.1.2.2: Any message containing connection-specific header
   // fields MUST be treated as malformed
-  if (hdr->field_find(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION) != nullptr) {
+  if (hdr->field_find(MIME_FIELD_CONNECTION, MIME_LEN_CONNECTION) != nullptr ||
+      hdr->field_find(MIME_FIELD_KEEP_ALIVE, MIME_LEN_KEEP_ALIVE) != nullptr ||
+      hdr->field_find(MIME_FIELD_PROXY_CONNECTION, MIME_LEN_PROXY_CONNECTION) != nullptr ||
+      hdr->field_find(MIME_FIELD_TRANSFER_ENCODING, MIME_LEN_TRANSFER_ENCODING) != nullptr ||
+      hdr->field_find(MIME_FIELD_UPGRADE, MIME_LEN_UPGRADE) != nullptr) {
     return Http2ErrorCode::HTTP2_ERROR_PROTOCOL_ERROR;
   }
 

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 02/03: TS-5057: Add 103 Early Hints support

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c5f0fc5bd902d4f2b90c1b958eef0b953716ca53
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Mon Nov 6 10:30:47 2017 +0900

    TS-5057: Add 103 Early Hints support
    
    (cherry picked from commit 1a9944ce2ffd1c54ef0fb3e30ecd539a28b8b028)
---
 doc/developer-guide/api/types/TSHttpStatus.en.rst |  2 ++
 lib/cppapi/include/atscppapi/HttpStatus.h         |  1 +
 lib/ts/apidefs.h.in                               |  1 +
 lib/ts/mkdfa.c                                    |  1 +
 proxy/InkAPITest.cc                               | 14 +++++++++++++-
 proxy/hdrs/HTTP.cc                                |  1 +
 proxy/hdrs/HTTP.h                                 |  1 +
 proxy/http/HttpTransact.cc                        |  3 ++-
 8 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/doc/developer-guide/api/types/TSHttpStatus.en.rst b/doc/developer-guide/api/types/TSHttpStatus.en.rst
index 9cfe9fe..78d2453 100644
--- a/doc/developer-guide/api/types/TSHttpStatus.en.rst
+++ b/doc/developer-guide/api/types/TSHttpStatus.en.rst
@@ -45,6 +45,8 @@ Enumeration Members
 
 .. c:member:: TSHttpStatus TS_HTTP_STATUS_SWITCHING_PROTOCOL
 
+.. c:member:: TSHttpStatus TS_HTTP_STATUS_EARLY_HINTS
+
 .. c:member:: TSHttpStatus TS_HTTP_STATUS_OK
 
 .. c:member:: TSHttpStatus TS_HTTP_STATUS_CREATED
diff --git a/lib/cppapi/include/atscppapi/HttpStatus.h b/lib/cppapi/include/atscppapi/HttpStatus.h
index 5c2e373..071aef1 100644
--- a/lib/cppapi/include/atscppapi/HttpStatus.h
+++ b/lib/cppapi/include/atscppapi/HttpStatus.h
@@ -37,6 +37,7 @@ enum HttpStatus {
 
   HTTP_STATUS_CONTINUE           = 100,
   HTTP_STATUS_SWITCHING_PROTOCOL = 101,
+  HTTP_STATUS_EARLY_HINTS        = 103,
 
   HTTP_STATUS_OK                            = 200,
   HTTP_STATUS_CREATED                       = 201,
diff --git a/lib/ts/apidefs.h.in b/lib/ts/apidefs.h.in
index 4f0ada3..7efe019 100644
--- a/lib/ts/apidefs.h.in
+++ b/lib/ts/apidefs.h.in
@@ -155,6 +155,7 @@ typedef enum {
   TS_HTTP_STATUS_NONE                            = 0,
   TS_HTTP_STATUS_CONTINUE                        = 100,
   TS_HTTP_STATUS_SWITCHING_PROTOCOL              = 101,
+  TS_HTTP_STATUS_EARLY_HINTS                     = 103,
   TS_HTTP_STATUS_OK                              = 200,
   TS_HTTP_STATUS_CREATED                         = 201,
   TS_HTTP_STATUS_ACCEPTED                        = 202,
diff --git a/lib/ts/mkdfa.c b/lib/ts/mkdfa.c
index 3767b0c..9dcc890 100644
--- a/lib/ts/mkdfa.c
+++ b/lib/ts/mkdfa.c
@@ -138,6 +138,7 @@ info_t methods[] = {
 info_t statuses[] = {
   {"100", "HTTP_STATUS_CONTINUE", -1},
   {"101", "HTTP_STATUS_SWITCHING_PROTOCOL", -1},
+  {"103", "HTTP_STATUS_EARLY_HINTS", -1},
   {"200", "HTTP_STATUS_OK", -1},
   {"201", "HTTP_STATUS_CREATED", -1},
   {"202", "HTTP_STATUS_ACCEPTED", -1},
diff --git a/proxy/InkAPITest.cc b/proxy/InkAPITest.cc
index 486c343..5f67c69 100644
--- a/proxy/InkAPITest.cc
+++ b/proxy/InkAPITest.cc
@@ -3272,7 +3272,7 @@ REGRESSION_TEST(SDK_API_TSHttpHdr)(RegressionTest *test, int /* atype ATS_UNUSED
   }
 
   if (strcmp("Not Modified", TSHttpHdrReasonLookup(TS_HTTP_STATUS_NOT_MODIFIED)) != 0) {
-    SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase2", TC_FAIL, "TSHttpHdrReasonLookup returns Value's mismatch");
+    SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase4", TC_FAIL, "TSHttpHdrReasonLookup returns Value's mismatch");
     if (test_passed_Http_Hdr_Reason_Lookup == true) {
       test_passed_Http_Hdr_Reason_Lookup = false;
     }
@@ -3280,6 +3280,15 @@ REGRESSION_TEST(SDK_API_TSHttpHdr)(RegressionTest *test, int /* atype ATS_UNUSED
     SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase4", TC_PASS, "ok");
   }
 
+  if (strcmp("Early Hints", TSHttpHdrReasonLookup(TS_HTTP_STATUS_EARLY_HINTS)) != 0) {
+    SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase5", TC_FAIL, "TSHttpHdrReasonLookup returns Value's mismatch");
+    if (test_passed_Http_Hdr_Reason_Lookup == true) {
+      test_passed_Http_Hdr_Reason_Lookup = false;
+    }
+  } else {
+    SDK_RPRINT(test, "TSHttpHdrReasonLookup", "TestCase5", TC_PASS, "ok");
+  }
+
   // Copy
   if (test_passed_Http_Hdr_Create == true) {
     if (TSHttpHdrCopy(bufp3, hdr_loc3, bufp1, hdr_loc1) == TS_ERROR) {
@@ -5488,6 +5497,7 @@ typedef enum {
 
   ORIG_TS_HTTP_STATUS_CONTINUE           = 100,
   ORIG_TS_HTTP_STATUS_SWITCHING_PROTOCOL = 101,
+  ORIG_TS_HTTP_STATUS_EARLY_HINTS        = 103,
 
   ORIG_TS_HTTP_STATUS_OK                            = 200,
   ORIG_TS_HTTP_STATUS_CREATED                       = 201,
@@ -5657,6 +5667,8 @@ REGRESSION_TEST(SDK_API_TSConstant)(RegressionTest *test, int /* atype ATS_UNUSE
   PRINT_DIFF(TS_HTTP_STATUS_NONE);
   PRINT_DIFF(TS_HTTP_STATUS_CONTINUE);
   PRINT_DIFF(TS_HTTP_STATUS_SWITCHING_PROTOCOL);
+  PRINT_DIFF(TS_HTTP_STATUS_EARLY_HINTS);
+
   PRINT_DIFF(TS_HTTP_STATUS_OK);
   PRINT_DIFF(TS_HTTP_STATUS_CREATED);
 
diff --git a/proxy/hdrs/HTTP.cc b/proxy/hdrs/HTTP.cc
index 3be7064..bf8aea3 100644
--- a/proxy/hdrs/HTTP.cc
+++ b/proxy/hdrs/HTTP.cc
@@ -756,6 +756,7 @@ http_hdr_reason_lookup(unsigned status)
     HTTP_STATUS_ENTRY(100, Continue);            // [RFC2616]
     HTTP_STATUS_ENTRY(101, Switching Protocols); // [RFC2616]
     HTTP_STATUS_ENTRY(102, Processing);          // [RFC2518]
+    HTTP_STATUS_ENTRY(103, Early Hints);         // TODO: add RFC number
     // 103-199 Unassigned
     HTTP_STATUS_ENTRY(200, OK);                              // [RFC2616]
     HTTP_STATUS_ENTRY(201, Created);                         // [RFC2616]
diff --git a/proxy/hdrs/HTTP.h b/proxy/hdrs/HTTP.h
index 5891834..251e3b9 100644
--- a/proxy/hdrs/HTTP.h
+++ b/proxy/hdrs/HTTP.h
@@ -43,6 +43,7 @@ enum HTTPStatus {
 
   HTTP_STATUS_CONTINUE           = 100,
   HTTP_STATUS_SWITCHING_PROTOCOL = 101,
+  HTTP_STATUS_EARLY_HINTS        = 103,
 
   HTTP_STATUS_OK                            = 200,
   HTTP_STATUS_CREATED                       = 201,
diff --git a/proxy/http/HttpTransact.cc b/proxy/http/HttpTransact.cc
index 29f492e..c898fce 100644
--- a/proxy/http/HttpTransact.cc
+++ b/proxy/http/HttpTransact.cc
@@ -4071,7 +4071,8 @@ HttpTransact::handle_forward_server_connection_open(State *s)
     // dont update the hostdb. let us try again with what we currently think.
   }
 
-  if (s->hdr_info.server_response.status_get() == HTTP_STATUS_CONTINUE) {
+  if (s->hdr_info.server_response.status_get() == HTTP_STATUS_CONTINUE ||
+      s->hdr_info.server_response.status_get() == HTTP_STATUS_EARLY_HINTS) {
     handle_100_continue_response(s);
     return;
   }

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.

[trafficserver] 03/03: Add flag to ignore out of bounds compile error for test

Posted by zw...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit d1fd93137635971476f824c552f2f99575d9bf0f
Author: Bryan Call <bc...@apache.org>
AuthorDate: Mon Oct 9 17:11:12 2017 -0700

    Add flag to ignore out of bounds compile error for test
    
    (cherry picked from commit f21fdd80f53da7880ae9e97e129aa1a8ac9fc451)
---
 lib/ts/Makefile.am | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/ts/Makefile.am b/lib/ts/Makefile.am
index 2e09e15..146c06f 100644
--- a/lib/ts/Makefile.am
+++ b/lib/ts/Makefile.am
@@ -244,6 +244,7 @@ test_tslib_CPPFLAGS = $(AM_CPPFLAGS)\
 	-I$(abs_top_srcdir)/tests/include
 
 # add you catch based test file here for tslib
+test_tslib_CXXFLAGS = -Wno-array-bounds $(AM_CXXFLAGS)
 test_tslib_LDADD = libtsutil.la
 test_tslib_SOURCES = \
 	unit-tests/main.cpp \

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.