summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2020-04-24 23:00:11 +0000
committerDave Barach <openvpp@barachs.net>2020-04-25 11:40:25 +0000
commit36d49391aadeb10b9f3626b62c5c019c4fddf5ed (patch)
tree9280b80a3769104f5ab3e8422428190a640c3352 /src/vcl
parent5e6222a0332e38316b5a58b23c35cca69bb72025 (diff)
session vcl: propagate transport cleanup notifications
Type: improvement Can be used to force app to close a connection on which it still waits for data. Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I7c3a8245cbbc23728e4408feb63a659a11f718ed
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vppcom.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index a8cebd8c413..0382af45544 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -749,6 +749,17 @@ vcl_session_cleanup_handler (vcl_worker_t * wrk, void *data)
return;
}
+ if (msg->type == SESSION_CLEANUP_TRANSPORT)
+ {
+ /* Transport was cleaned up before we confirmed close. Probably the
+ * app is still waiting for some data that cannot be delivered.
+ * Confirm close to make sure everything is cleaned up */
+ if (session->session_state == STATE_VPP_CLOSING)
+ vcl_session_cleanup (wrk, session, vcl_session_handle (session),
+ 1 /* do_disconnect */ );
+ return;
+ }
+
vcl_session_table_del_vpp_handle (wrk, msg->handle);
/* Should not happen. App did not close the connection so don't free it. */
if (session->session_state != STATE_CLOSED)