diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/WebSocketFrame.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/WebSocketFrame.java index c56e428760d..7a1e7edbb92 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/WebSocketFrame.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/WebSocketFrame.java @@ -139,6 +139,8 @@ public class WebSocketFrame implements Frame mask = new byte[copy.mask.length]; System.arraycopy(copy.mask,0,mask,0,mask.length); } + payloadLength = copy.payloadLength; + payloadStart = copy.payloadStart; data = copy.data.slice(); continuationIndex = copy.continuationIndex; continuation = copy.continuation; diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketServletRFCTest.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketServletRFCTest.java index a2bd5e5ae96..8829d0e8653 100644 --- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketServletRFCTest.java +++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/WebSocketServletRFCTest.java @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.Queue; import java.util.concurrent.TimeUnit; -import org.eclipse.jetty.util.BufferUtil; import org.eclipse.jetty.util.FutureCallback; import org.eclipse.jetty.util.Utf8Appendable.NotUtf8Exception; import org.eclipse.jetty.util.Utf8StringBuilder; @@ -321,7 +320,6 @@ public class WebSocketServletRFCTest WebSocketFrame bin = WebSocketFrame.binary(buf).setFin(true); ByteBuffer bb = generator.generate(bin); - BufferUtil.flipToFlush(bb,0); try { client.writeRaw(bb); @@ -363,7 +361,6 @@ public class WebSocketServletRFCTest WebSocketFrame text = WebSocketFrame.text().setPayload(buf).setFin(true); ByteBuffer bb = generator.generate(text); - BufferUtil.flipToFlush(bb,0); try { client.writeRaw(bb); @@ -402,7 +399,6 @@ public class WebSocketServletRFCTest WebSocketFrame txt = WebSocketFrame.text().setPayload(buf); ByteBuffer bb = generator.generate(txt); - BufferUtil.flipToFlush(bb,0); client.writeRaw(bb); Queue frames = client.readFrames(1,TimeUnit.SECONDS,1); diff --git a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java index 46e27e050ba..ae4aeeb8907 100644 --- a/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java +++ b/jetty-websocket/websocket-server/src/test/java/org/eclipse/jetty/websocket/server/blockhead/BlockheadClient.java @@ -416,8 +416,7 @@ public class BlockheadClient implements IncomingFrames { LOG.debug("writing out: {}",BufferUtil.toDetailString(buf)); } - byte arr[] = BufferUtil.toArray(buf); - out.write(arr,0,arr.length); + BufferUtil.writeTo(buf,out); out.flush(); if (frame.getOpCode() == OpCode.CLOSE)