Commit a520a18e authored by Karl Heyes's avatar Karl Heyes

allow listener_remove only cases. clients were not attached to the auth at

connection time so the remove trigger could not be processed.

svn path=/icecast/trunk/icecast/; revision=15265
parent 4c841bbe
......@@ -489,7 +489,7 @@ void auth_add_listener (const char *mount, client_t *client)
client_send_403 (client, "mountpoint unavailable");
return;
}
if (mountinfo && mountinfo->auth && mountinfo->auth->authenticate)
if (mountinfo && mountinfo->auth)
{
auth_client *auth_user;
......
......@@ -123,7 +123,7 @@ static int my_getpass(void *client, char *prompt, char *buffer, int buflen)
#endif
static int handle_returned_header (void *ptr, size_t size, size_t nmemb, void *stream)
static size_t handle_returned_header (void *ptr, size_t size, size_t nmemb, void *stream)
{
auth_client *auth_user = stream;
unsigned bytes = size * nmemb;
......@@ -157,7 +157,7 @@ static int handle_returned_header (void *ptr, size_t size, size_t nmemb, void *s
}
/* capture returned data, but don't do anything with it */
static int handle_returned_data (void *ptr, size_t size, size_t nmemb, void *stream)
static size_t handle_returned_data (void *ptr, size_t size, size_t nmemb, void *stream)
{
return (int)(size*nmemb);
}
......@@ -479,6 +479,9 @@ int auth_get_url_auth (auth_t *authenticator, config_options_t *options)
url_info->auth_header = strdup ("icecast-auth-user: 1\r\n");
url_info->timelimit_header = strdup ("icecast-auth-timelimit:");
/* force auth thread to call function. this makes sure the auth_t is attached to client */
authenticator->authenticate = url_add_listener;
while(options) {
if(!strcmp(options->name, "username"))
{
......@@ -492,7 +495,6 @@ int auth_get_url_auth (auth_t *authenticator, config_options_t *options)
}
if(!strcmp(options->name, "listener_add"))
{
authenticator->authenticate = url_add_listener;
free (url_info->addurl);
url_info->addurl = strdup (options->value);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment