summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2009-11-12 18:12:47 (GMT)
committerRemko Tronçon <git@el-tramo.be>2009-11-12 18:12:47 (GMT)
commitfdd8755e2363e8d706a3d0bdc2e71f234abdf829 (patch)
tree470401f6f80873c4e1ce5af5cd30ab6837854d04 /Swiften/QA/ClientTest/ClientTest.cpp
parent6a20be61e229255f93d55f13be3346525698237a (diff)
downloadswift-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.cpp14
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() {