diff options
author | Kevin Smith <git@kismith.co.uk> | 2018-06-19 13:57:06 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2018-06-19 15:57:25 (GMT) |
commit | 83434963a7b10b759ffe3fdc1312efdef282a450 (patch) | |
tree | 7cf46b95fc0327cc338259f07e10d609c6ed4c68 /Swiften/Network/Connector.cpp | |
parent | ddc60687e44209d136c63776b5dc714791b41436 (diff) | |
download | swift-83434963a7b10b759ffe3fdc1312efdef282a450.zip swift-83434963a7b10b759ffe3fdc1312efdef282a450.tar.bz2 |
Don't double-connect to IP literals
Before this change, an IP literal would be attempted directly, and if
that failed it would then 'resolve' the literal and try the result.
Test-Information:
Added a unit test verifying the bug before fixing it.
Change-Id: Ic887c74152f5a4b259392dad402952b3777268b1
Diffstat (limited to 'Swiften/Network/Connector.cpp')
-rw-r--r-- | Swiften/Network/Connector.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp index 5eddaba..ca924bb 100644 --- a/Swiften/Network/Connector.cpp +++ b/Swiften/Network/Connector.cpp @@ -29,13 +29,13 @@ void Connector::start() { assert(!currentConnection); 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())); } if (serviceLookupPrefix) { + queriedAllServices = false; serviceQuery = resolver->createServiceQuery(*serviceLookupPrefix, hostname); serviceQuery->onResult.connect(boost::bind(&Connector::handleServiceQueryResult, shared_from_this(), _1)); serviceQuery->run(); |