session: fix first segment manager cleanup

Change-Id: I750db7617ff9fd36647743094e0fa855e7dada86
Signed-off-by: Florin Coras <fcoras@cisco.com>
This commit is contained in:
Florin Coras
2018-10-03 01:00:57 -07:00
committed by Damjan Marion
parent 7a40133d33
commit 400ded3642
2 changed files with 5 additions and 4 deletions

View File

@ -557,13 +557,12 @@ app_worker_free (app_worker_t * app_wrk)
&& app_wrk->first_segment_manager != app_wrk->connects_seg_manager)
{
sm = segment_manager_get (app_wrk->first_segment_manager);
sm->first_is_protected = 0;
sm->app_wrk_index = SEGMENT_MANAGER_INVALID_APP_INDEX;
/* .. and has no fifos, e.g. it might be used for redirected sessions,
* remove it */
if (!segment_manager_has_fifos (sm))
{
sm->app_wrk_index = SEGMENT_MANAGER_INVALID_APP_INDEX;
segment_manager_del (sm);
}
segment_manager_del (sm);
}
/*

View File

@ -760,6 +760,8 @@ stream_session_disconnect_notify (transport_connection_t * tc)
stream_session_t *s;
s = session_get (tc->s_index, tc->thread_index);
if (s->session_state >= SESSION_STATE_TRANSPORT_CLOSING)
return;
s->session_state = SESSION_STATE_TRANSPORT_CLOSING;
app_wrk = app_worker_get_if_valid (s->app_wrk_index);
if (!app_wrk)