aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/svm/svm_fifo.h6
-rw-r--r--src/vnet/session/application.c5
-rw-r--r--src/vnet/session/session_node.c6
3 files changed, 15 insertions, 2 deletions
diff --git a/src/svm/svm_fifo.h b/src/svm/svm_fifo.h
index 40182901db5..40242614829 100644
--- a/src/svm/svm_fifo.h
+++ b/src/svm/svm_fifo.h
@@ -113,6 +113,12 @@ svm_fifo_is_full (svm_fifo_t * f)
return (f->cursize == f->nitems);
}
+static inline int
+svm_fifo_is_empty (svm_fifo_t * f)
+{
+ return (f->cursize == 0);
+}
+
static inline u32
svm_fifo_max_enqueue (svm_fifo_t * f)
{
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c
index 1dc04f0afa7..5f18bd27b2a 100644
--- a/src/vnet/session/application.c
+++ b/src/vnet/session/application.c
@@ -841,10 +841,11 @@ app_send_io_evt_rx (application_t * app, stream_session_t * s, u8 lock)
svm_msg_q_msg_t msg;
svm_msg_q_t *mq;
- if (PREDICT_FALSE (s->session_state == SESSION_STATE_CLOSED))
+ if (PREDICT_FALSE (s->session_state != SESSION_STATE_READY))
{
/* Session is closed so app will never clean up. Flush rx fifo */
- svm_fifo_dequeue_drop_all (s->server_rx_fifo);
+ if (s->session_state == SESSION_STATE_CLOSED)
+ svm_fifo_dequeue_drop_all (s->server_rx_fifo);
return 0;
}
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index 1ae92edf1ea..baabb05943d 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -68,6 +68,12 @@ session_mq_accepted_reply_handler (void *data)
return;
}
s->session_state = SESSION_STATE_READY;
+ if (!svm_fifo_is_empty (s->server_rx_fifo))
+ {
+ application_t *app;
+ app = application_get (s->app_index);
+ application_send_event (app, s, FIFO_EVENT_APP_RX);
+ }
}
}