[Modify] Polish it
This commit is contained in:
parent
26b108ae29
commit
94ef38537c
@ -336,10 +336,13 @@ namespace WebSocketSharp.Net
|
|||||||
write (buffer, ref offset, length);
|
write (buffer, ref offset, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
private InputChunkState writeData (byte[] buffer, ref int offset, int length)
|
private InputChunkState writeData (
|
||||||
|
byte[] buffer, ref int offset, int length
|
||||||
|
)
|
||||||
{
|
{
|
||||||
var cnt = length - offset;
|
var cnt = length - offset;
|
||||||
var left = _chunkSize - _chunkRead;
|
var left = _chunkSize - _chunkRead;
|
||||||
|
|
||||||
if (cnt > left)
|
if (cnt > left)
|
||||||
cnt = left;
|
cnt = left;
|
||||||
|
|
||||||
@ -350,7 +353,9 @@ namespace WebSocketSharp.Net
|
|||||||
offset += cnt;
|
offset += cnt;
|
||||||
_chunkRead += cnt;
|
_chunkRead += cnt;
|
||||||
|
|
||||||
return _chunkRead == _chunkSize ? InputChunkState.DataEnded : InputChunkState.Data;
|
return _chunkRead == _chunkSize
|
||||||
|
? InputChunkState.DataEnded
|
||||||
|
: InputChunkState.Data;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user