From 989c3c8fbd46ca0a8d9f6d6be3008e1285f3155e Mon Sep 17 00:00:00 2001 From: Simon Zhang Date: Tue, 14 Jan 2020 18:11:18 +0800 Subject: tls: add picotls session close process Type: fix Signed-off-by: Simon Zhang Change-Id: If0a1691c1435f2826c8c83f8bc52e4cd3ecc6256 --- src/plugins/tlspicotls/tls_picotls.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/tlspicotls/tls_picotls.c b/src/plugins/tlspicotls/tls_picotls.c index 7f1979422fe..d475e9cf71d 100644 --- a/src/plugins/tlspicotls/tls_picotls.c +++ b/src/plugins/tlspicotls/tls_picotls.c @@ -206,7 +206,13 @@ picotls_transport_close (tls_ctx_t * ctx) static int picotls_app_close (tls_ctx_t * ctx) { - picotls_confirm_app_close (ctx); + session_t *app_session; + + app_session = session_get_from_handle (ctx->app_session_handle); + if (!svm_fifo_max_dequeue_cons (app_session->tx_fifo)) + picotls_confirm_app_close (ctx); + else + ctx->app_closed = 1; return 0; } @@ -492,6 +498,9 @@ picotls_ctx_write (tls_ctx_t * ctx, session_t * app_session) tls_add_vpp_q_tx_evt (tls_session); tls_add_vpp_q_builtin_tx_evt (app_session); + if (ctx->app_closed) + picotls_app_close (ctx); + return 0; } -- cgit 1.2.3-korg