Fixed wrong content length for websocket handshake messages

This commit is contained in:
Trustin Lee 2010-06-22 07:02:27 +00:00
parent 7df28adfe3
commit 685153663e

View File

@ -123,8 +123,7 @@ public class WebSocketServerHandler extends SimpleChannelUpstreamHandler {
input.writeInt(b); input.writeInt(b);
input.writeLong(c); input.writeLong(c);
ChannelBuffer output = ChannelBuffers.wrappedBuffer( ChannelBuffer output = ChannelBuffers.wrappedBuffer(
MessageDigest.getInstance("MD5").digest(input.array()), MessageDigest.getInstance("MD5").digest(input.array()));
new byte[] { '\r', '\n' });
res.setContent(output); res.setContent(output);
} else { } else {
// Old handshake method with no challenge: // Old handshake method with no challenge: