From 99cf6b1b793d70e50ed690cd2be9e00553aa932f Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 14 Jan 2014 23:08:00 +0900 Subject: [PATCH] Fix a few --- websocket-sharp/WsStream.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/websocket-sharp/WsStream.cs b/websocket-sharp/WsStream.cs index 50137c5d..f72e8527 100644 --- a/websocket-sharp/WsStream.cs +++ b/websocket-sharp/WsStream.cs @@ -103,7 +103,9 @@ namespace WebSocketSharp private byte [] readHandshakeEntityBody (string length) { var len = Int64.Parse (length); - return _innerStream.ReadBytes (len, 1024); + return len > 1024 + ? _innerStream.ReadBytes (len, 1024) + : _innerStream.ReadBytes ((int) len); } private string [] readHandshakeHeaders ()