From c1f2778cf47353e046741d11bd2b383f775b142d Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Wed, 21 Jul 2021 17:07:32 +0700 Subject: Simplify HandleClose --- crypto/src/tls/TlsProtocol.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crypto/src/tls/TlsProtocol.cs b/crypto/src/tls/TlsProtocol.cs index db30f6b40..317b6b193 100644 --- a/crypto/src/tls/TlsProtocol.cs +++ b/crypto/src/tls/TlsProtocol.cs @@ -259,18 +259,18 @@ namespace Org.BouncyCastle.Tls { this.m_closed = true; - if (user_canceled && !m_appDataReady) - { - RaiseAlertWarning(AlertDescription.user_canceled, "User canceled handshake"); - } - - RaiseAlertWarning(AlertDescription.close_notify, "Connection closed"); - if (!m_appDataReady) { CleanupHandshake(); + + if (user_canceled) + { + RaiseAlertWarning(AlertDescription.user_canceled, "User canceled handshake"); + } } + RaiseAlertWarning(AlertDescription.close_notify, "Connection closed"); + CloseConnection(); } } -- cgit 1.4.1