summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2012-10-12 09:28:51 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-10-12 09:28:51 (GMT)
commit54deca37412de7bc7b317ac92b4aab1b568eab0d (patch)
tree159e240a925e6104e98b6545aa6d8f634915b9e8 /Swiften/Component/ComponentSession.cpp
parent3ad791ffbd8035d8e3418b50d4aae953ad8759d0 (diff)
downloadswift-contrib-54deca37412de7bc7b317ac92b4aab1b568eab0d.zip
swift-contrib-54deca37412de7bc7b317ac92b4aab1b568eab0d.tar.bz2
Workaround receiving stream features on component connections
Diffstat (limited to 'Swiften/Component/ComponentSession.cpp')
-rw-r--r--Swiften/Component/ComponentSession.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/Swiften/Component/ComponentSession.cpp b/Swiften/Component/ComponentSession.cpp
index 51d9d15..3269f23 100644
--- a/Swiften/Component/ComponentSession.cpp
+++ b/Swiften/Component/ComponentSession.cpp
@@ -10,6 +10,7 @@
#include <boost/smart_ptr/make_shared.hpp>
#include <Swiften/Elements/ProtocolHeader.h>
+#include <Swiften/Elements/StreamFeatures.h>
#include <Swiften/Elements/ComponentHandshake.h>
#include <Swiften/Session/SessionStream.h>
#include <Swiften/Component/ComponentHandshakeGenerator.h>
@@ -66,8 +67,13 @@ void ComponentSession::handleElement(boost::shared_ptr<Element> element) {
onInitialized();
}
else if (getState() == Authenticating) {
- // FIXME: We should actually check the element received
- finishSession(Error::AuthenticationFailedError);
+ if (boost::dynamic_pointer_cast<StreamFeatures>(element)) {
+ // M-Link sends stream features, so swallow that.
+ }
+ else {
+ // FIXME: We should actually check the element received
+ finishSession(Error::AuthenticationFailedError);
+ }
}
else {
finishSession(Error::UnexpectedElementError);