1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-09-22 04:15:54 -04:00

log username to access log (bug #706) if available.

svn path=/icecast/trunk/icecast/; revision=10012
This commit is contained in:
Karl Heyes 2005-09-12 16:47:04 +00:00
parent 7838940f0b
commit 477d44dd79

View File

@ -95,12 +95,11 @@ int get_clf_time (char *buffer, unsigned len, struct tm *t)
}
#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 @@ void logging_access(client_t *client)
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 @@ void logging_access(client_t *client)
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 @@ void logging_access(client_t *client)
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,