/*
- * Copyright (C) 1996-2015 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
if (al->request && al->request->auth_user_request != NULL)
user_auth = ::Format::QuoteUrlEncodeUsername(al->request->auth_user_request->username());
#endif
- const char *user_ident = ::Format::QuoteUrlEncodeUsername(al->cache.rfc931);
+ const char *user_ident = ::Format::QuoteUrlEncodeUsername(al->getClientIdent());
char clientip[MAX_IPSTRLEN];
al->getLogClientIp(clientip, MAX_IPSTRLEN);
- static SBuf method;
- if (al->_private.method_str)
- method.assign(al->_private.method_str);
- else
- method = al->http.method.image();
+ const SBuf method(al->getLogMethod());
- logfilePrintf(logfile, "%s %s %s [%s] \"" SQUIDSBUFPH " %s %s/%d.%d\" %d %" PRId64 " %s:%s%s",
+ logfilePrintf(logfile, "%s %s %s [%s] \"" SQUIDSBUFPH " " SQUIDSBUFPH " %s/%d.%d\" %d %" PRId64 " %s:%s%s",
clientip,
user_ident ? user_ident : dash_str,
user_auth ? user_auth : dash_str,
Time::FormatHttpd(squid_curtime),
SQUIDSBUFPRINT(method),
- al->url,
+ SQUIDSBUFPRINT(al->url),
AnyP::ProtocolType_str[al->http.version.protocol],
al->http.version.major, al->http.version.minor,
al->http.code,
if (Config.onoff.log_mime_hdrs) {
char *ereq = ::Format::QuoteMimeBlob(al->headers.request);
- char *erep = ::Format::QuoteMimeBlob(al->headers.reply);
+ MemBuf mb;
+ mb.init();
+ al->packReplyHeaders(mb);
+ auto erep = ::Format::QuoteMimeBlob(mb.content());
logfilePrintf(logfile, " [%s] [%s]\n", ereq, erep);
safe_free(ereq);
safe_free(erep);