summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/StaticDomainNameResolver.cpp')
-rw-r--r--Swiften/Network/StaticDomainNameResolver.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Swiften/Network/StaticDomainNameResolver.cpp b/Swiften/Network/StaticDomainNameResolver.cpp
index 609bbdd..a7275d2 100644
--- a/Swiften/Network/StaticDomainNameResolver.cpp
+++ b/Swiften/Network/StaticDomainNameResolver.cpp
@@ -13,6 +13,9 @@ namespace {
ServiceQuery(const String& service, Swift::StaticDomainNameResolver* resolver) : service(service), resolver(resolver) {}
virtual void run() {
+ if (!resolver->getIsResponsive()) {
+ return;
+ }
std::vector<DomainNameServiceQuery::Result> results;
for(StaticDomainNameResolver::ServicesCollection::const_iterator i = resolver->getServices().begin(); i != resolver->getServices().end(); ++i) {
if (i->first == service) {
@@ -30,6 +33,9 @@ namespace {
AddressQuery(const String& host, StaticDomainNameResolver* resolver) : host(host), resolver(resolver) {}
virtual void run() {
+ if (!resolver->getIsResponsive()) {
+ return;
+ }
StaticDomainNameResolver::AddressesMap::const_iterator i = resolver->getAddresses().find(host);
if (i != resolver->getAddresses().end()) {
MainEventLoop::postEvent(
@@ -48,6 +54,9 @@ namespace {
namespace Swift {
+StaticDomainNameResolver::StaticDomainNameResolver() : isResponsive(true) {
+}
+
void StaticDomainNameResolver::addAddress(const String& domain, const HostAddress& address) {
addresses[domain] = address;
}