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
1 changed files with 1 additions and 1 deletions

View File

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