From b45b8b2f3ba328c5b28ece9f32bd696167130599 Mon Sep 17 00:00:00 2001 From: theuni Date: Sat, 27 Nov 2010 19:54:03 +0000 Subject: 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 --- xbmc/AdvancedSettings.cpp | 3 +++ xbmc/AdvancedSettings.h | 1 + xbmc/FileSystem/FileCurl.cpp | 3 +++ 3 files changed, 7 insertions(+) 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()); -- cgit v1.2.3