aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2015-08-26 20:47:08 +0200
committerDaniel Gultsch <daniel@gultsch.de>2015-08-26 20:47:08 +0200
commitcd451856b2e15bad36a9729c70947210703031c3 (patch)
treeec8663f9c9c7460db267b66bc74d899e8ed4ff44
parentc4a548ada00f5abd175e28ac1df5204f8bbc092f (diff)
explictitly handle iq timeouts in bind and session iqs
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
index bb0c3987..097cb818 100644
--- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
+++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java
@@ -704,8 +704,11 @@ public class XmppConnection implements Runnable {
this.sendUnmodifiedIqPacket(iq, new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(final Account account, final IqPacket packet) {
+ if (packet.getType() == IqPacket.TYPE.TIMEOUT) {
+ return;
+ }
final Element bind = packet.findChild("bind");
- if (bind != null) {
+ if (bind != null && packet.getType() == IqPacket.TYPE.RESULT) {
final Element jid = bind.findChild("jid");
if (jid != null && jid.getContent() != null) {
try {
@@ -757,7 +760,9 @@ public class XmppConnection implements Runnable {
this.sendUnmodifiedIqPacket(startSession, new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(Account account, IqPacket packet) {
- if (packet.getType() == IqPacket.TYPE.RESULT) {
+ if (packet.getType() == IqPacket.TYPE.TIMEOUT) {
+ return;
+ } else if (packet.getType() == IqPacket.TYPE.RESULT) {
sendPostBindInitialization();
} else {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": could not init sessions");