diff options
-rw-r--r-- | Swiften/Network/BoostNetworkFactories.cpp | 11 | ||||
-rw-r--r-- | Swiften/Network/SConscript | 12 |
2 files changed, 16 insertions, 7 deletions
diff --git a/Swiften/Network/BoostNetworkFactories.cpp b/Swiften/Network/BoostNetworkFactories.cpp index 091a70a..070c6a1 100644 --- a/Swiften/Network/BoostNetworkFactories.cpp +++ b/Swiften/Network/BoostNetworkFactories.cpp @@ -7,7 +7,7 @@ #include <Swiften/Network/BoostNetworkFactories.h> #include <Swiften/Network/BoostTimerFactory.h> #include <Swiften/Network/BoostConnectionFactory.h> -#include <Swiften/Network/PlatformDomainNameResolver.h> + #include <Swiften/Network/BoostConnectionServerFactory.h> #include <Swiften/Network/PlatformNATTraversalWorker.h> #include <Swiften/Parser/PlatformXMLParserFactory.h> @@ -15,15 +15,22 @@ #include <Swiften/TLS/PlatformTLSFactories.h> #include <Swiften/Network/PlatformProxyProvider.h> +#ifdef USE_UNBOUND #include <Swiften/Network/UnboundDomainNameResolver.h> +#else +#include <Swiften/Network/PlatformDomainNameResolver.h> +#endif namespace Swift { BoostNetworkFactories::BoostNetworkFactories(EventLoop* eventLoop) : eventLoop(eventLoop){ timerFactory = new BoostTimerFactory(ioServiceThread.getIOService(), eventLoop); connectionFactory = new BoostConnectionFactory(ioServiceThread.getIOService(), eventLoop); +#ifdef USE_UNBOUND domainNameResolver = new UnboundDomainNameResolver(eventLoop, timerFactory); - //domainNameResolver = new PlatformDomainNameResolver(eventLoop); +#else + domainNameResolver = new PlatformDomainNameResolver(eventLoop); +#endif connectionServerFactory = new BoostConnectionServerFactory(ioServiceThread.getIOService(), eventLoop); #ifdef SWIFT_EXPERIMENTAL_FT natTraverser = new PlatformNATTraversalWorker(eventLoop); diff --git a/Swiften/Network/SConscript b/Swiften/Network/SConscript index 429ca51..7c790da 100644 --- a/Swiften/Network/SConscript +++ b/Swiften/Network/SConscript @@ -36,9 +36,6 @@ sourceList = [ "DomainNameResolver.cpp", "DomainNameAddressQuery.cpp", "DomainNameServiceQuery.cpp", - "PlatformDomainNameResolver.cpp", - "PlatformDomainNameServiceQuery.cpp", - "PlatformDomainNameAddressQuery.cpp", "StaticDomainNameResolver.cpp", "HostAddress.cpp", "HostAddressPort.cpp", @@ -60,11 +57,16 @@ sourceList = [ ] if myenv.get("HAVE_CARES", False) : - sourceList.append("CAresDomainNameResolver.cpp") + sourceList.append("CAresDomainNameResolver.cpp") if myenv.get("unbound", False) : + myenv.Append(CPPDEFINES = "USE_UNBOUND") sourceList.append("UnboundDomainNameResolver.cpp") - +else : + sourceList.append("PlatformDomainNameResolver.cpp") + sourceList.append("PlatformDomainNameServiceQuery.cpp") + sourceList.append("PlatformDomainNameAddressQuery.cpp") + if myenv["PLATFORM"] == "darwin" : myenv.Append(FRAMEWORKS = ["CoreServices", "SystemConfiguration"]) sourceList += [ "MacOSXProxyProvider.cpp" ] |