[xiph-commits] r15265 - icecast/trunk/icecast/src
karl at svn.xiph.org
karl at svn.xiph.org
Sun Sep 7 17:40:25 PDT 2008
Author: karl
Date: 2008-09-07 17:40:25 -0700 (Sun, 07 Sep 2008)
New Revision: 15265
Modified:
icecast/trunk/icecast/src/auth.c
icecast/trunk/icecast/src/auth_url.c
Log:
allow listener_remove only cases. clients were not attached to the auth at
connection time so the remove trigger could not be processed.
Modified: icecast/trunk/icecast/src/auth.c
===================================================================
--- icecast/trunk/icecast/src/auth.c 2008-09-08 00:30:37 UTC (rev 15264)
+++ icecast/trunk/icecast/src/auth.c 2008-09-08 00:40:25 UTC (rev 15265)
@@ -489,7 +489,7 @@
client_send_403 (client, "mountpoint unavailable");
return;
}
- if (mountinfo && mountinfo->auth && mountinfo->auth->authenticate)
+ if (mountinfo && mountinfo->auth)
{
auth_client *auth_user;
Modified: icecast/trunk/icecast/src/auth_url.c
===================================================================
--- icecast/trunk/icecast/src/auth_url.c 2008-09-08 00:30:37 UTC (rev 15264)
+++ icecast/trunk/icecast/src/auth_url.c 2008-09-08 00:40:25 UTC (rev 15265)
@@ -123,7 +123,7 @@
#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 @@
}
/* 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 @@
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 @@
}
if(!strcmp(options->name, "listener_add"))
{
- authenticator->authenticate = url_add_listener;
free (url_info->addurl);
url_info->addurl = strdup (options->value);
}
More information about the commits
mailing list