fix race in event socket

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12146 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2009-02-18 21:50:33 +00:00
parent ccdc6ec202
commit b09a12c94a
1 changed files with 1 additions and 1 deletions

View File

@ -1159,7 +1159,7 @@ static switch_status_t read_packet(listener_t *listener, switch_event_t **event,
}
}
if (channel && !switch_channel_ready(channel) && !switch_test_flag(listener, LFLAG_HANDLE_DISCO)) {
if (channel && switch_channel_get_state(channel) >= CS_HANGUP && !switch_test_flag(listener, LFLAG_HANDLE_DISCO)) {
switch_set_flag_locked(listener, LFLAG_HANDLE_DISCO);
if (switch_test_flag(listener, LFLAG_LINGER)) {
char message[128] = "";