diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-11-12 18:12:47 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-11-12 18:12:47 (GMT) |
commit | fdd8755e2363e8d706a3d0bdc2e71f234abdf829 (patch) | |
tree | 470401f6f80873c4e1ce5af5cd30ab6837854d04 /Swiften/QA/ClientTest/ClientTest.cpp | |
parent | 6a20be61e229255f93d55f13be3346525698237a (diff) | |
download | swift-contrib-fdd8755e2363e8d706a3d0bdc2e71f234abdf829.zip swift-contrib-fdd8755e2363e8d706a3d0bdc2e71f234abdf829.tar.bz2 |
Refactored DNS handling.
Connections now fallback on other DNS entries upon failure,
taking into account SRV priorities.
Diffstat (limited to 'Swiften/QA/ClientTest/ClientTest.cpp')
-rw-r--r-- | Swiften/QA/ClientTest/ClientTest.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/Swiften/QA/ClientTest/ClientTest.cpp b/Swiften/QA/ClientTest/ClientTest.cpp index b50a0bf..cf1c161 100644 --- a/Swiften/QA/ClientTest/ClientTest.cpp +++ b/Swiften/QA/ClientTest/ClientTest.cpp @@ -15,12 +15,20 @@ using namespace Swift; SimpleEventLoop eventLoop; Client* client = 0; +bool reconnected = false; bool rosterReceived = false; void handleRosterReceived(boost::shared_ptr<Payload>) { - rosterReceived = true; - client->disconnect(); - eventLoop.stop(); + if (reconnected) { + rosterReceived = true; + client->disconnect(); + eventLoop.stop(); + } + else { + reconnected = true; + client->disconnect(); + client->connect(); + } } void handleConnected() { |