mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-31 06:36:41 +00:00
xbmc: add patch to dont unload libcurl
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
198f29c245
commit
711d0a17b2
@ -0,0 +1,69 @@
|
|||||||
|
diff --git a/xbmc/filesystem/DllLibCurl.cpp b/xbmc/filesystem/DllLibCurl.cpp
|
||||||
|
index f93e693..65ecad8 100644
|
||||||
|
--- a/xbmc/filesystem/DllLibCurl.cpp
|
||||||
|
+++ b/xbmc/filesystem/DllLibCurl.cpp
|
||||||
|
@@ -39,7 +39,7 @@ bool DllLibCurlGlobal::Load()
|
||||||
|
CSingleLock lock(m_critSection);
|
||||||
|
if(g_curlReferences > 0)
|
||||||
|
{
|
||||||
|
- g_curlReferences++;
|
||||||
|
+ //g_curlReferences++;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -56,13 +56,16 @@ bool DllLibCurlGlobal::Load()
|
||||||
|
}
|
||||||
|
|
||||||
|
/* check idle will clean up the last one */
|
||||||
|
- g_curlReferences = 2;
|
||||||
|
+ //g_curlReferences = 2;
|
||||||
|
+ g_curlReferences = 1;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DllLibCurlGlobal::Unload()
|
||||||
|
{
|
||||||
|
+ return;
|
||||||
|
+ /*
|
||||||
|
CSingleLock lock(m_critSection);
|
||||||
|
if (--g_curlReferences == 0)
|
||||||
|
{
|
||||||
|
@@ -75,19 +78,22 @@ void DllLibCurlGlobal::Unload()
|
||||||
|
DllDynamic::Unload();
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* CheckIdle will clear this one up */
|
||||||
|
+ // CheckIdle will clear this one up
|
||||||
|
if(g_curlReferences == 1)
|
||||||
|
g_curlTimeout = XbmcThreads::SystemClockMillis();
|
||||||
|
+ */
|
||||||
|
}
|
||||||
|
|
||||||
|
void DllLibCurlGlobal::CheckIdle()
|
||||||
|
{
|
||||||
|
/* avoid locking section here, to avoid stalling gfx thread on loads*/
|
||||||
|
+ return;
|
||||||
|
+ /*
|
||||||
|
if(g_curlReferences == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
CSingleLock lock(m_critSection);
|
||||||
|
- /* 20 seconds idle time before closing handle */
|
||||||
|
+ // 20 seconds idle time before closing handle
|
||||||
|
const unsigned int idletime = 30000;
|
||||||
|
|
||||||
|
VEC_CURLSESSIONS::iterator it = m_sessions.begin();
|
||||||
|
@@ -112,9 +118,10 @@ void DllLibCurlGlobal::CheckIdle()
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
|
||||||
|
- /* check if we should unload the dll */
|
||||||
|
+ // check if we should unload the dll
|
||||||
|
if(g_curlReferences == 1 && XbmcThreads::SystemClockMillis() - g_curlTimeout > idletime)
|
||||||
|
Unload();
|
||||||
|
+ */
|
||||||
|
}
|
||||||
|
|
||||||
|
void DllLibCurlGlobal::easy_aquire(const char *protocol, const char *hostname, CURL_HANDLE** easy_handle, CURLM** multi_handle)
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user