mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-21 19:42:05 +01:00
Merge pull request #498 from jitsi/bugfix/4.4/bosh-connection
Fix BOSH connection establishment
This commit is contained in:
commit
7199003f98
1 changed files with 9 additions and 1 deletions
|
@ -43,6 +43,7 @@ import org.jivesoftware.smack.packet.StanzaError;
|
|||
import org.jivesoftware.smack.util.CloseableUtil;
|
||||
import org.jivesoftware.smack.util.PacketParserUtils;
|
||||
import org.jivesoftware.smack.xml.XmlPullParser;
|
||||
import org.jivesoftware.smack.xml.XmlPullParserException;
|
||||
|
||||
import org.igniterealtime.jbosh.AbstractBody;
|
||||
import org.igniterealtime.jbosh.BOSHClient;
|
||||
|
@ -200,6 +201,13 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
+ getHost() + ":" + getPort() + ".";
|
||||
throw new SmackException.SmackMessageException(errorMessage);
|
||||
}
|
||||
|
||||
try {
|
||||
XmlPullParser parser = PacketParserUtils.getParserFor("<stream:stream xmlns='jabber:client'/>");
|
||||
onStreamOpen(parser);
|
||||
} catch (XmlPullParserException | IOException e) {
|
||||
throw new AssertionError("Failed to setup stream environment", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -511,7 +519,7 @@ public class XMPPBOSHConnection extends AbstractXMPPConnection {
|
|||
parseAndProcessStanza(parser);
|
||||
break;
|
||||
case "features":
|
||||
parseFeatures(parser);
|
||||
parseFeaturesAndNotify(parser);
|
||||
break;
|
||||
case "error":
|
||||
// Some BOSH error isn't stream error.
|
||||
|
|
Loading…
Reference in a new issue