diff --git a/CASA/micasad/lib/communication/UnixIPCClientChannel.cs b/CASA/micasad/lib/communication/UnixIPCClientChannel.cs index b33a8e23..65c762f8 100644 --- a/CASA/micasad/lib/communication/UnixIPCClientChannel.cs +++ b/CASA/micasad/lib/communication/UnixIPCClientChannel.cs @@ -133,23 +133,17 @@ namespace Novell.CASA.MiCasa.Communication bytesRecvd = mSocket.Receive(buf); ms.Write(buf, 0, bytesRecvd); - totalBytes = totalBytes + bytesAvailable; + totalBytes = totalBytes + bytesAvailable; // did we wrap + if (totalBytes < 0) + { + return null; + } } if (totalBytes == 0) return null; return ms.ToArray(); - /* - byte[] finalbuf = ms.ToArray(); - int returnBufferLen = msgIdBytes.Length + msgLenBytes.Length + totalBytes; - returnBuffer = new byte[returnBufferLen]; - Array.Copy(msgIdBytes, returnBuffer, 2); - Array.Copy(msgLenBytes, 0, returnBuffer, 2, 4); - Array.Copy(finalbuf, 0, returnBuffer, 6, finalbuf.Length); - return returnBuffer; - * - */ } else {