aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vcl/vppcom.c41
1 files changed, 36 insertions, 5 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 6bdeb5a0db2..4b2f1f15fbe 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -2447,10 +2447,24 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
vcl_session_add_want_deq_ntf (s, SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL);
break;
case SESSION_CTRL_EVT_DISCONNECTED:
- disconnected_msg = (session_disconnected_msg_t *) e->data;
- s = vcl_session_disconnected_handler (wrk, disconnected_msg);
- if (!s)
- break;
+ if (!e->postponed)
+ {
+ disconnected_msg = (session_disconnected_msg_t *) e->data;
+ s = vcl_session_disconnected_handler (wrk, disconnected_msg);
+ if (!s)
+ break;
+ }
+ else
+ {
+ s = vcl_session_get (wrk, e->session_index);
+ s->flags &= ~VCL_SESSION_F_PENDING_DISCONNECT;
+ }
+ if (vcl_session_is_closed (s))
+ {
+ if (s && (s->flags & VCL_SESSION_F_PENDING_FREE))
+ vcl_session_free (wrk, s);
+ break;
+ }
sid = s->session_index;
if (sid < n_bits && except_map)
{
@@ -2459,7 +2473,24 @@ vcl_select_handle_mq_event (vcl_worker_t * wrk, session_event_t * e,
}
break;
case SESSION_CTRL_EVT_RESET:
- sid = vcl_session_reset_handler (wrk, (session_reset_msg_t *) e->data);
+ if (!e->postponed)
+ {
+ sid =
+ vcl_session_reset_handler (wrk, (session_reset_msg_t *) e->data);
+ s = vcl_session_get (wrk, sid);
+ }
+ else
+ {
+ sid = e->session_index;
+ s = vcl_session_get (wrk, sid);
+ s->flags &= ~VCL_SESSION_F_PENDING_DISCONNECT;
+ }
+ if (vcl_session_is_closed (s))
+ {
+ if (s && (s->flags & VCL_SESSION_F_PENDING_FREE))
+ vcl_session_free (wrk, s);
+ break;
+ }
if (sid < n_bits && except_map)
{
clib_bitmap_set_no_check ((uword *) except_map, sid, 1);