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

zwoop 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 c805341  Duplicate pqsn logic in shn
c805341 is described below

commit c8053415f9387f93222a0fc62bb0ea200b0c06c8
Author: dyrock <zeyu...@gmail.com>
AuthorDate: Tue Jun 19 16:58:24 2018 +0000

    Duplicate pqsn logic in shn
---
 proxy/logging/LogAccessHttp.cc | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc
index 4040edb..e292c39 100644
--- a/proxy/logging/LogAccessHttp.cc
+++ b/proxy/logging/LogAccessHttp.cc
@@ -1174,21 +1174,18 @@ LogAccessHttp::marshal_server_host_ip(char *buf)
 int
 LogAccessHttp::marshal_server_host_name(char *buf)
 {
-  const char *str = nullptr;
-  int padded_len  = INK_MIN_ALIGN;
-  int actual_len  = 0;
-
-  if (m_client_request) {
-    str = m_client_request->host_get(&actual_len);
+  char *str = nullptr;
+  int len   = INK_MIN_ALIGN;
 
-    if (str) {
-      padded_len = round_strlen(actual_len + 1); // +1 for trailing 0
-    }
+  if (m_http_sm->t_state.current.server) {
+    str = m_http_sm->t_state.current.server->name;
+    len = LogAccess::strlen(str);
   }
+
   if (buf) {
-    marshal_mem(buf, str, actual_len, padded_len);
+    marshal_str(buf, str, len);
   }
-  return padded_len;
+  return len;
 }
 
 /*-------------------------------------------------------------------------

Reply via email to