diff --git a/src/include/private/switch_core_pvt.h b/src/include/private/switch_core_pvt.h index 31da5a9bf1..8d2a8122b9 100644 --- a/src/include/private/switch_core_pvt.h +++ b/src/include/private/switch_core_pvt.h @@ -253,8 +253,6 @@ struct switch_runtime { int multiple_registrations; uint32_t max_db_handles; uint32_t db_handle_timeout; - int curl_count; - int ssl_count; int cpu_count; }; diff --git a/src/include/switch_core.h b/src/include/switch_core.h index 08d685083a..e38d4aba7c 100644 --- a/src/include/switch_core.h +++ b/src/include/switch_core.h @@ -436,9 +436,6 @@ SWITCH_DECLARE(void) switch_core_session_rwunlock(_In_ switch_core_session_t *se */ SWITCH_DECLARE(int) switch_core_add_state_handler(_In_ const switch_state_handler_table_t *state_handler); -SWITCH_DECLARE(int) switch_core_curl_count(int *val); -SWITCH_DECLARE(int) switch_core_ssl_count(int *val); - /*! \brief Remove a global state handler \param state_handler the state handler to remove diff --git a/src/include/switch_ssl.h b/src/include/switch_ssl.h index 30b3b07ec5..24f660b459 100644 --- a/src/include/switch_ssl.h +++ b/src/include/switch_ssl.h @@ -36,7 +36,7 @@ static switch_mutex_t **ssl_mutexes; static switch_memory_pool_t *ssl_pool = NULL; - +static int ssl_count = 0; static inline void switch_ssl_ssl_lock_callback(int mode, int type, char *file, int line) { @@ -56,7 +56,6 @@ static inline unsigned long switch_ssl_ssl_thread_id(void) static inline void switch_ssl_init_ssl_locks(void) { - int ssl_count = switch_core_ssl_count(NULL); int i, num; if (ssl_count == 0) { @@ -77,17 +76,13 @@ static inline void switch_ssl_init_ssl_locks(void) } ssl_count++; - switch_core_ssl_count(&ssl_count); } static inline void switch_ssl_destroy_ssl_locks() { int i; - int ssl_count = switch_core_ssl_count(NULL); - ssl_count--; - - if (ssl_count == 0) { + if (ssl_count == 1) { CRYPTO_set_locking_callback(NULL); for (i = 0; i < CRYPTO_num_locks(); i++) { if (ssl_mutexes[i]) { @@ -96,10 +91,8 @@ static inline void switch_ssl_destroy_ssl_locks() } OPENSSL_free(ssl_mutexes); + ssl_count--; } - - switch_core_ssl_count(&ssl_count); - } #else static inline void switch_ssl_init_ssl_locks(void) { return; } diff --git a/src/switch_core.c b/src/switch_core.c index 346f3c853c..4d687bf8cc 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -200,33 +200,6 @@ SWITCH_DECLARE(FILE *) switch_core_data_channel(switch_text_channel_t channel) } -SWITCH_DECLARE(int) switch_core_curl_count(int *val) -{ - if (!val) { - switch_mutex_lock(runtime.global_mutex); - return runtime.curl_count; - } - - runtime.curl_count = *val; - switch_mutex_unlock(runtime.global_mutex); - return 0; - -} - - -SWITCH_DECLARE(int) switch_core_ssl_count(int *val) -{ - if (!val) { - switch_mutex_lock(runtime.global_mutex); - return runtime.ssl_count; - } - - runtime.ssl_count = *val; - switch_mutex_unlock(runtime.global_mutex); - return 0; - -} - SWITCH_DECLARE(void) switch_core_remove_state_handler(const switch_state_handler_table_t *state_handler) { int index, tmp_index = 0;