[
https://issues.apache.org/jira/browse/TS-4457?focusedWorklogId=30034&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-30034
]
ASF GitHub Bot logged work on TS-4457:
--------------------------------------
Author: ASF GitHub Bot
Created on: 30/Sep/16 20:49
Start Date: 30/Sep/16 20:49
Worklog Time Spent: 10m
Work Description: Github user zwoop commented on a diff in the pull
request:
https://github.com/apache/trafficserver/pull/1066#discussion_r81415497
--- Diff: proxy/http/HttpTransactHeaders.cc ---
@@ -812,26 +813,16 @@
HttpTransactHeaders::insert_via_header_in_response(HttpTransact::State *s, HTTPH
}
char *incoming_via = s->via_string;
- int scheme = s->next_hop_scheme;
+ ink_assert(s->state_machine);
- ink_assert(scheme >= 0);
- int scheme_len = hdrtoken_index_to_length(scheme);
- int32_t hversion = header->version_get().m_version;
-
- memcpy(via_string, hdrtoken_index_to_wks(scheme), scheme_len);
- via_string += scheme_len;
-
- // Common case (I hope?)
- if ((HTTP_MAJOR(hversion) == 1) && HTTP_MINOR(hversion) == 1) {
- memcpy(via_string, "/1.1 ", 5);
- via_string += 5;
- } else {
- *via_string++ = '/';
- *via_string++ = '0' + HTTP_MAJOR(hversion);
- *via_string++ = '.';
- *via_string++ = '0' + HTTP_MINOR(hversion);
+ char const *proto_buf[10]; // 10 seems like a reasonable number of
protos to print
+ int retval = s->state_machine->populate_client_protocol(proto_buf, 10);
+ for (int i = 0; i < retval; i++) {
+ memcpy(via_string, proto_buf[i], strlen(proto_buf[i]));
--- End diff --
Is there any risk that we'll end up consuming too much of the Via: string
now? Or is the 1024 bytes still sufficient for all foreseeable protocol
additions? (It'd be a crazy long header if it was anyways :).
Issue Time Tracking
-------------------
Worklog Id: (was: 30034)
Time Spent: 4.5h (was: 4h 20m)
> Via header always reports http1
> -------------------------------
>
> Key: TS-4457
> URL: https://issues.apache.org/jira/browse/TS-4457
> Project: Traffic Server
> Issue Type: Bug
> Reporter: Miles Libbey
> Assignee: Eric Schwartz
> Fix For: 7.1.0
>
> Time Spent: 4.5h
> Remaining Estimate: 0h
>
> When using http2, the Via header says http1.1.
> $ curl -D- -o/dev/null -s "https://docs.trafficserver.apache.org/" | grep via
> via:http/1.1 ATS (ApacheTrafficServer/6.2.0 [cRs f ])
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)