To support openssl new feature 52/197452/2
authorxb.teng <xb.teng@samsung.com>
Fri, 11 Jan 2019 08:04:38 +0000 (16:04 +0800)
committerxb.teng <xb.teng@samsung.com>
Fri, 11 Jan 2019 09:18:40 +0000 (17:18 +0800)
Change-Id: I76517a095ade51cc326bbfc4c34ead3cf56a6017

dali/internal/imaging/common/file-download.cpp
dali/internal/imaging/common/file-download.h [changed mode: 0644->0755]

index 965226d..b4d3f4f 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;
old mode 100644 (file)
new mode 100755 (executable)
index c7fb345..d2ee371
@@ -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 );
 
 private: