Commit Graph

557 Commits

Author SHA1 Message Date
drieseng 540b2a1c13 Remove TFS control file. 2016-02-04 21:26:23 +01:00
drieseng 0884dbe306 Removed TFS control files. 2016-02-04 21:24:11 +01:00
drieseng a79b324dce Add solution file for VS 2015, and configure NuGet repo folder 2016-02-04 21:17:31 +01:00
drieseng 0830710816 Fixed project file.
Added missing (linked) source files.
2016-02-04 21:16:55 +01:00
drieseng 8a2bcdea35 Moved Build folder
Moved 'Build' folder to root, and renamed it to 'build'.
2016-02-04 20:46:47 +01:00
drieseng c6d686691f Remove TFS templates, and obsolete files imported by the migration from Codeplex
Removes TFS templates, and files that were importing into master by the
Github migration tool for TFS.
2016-02-04 20:35:09 +01:00
drieseng 3a2725eae2 Rename Renci.SshClient to src. 2016-02-03 21:18:34 +01:00
Gert Driesen 0699930785 Delete RSADigitalSignature.cs
Remove file that was actually deleted in Codeplex.
2016-02-03 20:34:29 +01:00
Gert Driesen b6ea2fe26f Document fixes. 2014-12-22 14:38:26 +00:00
Gert Driesen 80702f796d Ensure we do not block forever waiting for message listener thread to complete when the server sends a disconnect message, or the message listener thread never actually started. Fixes issue #2591.
Refactored creating of key exchange algorithm to allow unit tests without encyption and decryption.
Added tests for KeyExchangeDhGroupExchangeRequest and IgnoreMessage.
Added large set of tests for Session in both connected and disconnected mode.
Remove SshData.ReadInt64() and SshData.Write(long). Fixes issue #2579.
2014-12-22 14:38:10 +00:00
Gert Driesen 8f9d4ea873 Remove this qualifier. 2014-12-21 10:39:06 +00:00
Gert Driesen 45a233299f Fix compile. 2014-12-15 15:36:34 +00:00
Gert Driesen adfaafdda8 Apply optimization changes to other projects. 2014-12-15 15:24:54 +00:00
Gert Driesen c61633a3bc * Introduced ChannelExtendedDataEventArgs which is used to signal receive of extended data.
* Removed DataTypeCode from ChannelDataEventArgs, as this is specific to extended data.
* Large set of optimizations in receive and send of SSH messages:
  - removed several buffer copies
  - modified most of the SSH messages to allow the size of the message to be calculated in advance to eliminate need to resize buffer.
  - added Compress(byte[] data, int offset, int length) overload to Compressor to compress part of a given buffer thereby avoiding need for buffer copy.
  - added Encrypt(byte[] data, int offset, int length) overload to Cipher to encrypt part of a given buffer thereby avoiding need for buffer copy.

* SshData:
  - SshData.GetBytes uses a SshDataStream which has a capacity that (in almost all cases) matches the size of the SSH message.
  - Added a Load(byte[] value, int offset) overload.
  - Added a LoadBytes(byte[] bytes, int offset) overload.
  - Added a Write(byte[] data) overload.
  - Added a Write(byte[] buffer, int offset, int count) overload.

* Added SendData(byte[] data, int offset, int size) overload to Channel to allow sending part of a given buffer.
  This avoids a buffer copy in ScpClient, SftpClient, Shell, ChannelDirectTcpip, ChannelForwardedTcpip.
  Fixes issue #1516.

