mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2025-02-02 15:07:36 -05:00
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
This commit is contained in:
parent
4c841bbe21
commit
a520a18e53
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user