From 1a3fb47b5f0a823111e109ff63c90bbf36c4321a Mon Sep 17 00:00:00 2001 From: Gaston Dombiak Date: Fri, 31 Oct 2008 03:51:12 +0000 Subject: [PATCH] Fixed parsing of SUCCESS during SASL. SMACK-258 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@10856 b35dd754-fafc-0310-a699-88a17e54d16e --- .../org/jivesoftware/smack/PacketReader.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/org/jivesoftware/smack/PacketReader.java b/source/org/jivesoftware/smack/PacketReader.java index 09009d9ff..ef1c41d8a 100644 --- a/source/org/jivesoftware/smack/PacketReader.java +++ b/source/org/jivesoftware/smack/PacketReader.java @@ -338,17 +338,6 @@ class PacketReader { connection.getSASLAuthentication().challengeReceived(parser.nextText()); } else if (parser.getName().equals("success")) { - // We now need to bind a resource for the connection - // Open a new stream and wait for the response - connection.packetWriter.openStream(); - - // Reset the state of the parser since a new stream element is going - // to be sent by the server - resetParser(); - - // The SASL authentication with the server was successful. The next step - // will be to bind the resource - connection.getSASLAuthentication().authenticated(); } else if (parser.getName().equals("compressed")) { // Server confirmed that it's possible to use stream compression. Start @@ -364,6 +353,17 @@ class PacketReader { // Disconnect the connection connection.disconnect(); } + else if (parser.getName().equals("success")) { + // We now need to bind a resource for the connection + // Open a new stream and wait for the response + connection.packetWriter.openStream(); + // Reset the state of the parser since a new stream element is going + // to be sent by the server + resetParser(); + // The SASL authentication with the server was successful. The next step + // will be to bind the resource + connection.getSASLAuthentication().authenticated(); + } } eventType = parser.next(); } while (!done && eventType != XmlPullParser.END_DOCUMENT && thread == readerThread);