[Modify] Polish it
This commit is contained in:
parent
f698486de3
commit
3db97ec838
@ -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;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user