PR #11402 - move methods to original position in WebSocketConnection
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
This commit is contained in:
parent
436f4f8507
commit
4ca044486e
|
@ -199,40 +199,6 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
|
|||
this.useOutputDirectByteBuffers = useOutputDirectByteBuffers;
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra bytes from the initial HTTP upgrade that need to
|
||||
* be processed by the websocket parser before starting
|
||||
* to read bytes from the connection
|
||||
*
|
||||
* @param initialBuffer the bytes of extra content encountered during upgrade
|
||||
*/
|
||||
protected void setInitialBuffer(ByteBuffer initialBuffer)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Set initial buffer - {}", BufferUtil.toDetailString(initialBuffer));
|
||||
try (AutoLock l = lock.lock())
|
||||
{
|
||||
networkBuffer = newNetworkBuffer(initialBuffer.remaining());
|
||||
}
|
||||
ByteBuffer buffer = networkBuffer.getByteBuffer();
|
||||
BufferUtil.clearToFill(buffer);
|
||||
BufferUtil.put(initialBuffer, buffer);
|
||||
BufferUtil.flipToFlush(buffer, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen()
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onOpen() {}", this);
|
||||
|
||||
// Open Session
|
||||
super.onOpen();
|
||||
coreSession.onOpen();
|
||||
if (moreDemand())
|
||||
fillAndParse();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClose(Throwable cause)
|
||||
{
|
||||
|
@ -533,6 +499,40 @@ public class WebSocketConnection extends AbstractConnection implements Connectio
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extra bytes from the initial HTTP upgrade that need to
|
||||
* be processed by the websocket parser before starting
|
||||
* to read bytes from the connection
|
||||
*
|
||||
* @param initialBuffer the bytes of extra content encountered during upgrade
|
||||
*/
|
||||
protected void setInitialBuffer(ByteBuffer initialBuffer)
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Set initial buffer - {}", BufferUtil.toDetailString(initialBuffer));
|
||||
try (AutoLock l = lock.lock())
|
||||
{
|
||||
networkBuffer = newNetworkBuffer(initialBuffer.remaining());
|
||||
}
|
||||
ByteBuffer buffer = networkBuffer.getByteBuffer();
|
||||
BufferUtil.clearToFill(buffer);
|
||||
BufferUtil.put(initialBuffer, buffer);
|
||||
BufferUtil.flipToFlush(buffer, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onOpen()
|
||||
{
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("onOpen() {}", this);
|
||||
|
||||
// Open Session
|
||||
super.onOpen();
|
||||
coreSession.onOpen();
|
||||
if (moreDemand())
|
||||
fillAndParse();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInputBufferSize(int inputBufferSize)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue