diff options
| author | Tobias Markmann <tm@ayena.de> | 2018-07-28 11:45:35 (GMT) |
|---|---|---|
| committer | Tobias Markmann <tm@ayena.de> | 2018-07-30 13:27:15 (GMT) |
| commit | 798f8ec3331043a92f6ca3bc810b9477c3f8261e (patch) | |
| tree | 868bde2ddcbad1a66d4256edd6050f486860eb2b /Swiften/TLS/TLSContextFactory.h | |
| parent | 48596613cfe0f45c0916beabbcc3a27e01752c4b (diff) | |
| download | swift-798f8ec3331043a92f6ca3bc810b9477c3f8261e.zip swift-798f8ec3331043a92f6ca3bc810b9477c3f8261e.tar.bz2 | |
Use std::unique_ptr to have TLS classes own the TLSContext
TLSLayer and TLSConnection now own the TLSContext they use.
The TLSContextFactory interface is adjusted to use
std::unique_ptr.
Test-Information:
Builds and all tests pass on macOS with clang-7-master.
Change-Id: I14e33c98b48445094f404b73ea41af0a51d2dde6
Diffstat (limited to 'Swiften/TLS/TLSContextFactory.h')
| -rw-r--r-- | Swiften/TLS/TLSContextFactory.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Swiften/TLS/TLSContextFactory.h b/Swiften/TLS/TLSContextFactory.h index 9da3392..5f70541 100644 --- a/Swiften/TLS/TLSContextFactory.h +++ b/Swiften/TLS/TLSContextFactory.h @@ -3,25 +3,27 @@ * All rights reserved. * See the COPYING file for more information. */ #pragma once +#include <memory> + #include <Swiften/Base/API.h> #include <Swiften/Base/ByteArray.h> #include <Swiften/TLS/TLSContext.h> #include <Swiften/TLS/TLSOptions.h> namespace Swift { class SWIFTEN_API TLSContextFactory { public: virtual ~TLSContextFactory(); virtual bool canCreate() const = 0; - virtual TLSContext* createTLSContext(const TLSOptions& tlsOptions, TLSContext::Mode = TLSContext::Mode::Client) = 0; + virtual std::unique_ptr<TLSContext> createTLSContext(const TLSOptions& tlsOptions, TLSContext::Mode = TLSContext::Mode::Client) = 0; virtual void setCheckCertificateRevocation(bool b) = 0; virtual void setDisconnectOnCardRemoval(bool b) = 0; virtual ByteArray convertDHParametersFromPEMToDER(const std::string& pem); }; } |
Swift