]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/log/FormatHttpdCombined.cc
SourceFormat Enforcement
[thirdparty/squid.git] / src / log / FormatHttpdCombined.cc
index 088a4bbcb5685b23be237c2bf2db3b42de837fd6..b63dc62132b7e15a8a82779e750627837a965230 100644 (file)
@@ -32,8 +32,8 @@
 
 #include "squid.h"
 #include "AccessLogEntry.h"
-#include "format/Token.h"
 #include "format/Quoting.h"
+#include "format/Token.h"
 #include "globals.h"
 #include "HttpRequest.h"
 #include "log/File.h"
@@ -45,13 +45,15 @@ void
 Log::Format::HttpdCombined(const AccessLogEntry::Pointer &al, Logfile * logfile)
 {
     const char *user_ident = ::Format::QuoteUrlEncodeUsername(al->cache.rfc931);
-
-    const char *user_auth = ::Format::QuoteUrlEncodeUsername(al->cache.authuser);
-
+    const char *user_auth = NULL;
     const char *referer = NULL;
     const char *agent = NULL;
 
     if (al->request) {
+#if USE_AUTH
+        if (al->request->auth_user_request != NULL)
+            user_auth = ::Format::QuoteUrlEncodeUsername(al->request->auth_user_request->username());
+#endif
         referer = al->request->header.getStr(HDR_REFERER);
         agent = al->request->header.getStr(HDR_USER_AGENT);
     }
@@ -78,7 +80,7 @@ Log::Format::HttpdCombined(const AccessLogEntry::Pointer &al, Logfile * logfile)
                   al->cache.replySize,
                   referer,
                   agent,
-                  ::Format::log_tags[al->cache.code],
+                  LogTags_str[al->cache.code],
                   al->http.statusSfx(),
                   hier_code_str[al->hier.code],
                   (Config.onoff.log_mime_hdrs?"":"\n"));