From 7e46ad0cb732240490bb715a4f02c9e464f9ba8d Mon Sep 17 00:00:00 2001 From: sta Date: Fri, 17 Jan 2014 02:31:59 +0900 Subject: [PATCH] Fix a few --- websocket-sharp/WsStream.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/websocket-sharp/WsStream.cs b/websocket-sharp/WsStream.cs index 60d2dde6..4bbaaee9 100644 --- a/websocket-sharp/WsStream.cs +++ b/websocket-sharp/WsStream.cs @@ -111,10 +111,14 @@ namespace WebSocketSharp private static string [] readHandshakeHeaders (Stream stream) { var buffer = new List (); - Action add = i => buffer.Add ((byte) i); + var count = 0; + Action add = i => { + buffer.Add ((byte) i); + count++; + }; var read = false; - while (buffer.Count < _handshakeHeadersLimitLen) { + while (count < _handshakeHeadersLimitLen) { if (stream.ReadByte ().EqualsWith ('\r', add) && stream.ReadByte ().EqualsWith ('\n', add) && stream.ReadByte ().EqualsWith ('\r', add) &&