aboutsummaryrefslogtreecommitdiffstats
path: root/common/rdr/TLSInStream.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2021-06-10 16:31:24 +0200
committerPierre Ossman <ossman@cendio.se>2021-06-11 09:42:44 +0200
commitaa224673e44ba1346884b48e621dd1c8987c6828 (patch)
tree63b9646ff5679d6f093be2fb7578bfd68a8c4624 /common/rdr/TLSInStream.cxx
parent1b00e9972268f854a6b41be490f311b6e43746b4 (diff)
downloadtigervnc-aa224673e44ba1346884b48e621dd1c8987c6828.tar.gz
tigervnc-aa224673e44ba1346884b48e621dd1c8987c6828.zip
Propagate errno to GnuTLS
Give GnuTLS the correct errno from deeper layers, in the cases where we know it. In most cases GnuTLS doesn't care, but just in case...
Diffstat (limited to 'common/rdr/TLSInStream.cxx')
-rw-r--r--common/rdr/TLSInStream.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/common/rdr/TLSInStream.cxx b/common/rdr/TLSInStream.cxx
index 2339956d..e6c9c906 100644
--- a/common/rdr/TLSInStream.cxx
+++ b/common/rdr/TLSInStream.cxx
@@ -1,6 +1,7 @@
/* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved.
* Copyright (C) 2005 Martin Koegler
* Copyright (C) 2010 TigerVNC Team
+ * Copyright (C) 2012-2021 Pierre Ossman for Cendio AB
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -50,6 +51,10 @@ ssize_t TLSInStream::pull(gnutls_transport_ptr_t str, void* data, size_t size)
in->readBytes(data, size);
} catch (EndOfStream&) {
return 0;
+ } catch (SystemException &e) {
+ vlog.error("Failure reading TLS data: %s", e.str());
+ gnutls_transport_set_errno(self->session, e.err);
+ return -1;
} catch (Exception& e) {
vlog.error("Failure reading TLS data: %s", e.str());
gnutls_transport_set_errno(self->session, EINVAL);