Permalink
Browse files

added: url option to set proxy for http streams

  • Loading branch information...
1 parent e6f195c commit 3d86e4fff0a092b689f97076b4dddfc7d178696d queeup committed Dec 29, 2012
Showing with 15 additions and 0 deletions.
  1. +15 −0 xbmc/filesystem/CurlFile.cpp
@@ -716,6 +716,21 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2)
SetCookie(value);
else if (name.Equals("Encoding"))
SetContentEncoding(value);
+ else if (name.Equals("Proxy") && !g_guiSettings.GetBool("network.usehttpproxy"))
+ if (name.Equals("ProxyUserPass"))
+ {
+ SetProxyUserPass(value);
+ }
+ if (value.Equals('http://'))
+ {
+ m_proxy = value;
+ }
+ else
+ {
+ m_proxy = "http://" + value;
+ }
+ SetProxy(m_proxy);
+ CLog::Log(LOGDEBUG, "Using proxy %s", m_proxy.c_str());
else if (name.Equals("noshout") && value.Equals("true"))
m_skipshout = true;
else

4 comments on commit 3d86e4f

That won't work. "Equals" matches the whole string. You want to match only the start of it i guess?

Owner

queeup replied Dec 29, 2012

Ahhh ok. I add that just for if somebody add it proxy like with http://ip:port.

What do you suggest? I can do it like here
Force to use |Proxy=ip:port instead of Proxy=http://ip:port

value.Left(strlen("http://")).Equals("http://")

Also... single quotes are used for characters in C... double quotes are for strings.

And don't forget to put everything that belongs into "else if" in between curly brackets.

Owner

queeup replied Dec 29, 2012

I missed that single quotes. Python habit :) thankx for the "else if" brackets also. Noob C mistakes

Please sign in to comment.