From 33c497a8831904f4fc8d46d02cc78a3cb8f7f6df Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 27 Jun 2018 07:06:38 -0500 Subject: [PATCH] Issue #2683 - FrameFlusher.toString() isn't thread safe Signed-off-by: Joakim Erdfelt --- .../org/eclipse/jetty/websocket/common/io/FrameFlusher.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/FrameFlusher.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/FrameFlusher.java index a04d59543e3..401a0732245 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/FrameFlusher.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/FrameFlusher.java @@ -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); }