summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Barisione <marco@barisione.org>2011-03-18 17:35:09 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2011-03-18 18:05:15 +0000
commit683d2cf1c5d4095b9413442d4cafb4e850c47952 (patch)
tree6faf4506e221df8670b82190529c5b1a7d435784
parent27252c32885bcc057654dcbc3191812b745238a2 (diff)
SaslAuth: Don't process stanzas received after disconnection
Fixes: <https://bugs.freedesktop.org/show_bug.cgi?id=35430> Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
-rw-r--r--wocky/wocky-sasl-auth.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/wocky/wocky-sasl-auth.c b/wocky/wocky-sasl-auth.c
index d6afcc5..c369f67 100644
--- a/wocky/wocky-sasl-auth.c
+++ b/wocky/wocky-sasl-auth.c
@@ -290,6 +290,7 @@ static gboolean
stream_error (WockySaslAuth *sasl, WockyStanza *stanza)
{
WockyStanzaType type = WOCKY_STANZA_TYPE_NONE;
+ WockySaslAuthPrivate *priv = self->priv;
if (stanza == NULL)
{
@@ -313,6 +314,14 @@ stream_error (WockySaslAuth *sasl, WockyStanza *stanza)
return TRUE;
}
+ if (g_cancellable_is_cancelled (priv->cancel))
+ {
+ /* We got disconnected but we still had this stanza to process. Don't
+ * bother with it. */
+ auth_failed (sasl, WOCKY_AUTH_ERROR_CONNRESET, "Disconnected");
+ return TRUE;
+ }
+
return FALSE;
}