make crash protection a runtime option instead of a compile-time option

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5123 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-05-10 16:56:29 +00:00
parent c07224852c
commit ab34a26079
10 changed files with 130 additions and 133 deletions
+16 -6
View File
@@ -63,12 +63,6 @@ typedef apr_os_thread_t switch_thread_id_t;
/* #define DEBUG_ALLOC */
#define DO_EVENTS
#ifdef CRASH_PROT
#define __CP "ENABLED"
#else
#define __CP "DISABLED"
#endif
#define SWITCH_EVENT_QUEUE_LEN 256
#define SWITCH_MESSAGE_QUEUE_LEN 256
#define SWITCH_SQL_QUEUE_LEN 2000
@@ -145,6 +139,22 @@ struct switch_media_bug {
struct switch_media_bug *next;
};
struct switch_runtime {
switch_time_t initiated;
switch_hash_t *global_vars;
switch_memory_pool_t *memory_pool;
const switch_state_handler_table_t *state_handlers[SWITCH_MAX_STATE_HANDLERS];
int state_handler_index;
FILE *console;
uint8_t running;
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
uint32_t no_new_sessions;
uint32_t shutting_down;
uint32_t crash_prot;
};
extern struct switch_runtime runtime;
void switch_core_sqldb_start(switch_memory_pool_t *pool);
void switch_core_sqldb_stop(void);
void switch_core_session_init(switch_memory_pool_t *pool);
+2
View File
@@ -76,6 +76,8 @@ static inline switch_bool_t switch_is_digit_string(char *s) {
(expr && ( !strcasecmp(expr, "yes") ||\
!strcasecmp(expr, "on") ||\
!strcasecmp(expr, "true") ||\
!strcasecmp(expr, "enabled") ||\
!strcasecmp(expr, "active") ||\
atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE
/*!
\brief find local ip of the box