aboutsummaryrefslogtreecommitdiffstats
path: root/common/rfb/CSecurityRSAAES.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/rfb/CSecurityRSAAES.cxx')
-rw-r--r--common/rfb/CSecurityRSAAES.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/common/rfb/CSecurityRSAAES.cxx b/common/rfb/CSecurityRSAAES.cxx
index 56e1d702..0985d0f2 100644
--- a/common/rfb/CSecurityRSAAES.cxx
+++ b/common/rfb/CSecurityRSAAES.cxx
@@ -55,6 +55,8 @@ const int MaxKeyLength = 8192;
using namespace rfb;
+static LogWriter vlog("CSecurityRSAAES");
+
CSecurityRSAAES::CSecurityRSAAES(CConnection* cc_, uint32_t _secType,
int _keySize, bool _isAllEncrypted)
: CSecurity(cc_), state(ReadPublicKey),
@@ -74,6 +76,19 @@ CSecurityRSAAES::~CSecurityRSAAES()
void CSecurityRSAAES::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)