Uh oh!
There was an error while loading. Please reload this page.
Added SshCommand.InputStream to allow writing to stdin of SshCommand - #1293
Conversation
Excluded MD5 tests on net462 because I get System.InvalidOperationException: 'This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.' SshdConfig: do not throw for "Include", just do nothing. Modified failing dos2unix parameters in Dockerfile.TestServer. Forceing LF line ending for key files used by integration tests, otherwise using them causes error. SftpClientTest.Test_Sftp_Multiple_Async_Upload_And_Download_10Files_5MB_Each times out for maxFiles=10, decreasing to 2 to make the test pass.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
WojciechNagorski
commented
Jan 25, 2024
It looks good to me! But I need more time to test it! Do you have a specific function in mind that you want to implement using this functionality? |
WojciechNagorski
commented
Jan 25, 2024
Rob-Hague
left a comment
There was a problem hiding this comment.
I don't think we should send channel EOF in Write. How about calling it only in Dispose and initialising InputStream lazily, something like:
varcmd= ...using(cmd.InputStream)// This initialises InputStream{myStream.CopyTo(cmd.InputStream);}// This disposes InputStream and sends EOF?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
… SshCommand.InputStream with CreateInputStream to emphasise that a (disposable) resource is created here. EndExecute also closes the _inputStream to make sure that EOF is sent (in case the user forgot to dispose the input stream). Added more unit tests: sending the input one byte at a time, not disposing the input stream, calling CreateInputStream before BeginExecute or AfterEndExecute throws exception.
…SH.NET into SshCommandInputStream
realvizu
commented
Jan 31, 2024
I had a very specific use case: I had to call some legacy system that is implemented as a set of SSH commands and one of the commands requires sending a file via input stream. These changes made it work. |
realvizu
commented
Jan 31, 2024
Thanks a lot @WojciechNagorski and @Rob-Hague for the comments and suggestions!
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
realvizu
commented
Feb 2, 2024
Shall I do a squash+rebase onto develop before merging the PR? |
Rob-Hague
commented
Feb 2, 2024
It will be merged with "Squash and merge" so it is not necessary (it requires a CODEOWNERS approval before it can merge) |
WojciechNagorski
commented
Feb 6, 2024
There is a build problem:
|
Uh oh!
There was an error while loading. Please reload this page.
WojciechNagorski
commented
Feb 22, 2024
This issue has been fixed in the 2024.0.0 version. |

Changes:
I you have recommendations for further unit tests, please advise.
I started the work by trying to run all unit tests on my dev machine to see if they all pass. Unfortunately a lot of them failed, so I had to make the following modifications (see the changes in my first commit in this PR):
If you know a better fix for any of the above modifications, please advise.