[5.0] To support openssl new feature 23/198123/1
authorxb.teng <xb.teng@samsung.com>
Mon, 21 Jan 2019 06:57:43 +0000 (14:57 +0800)
committerxb.teng <xb.teng@samsung.com>
Mon, 21 Jan 2019 06:57:43 +0000 (14:57 +0800)
Change-Id: I4b07032348969cbe2a9a63cab304bd56ed3752f0

dali/internal/imaging/common/file-download.cpp
dali/internal/imaging/common/file-download.h

index e384a50..cad07cf 100755 (executable)
@@ -22,7 +22,6 @@
 #include <dali/integration-api/debug.h>
 #include <pthread.h>
 #include <curl/curl.h>
-#include <openssl/crypto.h>
 #include <cstring>
 
 // INTERNAL INCLUDES
@@ -250,10 +249,10 @@ void CurlEnvironment::OnOpenSSLLocking( int mode, int n, const char* file, int l
   }
 }
 
-unsigned long CurlEnvironment::GetThreadId()
+void CurlEnvironment::GetThreadId( CRYPTO_THREADID* tid )
 {
   // If dali uses c++ thread, we may replace pthread_self() to this_thread::get_id()
-  return static_cast< unsigned long >( pthread_self() );
+  CRYPTO_THREADID_set_numeric( tid, static_cast< unsigned long > ( pthread_self() ) );
 }
 
 void CurlEnvironment::SetLockingFunction()
@@ -265,7 +264,7 @@ void CurlEnvironment::SetLockingFunction()
 
   mMutexs = new std::mutex[ CRYPTO_num_locks() ];
 
-  CRYPTO_set_id_callback( &CurlEnvironment::GetThreadId );
+  CRYPTO_THREADID_set_callback( &CurlEnvironment::GetThreadId );
   CRYPTO_set_locking_callback( &CurlEnvironment::OnOpenSSLLocking );
 }
 
@@ -276,7 +275,7 @@ void CurlEnvironment::UnsetLockingFunction()
     return;
   }
 
-  CRYPTO_set_id_callback( NULL );
+  CRYPTO_THREADID_set_callback( NULL );
   CRYPTO_set_locking_callback( NULL );
   delete [] mMutexs;
   mMutexs = NULL;
index 9c6d419..5713919 100755 (executable)
@@ -23,6 +23,7 @@
 #include <string>
 #include <mutex> //c++11
 #include <stdint.h> // uint8
+#include <openssl/crypto.h>
 
 namespace Dali
 {
@@ -67,7 +68,7 @@ public:
   /**
    * Gets thread id for libcurl with openssl
    */
-  static unsigned long GetThreadId();
+  static void GetThreadId( CRYPTO_THREADID* tid );
 
   static void ConfigureCurlOptions( void* curlHandle, const std::string& url );