WIP. AutoBahn tests 6 working. Needed to check if final string is UTF-8 compliant.

This commit is contained in:
Veebs 2011-10-17 13:48:42 +11:00
parent 234952a516
commit beb56878e4

View File

@ -265,13 +265,13 @@ public class WebSocket08FrameDecoder extends ReplayingDecoder<WebSocket08FrameDe
// Check text for UTF8 correctness // Check text for UTF8 correctness
if (frameOpcode == OPCODE_TEXT || fragmentedFramesText != null) { if (frameOpcode == OPCODE_TEXT || fragmentedFramesText != null) {
// Check UTF-8 correctness for this payload
checkUTF8String(channel, framePayload.array()); checkUTF8String(channel, framePayload.array());
}
// If final frame in a fragmented message, then set // This does a second check to make sure UTF-8
// aggregated text so it can be returned // correctness for entire text message
if (fragmentedFramesText != null) {
aggregatedText = fragmentedFramesText.toString(); aggregatedText = fragmentedFramesText.toString();
fragmentedFramesText = null; fragmentedFramesText = null;
} }
} }