mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-28 11:42:15 -05:00
fwiw don't allow stanza count to go over MAX_INT
This commit is contained in:
parent
b7c672e10e
commit
db726a59b8
@ -437,6 +437,10 @@ public class XmppConnection implements Runnable {
|
|||||||
throw new IOException("interrupted mid tag");
|
throw new IOException("interrupted mid tag");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (stanzasReceived == Integer.MAX_VALUE) {
|
||||||
|
resetStreamId();
|
||||||
|
throw new IOException("time to restart the session. cant handle >2 billion pcks");
|
||||||
|
}
|
||||||
++stanzasReceived;
|
++stanzasReceived;
|
||||||
lastPacketReceived = SystemClock.elapsedRealtime();
|
lastPacketReceived = SystemClock.elapsedRealtime();
|
||||||
return element;
|
return element;
|
||||||
@ -901,6 +905,11 @@ public class XmppConnection implements Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void sendPacket(final AbstractStanza packet) {
|
private synchronized void sendPacket(final AbstractStanza packet) {
|
||||||
|
if (stanzasSent == Integer.MAX_VALUE) {
|
||||||
|
resetStreamId();
|
||||||
|
disconnect(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
final String name = packet.getName();
|
final String name = packet.getName();
|
||||||
if (name.equals("iq") || name.equals("message") || name.equals("presence")) {
|
if (name.equals("iq") || name.equals("message") || name.equals("presence")) {
|
||||||
++stanzasSent;
|
++stanzasSent;
|
||||||
|
Loading…
Reference in New Issue
Block a user