diff --git a/websocket-sharp/Net/ChunkStream.cs b/websocket-sharp/Net/ChunkStream.cs index 8515764d..18aaef41 100644 --- a/websocket-sharp/Net/ChunkStream.cs +++ b/websocket-sharp/Net/ChunkStream.cs @@ -184,11 +184,11 @@ namespace WebSocketSharp.Net if (!_gotIt) _saved.Append ((char) b); - - if (_saved.Length > 20) - throwProtocolViolation ("The chunk size is too long."); } + if (_saved.Length > 20) + throwProtocolViolation ("The chunk size is too long."); + if (!_sawCr || b != 10) return InputChunkState.None;