diff options
author | Pierre Ossman <ossman@cendio.se> | 2020-05-20 20:03:11 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-05-21 11:34:22 +0200 |
commit | f4fdc13f37f7ae67b2ba110c24366f84e1e70734 (patch) | |
tree | d5095da09e96b70f0628905f2db8f256315e332c /common/rdr/TLSInStream.cxx | |
parent | 9f623551a7eebfa5d9fa6cc2d369d4b3041fc89d (diff) | |
download | tigervnc-f4fdc13f37f7ae67b2ba110c24366f84e1e70734.tar.gz tigervnc-f4fdc13f37f7ae67b2ba110c24366f84e1e70734.zip |
Log I/O errors from TLS streams
Diffstat (limited to 'common/rdr/TLSInStream.cxx')
-rw-r--r-- | common/rdr/TLSInStream.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/common/rdr/TLSInStream.cxx b/common/rdr/TLSInStream.cxx index 70303db0..ba20e752 100644 --- a/common/rdr/TLSInStream.cxx +++ b/common/rdr/TLSInStream.cxx @@ -25,11 +25,14 @@ #include <rdr/Exception.h> #include <rdr/TLSException.h> #include <rdr/TLSInStream.h> +#include <rfb/LogWriter.h> #include <errno.h> #ifdef HAVE_GNUTLS using namespace rdr; +static rfb::LogWriter vlog("TLSInStream"); + ssize_t TLSInStream::pull(gnutls_transport_ptr_t str, void* data, size_t size) { TLSInStream* self= (TLSInStream*) str; @@ -45,8 +48,10 @@ ssize_t TLSInStream::pull(gnutls_transport_ptr_t str, void* data, size_t size) size = in->avail(); in->readBytes(data, size); - + } catch (EndOfStream&) { + return 0; } catch (Exception& e) { + vlog.error("Failure reading TLS data: %s", e.str()); gnutls_transport_set_errno(self->session, EINVAL); return -1; } |