SSH.NET icon indicating copy to clipboard operation
SSH.NET copied to clipboard

Fix sftp async methods not observing error conditions

Open Rob-Hague opened this issue 4 months ago • 0 comments

The async methods on SftpClient (as implemented in SftpSession) were only completing on receiving a response in the sftp layer, or via cancellation. They were not paying any attention to the ErrorOccured, SessionDisconnected or ChannelClosed events, which would result in an infinite wait when one of these occured.

This fix waits asynchronously on the wait handles using ThreadPool.RegisterWaitForSingleObject. It also adds missing plumbing of OperationTimeout.

closes #1497

Rob-Hague avatar Sep 29 '24 11:09 Rob-Hague