summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoger Planas <roger.planas@isode.com>2016-02-05 12:45:39 (GMT)
committerKevin Smith <kevin.smith@isode.com>2016-02-10 14:33:37 (GMT)
commitaf6493bf45fcd9174b485f8ae0532e2eb4e6914e (patch)
treecfabe60bd9db93ce05557ee26ba18cc4622e0db0 /Sluift/SluiftClient.h
parentdcfe31ce3055f3af7e3b617752d9c9fd16672569 (diff)
downloadswift-af6493bf45fcd9174b485f8ae0532e2eb4e6914e.zip
swift-af6493bf45fcd9174b485f8ae0532e2eb4e6914e.tar.bz2
Sluift: Add timeout to roster receiving operations
This avoids Sluift indefinitely waiting if the server does not respond Test-Information: Before the patch, a sluift client would wait indefinitely if a buggy XMPP server does not respond. With this patch, sluift clients now timeout and through an exception after SLUIFT_TIMEOUT when the server does not respond. Change-Id: I9d36f53a8f4d5b3d594cef68c42de38fd5a1c296
Diffstat (limited to 'Sluift/SluiftClient.h')
-rw-r--r--Sluift/SluiftClient.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Sluift/SluiftClient.h b/Sluift/SluiftClient.h
index b7a6578..68c4b61 100644
--- a/Sluift/SluiftClient.h
+++ b/Sluift/SluiftClient.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Isode Limited.
+ * Copyright (c) 2013-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -103,7 +103,7 @@ namespace Swift {
void setSoftwareVersion(const std::string& name, const std::string& version, const std::string& os);
boost::optional<SluiftClient::Event> getNextEvent(int timeout,
boost::function<bool (const Event&)> condition = 0);
- std::vector<XMPPRosterItem> getRoster();
+ std::vector<XMPPRosterItem> getRoster(int timeout);
private:
Sluift::Response doSendRequest(boost::shared_ptr<Request> request, int timeout);