Fixed onUpgradeFrom(): buffer must be copied.

This commit is contained in:
Simone Bordet 2015-10-29 19:26:56 +01:00
parent 7200b2df0e
commit 6b0e1d48c5
1 changed files with 2 additions and 2 deletions

View File

@ -92,8 +92,8 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res
{
if (BufferUtil.hasContent(buffer))
{
ByteBuffer upgradeBuffer = buffer;
releaseBuffer(); // TODO: right place to do this?
ByteBuffer upgradeBuffer = ByteBuffer.allocate(buffer.remaining());
upgradeBuffer.put(buffer);
return upgradeBuffer;
}
return null;