[xiph-commits] r10012 - icecast/trunk/icecast/src
karl at svn.xiph.org
karl at svn.xiph.org
Mon Sep 12 09:47:06 PDT 2005
Author: karl
Date: 2005-09-12 09:47:04 -0700 (Mon, 12 Sep 2005)
New Revision: 10012
Modified:
icecast/trunk/icecast/src/logging.c
Log:
log username to access log (bug #706) if available.
Modified: icecast/trunk/icecast/src/logging.c
===================================================================
--- icecast/trunk/icecast/src/logging.c 2005-09-12 16:43:45 UTC (rev 10011)
+++ icecast/trunk/icecast/src/logging.c 2005-09-12 16:47:04 UTC (rev 10012)
@@ -95,12 +95,11 @@
}
#endif
/*
-** ADDR USER AUTH DATE REQUEST CODE BYTES REFERER AGENT [TIME]
+** ADDR IDENT USER DATE REQUEST CODE BYTES REFERER AGENT [TIME]
**
** ADDR = client->con->ip
-** USER = -
-** we should do this for real once we support authentication
-** AUTH = -
+** IDENT = always - , we don't support it because it's useless
+** USER = client->username
** DATE = _make_date(client->con->con_time)
** REQUEST = build from client->parser
** CODE = client->respcode
@@ -116,7 +115,7 @@
struct tm thetime;
time_t now;
time_t stayed;
- char *referrer, *user_agent;
+ char *referrer, *user_agent, *username;
now = time(NULL);
@@ -137,6 +136,11 @@
stayed = now - client->con->con_time;
+ if (client->username == NULL)
+ username = "-";
+ else
+ username = client->username;
+
referrer = httpp_getvar (client->parser, "referer");
if (referrer == NULL)
referrer = "-";
@@ -146,8 +150,9 @@
user_agent = "-";
log_write_direct (accesslog,
- "%s - - [%s] \"%s\" %d " FORMAT_UINT64 " \"%s\" \"%s\" %lu",
+ "%s - %s [%s] \"%s\" %d " FORMAT_UINT64 " \"%s\" \"%s\" %lu",
client->con->ip,
+ username,
datebuf,
reqbuf,
client->respcode,
More information about the commits
mailing list