[Modify] Polish it

This commit is contained in:
sta 2021-02-03 19:38:48 +09:00
parent f698486de3
commit 3db97ec838

View File

@ -218,14 +218,15 @@ namespace WebSocketSharp.Net
if (asyncResult is HttpStreamAsyncResult) { if (asyncResult is HttpStreamAsyncResult) {
var ares = (HttpStreamAsyncResult) asyncResult; var ares = (HttpStreamAsyncResult) asyncResult;
if (!ares.IsCompleted) if (!ares.IsCompleted)
ares.AsyncWaitHandle.WaitOne (); ares.AsyncWaitHandle.WaitOne ();
return ares.SyncRead; return ares.SyncRead;
} }
// Close on exception?
var nread = _stream.EndRead (asyncResult); var nread = _stream.EndRead (asyncResult);
if (nread > 0 && _bodyLeft > 0) if (nread > 0 && _bodyLeft > 0)
_bodyLeft -= nread; _bodyLeft -= nread;