TV profile doesn't use openssl 1.1 yet.
So, this patch defines thread locking function for TV profile temporaly.
It will be removed or disabled after openssl 1.1 is applied to TV.
Change-Id: I60860df9cd656bab49cb244e7439ae9c227702d4
ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64")
ENDIF (SUPPORT_OMA_DRM)
+IF (USE_SSL_THREAD_LOCKING)
+ MESSAGE("USE_SSL_THREAD_LOCKING(openssl<=1.0):On")
+ ADD_DEFINITIONS("-DUSE_SSL_THREAD_LOCKING")
+ENDIF (USE_SSL_THREAD_LOCKING)
+
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fpic -Wall -Werror -Werror-implicit-function-declaration")
IF (BUILD_GTESTS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fvisibility=default")
#include <curl/curl.h>
#include <openssl/crypto.h>
+#ifdef USE_SSL_THREAD_LOCKING
+#include <openssl/crypto.h>
+#endif
+
#include "download-agent-dl-info.h"
#include "download-agent-http-mgr.h"
#include "download-agent-http-msg-handler.h"
static pthread_mutex_t mutex_da_info_list = PTHREAD_MUTEX_INITIALIZER;
-static pthread_mutex_t *g_openssl_locks_list;
da_info_t *da_info_list[DA_MAX_ID];
+#ifdef USE_SSL_THREAD_LOCKING
+static pthread_mutex_t *g_openssl_locks_list;
+
/* locking mechnism for safe use of openssl context */
static void openssl_lock_callback(int mode, int type, char *file, int line)
{
return DA_RESULT_OK;
}
+#endif
static void __init_da_info(int id)
{
{
DA_LOGV("");
da_ret_t ret = DA_RESULT_OK;
+#ifdef USE_SSL_THREAD_LOCKING
ret = init_openssl_locks();
DA_LOGI("Return ret = %d", ret);
+#endif
return ret;
}
DA_LOGV("");
destroy_da_info_list();
+#ifdef USE_SSL_THREAD_LOCKING
deinit_openssl_locks();
+#endif
DA_LOGI("====== da_deint EXIT =====");
return ret;
}
DA_MUTEX_UNLOCK(&GET_STATE_MUTEX(INFO));\
}
+#ifdef USE_SSL_THREAD_LOCKING
da_ret_t init_openssl_locks(void);
da_ret_t deinit_openssl_locks(void);
+#endif
+
da_ret_t get_available_da_id(int *available_id);
da_ret_t copy_user_input_data(da_info_t *da_info, const char *url,
req_data_t *ext_data, da_cb_t *da_cb_data);
-DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
-DBUILD_GCOV=%{?gcov:1}%{!?gcov:0} \
-DSUPPORT_LARGE_FILE:BOOL=ON \
+%if "%{?tizen_profile_name}" == "tv"
+ -DUSE_SSL_THREAD_LOCKING:BOOL=ON \
+%endif
.
make %{?jobs:-j%jobs}