You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Masakazu Kitajo (JIRA)" <ji...@apache.org> on 2015/12/09 06:37:10 UTC

[jira] [Commented] (TS-4063) Regression Test for HPACK Encoder is failed

    [ https://issues.apache.org/jira/browse/TS-4063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15048080#comment-15048080 ] 

Masakazu Kitajo commented on TS-4063:
-------------------------------------

I'm working on it, and will fix/add the tests in a day.

I have not finished the fix yet, but the change would be like this.
{code}
diff --git a/proxy/http2/RegressionHPACK.cc b/proxy/http2/RegressionHPACK.cc
index f4e8da8..1e22665 100644
--- a/proxy/http2/RegressionHPACK.cc
+++ b/proxy/http2/RegressionHPACK.cc
@@ -113,6 +113,7 @@ const static struct {
    17}};
 
 // [RFC 7541] C.3. Request Examples without Huffman Coding - C.3.1. First Request
+// [RFC 7541] C.4. Request Examples with Huffman Coding - C.4.1. First Request
 const static struct {
   char *raw_name;
   char *raw_value;
@@ -122,6 +123,12 @@ const static struct {
   {(char *)":path", (char *) "/"},
   {(char *)":authority", (char *) "www.example.com"},
   {(char *)"", (char *) ""} // End of this test case
+},{
+  {(char *)":method", (char *) "GET"},
+  {(char *)":scheme", (char *) "http"},
+  {(char *)":path", (char *) "/"},
+  {(char *)":authority", (char *) "www.example.com"},
+  {(char *)"", (char *) ""} // End of this test case
 }};
 const static struct {
   uint8_t *encoded_field;
@@ -138,7 +145,22 @@ const static struct {
                                            "\x40"
                                            "\xa:authority"
                                            "\xfwww.example.com",
-                                64}};
+                                64},
+                                {(uint8_t *)"\x40"
+                                           "\x85\xb9\x49\x53\x39\xe4"
+                                           "\x83\xc5\x83\x7f"
+                                           "\x40"
+                                           "\x85\xb8\x82\x4e\x5a\x4b"
+                                           "\x83\x9d\x29\xaf"
+                                           "\x40"
+                                           "\x84\xb9\x58\xd3\x3f"
+                                           "\x81\x63"
+                                           "\x40"
+                                           "\x88\xb8\x3b\x53\x39\xec\x32\x7d\x7f"
+                                           "\x8c\xf1\xe3\xc2\xe5\xf2\x3a\x6b\xa0\xab\x90\xf4\xff",
+                                53}};
+
+
 
 /***********************************************************************************
  *                                                                                 *
@@ -171,8 +193,8 @@ REGRESSION_TEST(HPACK_EncodeString)(RegressionTest *t, int, int *pstatus)
   uint8_t buf[BUFSIZE_FOR_REGRESSION_TEST];
   int len;
 
-  // FIXME Current encoder don't support huffman conding.
-  for (unsigned int i = 0; i < 1; i++) {
+  // FIXME Current encoder support only huffman conding.
+  for (unsigned int i = 1; i < 2; i++) {
     memset(buf, 0, BUFSIZE_FOR_REGRESSION_TEST);
 
     len = encode_string(buf, buf + BUFSIZE_FOR_REGRESSION_TEST, string_test_case[i].raw_string, string_test_case[i].raw_string_len);
@@ -241,7 +263,7 @@ REGRESSION_TEST(HPACK_Encode)(RegressionTest *t, int, int *pstatus)
   Http2DynamicTable dynamic_table;
 
   // FIXME Current encoder don't support indexing.
-  for (unsigned int i = 0; i < sizeof(encoded_field_test_case) / sizeof(encoded_field_test_case[0]); i++) {
+  for (unsigned int i = 1; i < sizeof(encoded_field_test_case) / sizeof(encoded_field_test_case[0]); i++) {
     ats_scoped_obj<HTTPHdr> headers(new HTTPHdr);
     headers->create(HTTP_TYPE_REQUEST);
{code}

> Regression Test for HPACK Encoder is failed
> -------------------------------------------
>
>                 Key: TS-4063
>                 URL: https://issues.apache.org/jira/browse/TS-4063
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: HTTP/2
>            Reporter: Masaori Koshiba
>
> {code}
> $ traffic_server -R 3 -r HPACK
> ...
> RPRINT HPACK_Encode: encoded value was invalid
>     REGRESSION_RESULT HPACK_Encode:                             FAILED
> ...
> RPRINT HPACK_EncodeLiteralHeaderField: encoded value was invalid
>     REGRESSION_RESULT HPACK_EncodeLiteralHeaderField:           FAILED
> ...
> {code}
> Those tests are assuming HAPCK encoder doesn't use Huffman.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)