summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Network/Connector.cpp')
-rw-r--r--Swiften/Network/Connector.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp
index 37cf35d..457d8a9 100644
--- a/Swiften/Network/Connector.cpp
+++ b/Swiften/Network/Connector.cpp
@@ -30,6 +30,7 @@ void Connector::start() {
assert(!serviceQuery);
assert(!timer);
queriedAllServices = false;
+ auto hostAddress = HostAddress::fromString(hostname);
if (timeoutMilliseconds > 0) {
timer = timerFactory->createTimer(timeoutMilliseconds);
timer->onTick.connect(boost::bind(&Connector::handleTimeout, shared_from_this()));
@@ -39,10 +40,10 @@ void Connector::start() {
serviceQuery->onResult.connect(boost::bind(&Connector::handleServiceQueryResult, shared_from_this(), _1));
serviceQuery->run();
}
- else if (HostAddress(hostname).isValid()) {
+ else if (hostAddress) {
// hostname is already a valid address; skip name lookup.
foundSomeDNS = true;
- addressQueryResults.push_back(HostAddress(hostname));
+ addressQueryResults.push_back(hostAddress.get());
tryNextAddress();
} else {
queryAddress(hostname);