diff --git a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/frames/DataFrame.java b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/frames/DataFrame.java index 8b6be07a34b..af0c9f8527d 100644 --- a/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/frames/DataFrame.java +++ b/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/frames/DataFrame.java @@ -18,7 +18,6 @@ package org.eclipse.jetty.websocket.common.frames; -import org.eclipse.jetty.io.ByteBufferPool; import org.eclipse.jetty.websocket.api.extensions.Frame; import org.eclipse.jetty.websocket.common.OpCode; import org.eclipse.jetty.websocket.common.WebSocketFrame; @@ -28,8 +27,6 @@ import org.eclipse.jetty.websocket.common.WebSocketFrame; */ public class DataFrame extends WebSocketFrame { - private ByteBufferPool pool; - protected DataFrame(byte opcode) { super(opcode); @@ -78,22 +75,6 @@ public class DataFrame extends WebSocketFrame return true; } - public void reset() - { - // TODO: this is rather ugly. - // The ByteBufferPool is set only from extensions that - // compress the payload. It would be better to wrap the - // callback associated with this DataFrame into one that - // releases the buffer and then call the nested callback, - // rather than null-checking whether the pool exists and - // if so then release the buffer. - if (pool!=null) - { - pool.release(this.data); - } - super.reset(); - } - /** * Set the data frame to continuation mode */ @@ -101,12 +82,4 @@ public class DataFrame extends WebSocketFrame { setOpCode(OpCode.CONTINUATION); } - - /** - * Sets the buffer pool used for the payload - */ - public void setBufferPool(ByteBufferPool pool) - { - this.pool = pool; - } } 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 cb963959209..73fde819220 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 @@ -35,7 +35,6 @@ import org.eclipse.jetty.websocket.api.WriteCallback; import org.eclipse.jetty.websocket.api.extensions.Frame; import org.eclipse.jetty.websocket.common.Generator; import org.eclipse.jetty.websocket.common.OpCode; -import org.eclipse.jetty.websocket.common.frames.DataFrame; /** * Interface for working with bytes destined for {@link EndPoint#write(Callback, ByteBuffer...)} @@ -357,11 +356,6 @@ public class FrameFlusher generator.getBufferPool().release(headerBuffer); headerBuffer = null; } - - if (frame instanceof DataFrame) - { - ((DataFrame)frame).reset(); - } } public String toString()