aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/application.c1
-rw-r--r--src/vnet/session/session.c7
-rw-r--r--src/vnet/session/session_types.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index e6292157dfa..ee69cf88c88 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -73,6 +73,7 @@ application_local_listen_session_alloc (application_t * app)
ll->session_index = ll - app->local_listen_sessions;
ll->session_type = session_type_from_proto_and_ip (TRANSPORT_PROTO_NONE, 0);
ll->app_index = app->app_index;
+ ll->session_state = SESSION_STATE_LISTENING;
return ll;
}
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index a94a0c40882..58e085ee29b 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -862,6 +862,12 @@ session_transport_delete_notify (transport_connection_t * tc)
switch (s->session_state)
{
+ case SESSION_STATE_CREATED:
+ /* Session was created but accept notification was not yet sent to the
+ * app. Cleanup everything. */
+ session_lookup_del_session (s);
+ session_free_w_fifos (s);
+ break;
case SESSION_STATE_ACCEPTING:
case SESSION_STATE_TRANSPORT_CLOSING:
/* If transport finishes or times out before we get a reply
@@ -963,6 +969,7 @@ session_stream_accept (transport_connection_t * tc, u32 listener_index,
s->app_wrk_index = app_wrk->wrk_index;
s->listener_index = listener_index;
+ s->session_state = SESSION_STATE_CREATED;
/* Shoulder-tap the server */
if (notify)
diff --git a/src/vnet/session/session_types.h b/src/vnet/session/session_types.h
index 846af25c777..e10dceafa16 100644
--- a/src/vnet/session/session_types.h
+++ b/src/vnet/session/session_types.h
@@ -113,6 +113,7 @@ typedef u64 session_handle_t;
*/
typedef enum
{
+ SESSION_STATE_CREATED,
SESSION_STATE_LISTENING,
SESSION_STATE_CONNECTING,
SESSION_STATE_ACCEPTING,