Fix for issue #84

master
sta 11 years ago
parent 2a3a62ec82
commit f60f16f70f

@ -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);
} }

Loading…
Cancel
Save