diff options
Diffstat (limited to 'Swiften/Network/UnixProxyProvider.cpp')
-rw-r--r-- | Swiften/Network/UnixProxyProvider.cpp | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/Swiften/Network/UnixProxyProvider.cpp b/Swiften/Network/UnixProxyProvider.cpp index 4ca9311..e6afa3d 100644 --- a/Swiften/Network/UnixProxyProvider.cpp +++ b/Swiften/Network/UnixProxyProvider.cpp @@ -4,12 +4,14 @@ * See Documentation/Licenses/BSD-simplified.txt for more information. */ -#include <stdio.h> -#include <stdlib.h> -#include <iostream> +/* + * Copyright (c) 2016 Isode Limited. + * All rights reserved. + * See the COPYING file for more information. + */ -#include <Swiften/Base/foreach.h> #include <Swiften/Network/UnixProxyProvider.h> + #if defined(HAVE_GCONF) # include "Swiften/Network/GConfProxyProvider.h" #endif @@ -17,48 +19,48 @@ namespace Swift { UnixProxyProvider::UnixProxyProvider() : - gconfProxyProvider(0), - environmentProxyProvider() + gconfProxyProvider(nullptr), + environmentProxyProvider() { #if defined(HAVE_GCONF) - gconfProxyProvider = new GConfProxyProvider(); + gconfProxyProvider = new GConfProxyProvider(); #endif } UnixProxyProvider::~UnixProxyProvider() { #if defined(HAVE_GCONF) - delete gconfProxyProvider; + delete gconfProxyProvider; #endif } HostAddressPort UnixProxyProvider::getSOCKS5Proxy() const { - HostAddressPort proxy; + HostAddressPort proxy; #if defined(HAVE_GCONF) - proxy = gconfProxyProvider->getSOCKS5Proxy(); - if(proxy.isValid()) { - return proxy; - } + proxy = gconfProxyProvider->getSOCKS5Proxy(); + if(proxy.isValid()) { + return proxy; + } #endif - proxy = environmentProxyProvider.getSOCKS5Proxy(); - if(proxy.isValid()) { - return proxy; - } - return HostAddressPort(HostAddress(), 0); + proxy = environmentProxyProvider.getSOCKS5Proxy(); + if(proxy.isValid()) { + return proxy; + } + return HostAddressPort(HostAddress(), 0); } HostAddressPort UnixProxyProvider::getHTTPConnectProxy() const { - HostAddressPort proxy; + HostAddressPort proxy; #if defined(HAVE_GCONF) - proxy = gconfProxyProvider->getHTTPConnectProxy(); - if(proxy.isValid()) { - return proxy; - } + proxy = gconfProxyProvider->getHTTPConnectProxy(); + if(proxy.isValid()) { + return proxy; + } #endif - proxy = environmentProxyProvider.getHTTPConnectProxy(); - if(proxy.isValid()) { - return proxy; - } - return HostAddressPort(HostAddress(), 0); + proxy = environmentProxyProvider.getHTTPConnectProxy(); + if(proxy.isValid()) { + return proxy; + } + return HostAddressPort(HostAddress(), 0); } |