aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/TLSOutStream.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'common/rdr/TLSOutStream.cxx')
-rw-r--r--common/rdr/TLSOutStream.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/common/rdr/TLSOutStream.cxx b/common/rdr/TLSOutStream.cxx
index 59edf150..888b455b 100644
--- a/common/rdr/TLSOutStream.cxx
+++ b/common/rdr/TLSOutStream.cxx
@@ -25,6 +25,7 @@
#include <rdr/Exception.h>
#include <rdr/TLSException.h>
#include <rdr/TLSOutStream.h>
+#include <errno.h>
#ifdef HAVE_GNUTLS
using namespace rdr;
@@ -35,8 +36,15 @@ ssize_t rdr::gnutls_OutStream_push(gnutls_transport_ptr str, const void* data,
size_t size)
{
OutStream* out = (OutStream*) str;
- out->writeBytes(data, size);
- out->flush();
+
+ try {
+ out->writeBytes(data, size);
+ out->flush();
+ } catch (Exception& e) {
+ gnutls_transport_set_global_errno(EINVAL);
+ return -1;
+ }
+
return size;
}