Issue #2683 - FrameFlusher.toString() isn't thread safe

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2018-06-27 07:06:38 -05:00
parent 6b335877d9
commit 33c497a883
1 changed files with 5 additions and 1 deletions

View File

@ -333,11 +333,15 @@ public class FrameFlusher extends IteratingCallback
@Override
public String toString()
{
int aggSize = -1;
ByteBuffer agg = aggregate;
if (agg != null)
aggSize = agg.position();
return String.format("%s@%x[queueSize=%d,aggregateSize=%d,terminated=%s]",
getClass().getSimpleName(),
hashCode(),
getQueueSize(),
aggregate == null ? 0 : aggregate.position(),
aggSize,
terminated);
}