diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2015-02-25 09:00:17 +0100 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2015-02-25 09:00:17 +0100 |
| commit | 02294cc0cf4e9a658da33e8d91896a4b6f2f9e8c (patch) | |
| tree | 76f40c9e53658fe3f21e12b8be54762619a0955a /src/client/QXmppOutgoingClient.cpp | |
| parent | da64eae308158b4e0e8816a93d698823b4785b1a (diff) | |
clean up support for 'bad-auth' replies, see #36
Diffstat (limited to 'src/client/QXmppOutgoingClient.cpp')
| -rw-r--r-- | src/client/QXmppOutgoingClient.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp index cc14dbdf..f82ae807 100644 --- a/src/client/QXmppOutgoingClient.cpp +++ b/src/client/QXmppOutgoingClient.cpp @@ -538,10 +538,11 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) QXmppSaslFailure failure; failure.parse(nodeRecv); - if (failure.condition() == "not-authorized") + // RFC3920 defines the error condition as "not-authorized", but + // some broken servers use "bad-auth" instead. We tolerate this + // by remapping the error to "not-authorized". + if (failure.condition() == "not-authorized" || failure.condition() == "bad-auth") d->xmppStreamError = QXmppStanza::Error::NotAuthorized; - else if (failure.condition() == "bad-auth") - d->xmppStreamError = QXmppStanza::Error::BadAuth; else d->xmppStreamError = QXmppStanza::Error::UndefinedCondition; emit error(QXmppClient::XmppStreamError); |
