summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session/session.c')
-rw-r--r--src/vnet/session/session.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 57567926a1c..6e24d562f98 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -124,13 +124,6 @@ session_program_transport_close (session_t * s)
session_worker_t *wrk;
session_event_t *evt;
- if (!session_has_transport (s))
- {
- /* Polling may not be enabled on main thread so close now */
- session_transport_close (s);
- return;
- }
-
/* If we are in the handler thread, or being called with the worker barrier
* held, just append a new event to pending disconnects vector. */
if (vlib_thread_is_main_w_barrier () || thread_index == s->thread_index)
@@ -483,7 +476,7 @@ session_notify_subscribers (u32 app_index, session_t * s,
* @return 0 on success or negative number if failed to send notification.
*/
static inline int
-session_enqueue_notify (session_t * s)
+session_enqueue_notify_inline (session_t * s)
{
app_worker_t *app_wrk;
@@ -513,6 +506,12 @@ session_enqueue_notify (session_t * s)
}
int
+session_enqueue_notify (session_t * s)
+{
+ return session_enqueue_notify_inline (s);
+}
+
+int
session_dequeue_notify (session_t * s)
{
app_worker_t *app_wrk;
@@ -560,7 +559,11 @@ session_main_flush_enqueue_events (u8 transport_proto, u32 thread_index)
errors++;
continue;
}
- if (PREDICT_FALSE (session_enqueue_notify (s)))
+
+ if (svm_fifo_is_empty (s->rx_fifo))
+ continue;
+
+ if (PREDICT_FALSE (session_enqueue_notify_inline (s)))
errors++;
}