diff options
| author | Richard Maudsley <richard.maudsley@isode.com> | 2014-07-17 09:46:50 (GMT) |
|---|---|---|
| committer | Swift Review <review@swift.im> | 2014-08-10 11:08:27 (GMT) |
| commit | 8ec22a9c5591584fd1725ed028d714c51b7509d3 (patch) | |
| tree | 3687e7023696c9e790a24fd54b7d04f14ac58ab2 /Swiften/Network/StaticDomainNameResolver.cpp | |
| parent | 5e9e715e49a5ddb6ce9c76ec61e7ecfd6eacdb58 (diff) | |
| download | swift-contrib-8ec22a9c5591584fd1725ed028d714c51b7509d3.zip swift-contrib-8ec22a9c5591584fd1725ed028d714c51b7509d3.tar.bz2 | |
Fix invalid characters being allowed in JID domains
Test-Information:
Prepare valid and invalid JIDs and make sure that isValid() is reported correctly. Added unit tests.
Change-Id: Ic4d86f8b6ea9defc517ada2f8e3cc54979237cf4
Diffstat (limited to 'Swiften/Network/StaticDomainNameResolver.cpp')
| -rw-r--r-- | Swiften/Network/StaticDomainNameResolver.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Swiften/Network/StaticDomainNameResolver.cpp b/Swiften/Network/StaticDomainNameResolver.cpp index ee18ee5..17d9c3b 100644 --- a/Swiften/Network/StaticDomainNameResolver.cpp +++ b/Swiften/Network/StaticDomainNameResolver.cpp @@ -76,44 +76,44 @@ class StaticDomainNameResolverEventOwner : public EventOwner { } }; namespace Swift { StaticDomainNameResolver::StaticDomainNameResolver(EventLoop* eventLoop) : eventLoop(eventLoop), isResponsive(true), owner(new StaticDomainNameResolverEventOwner()) { } StaticDomainNameResolver::~StaticDomainNameResolver() { eventLoop->removeEventsFromOwner(owner); } void StaticDomainNameResolver::addAddress(const std::string& domain, const HostAddress& address) { addresses[domain].push_back(address); } void StaticDomainNameResolver::addService(const std::string& service, const DomainNameServiceQuery::Result& result) { services.push_back(std::make_pair(service, result)); } void StaticDomainNameResolver::addXMPPClientService(const std::string& domain, const HostAddressPort& address) { static int hostid = 0; std::string hostname(std::string("host-") + boost::lexical_cast<std::string>(hostid)); hostid++; addService("_xmpp-client._tcp." + domain, ServiceQuery::Result(hostname, address.getPort(), 0, 0)); addAddress(hostname, address.getAddress()); } void StaticDomainNameResolver::addXMPPClientService(const std::string& domain, const std::string& hostname, int port) { addService("_xmpp-client._tcp." + domain, ServiceQuery::Result(hostname, port, 0, 0)); } -boost::shared_ptr<DomainNameServiceQuery> StaticDomainNameResolver::createServiceQuery(const std::string& name) { - return boost::shared_ptr<DomainNameServiceQuery>(new ServiceQuery(name, this, eventLoop, owner)); +boost::shared_ptr<DomainNameServiceQuery> StaticDomainNameResolver::createServiceQuery(const std::string& serviceLookupPrefix, const std::string& domain) { + return boost::shared_ptr<DomainNameServiceQuery>(new ServiceQuery(serviceLookupPrefix + domain, this, eventLoop, owner)); } boost::shared_ptr<DomainNameAddressQuery> StaticDomainNameResolver::createAddressQuery(const std::string& name) { return boost::shared_ptr<DomainNameAddressQuery>(new AddressQuery(name, this, eventLoop, owner)); } } |
Swift