Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: lock on _incoming

$
0
0

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:

publicoverrideint 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;
        }

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>