mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-03 20:38:59 +00:00
Use tabs instead of spaces for indentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
56
main/ssl.c
56
main/ssl.c
@@ -45,23 +45,23 @@ static int ssl_num_locks;
|
|||||||
|
|
||||||
static unsigned long ssl_threadid(void)
|
static unsigned long ssl_threadid(void)
|
||||||
{
|
{
|
||||||
return pthread_self();
|
return pthread_self();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ssl_lock(int mode, int n, const char *file, int line)
|
static void ssl_lock(int mode, int n, const char *file, int line)
|
||||||
{
|
{
|
||||||
if (n < 0 || n >= ssl_num_locks) {
|
if (n < 0 || n >= ssl_num_locks) {
|
||||||
ast_log(LOG_ERROR, "OpenSSL is full of LIES!!! - "
|
ast_log(LOG_ERROR, "OpenSSL is full of LIES!!! - "
|
||||||
"ssl_num_locks '%d' - n '%d'\n",
|
"ssl_num_locks '%d' - n '%d'\n",
|
||||||
ssl_num_locks, n);
|
ssl_num_locks, n);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mode & CRYPTO_LOCK) {
|
if (mode & CRYPTO_LOCK) {
|
||||||
ast_mutex_lock(&ssl_locks[n]);
|
ast_mutex_lock(&ssl_locks[n]);
|
||||||
} else {
|
} else {
|
||||||
ast_mutex_unlock(&ssl_locks[n]);
|
ast_mutex_unlock(&ssl_locks[n]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_OPENSSL */
|
#endif /* HAVE_OPENSSL */
|
||||||
@@ -73,28 +73,28 @@ static void ssl_lock(int mode, int n, const char *file, int line)
|
|||||||
int ast_ssl_init(void)
|
int ast_ssl_init(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_OPENSSL
|
#ifdef HAVE_OPENSSL
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
SSL_library_init();
|
SSL_library_init();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
ERR_load_BIO_strings();
|
ERR_load_BIO_strings();
|
||||||
OpenSSL_add_all_algorithms();
|
OpenSSL_add_all_algorithms();
|
||||||
|
|
||||||
/* Make OpenSSL thread-safe. */
|
/* Make OpenSSL thread-safe. */
|
||||||
|
|
||||||
CRYPTO_set_id_callback(ssl_threadid);
|
CRYPTO_set_id_callback(ssl_threadid);
|
||||||
|
|
||||||
ssl_num_locks = CRYPTO_num_locks();
|
ssl_num_locks = CRYPTO_num_locks();
|
||||||
if (!(ssl_locks = ast_calloc(ssl_num_locks, sizeof(ssl_locks[0])))) {
|
if (!(ssl_locks = ast_calloc(ssl_num_locks, sizeof(ssl_locks[0])))) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
for (i = 0; i < ssl_num_locks; i++) {
|
for (i = 0; i < ssl_num_locks; i++) {
|
||||||
ast_mutex_init(&ssl_locks[i]);
|
ast_mutex_init(&ssl_locks[i]);
|
||||||
}
|
}
|
||||||
CRYPTO_set_locking_callback(ssl_lock);
|
CRYPTO_set_locking_callback(ssl_lock);
|
||||||
|
|
||||||
#endif /* HAVE_OPENSSL */
|
#endif /* HAVE_OPENSSL */
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user