1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-11-03 04:17:17 -05:00

Merge branch 'feature-logs'

This commit is contained in:
Philipp Schafft 2017-01-22 08:50:28 +00:00
commit ed54d5eb84
2 changed files with 40 additions and 2 deletions

View File

@ -61,6 +61,42 @@ static unsigned long _next_auth_id(void) {
return id;
}
static const char *auth_result2str(auth_result res)
{
switch (res) {
case AUTH_UNDEFINED:
return "undefined";
break;
case AUTH_OK:
return "ok";
break;
case AUTH_FAILED:
return "failed";
break;
case AUTH_RELEASED:
return "released";
break;
case AUTH_FORBIDDEN:
return "forbidden";
break;
case AUTH_NOMATCH:
return "no match";
break;
case AUTH_USERADDED:
return "user added";
break;
case AUTH_USEREXISTS:
return "user exists";
break;
case AUTH_USERDELETED:
return "user deleted";
break;
default:
return "(unknown)";
break;
}
}
static auth_client *auth_client_setup (client_t *client)
{
/* This will look something like "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" */
@ -268,6 +304,8 @@ static void __handle_auth_client (auth_t *auth, auth_client *auth_user) {
result = AUTH_FAILED;
}
ICECAST_LOG_DEBUG("client %p on auth %p role %s processed: %s", auth_user->client, auth, auth->role, auth_result2str(result));
if (result == AUTH_OK) {
if (auth_user->client->acl)
acl_release(auth_user->client->acl);
@ -355,7 +393,7 @@ static void auth_add_client(auth_t *auth, client_t *client, void (*on_no_match)(
auth_user->on_no_match = on_no_match;
auth_user->on_result = on_result;
auth_user->userdata = userdata;
ICECAST_LOG_INFO("adding client for authentication");
ICECAST_LOG_INFO("adding client %p for authentication on %p", client, auth);
queue_auth_client(auth_user);
}

View File

@ -669,7 +669,7 @@ int fserve_add_client (client_t *client, FILE *file)
{
fserve_t *fclient = calloc (1, sizeof(fserve_t));
ICECAST_LOG_DEBUG("Adding client to file serving engine");
ICECAST_LOG_DEBUG("Adding client %p to file serving engine", client);
if (fclient == NULL)
{
client_send_error(client, 404, 0, "memory exhausted");