From 142fc2213d0514c1b101a4a7ca0d672bd6c0ff4e Mon Sep 17 00:00:00 2001 From: sta Date: Tue, 20 May 2014 11:03:22 +0900 Subject: [PATCH] Fix a few for Chunk.cs --- websocket-sharp/Net/Chunk.cs | 10 ++-------- websocket-sharp/Net/ChunkStream.cs | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/websocket-sharp/Net/Chunk.cs b/websocket-sharp/Net/Chunk.cs index 73573dbf..efa165c9 100644 --- a/websocket-sharp/Net/Chunk.cs +++ b/websocket-sharp/Net/Chunk.cs @@ -61,15 +61,9 @@ namespace WebSocketSharp.Net #region Public Properties - public int Length { + public int ReadLeft { get { - return _data.Length; - } - } - - public int Offset { - get { - return _offset; + return _data.Length - _offset; } } diff --git a/websocket-sharp/Net/ChunkStream.cs b/websocket-sharp/Net/ChunkStream.cs index 68c3a830..0d521ed8 100644 --- a/websocket-sharp/Net/ChunkStream.cs +++ b/websocket-sharp/Net/ChunkStream.cs @@ -134,7 +134,7 @@ namespace WebSocketSharp.Net if (chunk == null) continue; - if (chunk.Offset == chunk.Length) { + if (chunk.ReadLeft == 0) { _chunks [i] = null; continue; }