diff options
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/session.c | 18 | ||||
-rw-r--r-- | src/vnet/session/session.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index 4081f909482..6492ce7089e 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -830,6 +830,24 @@ stream_session_delete_notify (transport_connection_t * tc) } /** + * Notification from transport that session can be closed + * + * Should be called by transport only if it was closed with non-empty + * tx fifo and once it decides to begin the closing procedure prior to + * issuing a delete notify. This gives the chance to the session layer + * to cleanup any outstanding events. + */ +void +session_stream_close_notify (transport_connection_t * tc) +{ + stream_session_t *s; + + if (!(s = session_get_if_valid (tc->s_index, tc->thread_index))) + return; + s->session_state = SESSION_STATE_CLOSED; +} + +/** * Notify application that connection has been reset. */ void diff --git a/src/vnet/session/session.h b/src/vnet/session/session.h index 6c1bdb639df..3b729234967 100644 --- a/src/vnet/session/session.h +++ b/src/vnet/session/session.h @@ -613,6 +613,7 @@ void stream_session_init_fifos_pointers (transport_connection_t * tc, int stream_session_accept_notify (transport_connection_t * tc); void stream_session_disconnect_notify (transport_connection_t * tc); void stream_session_delete_notify (transport_connection_t * tc); +void session_stream_close_notify (transport_connection_t * tc); void stream_session_reset_notify (transport_connection_t * tc); int stream_session_accept (transport_connection_t * tc, u32 listener_index, u8 notify); |