summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session_input.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/vnet/session/session_input.c b/src/vnet/session/session_input.c
index 5899242f975..e7a81c343f4 100644
--- a/src/vnet/session/session_input.c
+++ b/src/vnet/session/session_input.c
@@ -155,7 +155,7 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
if (app->cb_fns.session_accept_callback (s))
{
session_close (s);
- s->app_wrk_index = SESSION_INVALID_INDEX;
+ s->app_wrk_index = APP_INVALID_INDEX;
break;
}
if (is_builtin)
@@ -185,7 +185,7 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
if (rv)
{
session_close (s);
- s->app_wrk_index = SESSION_INVALID_INDEX;
+ s->app_wrk_index = APP_INVALID_INDEX;
break;
}
if (old_state >= SESSION_STATE_TRANSPORT_CLOSING)
@@ -234,10 +234,11 @@ app_worker_flush_events_inline (app_worker_t *app_wrk, u32 thread_index,
case SESSION_CTRL_EVT_CLEANUP:
s = session_get (evt->as_u64[0] & 0xffffffff, thread_index);
/* Notification enqueued before session was refused by app */
- if (PREDICT_FALSE (s->app_wrk_index == APP_INVALID_INDEX))
- break;
- if (app->cb_fns.session_cleanup_callback)
- app->cb_fns.session_cleanup_callback (s, evt->as_u64[0] >> 32);
+ if (PREDICT_TRUE (s->app_wrk_index != APP_INVALID_INDEX))
+ {
+ if (app->cb_fns.session_cleanup_callback)
+ app->cb_fns.session_cleanup_callback (s, evt->as_u64[0] >> 32);
+ }
if (evt->as_u64[0] >> 32 != SESSION_CLEANUP_SESSION)
break;
uword_to_pointer (evt->as_u64[1], void (*) (session_t * s)) (s);