diff options
Diffstat (limited to 'Swiften/Network/CachingNameOnlyDomainNameResolver.cpp')
-rw-r--r-- | Swiften/Network/CachingNameOnlyDomainNameResolver.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Swiften/Network/CachingNameOnlyDomainNameResolver.cpp b/Swiften/Network/CachingNameOnlyDomainNameResolver.cpp new file mode 100644 index 0000000..a83bebd --- /dev/null +++ b/Swiften/Network/CachingNameOnlyDomainNameResolver.cpp @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2012 Kevin Smith + * Licensed under the GNU General Public License v3. + * See Documentation/Licenses/GPLv3.txt for more information. + */ + +#include <Swiften/Network/CachingNameOnlyDomainNameResolver.h> + +#include <boost/smart_ptr/make_shared.hpp> + +namespace Swift { +CachingNameOnlyDomainNameResolver::CachingNameOnlyDomainNameResolver(DomainNameResolver* realResolver, EventLoop* eventLoop) : realResolver(realResolver) { + staticResolver = boost::make_shared<StaticDomainNameResolver>(eventLoop); +} + +CachingNameOnlyDomainNameResolver::~CachingNameOnlyDomainNameResolver() { + +} + +DomainNameServiceQuery::ref CachingNameOnlyDomainNameResolver::createServiceQuery(const std::string& name) { + return staticResolver->createServiceQuery(name); +} + +DomainNameAddressQuery::ref CachingNameOnlyDomainNameResolver::createAddressQuery(const std::string& name) { + return realResolver->createAddressQuery(name); +} + +void CachingNameOnlyDomainNameResolver::handleAddressQueryResult(const std::string hostname, const std::vector<HostAddress>& address, boost::optional<DomainNameResolveError> error) { + //FIXME: Cache +} + +} |