mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-17 07:18:15 +00:00
Improved and portable ast_log recursion avoidance
This introduces a new logger routine ast_log_safe. This routine should be used for all error messages in code that can be run as a result of ast_log. ast_log_safe does nothing if run recursively. All error logging in astobj2.c, strings.c and utils.h have been switched to ast_log_safe. This required adding support for raw threadstorage. This provides direct access to the void* pointer in threadstorage. In ast_log_safe, NULL is used to signify that this thread is not already running ast_log_safe, (void*)1 when it is already running. This was done since it's critical that ast_log_safe do nothing that could log during recursion checking. ASTERISK-24155 #close Reported by: Timo Teräs Review: https://reviewboard.asterisk.org/r/4502/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@433522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -33,6 +33,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/cli.h"
|
||||
#include "asterisk/paths.h"
|
||||
|
||||
/* Use ast_log_safe in place of ast_log. */
|
||||
#define ast_log ast_log_safe
|
||||
|
||||
#if defined(TEST_FRAMEWORK)
|
||||
/* We are building with the test framework enabled so enable AO2 debug tests as well. */
|
||||
#define AO2_DEBUG 1
|
||||
|
||||
Reference in New Issue
Block a user