aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/SSecurityRSAAES.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb/SSecurityRSAAES.cxx')
-rw-r--r--common/rfb/SSecurityRSAAES.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/rfb/SSecurityRSAAES.cxx b/common/rfb/SSecurityRSAAES.cxx
index 39b286de..fed213ad 100644
--- a/common/rfb/SSecurityRSAAES.cxx
+++ b/common/rfb/SSecurityRSAAES.cxx
@@ -74,6 +74,8 @@ BoolParameter SSecurityRSAAES::requireUsername
("RequireUsername", "Require username for the RSA-AES security types",
false, ConfServer);
+static LogWriter vlog("CSecurityRSAAES");
+
SSecurityRSAAES::SSecurityRSAAES(SConnection* sc_, uint32_t _secType,
int _keySize, bool _isAllEncrypted)
: SSecurity(sc_), state(SendPublicKey),
@@ -94,6 +96,19 @@ SSecurityRSAAES::~SSecurityRSAAES()
void SSecurityRSAAES::cleanup()
{
+ if (raos) {
+ try {
+ if (raos->hasBufferedData()) {
+ raos->cork(false);
+ raos->flush();
+ if (raos->hasBufferedData())
+ vlog.error("Failed to flush remaining socket data on close");
+ }
+ } catch (std::exception& e) {
+ vlog.error("Failed to flush remaining socket data on close: %s", e.what());
+ }
+ }
+
if (serverKeyN)
delete[] serverKeyN;
if (serverKeyE)