Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimone Bordet2014-05-14 15:25:04 -0400
committerSimone Bordet2014-05-14 15:25:04 -0400
commita2b6c695255c93b173ee861f1b146efb861e32a4 (patch)
tree84f4c16f7904f8f83a38a9767849a038210d0186 /jetty-websocket
parentbe3848a37134bb1a9ede4ce01d5c38620227eece (diff)
downloadorg.eclipse.jetty.project-a2b6c695255c93b173ee861f1b146efb861e32a4.tar.gz
org.eclipse.jetty.project-a2b6c695255c93b173ee861f1b146efb861e32a4.tar.xz
org.eclipse.jetty.project-a2b6c695255c93b173ee861f1b146efb861e32a4.zip
Fixed field initialization problem.
Diffstat (limited to 'jetty-websocket')
-rw-r--r--jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/io/FrameFlusher.java14
1 files changed, 11 insertions, 3 deletions
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 6e995e579f..b062aac966 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
@@ -29,6 +29,7 @@ import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.EndPoint;
import org.eclipse.jetty.util.ArrayQueue;
import org.eclipse.jetty.util.BufferUtil;
+import org.eclipse.jetty.util.Callback;
import org.eclipse.jetty.util.IteratingCallback;
import org.eclipse.jetty.util.log.Log;
import org.eclipse.jetty.util.log.Logger;
@@ -46,11 +47,17 @@ public class FrameFlusher
{
private class Flusher extends IteratingCallback
{
- private final List<FrameEntry> entries = new ArrayList<>(maxGather);
- private final List<ByteBuffer> buffers = new ArrayList<>((maxGather * 2) + 1);
+ private final List<FrameEntry> entries;
+ private final List<ByteBuffer> buffers;
private ByteBuffer aggregate;
private BatchMode batchMode;
+ public Flusher(int maxGather)
+ {
+ entries = new ArrayList<>(maxGather);
+ buffers = new ArrayList<>((maxGather * 2) + 1);
+ }
+
private Action batch()
{
if (aggregate == null)
@@ -289,7 +296,7 @@ public class FrameFlusher
private final int maxGather;
private final Object lock = new Object();
private final ArrayQueue<FrameEntry> queue = new ArrayQueue<>(16,16,lock);
- private final Flusher flusher = new Flusher();
+ private final Flusher flusher;
private final AtomicBoolean closed = new AtomicBoolean();
private volatile Throwable failure;
@@ -300,6 +307,7 @@ public class FrameFlusher
this.bufferSize = bufferSize;
this.generator = Objects.requireNonNull(generator);
this.maxGather = maxGather;
+ this.flusher = new Flusher(maxGather);
}
public void close()

Back to the top