SSH.NET
SSH.NET copied to clipboard
Fix sftp async methods not observing error conditions
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