Skip to content

Commit

Permalink
tls: debug messages for mutex ops with lock function
Browse files Browse the repository at this point in the history
  • Loading branch information
miconda committed Feb 11, 2016
1 parent fe7f411 commit dcfd501
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/tls/tls_locking.c
@@ -1,7 +1,7 @@
/*
* TLS module
*
* Copyright (C) 2007 iptelorg GmbH
* Copyright (C) 2007 iptelorg GmbH
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
Expand Down Expand Up @@ -42,7 +42,7 @@ struct CRYPTO_dynlock_value{
static struct CRYPTO_dynlock_value* dyn_create_f(const char* file, int line)
{
struct CRYPTO_dynlock_value* l;

l=shm_malloc(sizeof(struct CRYPTO_dynlock_value));
if (l==0){
LOG(L_CRIT, "ERROR: tls: dyn_create_f locking callback out of shm."
Expand Down Expand Up @@ -104,11 +104,12 @@ static void locking_f(int mode, int n, const char* file, int line)
abort(); /* quick crash :-) */
}
if (mode & CRYPTO_LOCK){
LM_DBG("lock get (%d): %d (%s:%d)\n", mode, n, file, line);
lock_set_get(static_locks, n);
}else{
lock_set_release(static_locks, n);
LM_DBG("lock release (%d): %d (%s:%d)\n", mode, n, file, line);
}

}


Expand Down Expand Up @@ -160,7 +161,7 @@ int tls_init_locks()
CRYPTO_set_dynlock_create_callback(dyn_create_f);
CRYPTO_set_dynlock_lock_callback(dyn_lock_f);
CRYPTO_set_dynlock_destroy_callback(dyn_destroy_f);

/* starting with v1.0.0 openssl does not use anymore getpid(), but address
* of errno which can point to same virtual address in a multi-process
* application
Expand All @@ -172,8 +173,7 @@ int tls_init_locks()
* (only atomic_inc), fallback to the default use-locks mode
* CRYPTO_set_add_lock_callback(atomic_add_f);
*/



return 0;
error:
tls_destroy_locks();
Expand Down

0 comments on commit dcfd501

Please sign in to comment.