This project is read-only.

lock on _incoming

Dec 21, 2012 at 6:53 AM

Hello,

I think I found small bug. There was no lock in Read function (ShellStream.cs). This cause a crash in (Channel_DataReceived) under heavy load. Fixed fragment:

       public override int Read(byte[] buffer, int offset, int count)
        {
            var i = 0;

            lock (this._incoming)
            {
                for (; i < count && this._incoming.Count > 0; i++)
                {
                    buffer[offset + i] = this._incoming.Dequeue();
                }
            }

            return i;
        }

Dec 21, 2012 at 1:53 PM

Hi,

You correct, thanks for pointing this out.

 

I just committed a code with this fix.

 

Thanks,

Oleg