summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-03-23 11:54:03 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-03-23 11:54:03 (GMT)
commit846c4b9d2e7ec3214a3b13bdbbce77f70fede515 (patch)
tree579bf6be3e266c8e28a7469e7547ac88fa9af3fc /Swiften/TLS
parent8ccdfd958ba1e7afbeb8c5893c12f09046cb8892 (diff)
downloadswift-contrib-846c4b9d2e7ec3214a3b13bdbbce77f70fede515.zip
swift-contrib-846c4b9d2e7ec3214a3b13bdbbce77f70fede515.tar.bz2
Allow TLS errors to bubble further up the stackks/tlserrors
Diffstat (limited to 'Swiften/TLS')
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLContext.cpp6
-rw-r--r--Swiften/TLS/Schannel/SchannelContext.cpp2
-rw-r--r--Swiften/TLS/TLSContext.h3
3 files changed, 6 insertions, 5 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
index 54addef..8c03052 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
@@ -132,7 +132,7 @@ void OpenSSLContext::doConnect() {
break;
default:
state_ = Error;
- onError();
+ onError(boost::make_shared<TLSError>());
}
}
@@ -166,7 +166,7 @@ void OpenSSLContext::handleDataFromApplication(const SafeByteArray& data) {
}
else {
state_ = Error;
- onError();
+ onError(boost::make_shared<TLSError>());
}
}
@@ -182,7 +182,7 @@ void OpenSSLContext::sendPendingDataToApplication() {
}
if (ret < 0 && SSL_get_error(handle_, ret) != SSL_ERROR_WANT_READ) {
state_ = Error;
- onError();
+ onError(boost::make_shared<TLSError>());
}
}
diff --git a/Swiften/TLS/Schannel/SchannelContext.cpp b/Swiften/TLS/Schannel/SchannelContext.cpp
index 9be1ded..4f8f36f 100644
--- a/Swiften/TLS/Schannel/SchannelContext.cpp
+++ b/Swiften/TLS/Schannel/SchannelContext.cpp
@@ -473,7 +473,7 @@ void SchannelContext::indicateError()
{
m_state = Error;
m_receivedData.clear();
- onError();
+ onError(boost::make_shared<TLSError>());
}
//------------------------------------------------------------------------
diff --git a/Swiften/TLS/TLSContext.h b/Swiften/TLS/TLSContext.h
index 9dee902..5640fe1 100644
--- a/Swiften/TLS/TLSContext.h
+++ b/Swiften/TLS/TLSContext.h
@@ -13,6 +13,7 @@
#include <Swiften/TLS/Certificate.h>
#include <Swiften/TLS/CertificateWithKey.h>
#include <Swiften/TLS/CertificateVerificationError.h>
+#include <Swiften/TLS/TLSError.h>
namespace Swift {
@@ -35,7 +36,7 @@ namespace Swift {
public:
boost::signal<void (const SafeByteArray&)> onDataForNetwork;
boost::signal<void (const SafeByteArray&)> onDataForApplication;
- boost::signal<void ()> onError;
+ boost::signal<void (boost::shared_ptr<TLSError>)> onError;
boost::signal<void ()> onConnected;
};
}