diff options
author | Florin Coras <fcoras@cisco.com> | 2019-07-08 13:00:00 -0700 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2019-07-08 13:15:24 -0700 |
commit | aaff5eefb1dddf3ea71e3258b362d6516350303e (patch) | |
tree | b19fa5a291d5eb9651576e60d09133f921ff3bec /src/vcl/vppcom.c | |
parent | 888640a398f974cf388bdc983d10e78591275b37 (diff) |
vcl: cleanup listener accept fifo
Type: fix
Change-Id: Ic470d429f4bf1924185f720d66efe06f4727bcbd
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r-- | src/vcl/vppcom.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index 9a351d8aca6..3d08d395a27 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -822,13 +822,27 @@ static int vppcom_session_unbind (u32 session_handle) { vcl_worker_t *wrk = vcl_worker_get_current (); + session_accepted_msg_t *accepted_msg; vcl_session_t *session = 0; + vcl_session_msg_t *evt; u64 vpp_handle; session = vcl_session_get_w_handle (wrk, session_handle); if (!session) return VPPCOM_EBADFD; + /* Flush pending accept events, if any */ + while (clib_fifo_elts (session->accept_evts_fifo)) + { + clib_fifo_sub2 (session->accept_evts_fifo, evt); + accepted_msg = &evt->accepted_msg; + vcl_session_table_del_vpp_handle (wrk, accepted_msg->handle); + vcl_send_session_accepted_reply (session->vpp_evt_q, + accepted_msg->context, + session->vpp_handle, -1); + } + clib_fifo_free (session->accept_evts_fifo); + vpp_handle = session->vpp_handle; session->vpp_handle = ~0; session->session_state = STATE_DISCONNECT; |