427700 - Outgoing extensions that create multiple frames should flush

them in order and atomically.

Removed unused code.
This commit is contained in:
Simone Bordet 2014-02-15 17:53:23 +01:00
parent a2a90c5c87
commit a8e4caca90
2 changed files with 0 additions and 33 deletions

View File

@ -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;
}
}

View File

@ -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()