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 2020/04/28 02:41:12 UTC

[GitHub] [trafficserver] sudheerv commented on a change in pull request #6710: Add Access log fields for Proxy Protocol context

sudheerv commented on a change in pull request #6710:
URL: https://github.com/apache/trafficserver/pull/6710#discussion_r416284354



##########
File path: proxy/logging/LogAccess.cc
##########
@@ -1315,6 +1315,61 @@ LogAccess::marshal_version_build_number(char *buf)
   -------------------------------------------------------------------------*/
 
 int
+LogAccess::marshal_proxy_protocol_version(char *buf)
+{
+  const char *version_str = nullptr;
+  int len                 = INK_MIN_ALIGN;
+
+  if (m_http_sm) {
+    NetVConnection::ProxyProtocolVersion ver = m_http_sm->t_state.pp_info.proxy_protocol_version;
+    switch (ver) {
+    case NetVConnection::ProxyProtocolVersion::V1:
+      version_str = "V1";
+      break;
+    case NetVConnection::ProxyProtocolVersion::V2:
+      version_str = "V2";
+      break;
+    case NetVConnection::ProxyProtocolVersion::UNDEFINED:
+    default:
+      version_str = "UNK";
+      break;
+    }

Review comment:
       > This this be '-'? That would seem to follow the if something is not set, log `-`. Or is UNDEFINED different than not set?
   
   Ah agree. `-` is indeed better.




----------------------------------------------------------------
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