diff options
-rw-r--r-- | common/rdr/TLSInStream.cxx | 7 | ||||
-rw-r--r-- | common/rdr/TLSOutStream.cxx | 4 |
2 files changed, 10 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; } diff --git a/common/rdr/TLSOutStream.cxx b/common/rdr/TLSOutStream.cxx index 7d59a9c7..a883fe89 100644 --- a/common/rdr/TLSOutStream.cxx +++ b/common/rdr/TLSOutStream.cxx @@ -25,11 +25,14 @@ #include <rdr/Exception.h> #include <rdr/TLSException.h> #include <rdr/TLSOutStream.h> +#include <rfb/LogWriter.h> #include <errno.h> #ifdef HAVE_GNUTLS using namespace rdr; +static rfb::LogWriter vlog("TLSOutStream"); + enum { DEFAULT_BUF_SIZE = 16384 }; ssize_t TLSOutStream::push(gnutls_transport_ptr_t str, const void* data, @@ -42,6 +45,7 @@ ssize_t TLSOutStream::push(gnutls_transport_ptr_t str, const void* data, out->writeBytes(data, size); out->flush(); } catch (Exception& e) { + vlog.error("Failure sending TLS data: %s", e.str()); gnutls_transport_set_errno(self->session, EINVAL); return -1; } |