You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/04/06 23:12:25 UTC
[GitHub] [trafficserver] randall commented on a change in pull request #7680: Add sqpv log field for server protocol
randall commented on a change in pull request #7680:
URL: https://github.com/apache/trafficserver/pull/7680#discussion_r608236463
##########
File path: proxy/logging/LogAccess.cc
##########
@@ -1782,6 +1782,40 @@ LogAccess::marshal_client_req_protocol_version(char *buf)
return len;
}
+/*-------------------------------------------------------------------------
+ -------------------------------------------------------------------------*/
+
+int
+LogAccess::marshal_server_req_protocol_version(char *buf)
+{
+ const char *protocol_str = m_http_sm->server_protocol;
+ int len = LogAccess::strlen(protocol_str);
+
+ // Set major & minor versions when protocol_str is not "http/2".
+ if (::strlen(protocol_str) == 4 && strncmp("http", protocol_str, 4) == 0) {
+ if (m_proxy_request) {
+ HTTPVersion versionObject = m_proxy_request->version_get();
+ int64_t major = HTTP_MAJOR(versionObject.m_version);
+ int64_t minor = HTTP_MINOR(versionObject.m_version);
+ if (major == 1 && minor == 1) {
+ protocol_str = "http/1.1";
+ } else if (major == 1 && minor == 0) {
+ protocol_str = "http/1.0";
+ } // else invalid http version
+ } else {
+ protocol_str = "*";
Review comment:
why `*` ? I'm not trying to be nit-picky, just not sure I've seen a field with that set before.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org