[xiph-commits] r14115 - icecast/trunk/icecast/src
karl at svn.xiph.org
karl at svn.xiph.org
Thu Nov 8 12:00:57 PST 2007
Author: karl
Date: 2007-11-08 12:00:54 -0800 (Thu, 08 Nov 2007)
New Revision: 14115
Modified:
icecast/trunk/icecast/src/auth_url.c
Log:
only pass clients to url auth handler if the trigger is defined in the xml
Modified: icecast/trunk/icecast/src/auth_url.c
===================================================================
--- icecast/trunk/icecast/src/auth_url.c 2007-11-08 19:52:51 UTC (rev 14114)
+++ icecast/trunk/icecast/src/auth_url.c 2007-11-08 20:00:54 UTC (rev 14115)
@@ -467,35 +467,53 @@
{
auth_url *url_info;
- authenticator->authenticate = url_add_listener;
- authenticator->release_listener = url_remove_listener;
-
authenticator->free = auth_url_clear;
authenticator->adduser = auth_url_adduser;
authenticator->deleteuser = auth_url_deleteuser;
authenticator->listuser = auth_url_listuser;
- authenticator->stream_start = url_stream_start;
- authenticator->stream_end = url_stream_end;
-
url_info = calloc(1, sizeof(auth_url));
authenticator->state = url_info;
+
+ /* default headers */
url_info->auth_header = strdup ("icecast-auth-user: 1\r\n");
url_info->timelimit_header = strdup ("icecast-auth-timelimit:");
while(options) {
if(!strcmp(options->name, "username"))
+ {
+ free (url_info->username);
url_info->username = strdup (options->value);
+ }
if(!strcmp(options->name, "password"))
+ {
+ free (url_info->password);
url_info->password = strdup (options->value);
+ }
if(!strcmp(options->name, "listener_add"))
+ {
+ authenticator->authenticate = url_add_listener;
+ free (url_info->addurl);
url_info->addurl = strdup (options->value);
+ }
if(!strcmp(options->name, "listener_remove"))
+ {
+ authenticator->release_listener = url_remove_listener;
+ free (url_info->removeurl);
url_info->removeurl = strdup (options->value);
+ }
if(!strcmp(options->name, "mount_add"))
+ {
+ authenticator->stream_start = url_stream_start;
+ free (url_info->stream_start);
url_info->stream_start = strdup (options->value);
+ }
if(!strcmp(options->name, "mount_remove"))
+ {
+ authenticator->stream_end = url_stream_end;
+ free (url_info->stream_end);
url_info->stream_end = strdup (options->value);
+ }
if(!strcmp(options->name, "auth_header"))
{
free (url_info->auth_header);
More information about the commits
mailing list