You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by am...@apache.org on 2017/05/10 19:29:59 UTC

[trafficserver] branch master updated: Via: Change separator character to '-' instead of ' '.

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

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

The following commit(s) were added to refs/heads/master by this push:
       new  124a636   Via: Change separator character to '-' instead of ' '.
124a636 is described below

commit 124a636ea7816a2dac6ca6ff380b2fe362b81974
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 10 13:28:10 2017 -0500

    Via: Change separator character to '-' instead of ' '.
---
 proxy/http/HttpTransactHeaders.cc | 4 +++-
 tests/gold_tests/headers/via.gold | 8 ++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/proxy/http/HttpTransactHeaders.cc b/proxy/http/HttpTransactHeaders.cc
index d3376e2..7a26643 100644
--- a/proxy/http/HttpTransactHeaders.cc
+++ b/proxy/http/HttpTransactHeaders.cc
@@ -693,10 +693,12 @@ write_client_protocol_stack(HttpTransact::State *s, char *via_string, size_t len
   char *limit       = via_string + len;
   ts::StringView *v = proto_buf.data();
   for (int i = 0; i < retval && (via + v->size() + 1) < limit; ++i, ++v) {
+    if (i)
+      *via++ = '-';
     memcpy(via, v->ptr(), v->size());
     via += v->size();
-    *via++ = ' ';
   }
+  *via++ = ' ';
   return via - via_string;
 }
 
diff --git a/tests/gold_tests/headers/via.gold b/tests/gold_tests/headers/via.gold
index 7d12c18..c2eadda 100644
--- a/tests/gold_tests/headers/via.gold
+++ b/tests/gold_tests/headers/via.gold
@@ -1,4 +1,4 @@
-Via: http/1.1 tcp ipv4
-Via: http/1.0 tcp ipv4
-Via: http/1.1 h2 tls/1.2 tcp ipv4
-Via: http/1.1 tls/1.2 tcp ipv4
+Via: http/1.1-tcp-ipv4
+Via: http/1.0-tcp-ipv4
+Via: http/1.1-h2-tls/1.2-tcp-ipv4
+Via: http/1.1-tls/1.2-tcp-ipv4

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