[Fix] Read proxy port setting using GetInt().
authorulion <ulion2002@gmail.com>
Wed, 14 Aug 2013 23:38:38 +0000 (07:38 +0800)
committerulion <ulion2002@gmail.com>
Wed, 14 Aug 2013 23:42:27 +0000 (07:42 +0800)
xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
xbmc/filesystem/CurlFile.cpp

index b0cbc52..d54e0d7 100644 (file)
@@ -197,7 +197,7 @@ extern "C" void __stdcall update_emu_environ()
   // Use a proxy, if the GUI was configured as such
   if (CSettings::Get().GetBool("network.usehttpproxy")
       && !CSettings::Get().GetString("network.httpproxyserver").empty()
-      && !CSettings::Get().GetString("network.httpproxyport").empty()
+      && CSettings::Get().GetInt("network.httpproxyport") > 0
       && CSettings::Get().GetInt("network.httpproxytype") == 0)
   {
     CStdString strProxy;
@@ -209,7 +209,7 @@ extern "C" void __stdcall update_emu_environ()
     }
 
     strProxy += CSettings::Get().GetString("network.httpproxyserver");
-    strProxy += ":" + CSettings::Get().GetString("network.httpproxyport");
+    strProxy.AppendFormat(":%d", CSettings::Get().GetInt("network.httpproxyport"));
 
     CEnvironment::setenv( "HTTP_PROXY", "http://" + strProxy, true );
     CEnvironment::setenv( "HTTPS_PROXY", "http://" + strProxy, true );
index a03d25b..a408589 100644 (file)
@@ -733,11 +733,11 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2)
   {
     if (CSettings::Get().GetBool("network.usehttpproxy")
         && !CSettings::Get().GetString("network.httpproxyserver").empty()
-        && !CSettings::Get().GetString("network.httpproxyport").empty()
+        && CSettings::Get().GetInt("network.httpproxyport") > 0
         && m_proxy.IsEmpty())
     {
       m_proxy = CSettings::Get().GetString("network.httpproxyserver");
-      m_proxy += ":" + CSettings::Get().GetString("network.httpproxyport");
+      m_proxy.AppendFormat(":%d", CSettings::Get().GetInt("network.httpproxyport"));
       if (CSettings::Get().GetString("network.httpproxyusername").length() > 0 && m_proxyuserpass.IsEmpty())
       {
         m_proxyuserpass = CSettings::Get().GetString("network.httpproxyusername");