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
diff --git a/src/vnet/tls/tls.c b/src/vnet/tls/tls.c
index 89dbd36..1af0857 100644
--- a/src/vnet/tls/tls.c
+++ b/src/vnet/tls/tls.c
@@ -518,7 +518,12 @@
   tls_ctx_t *ctx;
 
   if (ntf == SESSION_CLEANUP_TRANSPORT)
-    return;
+    {
+      /* Allow cleanup of tcp session */
+      if (s->session_state == SESSION_STATE_TRANSPORT_DELETED)
+	session_close (s);
+      return;
+    }
 
   ctx = tls_ctx_get (s->opaque);
   if (!ctx->no_app_session)