sshnet / SSH.NET

SSH.NET is a Secure Shell (SSH) library for .NET, optimized for parallelism.
http://sshnet.github.io/SSH.NET/
MIT License
3.88k stars 917 forks source link

Fixed dequeuing of incoming queue #1319

Closed jscarle closed 4 months ago

jscarle commented 4 months ago

Fixed the dequeueing of the _incoming queue following #1207 and added the related test to protect against future regressions.

jscarle commented 4 months ago

@WojciechNagorski Following @Rob-Hague 's observation in #1207, there is indeed an issue where the incoming queue may not dequeue at the same rate as the expect queue if the data that has not been processed exceeds the size of the expect buffer. An improbable case, but nonetheless, this PR fixes that.

jscarle commented 4 months ago

Additionally, I made sure that the full incoming queue is returned when Expect matches and not just the expected queue.

jscarle commented 4 months ago

@WojciechNagorski @Rob-Hague This is ready to be merged.