X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fimaging%2Fwindows%2Ffile-download-win.cpp;h=198e828648dc4a78b49b5a3f2a3c1b01aef2261b;hb=a92771e3821fb244fa81d488449aa8b2c6be5e0b;hp=a6ab471d74bbfb860f7659631cfc780dcb26753e;hpb=88182dddac40e95258d7cff3daa2f21b1bcd6174;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/imaging/windows/file-download-win.cpp b/dali/internal/imaging/windows/file-download-win.cpp index a6ab471..198e828 100755 --- a/dali/internal/imaging/windows/file-download-win.cpp +++ b/dali/internal/imaging/windows/file-download-win.cpp @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include #include #include #include <../ExInclude/InternalFileOperation.h> @@ -224,70 +223,18 @@ bool DownloadFile( CURL* curlHandle, namespace Network { -std::mutex* CurlEnvironment::mMutexs = NULL; - CurlEnvironment::CurlEnvironment() { // Must be called before we attempt any loads. e.g. by using curl_easy_init() // and before we start any threads. curl_global_init(CURL_GLOBAL_ALL); - - // libcurl with openssl needs locking_function and thread id for threadsafe - // https://curl.haxx.se/libcurl/c/threadsafe.html - // https://www.openssl.org/docs/man1.0.2/crypto/threads.html#DESCRIPTION - // SetLockingFunction sets locking_function and get thread id by the guide. - SetLockingFunction(); } CurlEnvironment::~CurlEnvironment() { - UnsetLockingFunction(); - curl_global_cleanup(); } -// libcurl with openssl needs locking_function and thread id for threadsafe -// https://curl.haxx.se/libcurl/c/threadsafe.html -// https://www.openssl.org/docs/man1.0.2/crypto/threads.html#DESCRIPTION -void CurlEnvironment::OnOpenSSLLocking( int mode, int n, const char* file, int line ) -{ - if( mode & CRYPTO_LOCK ) - { - mMutexs[n].lock(); - } - else - { - mMutexs[n].unlock(); - } -} - -void CurlEnvironment::SetLockingFunction() -{ - if( mMutexs != NULL ) - { - return; - } - - mMutexs = new std::mutex[ CRYPTO_num_locks() ]; - - CRYPTO_set_id_callback( &CurlEnvironment::GetThreadId ); - CRYPTO_set_locking_callback( &CurlEnvironment::OnOpenSSLLocking ); -} - -void CurlEnvironment::UnsetLockingFunction() -{ - if( mMutexs == NULL ) - { - return; - } - - CRYPTO_set_id_callback( NULL ); - CRYPTO_set_locking_callback( NULL ); - - delete [] mMutexs; - mMutexs = NULL; -} - bool DownloadRemoteFileIntoMemory( const std::string& url, Dali::Vector& dataBuffer, size_t& dataSize,