Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

My implementation of dynamic source authentication

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Dev Branches
View previous topic :: View next topic  
Author Message
dkstar88



Joined: 23 Apr 2010
Posts: 1

PostPosted: Fri Apr 23, 2010 3:35 am    Post subject: My implementation of dynamic source authentication Reply with quote

Hi all:

I am working on a project that uses icecast as the stream server. The problem is although icecast now has the stream_auth by url feature, but it will only work when a mount point is specified in the config. It works only when I have a limited mountpoints, but I intend to allow any registered user supply a source, and modifying the config every time a new user is registered just creates more work for the server.

So I made a small modification to the source to allow a default mount point. When I put a "/default" mount-name in the config, any unspecified mount-name will automatically go to the default mount point for authentication.


Here is my modification:

In cfgfile.c +1126
Code:

/* return the mount details that match the supplied mountpoint */
mount_proxy *config_find_mount (ice_config_t *config, const char *mount)
{
    mount_proxy *mountinfo = config->mounts;
   mount_proxy *defaultmount = NULL;
    while (mountinfo)
    {
      if (strcmp (mountinfo->mountname, "/default") == 0)
         defaultmount = mountinfo;
        if (strcmp (mountinfo->mountname, mount) == 0)
            break;
        mountinfo = mountinfo->next;
    }

   // change to default
   if (mountinfo) {
      return mountinfo;
   } else {
      return defaultmount;   
   }
}


This code might not be most efficient. Since I am looking for the default mount point everytime config_find_mount() is called. But really it only need be called once when the config is loaded. Maybe someone could improve the code.
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Apr 23, 2010 3:28 pm    Post subject: Reply with quote

That is the correct location for such a match, it is only used when applying mount settings, so not just at xml read time. I suspect default without a / would be better as /default could be a valid streaming mountpoint.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Dev Branches All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber