Fix for issue #84

This commit is contained in:
sta 2014-10-25 11:56:28 +09:00
parent 2a3a62ec82
commit f60f16f70f

View File

@ -671,28 +671,24 @@ namespace WebSocketSharp
0, 0,
length, length,
ar => { ar => {
byte[] bytes = null;
try { try {
var len = stream.EndRead (ar); byte[] bytes = null;
bytes = len < 1 try {
? new byte[0] var len = stream.EndRead (ar);
: len < length bytes = len < 1
? stream.readBytes (buff, len, length - len) ? new byte[0]
: buff; : len < length
} ? stream.readBytes (buff, len, length - len)
catch (ObjectDisposedException) { : buff;
// The Stream has been closed. }
return; catch (ObjectDisposedException) {
} // The Stream has been closed.
catch (Exception ex) { return;
if (error != null) }
error (ex); catch {
throw;
}
return;
}
try {
if (completed != null) if (completed != null)
completed (bytes); completed (bytes);
} }