Skip to content

Commit

Permalink
Existed code use protocol option easy method previous commit added.
Browse files Browse the repository at this point in the history
  • Loading branch information
ulion committed Mar 9, 2013
1 parent 66e7c99 commit a2f0c6d
Showing 1 changed file with 6 additions and 19 deletions.
25 changes: 6 additions & 19 deletions xbmc/filesystem/CurlFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -736,30 +736,17 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2)
m_password = url2.GetPassWord();

// handle any protocol options
CStdString options = url2.GetProtocolOptions();
options.TrimRight('/'); // hack for trailing slashes being added from source
if (options.length() > 0)
std::map<CStdString, CStdString> options;
url2.GetProtocolOptions(options);
if (options.size() > 0)
{
// clear protocol options
url2.SetProtocolOptions("");
// set xbmc headers
CStdStringArray array;
CUtil::Tokenize(options, array, "&");
for(CStdStringArray::iterator it = array.begin(); it != array.end(); it++)
for(std::map<CStdString, CStdString>::const_iterator it = options.begin(); it != options.end(); ++it)
{
// parse name, value
CStdString name, value;
int pos = it->Find('=');
if(pos >= 0)
{
name = it->Left(pos);
value = it->Mid(pos+1, it->size());
}
else
{
name = (*it);
value = "";
}
const CStdString &name = it->first;
CStdString value = it->second;

// url decode value
CURL::Decode(value);
Expand Down

0 comments on commit a2f0c6d

Please sign in to comment.