aboutsummaryrefslogtreecommitdiffstats
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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index f063548dcfe..f4a9e456454 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -1099,6 +1099,15 @@ session_transport_closing_notify (transport_connection_t * tc)
s = session_get (tc->s_index, tc->thread_index);
if (s->session_state >= SESSION_STATE_TRANSPORT_CLOSING)
return;
+
+ /* Wait for reply from app before sending notification as the
+ * accept might be rejected */
+ if (s->session_state == SESSION_STATE_ACCEPTING)
+ {
+ s->session_state = SESSION_STATE_TRANSPORT_CLOSING;
+ return;
+ }
+
s->session_state = SESSION_STATE_TRANSPORT_CLOSING;
app_wrk = app_worker_get (s->app_wrk_index);
app_worker_close_notify (app_wrk, s);
@@ -1225,6 +1234,11 @@ session_transport_reset_notify (transport_connection_t * tc)
svm_fifo_dequeue_drop_all (s->tx_fifo);
if (s->session_state >= SESSION_STATE_TRANSPORT_CLOSING)
return;
+ if (s->session_state == SESSION_STATE_ACCEPTING)
+ {
+ s->session_state = SESSION_STATE_TRANSPORT_CLOSING;
+ return;
+ }
s->session_state = SESSION_STATE_TRANSPORT_CLOSING;
app_wrk = app_worker_get (s->app_wrk_index);
app_worker_reset_notify (app_wrk, s);