Skip to content

Commit

Permalink
[hack] force curl to not unload, this hack fixes ssl from slipping ou…
Browse files Browse the repository at this point in the history
…t when python unloads
  • Loading branch information
davilla committed Dec 28, 2011
1 parent ba852bb commit 9c2e80f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions xbmc/filesystem/DllLibCurl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ bool DllLibCurlGlobal::Load()
CSingleLock lock(m_critSection);
if(g_curlReferences > 0)
{
g_curlReferences++;
//g_curlReferences++;
return true;
}

Expand All @@ -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)
{
Expand All @@ -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();
Expand All @@ -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)
Expand Down

0 comments on commit 9c2e80f

Please sign in to comment.