Skip to content

Commit

Permalink
changed: stop unloading libcurl without stopping closing of http sess…
Browse files Browse the repository at this point in the history
…ions completely

This reverts commit 9c2e80f.
  • Loading branch information
elupus committed Jan 21, 2012
1 parent bf214ab commit bcbe164
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions xbmc/filesystem/DllLibCurl.cpp
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,16 +56,13 @@ bool DllLibCurlGlobal::Load()
}

/* check idle will clean up the last one */
//g_curlReferences = 2;
g_curlReferences = 1;
g_curlReferences = 2;

return true;
}

void DllLibCurlGlobal::Unload()
{
return;
/*
CSingleLock lock(m_critSection);
if (--g_curlReferences == 0)
{
Expand All @@ -78,22 +75,19 @@ 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 @@ -118,10 +112,11 @@ void DllLibCurlGlobal::CheckIdle()
it++;
}

// check if we should unload the dll
/* check if we should unload the dll */
#if(0) // we never unload libcurl, since libssl can break when python unloads then
if(g_curlReferences == 1 && XbmcThreads::SystemClockMillis() - g_curlTimeout > idletime)
Unload();
*/
#endif
}

void DllLibCurlGlobal::easy_aquire(const char *protocol, const char *hostname, CURL_HANDLE** easy_handle, CURLM** multi_handle)
Expand Down

0 comments on commit bcbe164

Please sign in to comment.