tls: ssl close only after all data drained

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: Ia77b26db61b6f58b4ff659f09192b4ea93ed50b4
This commit is contained in:
Florin Coras
2022-01-10 09:15:41 -08:00
committed by Dave Barach
parent 30d46e7455
commit 0cef5f5d71

View File

@ -363,6 +363,8 @@ openssl_ctx_handshake_rx (tls_ctx_t * ctx, session_t * tls_session)
static void
openssl_confirm_app_close (tls_ctx_t * ctx)
{
openssl_ctx_t *oc = (openssl_ctx_t *) ctx;
SSL_shutdown (oc->ssl);
tls_disconnect_transport (ctx);
session_transport_closed_notify (&ctx->connection);
}
@ -931,8 +933,6 @@ openssl_app_close (tls_ctx_t * ctx)
openssl_ctx_t *oc = (openssl_ctx_t *) ctx;
session_t *app_session;
SSL_shutdown (oc->ssl);
/* Wait for all data to be written to tcp */
app_session = session_get_from_handle (ctx->app_session_handle);
if (BIO_ctrl_pending (oc->rbio) <= 0