Skip to content

Commit

Permalink
Fix for ignoring Protocol Options in CShoutcastFile::Open.
Browse files Browse the repository at this point in the history
(something like UserAgent, Referer, etc.)
  • Loading branch information
SpiritOffice committed Jul 17, 2013
1 parent d849f9b commit b6e5b50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion xbmc/filesystem/ShoutcastFile.cpp
Expand Up @@ -69,7 +69,7 @@ int64_t CShoutcastFile::GetLength()
bool CShoutcastFile::Open(const CURL& url)
{
CURL url2(url);
url2.SetProtocolOptions("noshout=true&Icy-MetaData=1");
url2.SetProtocolOptions(url2.GetProtocolOptions()+"&noshout=true&Icy-MetaData=1");
url2.SetProtocol("http");

bool result=false;
Expand Down

3 comments on commit b6e5b50

@garbear
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if url2.GetProtocolOptions() is empty, is it a problem if the protocol options start with "&"? it doesn't create a link like http://xxx?&noshout=... does it?

@arnova
Copy link
Member

@arnova arnova commented on b6e5b50 Jul 18, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better be safe than sorry I'd say: an extra url2.GetProtocolOptions() ? ... is fairly simple to implement...

@SpiritOffice
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I allready tested it. if the m_strProtocolOptions is empty, then it just starts with "&". But it doesnt matter, because your url is allready splitted away in another string, and then you have "CUtil::Tokenize(options, array, "&");" in CurlFile.cpp.
It just splits this options string, there is no problem whether you have "&" as your first symbol or not.

Please sign in to comment.