Skip to content

Commit

Permalink
Fix hybi hanging. Was throwing a swallowed indexoutofrange.
Browse files Browse the repository at this point in the history
  • Loading branch information
statianzo committed Sep 28, 2011
1 parent af151f4 commit 982650c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Fleck/Refactor/Hybi13Handler.cs
Expand Up @@ -63,7 +63,7 @@ public static byte[] FrameData(byte[] payload, Opcode opcode)
public static void ReceiveData(List<byte> data, ReadState readState, Action<Opcode, byte[]> processFrame)
{

while (data.Count > 0)
while (data.Count >= 2)
{
var isFinal = (data[0] & 128) != 0;
var opcode = (Opcode)(data[0] & 15);
Expand Down Expand Up @@ -95,7 +95,6 @@ public static void ReceiveData(List<byte> data, ReadState readState, Action<Opco
payloadLength = length;
}


if (data.Count < index + 4)
return; //Not complete

Expand Down

0 comments on commit 982650c

Please sign in to comment.