summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-10-16 08:16:56 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-10-16 08:16:56 (GMT)
commit76978866497a7dd9be96edef5fa06f470a6b324f (patch)
treef5fb6b922b0e3ba974f6d67640f0b4d195ed96cd /Swiften/Network
parent9e6b127cf35319b0e89d4d6f4dff55a80ce03c02 (diff)
downloadswift-contrib-76978866497a7dd9be96edef5fa06f470a6b324f.zip
swift-contrib-76978866497a7dd9be96edef5fa06f470a6b324f.tar.bz2
Hoist ProxyProvider creation out of Client.
Diffstat (limited to 'Swiften/Network')
-rw-r--r--Swiften/Network/BoostNetworkFactories.cpp11
-rw-r--r--Swiften/Network/BoostNetworkFactories.h5
-rw-r--r--Swiften/Network/NetworkFactories.h2
3 files changed, 14 insertions, 4 deletions
diff --git a/Swiften/Network/BoostNetworkFactories.cpp b/Swiften/Network/BoostNetworkFactories.cpp
index 030fd49..2b4c04b 100644
--- a/Swiften/Network/BoostNetworkFactories.cpp
+++ b/Swiften/Network/BoostNetworkFactories.cpp
@@ -13,6 +13,7 @@
#include <Swiften/Parser/PlatformXMLParserFactory.h>
#include <Swiften/Network/NullNATTraverser.h>
#include <Swiften/TLS/PlatformTLSFactories.h>
+#include <Swiften/Network/PlatformProxyProvider.h>
namespace Swift {
@@ -28,13 +29,11 @@ BoostNetworkFactories::BoostNetworkFactories(EventLoop* eventLoop) {
#endif
xmlParserFactory = new PlatformXMLParserFactory();
tlsFactories = new PlatformTLSFactories();
-}
-
-TLSContextFactory* BoostNetworkFactories::getTLSContextFactory() const {
- return tlsFactories->getTLSContextFactory();
+ proxyProvider = new PlatformProxyProvider();
}
BoostNetworkFactories::~BoostNetworkFactories() {
+ delete proxyProvider;
delete tlsFactories;
delete xmlParserFactory;
delete natTraverser;
@@ -44,4 +43,8 @@ BoostNetworkFactories::~BoostNetworkFactories() {
delete timerFactory;
}
+TLSContextFactory* BoostNetworkFactories::getTLSContextFactory() const {
+ return tlsFactories->getTLSContextFactory();
+}
+
}
diff --git a/Swiften/Network/BoostNetworkFactories.h b/Swiften/Network/BoostNetworkFactories.h
index 8f2b17a..3d268d1 100644
--- a/Swiften/Network/BoostNetworkFactories.h
+++ b/Swiften/Network/BoostNetworkFactories.h
@@ -49,6 +49,10 @@ namespace Swift {
virtual TLSContextFactory* getTLSContextFactory() const;
+ virtual ProxyProvider* getProxyProvider() const {
+ return proxyProvider;
+ }
+
private:
BoostIOServiceThread ioServiceThread;
TimerFactory* timerFactory;
@@ -58,5 +62,6 @@ namespace Swift {
NATTraverser* natTraverser;
XMLParserFactory* xmlParserFactory;
PlatformTLSFactories* tlsFactories;
+ ProxyProvider* proxyProvider;
};
}
diff --git a/Swiften/Network/NetworkFactories.h b/Swiften/Network/NetworkFactories.h
index 2404460..6eba2f3 100644
--- a/Swiften/Network/NetworkFactories.h
+++ b/Swiften/Network/NetworkFactories.h
@@ -15,6 +15,7 @@ namespace Swift {
class XMLParserFactory;
class TLSContextFactory;
class CertificateFactory;
+ class ProxyProvider;
/**
* An interface collecting network factories.
@@ -30,5 +31,6 @@ namespace Swift {
virtual NATTraverser* getNATTraverser() const = 0;
virtual XMLParserFactory* getXMLParserFactory() const = 0;
virtual TLSContextFactory* getTLSContextFactory() const = 0;
+ virtual ProxyProvider* getProxyProvider() const = 0;
};
}