Quantcast
Channel: sshnet Source Code Rss Feed
Viewing all articles
Browse latest Browse all 291

Patch Uploaded: #17498

$
0
0

Corillian has uploaded a patch.

Description:
Issue 2675:

The output thread within Shell.Start() is not properly synchronized. Specifically the call to EventWaitHandle.WaitAny() is waiting until the asynchronous BeginRead() operation is finished which occurs at the moment EndRead() returns within the callback. At this point a new BeginRead() operation is queued, potentially before the data in buffer has had an opportunity to hit the socket, which causes a race condition. In the case where TUNING is not defined a Take() call is made to copy the contents of buffer. In this case there is still a race condition as another asynchronous BeginRead() operation may have already been initiated and could be overwriting the contents of buffer before the Take() begins.

The solution is to wait on a ManualResetEventSlim that doesn't get set until both the BeginRead() and _channel.SendData() operations are complete. I've attached a patched Shell.cs that fixes this issue and will formally submit the file as a patch as well.


Viewing all articles
Browse latest Browse all 291

Trending Articles



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