fix some races and alter core (do a full rebuild)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5751 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2007-09-24 19:34:25 +00:00
parent 981c4371bf
commit d33b5670f0
17 changed files with 37 additions and 45 deletions
@@ -2822,7 +2822,7 @@ static switch_status_t conf_api_sub_list(conference_obj_t * conference, switch_s
}
if (conference == NULL) {
for (hi = switch_hash_first(globals.conference_pool, globals.conference_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, globals.conference_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
conference = (conference_obj_t *) val;
+1 -1
View File
@@ -586,7 +586,7 @@ SWITCH_STANDARD_APP(enum_app_function)
void *vval;
const void *vvar;
if ((hi = switch_channel_variable_first(channel, switch_core_session_get_pool(session)))) {
if ((hi = switch_channel_variable_first(channel))) {
for (; hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &vvar, NULL, &vval);
if (vvar && !strncmp(vvar, "enum_", 5)) {
@@ -252,7 +252,7 @@ static switch_status_t dialplan_xml_locate(switch_core_session_t *session, switc
stream.write_function(&stream, "%s=%s&", prof_names[x], encode_buf);
}
if ((hi = switch_channel_variable_first(channel, switch_core_session_get_pool(session)))) {
if ((hi = switch_channel_variable_first(channel))) {
for (; hi; hi = switch_hash_next(hi)) {
void *val;
const void *var;
@@ -477,7 +477,7 @@ static void pres_event_handler(switch_event_t *event)
sql = switch_mprintf("select sub_from, sub_to,'%q','%q','%q','%q' from jabber_subscriptions where sub_to like '%%%q'", type, rpid, status, proto, from);
for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
profile = (mdl_profile_t *) val;
@@ -572,7 +572,7 @@ static void roster_event_handler(switch_event_t *event)
sql = switch_mprintf("select *,'%q' from jabber_subscriptions", status ? status : "");
}
for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
profile = (mdl_profile_t *) val;
@@ -642,7 +642,7 @@ static void sign_off(void)
sql = switch_mprintf("select * from jabber_subscriptions");
for (hi = switch_hash_first(switch_hash_pool_get(globals.profile_hash), globals.profile_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
profile = (mdl_profile_t *) val;
@@ -760,7 +760,7 @@ static int get_codecs(struct private_object *tech_pvt)
return 0;
}
} else if (((tech_pvt->num_codecs =
switch_loadable_module_get_codecs(switch_core_session_get_pool(tech_pvt->session), tech_pvt->codecs, SWITCH_MAX_CODECS))) <= 0) {
switch_loadable_module_get_codecs(tech_pvt->codecs, SWITCH_MAX_CODECS))) <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n");
return 0;
}
+1 -1
View File
@@ -230,7 +230,7 @@ static switch_status_t iax_set_codec(private_t * tech_pvt, struct iax_session *i
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n");
return SWITCH_STATUS_GENERR;
}
} else if (((num_codecs = switch_loadable_module_get_codecs(switch_core_session_get_pool(tech_pvt->session), codecs, SWITCH_MAX_CODECS))) <= 0) {
} else if (((num_codecs = switch_loadable_module_get_codecs(codecs, SWITCH_MAX_CODECS))) <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n");
return SWITCH_STATUS_GENERR;
}
+1 -1
View File
@@ -1090,7 +1090,7 @@ static switch_status_t cmd_status(char **argv, int argc, switch_stream_handle_t
stream->write_function(stream, "%25s\t%s\t %32s\t%s\n", "Name", " Type", "Data", "State");
stream->write_function(stream, "%s\n", line);
switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_hash_first(switch_hash_pool_get(mod_sofia_globals.profile_hash), mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &vvar, NULL, &val);
profile = (sofia_profile_t *) val;
if (sofia_test_pflag(profile, PFLAG_RUNNING)) {
+4 -4
View File
@@ -264,7 +264,7 @@ void sofia_glue_tech_prepare_codecs(private_object_t *tech_pvt)
}
} else {
tech_pvt->num_codecs =
switch_loadable_module_get_codecs(switch_core_session_get_pool(tech_pvt->session), tech_pvt->codecs,
switch_loadable_module_get_codecs(tech_pvt->codecs,
sizeof(tech_pvt->codecs) / sizeof(tech_pvt->codecs[0]));
}
@@ -574,7 +574,7 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
}
SWITCH_STANDARD_STREAM(stream);
if ((hi = switch_channel_variable_first(channel, switch_core_session_get_pool(tech_pvt->session)))) {
if ((hi = switch_channel_variable_first(channel))) {
for (; hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &vvar, NULL, &vval);
if (vvar && vval) {
@@ -1540,14 +1540,14 @@ void sofia_glue_del_profile(sofia_profile_t *profile)
switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_hash_first(switch_hash_pool_get(mod_sofia_globals.profile_hash), mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &vvar, NULL, &vval);
this_profile = (sofia_profile_t *) vval;
if (this_profile == profile) {
switch_core_hash_delete(mod_sofia_globals.profile_hash, vvar);
}
}
for (hi = switch_hash_first(switch_hash_pool_get(mod_sofia_globals.gateway_hash), mod_sofia_globals.gateway_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.gateway_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, &vvar, NULL, &vval);
this_gateway = (sofia_gateway_t *) vval;
+3 -3
View File
@@ -116,7 +116,7 @@ void sofia_presence_cancel(void)
if ((sql = switch_mprintf("select 0,'unavailable','unavailable',* from sip_subscriptions where event='presence'"))) {
switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_hash_first(switch_hash_pool_get(mod_sofia_globals.profile_hash), mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
profile = (sofia_profile_t *) val;
if (!(profile->pflags & PFLAG_PRESENCE)) {
@@ -294,7 +294,7 @@ void sofia_presence_event_handler(switch_event_t *event)
assert(sql != NULL);
switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_hash_first(switch_hash_pool_get(mod_sofia_globals.profile_hash), mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
profile = (sofia_profile_t *) val;
if (!(profile->pflags & PFLAG_PRESENCE)) {
@@ -396,7 +396,7 @@ void sofia_presence_event_handler(switch_event_t *event)
}
switch_mutex_lock(mod_sofia_globals.hash_mutex);
for (hi = switch_hash_first(switch_hash_pool_get(mod_sofia_globals.profile_hash), mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
for (hi = switch_hash_first(NULL, mod_sofia_globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val);
profile = (sofia_profile_t *) val;
if (!(profile->pflags & PFLAG_PRESENCE)) {
@@ -144,7 +144,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_native_file_load)
switch_file_interface_t *file_interface;
const switch_codec_implementation_t *codecs[SWITCH_MAX_CODECS];
uint32_t num_codecs = switch_loadable_module_get_codecs(NULL, codecs, sizeof(codecs) / sizeof(codecs[0]));
uint32_t num_codecs = switch_loadable_module_get_codecs(codecs, sizeof(codecs) / sizeof(codecs[0]));
uint32_t x;
for (x = 0; x < num_codecs; x++) {
+1 -1
View File
@@ -142,7 +142,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_mono_load)
/* Finally, go through and initialise each plugin before returning SUCCESS */
switch_hash_index_t *p = NULL;
for (p = switch_hash_first(mono_pool, globals.plugins); p; p = switch_hash_next(p)) {
for (p = switch_hash_first(NULL, globals.plugins); p; p = switch_hash_next(p)) {
mono_plugin *plugin = (mono_plugin *) switch_core_alloc(mono_pool, sizeof(*plugin));
switch_ssize_t *key_length = NULL;
const void *key = NULL;