[Freeswitch-svn] [commit] r5502 - freeswitch/trunk/src
Freeswitch SVN
anthm at freeswitch.org
Fri Jul 6 12:29:25 EDT 2007
Author: anthm
Date: Fri Jul 6 12:29:25 2007
New Revision: 5502
Modified:
freeswitch/trunk/src/switch_core.c
freeswitch/trunk/src/switch_core_session.c
Log:
fix startup race
Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c (original)
+++ freeswitch/trunk/src/switch_core.c Fri Jul 6 12:29:25 2007
@@ -398,6 +398,8 @@
switch_uuid_t uuid;
memset(&runtime, 0, sizeof(runtime));
+ runtime.no_new_sessions = 1;
+
/* INIT APR and Create the pool context */
if (apr_initialize() != SWITCH_STATUS_SUCCESS) {
*err = "FATAL ERROR! Could not initilize APR\n";
@@ -577,6 +579,9 @@
"\nFreeSWITCH Version %s Started.\nCrash Protection [%s]\nMax Sessions[%u]\n\n", SWITCH_VERSION_FULL,
runtime.crash_prot ? "Enabled" : "Disabled",
switch_core_session_limit(0));
+
+ runtime.no_new_sessions = 0;
+
return SWITCH_STATUS_SUCCESS;
}
Modified: freeswitch/trunk/src/switch_core_session.c
==============================================================================
--- freeswitch/trunk/src/switch_core_session.c (original)
+++ freeswitch/trunk/src/switch_core_session.c Fri Jul 6 12:29:25 2007
@@ -767,7 +767,10 @@
switch_uuid_t uuid;
uint32_t count = 0;
- assert(endpoint_interface != NULL);
+ if (!switch_core_ready() || endpoint_interface == NULL) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "The system cannot create any sessions at this time.\n");
+ return NULL;
+ }
switch_mutex_lock(session_manager.session_table_mutex);
count = session_manager.session_count;
@@ -778,11 +781,6 @@
return NULL;
}
- if (!switch_core_ready()) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Read my lips: no new sessions!\n");
- return NULL;
- }
-
if (pool && *pool) {
usepool = *pool;
*pool = NULL;
More information about the Freeswitch-svn
mailing list