aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheuni <theuni@svn>2010-11-27 19:54:03 +0000
committertheuni <theuni@svn>2010-11-27 19:54:03 +0000
commitb45b8b2f3ba328c5b28ece9f32bd696167130599 (patch)
treec3fd735527871867028e6ac82444ce388f18d53d
parent0f03b0b33c87872c3fc34ea945034dfe1853f336 (diff)
Squashed 3 commits: Add a setting to disable ipv6. ipv6 enabled by default
fixed: Disable ipv6 for libcurl. It is known to cause long timeouts with some hardware in linux. (cherry picked from commit 837b8662d6fd3b8003863e842fa3a06b1587fb72) [changed] on second thought, this probably only breaks for a tiny set of users. Let's enable ipv6 by default and let affected users disable. (cherry picked from commit eb64b9c978476f0eedbdeb719e3fabf7034abd99) fixed build (cherry picked from commit 91982515b4b94a0a53576b315398031e034d6266) git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/branches/Dharma@35495 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
-rw-r--r--xbmc/AdvancedSettings.cpp3
-rw-r--r--xbmc/AdvancedSettings.h1
-rw-r--r--xbmc/FileSystem/FileCurl.cpp3
3 files changed, 7 insertions, 0 deletions
diff --git a/xbmc/AdvancedSettings.cpp b/xbmc/AdvancedSettings.cpp
index 60f4c5b355..34f4057130 100644
--- a/xbmc/AdvancedSettings.cpp
+++ b/xbmc/AdvancedSettings.cpp
@@ -235,6 +235,8 @@ void CAdvancedSettings::Initialize()
m_curlconnecttimeout = 10;
m_curllowspeedtime = 20;
m_curlretries = 2;
+ m_curlDisableIPV6 = false; //Certain hardware/OS combinations have trouble
+ //with ipv6.
m_fullScreen = m_startFullScreen = false;
@@ -496,6 +498,7 @@ bool CAdvancedSettings::Load()
XMLUtils::GetInt(pElement, "curlclienttimeout", m_curlconnecttimeout, 1, 1000);
XMLUtils::GetInt(pElement, "curllowspeedtime", m_curllowspeedtime, 1, 1000);
XMLUtils::GetInt(pElement, "curlretries", m_curlretries, 0, 10);
+ XMLUtils::GetBoolean(pElement,"disableipv6", m_curlDisableIPV6);
}
pElement = pRootElement->FirstChildElement("samba");
diff --git a/xbmc/AdvancedSettings.h b/xbmc/AdvancedSettings.h
index 6388e31061..2d7305c23b 100644
--- a/xbmc/AdvancedSettings.h
+++ b/xbmc/AdvancedSettings.h
@@ -232,6 +232,7 @@ class CAdvancedSettings
int m_curlconnecttimeout;
int m_curllowspeedtime;
int m_curlretries;
+ bool m_curlDisableIPV6;
bool m_fullScreen;
bool m_startFullScreen;
diff --git a/xbmc/FileSystem/FileCurl.cpp b/xbmc/FileSystem/FileCurl.cpp
index 150b4d605a..39dec32ec3 100644
--- a/xbmc/FileSystem/FileCurl.cpp
+++ b/xbmc/FileSystem/FileCurl.cpp
@@ -492,6 +492,9 @@ void CFileCurl::SetCommonOptions(CReadState* state)
else
SetRequestHeader("Connection", "keep-alive");
+ if (g_advancedSettings.m_curlDisableIPV6)
+ g_curlInterface.easy_setopt(h, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+
if (m_proxy.length() > 0)
{
g_curlInterface.easy_setopt(h, CURLOPT_PROXY, m_proxy.c_str());