avoiding racelock

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7624 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-02-15 19:48:16 +00:00
parent dd1c14cfa8
commit 1f3edc49dc
3 changed files with 16 additions and 17 deletions
+7 -12
View File
@@ -702,7 +702,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
private_object_t *tech_pvt = switch_core_session_get_private(session);
switch_status_t status;
switch_assert(tech_pvt != NULL);
if (switch_channel_get_state(channel) >= CS_HANGUP || !tech_pvt) {
return SWITCH_STATUS_FALSE;
}
if (msg->message_id == SWITCH_MESSAGE_INDICATE_ANSWER || msg->message_id == SWITCH_MESSAGE_INDICATE_PROGRESS) {
const char *var;
@@ -755,11 +757,7 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
switch_core_session_t *other_session;
switch_channel_t *other_channel;
const char *ip = NULL, *port = NULL;
if (switch_channel_get_state(channel) >= CS_HANGUP) {
return SWITCH_STATUS_FALSE;
}
switch_channel_set_flag(channel, CF_BYPASS_MEDIA);
tech_pvt->local_sdp_str = NULL;
if ((uuid = switch_channel_get_variable(channel, SWITCH_SIGNAL_BOND_VARIABLE))
@@ -792,10 +790,6 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
{
uint32_t count = 0;
if (switch_channel_get_state(channel) >= CS_HANGUP) {
return SWITCH_STATUS_FALSE;
}
switch_channel_clear_flag(channel, CF_BYPASS_MEDIA);
tech_pvt->local_sdp_str = NULL;
if (!switch_rtp_ready(tech_pvt->rtp_session)) {
@@ -975,8 +969,9 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
case SWITCH_MESSAGE_INDICATE_ANSWER:
sofia_answer_channel(session);
break;
case SWITCH_MESSAGE_INDICATE_PROGRESS:{
if (!switch_test_flag(tech_pvt, TFLAG_ANS)) {
case SWITCH_MESSAGE_INDICATE_PROGRESS:
{
if (!switch_test_flag(tech_pvt, TFLAG_ANS) && !switch_test_flag(tech_pvt, TFLAG_EARLY_MEDIA)) {
switch_set_flag_locked(tech_pvt, TFLAG_EARLY_MEDIA);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from);