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

Patch Uploaded: #17236

$
0
0

onehourlate has uploaded a patch.

Description:
Hi,

I had a couple of issues while using scp with cisco routers

1) the scp commands (scp -t or scp -f) uses double quotes to escape the file name. That's not supported if the other end doesn't have a shell that understands that. So the patch adds the quote only if necessary (that is, if the file contains whitespace chars). It cas it adds quotes, it also escapes any inner quote in the file name. Cf ScpClient.QuoteIfNeeded method

2) the Upload(Stream source, string path) method didn't work at all because the scp -t command was never sent if the filename didn't contain a '/' or '\'

3) Disposing of the scp session tended to throw an exception because the other end had already closed it. I didn't try to hard to understand, but I added code to swallow the SocketException with error code 10054 (WSAECONNRESET cf https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668%28v=vs.85%29.aspx) in method Session.SocketDisconnect . No point raising an exception on close because the other end already closed the socket I think.


Viewing all articles
Browse latest Browse all 291

Trending Articles