summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2010-04-07 19:26:45 (GMT)
committerRemko Tronçon <git@el-tramo.be>2010-04-07 19:26:45 (GMT)
commit7ad73a099f4e3e55cbafd004df3eb8d4007efb20 (patch)
treebc9b6317cdd53e209223b2b28d5286165d474d97 /Swiften/Network/StaticDomainNameResolver.cpp
parent39e4547f396b6a21ec4ceb2f28c003c4011229a7 (diff)
parent2086abd85c97ee4e03f6d7b266076c6607012243 (diff)
downloadswift-contrib-7ad73a099f4e3e55cbafd004df3eb8d4007efb20.zip
swift-contrib-7ad73a099f4e3e55cbafd004df3eb8d4007efb20.tar.bz2
Merge branch 'case-305'
Diffstat (limited to 'Swiften/Network/StaticDomainNameResolver.cpp')
-rw-r--r--Swiften/Network/StaticDomainNameResolver.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/Swiften/Network/StaticDomainNameResolver.cpp b/Swiften/Network/StaticDomainNameResolver.cpp
index a751fdd..196176f 100644
--- a/Swiften/Network/StaticDomainNameResolver.cpp
+++ b/Swiften/Network/StaticDomainNameResolver.cpp
@@ -38,10 +38,8 @@ namespace {
}
StaticDomainNameResolver::AddressesMap::const_iterator i = resolver->getAddresses().find(host);
if (i != resolver->getAddresses().end()) {
- std::vector<HostAddress> result;
- result.push_back(i->second);
MainEventLoop::postEvent(
- boost::bind(boost::ref(onResult), result, boost::optional<DomainNameResolveError>()));
+ boost::bind(boost::ref(onResult), i->second, boost::optional<DomainNameResolveError>()));
}
else {
MainEventLoop::postEvent(boost::bind(boost::ref(onResult), std::vector<HostAddress>(), boost::optional<DomainNameResolveError>(DomainNameResolveError())));
@@ -60,7 +58,7 @@ StaticDomainNameResolver::StaticDomainNameResolver() : isResponsive(true) {
}
void StaticDomainNameResolver::addAddress(const String& domain, const HostAddress& address) {
- addresses[domain] = address;
+ addresses[domain].push_back(address);
}
void StaticDomainNameResolver::addService(const String& service, const DomainNameServiceQuery::Result& result) {
@@ -76,6 +74,10 @@ void StaticDomainNameResolver::addXMPPClientService(const String& domain, const
addAddress(hostname, address.getAddress());
}
+void StaticDomainNameResolver::addXMPPClientService(const String& domain, const String& hostname, int port) {
+ addService("_xmpp-client._tcp." + domain, ServiceQuery::Result(hostname, port, 0, 0));
+}
+
boost::shared_ptr<DomainNameServiceQuery> StaticDomainNameResolver::createServiceQuery(const String& name) {
return boost::shared_ptr<DomainNameServiceQuery>(new ServiceQuery(name, this));
}