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 2016/03/08 18:44:28 UTC

trafficserver git commit: TS-4257: Using original scheme and check for not set in log field cqus This closes #512.

Repository: trafficserver
Updated Branches:
  refs/heads/master a4b37105c -> 06fbcac1e


TS-4257: Using original scheme and check for not set in log field cqus
This closes #512.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/06fbcac1
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/06fbcac1
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/06fbcac1

Branch: refs/heads/master
Commit: 06fbcac1e5ec273bf3cfdf8dc9968b5852847b39
Parents: a4b3710
Author: Alan M. Carroll <am...@apache.org>
Authored: Sat Mar 5 10:15:06 2016 -0600
Committer: Alan M. Carroll <am...@apache.org>
Committed: Tue Mar 8 11:43:33 2016 -0600

----------------------------------------------------------------------
 proxy/logging/LogAccessHttp.cc | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/06fbcac1/proxy/logging/LogAccessHttp.cc
----------------------------------------------------------------------
diff --git a/proxy/logging/LogAccessHttp.cc b/proxy/logging/LogAccessHttp.cc
index c3c24c2..7f9f7e3 100644
--- a/proxy/logging/LogAccessHttp.cc
+++ b/proxy/logging/LogAccessHttp.cc
@@ -544,11 +544,19 @@ LogAccessHttp::marshal_client_req_url_path(char *buf)
 int
 LogAccessHttp::marshal_client_req_url_scheme(char *buf)
 {
-  char *str = NULL;
-  int alen = 0;
+  int scheme = m_http_sm->t_state.orig_scheme;
+  const char *str = NULL;
+  int alen;
   int plen = INK_MIN_ALIGN;
 
-  str = (char *)m_client_request->scheme_get(&alen);
+  // If the transaction aborts very early, the scheme may not be set, or so ASAN reports.
+  if (scheme >= 0) {
+    str = hdrtoken_index_to_wks(scheme);
+    alen = hdrtoken_index_to_length(scheme);
+  } else {
+    str = "UNKNOWN";
+    alen = strlen(str);
+  }
 
   // calculate the the padded length only if the actual length
   // is not zero. We don't want the padded length to be zero