summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-04-19 09:20:46 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-04-19 12:33:41 (GMT)
commit32444b8b7cff886e79579891a82bf70aab6f207a (patch)
treef9d6f6f08ae766183ba29a06115142019d6213a0 /Swiften/Network/MacOSXProxyProvider.cpp
parent8ec81c322186e7ac0f053061ee61d5e371417efb (diff)
downloadswift-32444b8b7cff886e79579891a82bf70aab6f207a.zip
swift-32444b8b7cff886e79579891a82bf70aab6f207a.tar.bz2
Fixed OS X ProxyProvider compilation.
Diffstat (limited to 'Swiften/Network/MacOSXProxyProvider.cpp')
-rw-r--r--Swiften/Network/MacOSXProxyProvider.cpp55
1 files changed, 34 insertions, 21 deletions
diff --git a/Swiften/Network/MacOSXProxyProvider.cpp b/Swiften/Network/MacOSXProxyProvider.cpp
index babcc7f..cd994e1 100644
--- a/Swiften/Network/MacOSXProxyProvider.cpp
+++ b/Swiften/Network/MacOSXProxyProvider.cpp
@@ -4,35 +4,21 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+#include <Swiften/Base/Platform.h>
+#include <Swiften/Network/MacOSXProxyProvider.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <utility>
-#include "Swiften/Network/MacOSXProxyProvider.h"
+#ifdef SWIFTEN_PLATFORM_IPHONE
#include <SystemConfiguration/SystemConfiguration.h>
+#endif
-namespace Swift {
-
-MacOSXProxyProvider::MacOSXProxyProvider()
-: ProxyProvider()
-{
- CFDictionaryRef proxies = SCDynamicStoreCopyProxies(NULL);
- if(proxies != NULL) {
- socksProxy = getFromDictionary(proxies, kSCPropNetProxiesSOCKSEnable, kSCPropNetProxiesSOCKSProxy, kSCPropNetProxiesSOCKSPort);
- httpProxy = getFromDictionary(proxies, kSCPropNetProxiesHTTPEnable, kSCPropNetProxiesHTTPProxy, kSCPropNetProxiesHTTPPort);
- }
-}
-
-HostAddressPort MacOSXProxyProvider::getHTTPConnectProxy() const {
- return httpProxy;
-}
-HostAddressPort MacOSXProxyProvider::getSOCKS5Proxy() const {
- return socksProxy;
-}
-
-HostAddressPort MacOSXProxyProvider::getFromDictionary(CFDictionaryRef dict, CFStringRef enabledKey, CFStringRef hostKey, CFStringRef portKey) {
+#ifndef SWIFTEN_PLATFORM_IPHONE
+static HostAddressPort getFromDictionary(CFDictionaryRef dict, CFStringRef enabledKey, CFStringRef hostKey, CFStringRef portKey) {
CFNumberRef numberValue = NULL;
HostAddressPort ret = HostAddressPort(HostAddress(), 0);
@@ -79,5 +65,32 @@ HostAddressPort MacOSXProxyProvider::getFromDictionary(CFDictionaryRef dict, CFS
}
return ret;
}
+#endif
+namespace Swift {
+
+MacOSXProxyProvider::MacOSXProxyProvider() {
+}
+
+HostAddressPort MacOSXProxyProvider::getHTTPConnectProxy() const {
+ HostAddressPort result;
+#ifndef SWIFTEN_PLATFORM_IPHONE
+ CFDictionaryRef proxies = SCDynamicStoreCopyProxies(NULL);
+ if(proxies != NULL) {
+ result = getFromDictionary(proxies, kSCPropNetProxiesHTTPEnable, kSCPropNetProxiesHTTPProxy, kSCPropNetProxiesHTTPPort);
+ }
+#endif
+ return result;
+}
+
+HostAddressPort MacOSXProxyProvider::getSOCKS5Proxy() const {
+ HostAddressPort result;
+#ifndef SWIFTEN_PLATFORM_IPHONE
+ CFDictionaryRef proxies = SCDynamicStoreCopyProxies(NULL);
+ if(proxies != NULL) {
+ result = getFromDictionary(proxies, kSCPropNetProxiesSOCKSEnable, kSCPropNetProxiesSOCKSProxy, kSCPropNetProxiesSOCKSPort);
+ }
+#endif
+ return result;
+}
}