summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2014-06-23 15:52:23 (GMT)
committerSwift Review <review@swift.im>2014-07-11 17:33:42 (GMT)
commitd949d1638c0778a6262c3afa13b55059a85b0499 (patch)
treeca869e0f3be60772112a8459cda7b5e6bf0f4a87
parentf2bcc401477dcb5ca52b5d9d5e85f4bf7bae9285 (diff)
downloadswift-contrib-d949d1638c0778a6262c3afa13b55059a85b0499.zip
swift-contrib-d949d1638c0778a6262c3afa13b55059a85b0499.tar.bz2
Apply a Connector timeout even if not using SRV lookups.
Test-Information: Unit tests only Change-Id: I7bc7d48a041f33b1a8527b5be4a476c12f796b34
-rw-r--r--Swiften/Network/Connector.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Swiften/Network/Connector.cpp b/Swiften/Network/Connector.cpp
index a58efbc..da2490f 100644
--- a/Swiften/Network/Connector.cpp
+++ b/Swiften/Network/Connector.cpp
@@ -31,13 +31,13 @@ void Connector::start() {
assert(!serviceQuery);
assert(!timer);
queriedAllServices = false;
+ if (timeoutMilliseconds > 0) {
+ timer = timerFactory->createTimer(timeoutMilliseconds);
+ timer->onTick.connect(boost::bind(&Connector::handleTimeout, shared_from_this()));
+ }
if (serviceLookupPrefix) {
serviceQuery = resolver->createServiceQuery((*serviceLookupPrefix) + hostname);
serviceQuery->onResult.connect(boost::bind(&Connector::handleServiceQueryResult, shared_from_this(), _1));
- if (timeoutMilliseconds > 0) {
- timer = timerFactory->createTimer(timeoutMilliseconds);
- timer->onTick.connect(boost::bind(&Connector::handleTimeout, shared_from_this()));
- }
serviceQuery->run();
}
else {