You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2015/07/08 19:26:44 UTC

[1/2] trafficserver git commit: TS-3595: Cookie header split into multiple lines with H2

Repository: trafficserver
Updated Branches:
  refs/heads/6.0.x 7b4c78527 -> bb998134e


TS-3595: Cookie header split into multiple lines with H2

(cherry picked from commit 56160c13a9b2dcf995ec6b0747f636b106d4b7b0)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/45b90f57
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/45b90f57
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/45b90f57

Branch: refs/heads/6.0.x
Commit: 45b90f577ab129d0c9f45c0d95c65b5bc6de4550
Parents: 7b4c785
Author: Bryan Call <bc...@apache.org>
Authored: Tue Jul 7 15:27:14 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Jul 8 10:25:36 2015 -0700

----------------------------------------------------------------------
 proxy/hdrs/MIME.h    | 20 ++++++++++++++++++++
 proxy/http2/HTTP2.cc |  6 ++++++
 2 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45b90f57/proxy/hdrs/MIME.h
----------------------------------------------------------------------
diff --git a/proxy/hdrs/MIME.h b/proxy/hdrs/MIME.h
index 628f013..4d9b2b6 100644
--- a/proxy/hdrs/MIME.h
+++ b/proxy/hdrs/MIME.h
@@ -942,6 +942,7 @@ public:
   // Other separators (e.g. ';' in Set-cookie/Cookie) are also possible
   void field_value_append(MIMEField *field, const char *value, int value_length, bool prepend_comma = false,
                           const char separator = ',');
+  void field_combine_dups(MIMEField *field, bool prepend_comma = false, const char separator = ',');
   time_t get_age();
   int64_t get_content_length() const;
   time_t get_date();
@@ -1328,6 +1329,25 @@ MIMEHdr::field_value_append(MIMEField *field, const char *value_str, int value_l
   field->value_append(m_heap, m_mime, value_str, value_len, prepend_comma, separator);
 }
 
+
+
+inline void
+MIMEHdr::field_combine_dups(MIMEField *field, bool prepend_comma, const char separator)
+{
+  if (field->has_dups()) {
+    MIMEField *duplicate = field->m_next_dup;
+    field_combine_dups(duplicate, prepend_comma, separator);
+
+
+    int value_len = 0;
+    const char *value_str = duplicate->value_get(&value_len);
+    if (value_len > 0) {
+      field->value_append(m_heap, m_mime, value_str, value_len, prepend_comma, separator);
+    }
+    field_delete(duplicate);
+  }
+}
+
 /*-------------------------------------------------------------------------
   -------------------------------------------------------------------------*/
 

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/45b90f57/proxy/http2/HTTP2.cc
----------------------------------------------------------------------
diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc
index 9390ed8..5a6637b 100644
--- a/proxy/http2/HTTP2.cc
+++ b/proxy/http2/HTTP2.cc
@@ -495,6 +495,12 @@ convert_from_2_to_1_1_header(HTTPHdr *headers)
       return PARSE_ERROR;
     }
 
+    // 8.1.2.5 Combine Cookie headers
+    field = headers->field_find(MIME_FIELD_COOKIE, MIME_LEN_COOKIE);
+    if (field) {
+      headers->field_combine_dups(field, true, ';');
+    }
+
     // Convert HTTP version to 1.1
     int32_t version = HTTP_VERSION(1, 1);
     http_hdr_version_set(headers->m_http, version);


[2/2] trafficserver git commit: TS-3595: Cookie header split into multiple lines with H2 Changed to not be recursive

Posted by bc...@apache.org.
TS-3595: Cookie header split into multiple lines with H2
Changed to not be recursive

(cherry picked from commit 63ae314a50dcc0b0811f6fb044b1ca1afbc72a31)


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/bb998134
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/bb998134
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/bb998134

Branch: refs/heads/6.0.x
Commit: bb998134e2053285753ca6b692ac4c9f81c3175f
Parents: 45b90f5
Author: Bryan Call <bc...@apache.org>
Authored: Tue Jul 7 18:52:02 2015 -0700
Committer: Bryan Call <bc...@apache.org>
Committed: Wed Jul 8 10:26:21 2015 -0700

----------------------------------------------------------------------
 proxy/hdrs/MIME.h | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/bb998134/proxy/hdrs/MIME.h
----------------------------------------------------------------------
diff --git a/proxy/hdrs/MIME.h b/proxy/hdrs/MIME.h
index 4d9b2b6..f55da24 100644
--- a/proxy/hdrs/MIME.h
+++ b/proxy/hdrs/MIME.h
@@ -1329,22 +1329,22 @@ MIMEHdr::field_value_append(MIMEField *field, const char *value_str, int value_l
   field->value_append(m_heap, m_mime, value_str, value_len, prepend_comma, separator);
 }
 
-
-
 inline void
 MIMEHdr::field_combine_dups(MIMEField *field, bool prepend_comma, const char separator)
 {
-  if (field->has_dups()) {
-    MIMEField *duplicate = field->m_next_dup;
-    field_combine_dups(duplicate, prepend_comma, separator);
+  MIMEField *current = field->m_next_dup;
+  MIMEField *next = NULL;
 
+  while (current) {
+    next = current->m_next_dup;
 
     int value_len = 0;
-    const char *value_str = duplicate->value_get(&value_len);
+    const char *value_str = current->value_get(&value_len);
     if (value_len > 0) {
       field->value_append(m_heap, m_mime, value_str, value_len, prepend_comma, separator);
     }
-    field_delete(duplicate);
+    field_delete(current, false); // don't delete duplicates
+    current = next;
   }
 }