All optimization changes above are only active when the TUNING conditional compilation symbol is defined.
By default, this symbol is defined.
2014-12-15 12:55:11 +00:00
Gert Driesen be314d209e Fix build. 2014-11-27 19:57:11 +00:00
Gert Driesen 38d4f3d605 Add SendEof to IChannel. 2014-11-26 18:15:10 +00:00
Gert Driesen e0a795ee3a Use Write(byte) overload is used internally when Write(bool) is invoked. 2014-11-24 15:24:05 +00:00
Gert Driesen d9b9e035ca Reintroduce internal Channel.SendEof method. 2014-11-23 17:04:48 +00:00
Gert Driesen e7ff062145 Remove redundant this qualifier, and fixes general warnings. 2014-11-22 17:11:41 +00:00
Gert Driesen 0986ba8196 Fix formatting of release notes. 2014-11-22 13:09:52 +00:00
Gert Driesen 90f3086440 Fix warning. 2014-11-22 12:37:54 +00:00
Gert Driesen 0da2c06ded Small doc fixes, fix warnings and prepare for beta 2. 2014-11-22 12:27:11 +00:00
Gert Driesen 2659048654 Prepare for 2014.4.6-beta2. 2014-11-22 11:58:42 +00:00
Gert Driesen 007112d2b4 Rephrase buffer size change. 2014-11-22 11:57:05 +00:00
Gert Driesen 52b97729e2 Reduce default buffer size as workaround for SSH servers issues. 2014-11-22 11:17:18 +00:00
Gert Driesen c45bc8f1a4 Document fix for issue #1844. 2014-11-22 11:02:09 +00:00
Gert Driesen a780cb9a56 Document fix for issue #1877. 2014-11-22 10:56:44 +00:00
Gert Driesen b1c90ea758 Document fixes for issues #2029 and #2400. 2014-11-22 10:29:50 +00:00
Gert Driesen c4b120e6a3 Fix Silverlight and WP compile. 2014-11-22 10:25:50 +00:00
Gert Driesen 3d3d76fe52 Introduce TrySendMessage method on Session which will not let SocketException or SshException exception bubble up, but instead return false in this case.
Use TrySendMessage to send SSH_MSG_DISCONNECT, SSH_MSG_CHANNEL_EOF, SSH_MSG_CHANNEL_CLOSE and SSH_MSG_IGNORE messages to avoid throwing exceptions while closing/disposing or sending keep-alive messages.
Avoid sending multiple keep-alive messages concurrently for the same client.
Fixed regression in multi-factor authentication.
2014-11-20 18:56:35 +00:00
Gert Driesen 39a75ef91c Remove redundant this qualifier. 2014-11-19 14:56:16 +00:00
Gert Driesen 9da65f35a4 Remove redundant this qualifier. 2014-11-18 18:08:25 +00:00
Gert Driesen 188c313818 When disposing a client, (re)use Disconnect() to signal that we're disconnecting - hereby avoiding exceptions getting thrown for a waithandle timeout (waiting for a SSH response message). Note: may need to revisit this again to only avoid throwing exception waiting for a response on a disconnect or channel close/eof message. 2014-11-17 20:30:47 +00:00
Gert Driesen 26548e248a No longer disconnect the SSH session whenever a timeout occurs waiting for a WaitHande to become signaled. 2014-11-17 20:09:35 +00:00
Gert Driesen e1abcd2a08 Remove redundant this qualifier. 2014-11-16 21:04:34 +00:00
Gert Driesen ab1a43aedc Document fix for issue 2010. 2014-11-16 15:05:38 +00:00
Gert Driesen 8b05e92d41 Avoid sending data on a socket that is closed (by ourselves). 2014-11-16 15:02:51 +00:00
Gert Driesen d80ce73c56 Do not set DontLinger socket option. 2014-11-16 14:55:16 +00:00
Gert Driesen 8e2ea99dd9 Increase backlog to 5. 2014-11-16 14:52:59 +00:00
Gert Driesen 861e291f44 Sync projects with .NET 4.x projects. 2014-11-16 14:36:53 +00:00
Gert Driesen b7d3a4fe5d Remove placeholder. 2014-11-16 10:39:51 +00:00
Gert Driesen cb430bb013 Add to TFS. 2014-11-16 10:29:51 +00:00
Gert Driesen f629f05081 Document fix for issue 1382. 2014-11-16 10:15:39 +00:00
Gert Driesen 6e11950d60 Added internal ctor to ScpClient that takes an IServiceFactory to allow for mocking of PipeStream.
Added missing read (and check) of the returncode after a file copy command. Fixes issue #1382.
2014-11-16 10:12:12 +00:00
Gert Driesen 063338f524 Use Socket.Shutdown(SocketShutdown.Send) to signal FIN to remove party, and allow socket to close in a clean way. 2014-11-13 19:09:47 +00:00
Gert Driesen 4dbbf7514f Create output buffer after padding to ensure its length matches the padded length.
Fixes issue #2547.
2014-11-12 20:45:43 +00:00
Gert Driesen 80a193ec50 Removed redundant this qualified.
Changed accessibility of _blockSize to private.
2014-11-12 18:58:46 +00:00
Gert Driesen 62ab1d4114 Document fix for issue #2013. 2014-11-12 18:49:44 +00:00
Gert Driesen 71664e2c93 Channel:
* Only send SSH_MSG_CHANNEL_EOF message to remote party when we haven't received a SSH_MSG_CHANNEL_EOF or SSH_MSG_CHANNEL_CLOSE message from the remote party.
* Move logic for sending SSH_MSG_CHANNEL_EOF message from derived classes and client classes into Channel.Close(bool) method.
* Move initialization to ctor.

ChannelSession:
* Avoid leaking session semaphores.

SftpFileStream:
* Modify CanRead, CanWrite and CanSeek to return false when the stream is disposed.
* Modify other public members to throw ObjectDisposedException when the stream is disposed or the SFTP session is no longer open.
* Modify Dispose to only flush the write buffer and/or close the SFTP file handle when the SFTP session is open.
* No longer flush write buffer or close SFTP file handle in finalizer. Fixes issue #2013.

Session:
* Remove CreateClientChannel<T> and CreateServerChannel<T> methods; use specific constructors of channels instead.

SftpClient:
* BufferSize was not used for AppendText(String, Encoding) and Create(String) overloads.

SubsystemSession:
* Added IsOpen property.
* Throw ObjectDisposedException in all public members - except for IsOpen - when the session is disposed.
* Throw InvalidOperationException in all public members - except for Connect and IsOpen - when the session is not open.
* Modify Disconnect to release managed resources that are linked to the connected session.
* Modify Dispose to use Disconnect to managed resources that are linked to the connected session.

Unit tests:
* Added large set of tests for changes listed above.
* Tests for which the code was automatically, and that are not yet correctly implemented, are now marked as Ignore.
* Tests that require a (specifically configured) running SSH server are now marked with test category "integration".
2014-11-12 18:48:20 +00:00
Gert Driesen 3a5edc9077 Added missing checks for availability of session. 2014-11-11 12:53:03 +00:00