diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-10-16 08:09:03 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-10-16 08:09:03 (GMT) |
commit | 9e6b127cf35319b0e89d4d6f4dff55a80ce03c02 (patch) | |
tree | 82bc0006bf3d5648ed813d9ddcfc01c1ef404f46 /Swiften/Network | |
parent | 3a60cfec978c512c7b4bbe6c04a0ca3fbdf1e51e (diff) | |
download | swift-contrib-9e6b127cf35319b0e89d4d6f4dff55a80ce03c02.zip swift-contrib-9e6b127cf35319b0e89d4d6f4dff55a80ce03c02.tar.bz2 |
Hoist TLSContextFactory creation out of Client.
Diffstat (limited to 'Swiften/Network')
-rw-r--r-- | Swiften/Network/BoostNetworkFactories.cpp | 7 | ||||
-rw-r--r-- | Swiften/Network/BoostNetworkFactories.h | 4 | ||||
-rw-r--r-- | Swiften/Network/NetworkFactories.h | 3 |
3 files changed, 14 insertions, 0 deletions
diff --git a/Swiften/Network/BoostNetworkFactories.cpp b/Swiften/Network/BoostNetworkFactories.cpp index 56be2b7..030fd49 100644 --- a/Swiften/Network/BoostNetworkFactories.cpp +++ b/Swiften/Network/BoostNetworkFactories.cpp @@ -12,6 +12,7 @@ #include <Swiften/Network/PlatformNATTraversalWorker.h> #include <Swiften/Parser/PlatformXMLParserFactory.h> #include <Swiften/Network/NullNATTraverser.h> +#include <Swiften/TLS/PlatformTLSFactories.h> namespace Swift { @@ -26,9 +27,15 @@ BoostNetworkFactories::BoostNetworkFactories(EventLoop* eventLoop) { natTraverser = new NullNATTraverser(eventLoop); #endif xmlParserFactory = new PlatformXMLParserFactory(); + tlsFactories = new PlatformTLSFactories(); +} + +TLSContextFactory* BoostNetworkFactories::getTLSContextFactory() const { + return tlsFactories->getTLSContextFactory(); } BoostNetworkFactories::~BoostNetworkFactories() { + delete tlsFactories; delete xmlParserFactory; delete natTraverser; delete connectionServerFactory; diff --git a/Swiften/Network/BoostNetworkFactories.h b/Swiften/Network/BoostNetworkFactories.h index c9ecb59..8f2b17a 100644 --- a/Swiften/Network/BoostNetworkFactories.h +++ b/Swiften/Network/BoostNetworkFactories.h @@ -12,6 +12,7 @@ namespace Swift { class EventLoop; class NATTraverser; + class PlatformTLSFactories; class BoostNetworkFactories : public NetworkFactories { public: @@ -46,6 +47,8 @@ namespace Swift { return xmlParserFactory; } + virtual TLSContextFactory* getTLSContextFactory() const; + private: BoostIOServiceThread ioServiceThread; TimerFactory* timerFactory; @@ -54,5 +57,6 @@ namespace Swift { ConnectionServerFactory* connectionServerFactory; NATTraverser* natTraverser; XMLParserFactory* xmlParserFactory; + PlatformTLSFactories* tlsFactories; }; } diff --git a/Swiften/Network/NetworkFactories.h b/Swiften/Network/NetworkFactories.h index 42c9f6a..2404460 100644 --- a/Swiften/Network/NetworkFactories.h +++ b/Swiften/Network/NetworkFactories.h @@ -13,6 +13,8 @@ namespace Swift { class ConnectionServerFactory; class NATTraverser; class XMLParserFactory; + class TLSContextFactory; + class CertificateFactory; /** * An interface collecting network factories. @@ -27,5 +29,6 @@ namespace Swift { virtual ConnectionServerFactory* getConnectionServerFactory() const = 0; virtual NATTraverser* getNATTraverser() const = 0; virtual XMLParserFactory* getXMLParserFactory() const = 0; + virtual TLSContextFactory* getTLSContextFactory() const = 0; }; } |