From b6c9d9a880f6f1a6908a3c62dfccdce3e68dad80 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 10 Sep 2014 08:47:19 +0200 Subject: ICE-5582 (SOCKs test), ICE-5314 (HTTP proxies), major refactoring of networking code (addition of StreamSocket class abstraction) --- cpp/src/Ice/Instance.cpp | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'cpp/src/Ice/Instance.cpp') diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 2bf9555f237..01c9d6d6b06 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -1203,21 +1204,8 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi _proxyFactory = new ProxyFactory(this); - string proxyHost = _initData.properties->getProperty("Ice.SOCKSProxyHost"); - int defaultIPv6 = 1; // IPv6 enabled by default. - if(!proxyHost.empty()) - { -#ifdef ICE_OS_WINRT - throw InitializationException(__FILE__, __LINE__, "SOCKS proxy not supported in WinRT"); -#else - int proxyPort = _initData.properties->getPropertyAsIntWithDefault("Ice.SOCKSProxyPort", 1080); - _networkProxy = new SOCKSNetworkProxy(proxyHost, proxyPort); - defaultIPv6 = 0; // IPv6 is not supported with SOCKS -#endif - } - bool ipv4 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv4", 1) > 0; - bool ipv6 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv6", defaultIPv6) > 0; + bool ipv6 = _initData.properties->getPropertyAsIntWithDefault("Ice.IPv6", 1) > 0; if(!ipv4 && !ipv6) { throw InitializationException(__FILE__, __LINE__, "Both IPV4 and IPv6 support cannot be disabled."); @@ -1236,12 +1224,7 @@ IceInternal::Instance::Instance(const CommunicatorPtr& communicator, const Initi } _preferIPv6 = _initData.properties->getPropertyAsInt("Ice.PreferIPv6Address") > 0; -#ifndef ICE_OS_WINRT - if(ipv6 && SOCKSNetworkProxyPtr::dynamicCast(_networkProxy)) - { - throw InitializationException(__FILE__, __LINE__, "IPv6 is not supported with SOCKS4 proxies"); - } -#endif + _networkProxy = IceInternal::createNetworkProxy(_initData.properties, _protocolSupport); _endpointFactoryManager = new EndpointFactoryManager(this); #ifndef ICE_OS_WINRT -- cgit v1.2.3