diff options
Diffstat (limited to 'common/rfb/CSecurityTLS.cxx')
-rw-r--r-- | common/rfb/CSecurityTLS.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/common/rfb/CSecurityTLS.cxx b/common/rfb/CSecurityTLS.cxx index bb7e3879..0c10a85d 100644 --- a/common/rfb/CSecurityTLS.cxx +++ b/common/rfb/CSecurityTLS.cxx @@ -85,6 +85,19 @@ CSecurityTLS::CSecurityTLS(CConnection* cc_, bool _anon) void CSecurityTLS::shutdown() { + if (tlsos) { + try { + if (tlsos->hasBufferedData()) { + tlsos->cork(false); + tlsos->flush(); + if (tlsos->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 (session) { int ret; // FIXME: We can't currently wait for the response, so we only send |