[mod_event_socket] Fix "Listener session is null" problem - regression from previous commit to the mod.

This commit is contained in:
Andrey Volk 2019-11-13 17:56:57 +04:00
parent b0f09fcff2
commit f8dc87bd18
1 changed files with 6 additions and 10 deletions

View File

@ -2635,16 +2635,12 @@ static void *SWITCH_THREAD_FUNC listener_run(switch_thread_t *thread, void *obj)
switch_assert(listener != NULL);
if (!(session = listener->session)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Listener session is null!\n");
switch_clear_flag_locked(listener, LFLAG_RUNNING);
goto done;
}
if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Unable to lock session!\n");
locked = 0;
goto done;
if ((session = listener->session)) {
if (switch_core_session_read_lock(session) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Unable to lock session!\n");
locked = 0;
goto done;
}
}
if (!listener->sock) {