/*
- * $Id: access_log.cc,v 1.67 2001/02/07 18:56:51 hno Exp $
+ * $Id: access_log.cc,v 1.68 2001/04/10 17:01:35 hno Exp $
*
* DEBUG: section 46 Access Log
* AUTHOR: Duane Wessels
accessLogFormatName(const char *name)
{
if (NULL == name)
- return xcalloc(strlen(dash_str) + 1, 1);
+ return NULL;
return username_quote(name);
}
client = fqdncache_gethostbyaddr(al->cache.caddr, FQDN_LOOKUP_IF_MISS);
if (client == NULL)
client = inet_ntoa(al->cache.caddr);
+ user = accessLogFormatName(al->cache.authuser ?
+ al->cache.authuser : al->cache.rfc931);
logfilePrintf(logfile, "%9d.%03d %6d %s %s/%03d %d %s %s %s %s%s/%s %s",
(int) current_time.tv_sec,
(int) current_time.tv_usec / 1000,
al->cache.size,
al->private.method_str,
al->url,
- (user = accessLogFormatName(al->cache.authuser ?
- al->cache.authuser : al->cache.rfc931)),
+ user ? user : dash_str,
al->hier.ping.timedout ? "TIMEOUT_" : "",
hier_strings[al->hier.code],
al->hier.host,
client = fqdncache_gethostbyaddr(al->cache.caddr, 0);
if (client == NULL)
client = inet_ntoa(al->cache.caddr);
+ user = accessLogFormatName(al->cache.authuser);
logfilePrintf(logfile, "%s %s %s [%s] \"%s %s HTTP/%d.%d\" %d %d %s:%s",
client,
accessLogFormatName(al->cache.rfc931),
- (user = accessLogFormatName(al->cache.authuser)),
+ user ? user : dash_str,
mkhttpdlogtime(&squid_curtime),
al->private.method_str,
al->url,