Merge pull request #460 from fredericBregier/master

Master fix for issue #456 related to payload in WebSocket08FrameEncoder
This commit is contained in:
Norman Maurer 2012-07-18 01:50:23 -07:00
commit b5412c9563

View File

@ -166,7 +166,7 @@ public class WebSocket08FrameEncoder extends MessageToByteEncoder<WebSocketFrame
if (maskPayload) {
int random = (int) (Math.random() * Integer.MAX_VALUE);
mask = ByteBuffer.allocate(4).putInt(random).array();
out.writeInt((int) (Math.random() * Integer.MAX_VALUE));
header.writeBytes(mask);
int counter = 0;
for (int i = data.readerIndex(); i < data.writerIndex(); i ++) {