catch number format exception in server ack

This commit is contained in:
Daniel Gultsch 2015-07-10 12:09:59 +02:00
parent 26044ca229
commit 7eac30d1f4

View File

@ -366,6 +366,7 @@ public class XmppConnection implements Runnable {
} else if (nextTag.isStart("a")) { } else if (nextTag.isStart("a")) {
final Element ack = tagReader.readElement(nextTag); final Element ack = tagReader.readElement(nextTag);
lastPacketReceived = SystemClock.elapsedRealtime(); lastPacketReceived = SystemClock.elapsedRealtime();
try {
final int serverSequence = Integer.parseInt(ack.getAttribute("h")); final int serverSequence = Integer.parseInt(ack.getAttribute("h"));
if (Config.EXTENDED_SM_LOGGING) { if (Config.EXTENDED_SM_LOGGING) {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": server acknowledged stanza #" + serverSequence); Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": server acknowledged stanza #" + serverSequence);
@ -378,6 +379,9 @@ public class XmppConnection implements Runnable {
} }
this.messageReceipts.remove(serverSequence); this.messageReceipts.remove(serverSequence);
} }
} catch (NumberFormatException e) {
Log.d(Config.LOGTAG,account.getJid().toBareJid()+": server send ack without sequence number");
}
} else if (nextTag.isStart("failed")) { } else if (nextTag.isStart("failed")) {
tagReader.readElement(nextTag); tagReader.readElement(nextTag);
Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": resumption failed"); Log.d(Config.LOGTAG, account.getJid().toBareJid().toString() + ": resumption failed");