1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-22 14:22:05 +01:00

Use ackedStanzasCount instead of handledCount in processHandledCount

for the initial size of the ackedStanzas list.

Thanks to Juan Antonio for reporting.
This commit is contained in:
Florian Schmaus 2015-10-21 16:03:45 +02:00
parent 9c9d1f893a
commit cc758b8f59

View file

@ -1758,7 +1758,7 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
private void processHandledCount(long handledCount) throws StreamManagementCounterError { private void processHandledCount(long handledCount) throws StreamManagementCounterError {
long ackedStanzasCount = SMUtils.calculateDelta(handledCount, serverHandledStanzasCount); long ackedStanzasCount = SMUtils.calculateDelta(handledCount, serverHandledStanzasCount);
final List<Stanza> ackedStanzas = new ArrayList<Stanza>( final List<Stanza> ackedStanzas = new ArrayList<Stanza>(
handledCount <= Integer.MAX_VALUE ? (int) handledCount ackedStanzasCount <= Integer.MAX_VALUE ? (int) ackedStanzasCount
: Integer.MAX_VALUE); : Integer.MAX_VALUE);
for (long i = 0; i < ackedStanzasCount; i++) { for (long i = 0; i < ackedStanzasCount; i++) {
Stanza ackedStanza = unacknowledgedStanzas.poll(); Stanza ackedStanza = unacknowledgedStanzas.poll();