summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/PlatformDomainNameServiceQuery.cpp')
-rw-r--r--Swiften/Network/PlatformDomainNameServiceQuery.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/Swiften/Network/PlatformDomainNameServiceQuery.cpp b/Swiften/Network/PlatformDomainNameServiceQuery.cpp
index 5788d2f..58cf8d2 100644
--- a/Swiften/Network/PlatformDomainNameServiceQuery.cpp
+++ b/Swiften/Network/PlatformDomainNameServiceQuery.cpp
@@ -38,7 +38,11 @@ using namespace Swift;
namespace Swift {
-PlatformDomainNameServiceQuery::PlatformDomainNameServiceQuery(const std::string& service, EventLoop* eventLoop, PlatformDomainNameResolver* resolver) : PlatformDomainNameQuery(resolver), eventLoop(eventLoop), service(service) {
+PlatformDomainNameServiceQuery::PlatformDomainNameServiceQuery(const boost::optional<std::string>& serviceName, EventLoop* eventLoop, PlatformDomainNameResolver* resolver) : PlatformDomainNameQuery(resolver), eventLoop(eventLoop), serviceValid(false) {
+ if (!!serviceName) {
+ service = *serviceName;
+ serviceValid = true;
+ }
}
void PlatformDomainNameServiceQuery::run() {
@@ -46,6 +50,11 @@ void PlatformDomainNameServiceQuery::run() {
}
void PlatformDomainNameServiceQuery::runBlocking() {
+ if (!serviceValid) {
+ emitError();
+ return;
+ }
+
SWIFT_LOG(debug) << "Querying " << service << std::endl;
std::vector<DomainNameServiceQuery::Result> records;