diff options
author | Edwin Mons <edwin.mons@isode.com> | 2019-01-08 16:43:31 (GMT) |
---|---|---|
committer | Edwin Mons <edwin.mons@isode.com> | 2019-01-14 15:22:30 (GMT) |
commit | 6f6ad903d9e248f59bddedb3ab4cae41a7d8bec0 (patch) | |
tree | 0d02c381e515856a501b7589afd9c98e6b713ce2 /Swiften/TLS/TLSError.h | |
parent | 24ddcdb0a82cbd33deb5b72ad9f86f1c46fc9d13 (diff) | |
download | swift-6f6ad903d9e248f59bddedb3ab4cae41a7d8bec0.zip swift-6f6ad903d9e248f59bddedb3ab4cae41a7d8bec0.tar.bz2 |
Add optional message to TLSError
TLSError now takes an optional error message. OpenSSLContext has been
updated to send out one, and calls to SWIFT_LOG have been removed from
it for anything but setCertificateChain.
OpenSSLContext::handleDataFromApplication misinterpreted the return code
of SSL_write, triggering an onError in cases where more network I/O was
required.
Test-Information:
Unit tests pass on Debian 9
Server test code no longer emits undesirable warnings to stderr on macOS
10.14.
Change-Id: If0f932693361ef9738ae50d5445bfb4d3ed9b28f
Diffstat (limited to 'Swiften/TLS/TLSError.h')
-rw-r--r-- | Swiften/TLS/TLSError.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Swiften/TLS/TLSError.h b/Swiften/TLS/TLSError.h index ae775e6..9e4af2f 100644 --- a/Swiften/TLS/TLSError.h +++ b/Swiften/TLS/TLSError.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2016 Isode Limited. + * Copyright (c) 2012-2019 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ @@ -7,6 +7,7 @@ #pragma once #include <memory> +#include <string> #include <Swiften/Base/API.h> #include <Swiften/Base/Error.h> @@ -18,16 +19,23 @@ namespace Swift { enum Type { UnknownError, - CertificateCardRemoved + CertificateCardRemoved, + AcceptFailed, + ConnectFailed }; - TLSError(Type type = UnknownError) : type(type) {} + TLSError(Type type = UnknownError, std::string message = "") : type_(type), message_(std::move(message)) {} Type getType() const { - return type; + return type_; + } + + const std::string& getMessage() const { + return message_; } private: - Type type; + Type type_; + std::string message_; }; } |