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/Client
parent9e6b127cf35319b0e89d4d6f4dff55a80ce03c02 (diff)
downloadswift-contrib-76978866497a7dd9be96edef5fa06f470a6b324f.zip
swift-contrib-76978866497a7dd9be96edef5fa06f470a6b324f.tar.bz2
Hoist ProxyProvider creation out of Client.
Diffstat (limited to 'Swiften/Client')
-rw-r--r--Swiften/Client/CoreClient.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/Swiften/Client/CoreClient.cpp b/Swiften/Client/CoreClient.cpp
index 2a66905..a8a5c8f 100644
--- a/Swiften/Client/CoreClient.cpp
+++ b/Swiften/Client/CoreClient.cpp
@@ -17,11 +17,11 @@
#include <Swiften/TLS/CertificateVerificationError.h>
#include <Swiften/Network/ChainedConnector.h>
#include <Swiften/Network/NetworkFactories.h>
+#include <Swiften/Network/ProxyProvider.h>
#include <Swiften/TLS/PKCS12Certificate.h>
#include <Swiften/Session/BasicSessionStream.h>
#include <Swiften/Queries/IQRouter.h>
#include <Swiften/Client/ClientSessionStanzaChannel.h>
-#include <Swiften/Network/PlatformProxyProvider.h>
#include <Swiften/Network/SOCKS5ProxiedConnectionFactory.h>
#include <Swiften/Network/HTTPConnectProxiedConnectionFactory.h>
@@ -62,12 +62,11 @@ void CoreClient::connect(const std::string& host) {
disconnectRequested_ = false;
assert(!connector_);
assert(proxyConnectionFactories.empty());
- PlatformProxyProvider proxyProvider;
- if(proxyProvider.getSOCKS5Proxy().isValid()) {
- proxyConnectionFactories.push_back(new SOCKS5ProxiedConnectionFactory(networkFactories->getConnectionFactory(), proxyProvider.getSOCKS5Proxy()));
+ if(networkFactories->getProxyProvider()->getSOCKS5Proxy().isValid()) {
+ proxyConnectionFactories.push_back(new SOCKS5ProxiedConnectionFactory(networkFactories->getConnectionFactory(), networkFactories->getProxyProvider()->getSOCKS5Proxy()));
}
- if(proxyProvider.getHTTPConnectProxy().isValid()) {
- proxyConnectionFactories.push_back(new HTTPConnectProxiedConnectionFactory(networkFactories->getConnectionFactory(), proxyProvider.getHTTPConnectProxy()));
+ if(networkFactories->getProxyProvider()->getHTTPConnectProxy().isValid()) {
+ proxyConnectionFactories.push_back(new HTTPConnectProxiedConnectionFactory(networkFactories->getConnectionFactory(), networkFactories->getProxyProvider()->getHTTPConnectProxy()));
}
std::vector<ConnectionFactory*> connectionFactories(proxyConnectionFactories);
connectionFactories.push_back(networkFactories->getConnectionFactory());