Commit c8350bd7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

- Repair SLP compilation

- Do things simply and efficiently
parent 6304da7b
......@@ -62,36 +62,11 @@ void RegReport(SLPHandle slp_handle,SLPError slp_error,void* cookie)
char * BuildService(Program *p)
{
char *psz_msg;
string msg="";
string url="";
unsigned int i=0;
string address = p->GetAddress();
if (address.find(':') != string::npos)
address = "[" + address + "]";
string head = "service:vlc.services.videolan.org://";
if(p->IsHTTP() )
{
url += "http://";
}
else
{
url+="udp:@";
}
if(p->GetIPVersion() == 6)
{
url += "[";
}
url += p->GetAddress();
if(p->GetIPVersion() == 6)
{
url += "]";
}
url+=":";
url += p->GetPort();
string url = "udp:@" + address + ":" + p->GetPort();
#if 0
/* This code is for the new naming scheme after vlc 0.7.0 */
......@@ -100,18 +75,9 @@ char * BuildService(Program *p)
url += p->GetName();
#endif
msg += head + url;
psz_msg = (char *)malloc( msg.size() * sizeof(char) );
for(i=0 ; i< msg.size() ; i++)
{
psz_msg[i] = msg[i] ;
}
psz_msg[i] = '\0';
string msg = "service:vlc.services.videolan.org://" + url;
return psz_msg;
return strdup(msg.c_str());
}
int SLP::Register(Program *p)
......
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