427700 - Outgoing extensions that create multiple frames should flush
them in order and atomically. Removed unused code.
This commit is contained in:
parent
a2a90c5c87
commit
a8e4caca90
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
package org.eclipse.jetty.websocket.common.frames;
|
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.api.extensions.Frame;
|
||||||
import org.eclipse.jetty.websocket.common.OpCode;
|
import org.eclipse.jetty.websocket.common.OpCode;
|
||||||
import org.eclipse.jetty.websocket.common.WebSocketFrame;
|
import org.eclipse.jetty.websocket.common.WebSocketFrame;
|
||||||
|
@ -28,8 +27,6 @@ import org.eclipse.jetty.websocket.common.WebSocketFrame;
|
||||||
*/
|
*/
|
||||||
public class DataFrame extends WebSocketFrame
|
public class DataFrame extends WebSocketFrame
|
||||||
{
|
{
|
||||||
private ByteBufferPool pool;
|
|
||||||
|
|
||||||
protected DataFrame(byte opcode)
|
protected DataFrame(byte opcode)
|
||||||
{
|
{
|
||||||
super(opcode);
|
super(opcode);
|
||||||
|
@ -78,22 +75,6 @@ public class DataFrame extends WebSocketFrame
|
||||||
return true;
|
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
|
* Set the data frame to continuation mode
|
||||||
*/
|
*/
|
||||||
|
@ -101,12 +82,4 @@ public class DataFrame extends WebSocketFrame
|
||||||
{
|
{
|
||||||
setOpCode(OpCode.CONTINUATION);
|
setOpCode(OpCode.CONTINUATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the buffer pool used for the payload
|
|
||||||
*/
|
|
||||||
public void setBufferPool(ByteBufferPool pool)
|
|
||||||
{
|
|
||||||
this.pool = pool;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,6 @@ import org.eclipse.jetty.websocket.api.WriteCallback;
|
||||||
import org.eclipse.jetty.websocket.api.extensions.Frame;
|
import org.eclipse.jetty.websocket.api.extensions.Frame;
|
||||||
import org.eclipse.jetty.websocket.common.Generator;
|
import org.eclipse.jetty.websocket.common.Generator;
|
||||||
import org.eclipse.jetty.websocket.common.OpCode;
|
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...)}
|
* Interface for working with bytes destined for {@link EndPoint#write(Callback, ByteBuffer...)}
|
||||||
|
@ -357,11 +356,6 @@ public class FrameFlusher
|
||||||
generator.getBufferPool().release(headerBuffer);
|
generator.getBufferPool().release(headerBuffer);
|
||||||
headerBuffer = null;
|
headerBuffer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (frame instanceof DataFrame)
|
|
||||||
{
|
|
||||||
((DataFrame)frame).reset();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
|
|
Loading…
Reference in New Issue