Commit Graph

448 Commits

Author SHA1 Message Date
Gert Driesen d3f750aa79 Unsubscribe from events before disposing WaitHandles.
This reduces the likelyhood of invoking Set() on a disposed WaitHandle.
Incomplete fix for issues #1944 and #1942 as eventhandlers could still be invoked after unsubscription.
2014-04-10 19:00:40 +00:00
Gert Driesen 0a8ac33d46 Unsubscribe from events before disposing WaitHandles.
This reduces the likelyhood of invoking Set() on a disposed WaitHandle.
Incomplete fix for issues #1944 and #1942 as eventhandlers could still be invoked after unsubscription.
2014-04-10 18:56:29 +00:00
Gert Driesen 61b712a512 Fix issue #1943:
Client channels are no longer closed on dispose
2014-04-07 13:20:26 +00:00
Gert Driesen 53cd872b89 Document fix for issue #1764:
Incorrect copyright in assemblies
2014-04-06 15:07:17 +00:00
Gert Driesen 239a425225 Fix indentation of release notes. 2014-04-06 12:31:52 +00:00
Gert Driesen 92231b5150 Shall we make it 2014.4.6-beta1, right :p 2014-04-06 09:13:53 +00:00
Gert Driesen 039f7fea7b 2013.4.6-beta1 2014-04-06 09:08:14 +00:00
Gert Driesen fea1433f2a Fix compile on WP. 2014-04-06 09:02:37 +00:00
Gert Driesen 8568283583 Add SandCastle folder under Build.
Fix formatting of comment in SandCastle build script.
2014-04-06 06:57:25 +00:00
Gert Driesen 069b373343 Remove linefeed from WriteLine method in Shellstream class (issue #1584).
Guard against NRE in Channel_DataReceived.
2014-04-05 12:47:30 +00:00
Gert Driesen 46d15325e9 Use an int to hold position when iterating of state. Stuck loop on key exchange using arcfour encryption (issue #1922) 2014-03-31 18:55:22 +00:00
Gert Driesen fbd482fd63 Split up data in multiple messages when it does not fit in remote window size. This prevents timeout when sending data to server with a low window size and which adjusts the window size very conservatively (issue #1706) 2014-03-31 18:44:35 +00:00
Gert Driesen dae0eb761d Make it more clear that the local window size is related to the packet size. 2014-03-31 17:37:29 +00:00
Gert Driesen c1fec4b7a4 Add support for generating help doc. 2014-03-23 19:26:55 +00:00
Gert Driesen 870bedfe55 Move all shared assembly-level attribute to CommonAssemblyInfo.cs. 2014-03-23 19:05:57 +00:00
Gert Driesen fc490c0fa7 Added ClientChannel, ServerChannel and ChannelOpenConfirmedEventArgs source files, and do not emit debug symbols in release configuration. 2014-03-23 18:19:05 +00:00
Gert Driesen 12b3793582 Use batching to simplify build script. 2014-03-23 09:15:36 +00:00
Gert Driesen 1b83ffb5a9 Document few more fixed, and correct typo. 2014-03-23 09:14:45 +00:00
Gert Driesen d68fde30fe Fixed another reference in XML doc. 2014-03-23 09:13:32 +00:00
Gert Driesen 22d44348f5 Fixed reference in XML doc. 2014-03-23 09:12:24 +00:00
Gert Driesen 3384a7d806 Fix compile on .NET 3.5 2014-03-23 09:09:20 +00:00
Gert Driesen 397640ef10 Issue #1930: No connection possible with the same auth method requested multiple times. Improve exception message for authentication failures. 2014-03-22 18:03:09 +00:00
Gert Driesen 2ddb3df0e0 * Introduce ClientChannel and ServerChannel classes to distinguish between channel initiated by the client or the server.
* Increase maximum SSH packet size to 68536 bytes (64 KB + 3000 bytes).
* Increase local window size to 2 MB.
* Increase local maximum packet size from 32 KB to 64 KB.
* Modify Channel to save remote channel info (packet size, window size and channel number); distinguish between local and remote packet size.
* Expose channel in SubsystemSession to allow SftpSession to access local and remote maximum packet size for calculation of optimal read and write (buffer) length.
* Move verification of maximum data payload to send to Channel.SendMessage and verify data length against remote packet size.
* Limit size of payload to send to peer to RemotePacketSize in ChannelForwardedTcpip and ChannelDirectTcpip.
* Disable debug symbols when building in Release configuration.
2014-03-22 15:06:44 +00:00
Gert Driesen 24fc04934f Fixed reference in XML doc. 2014-03-22 09:30:51 +00:00
Gert Driesen a11518fe93 Large improvement of throughput for DownloadFile by taking into account of the SSH_FXP_DATA header info for determining the length of the data we request in each response message. This eliminates an extra SSH_MSG_CHANNEL_DATA message for each SSH_FXP_DATA. 2014-03-13 20:55:23 +00:00
Gert Driesen cb7d2b6bd1 Avoid race conditions signaling events.
Update release notes with new fixes.
2014-03-13 20:27:40 +00:00
Gert Driesen e630397c66 Use server decryption algorithm instead of client encryption algorithm to decrypt server message. Fixes issue #1917. 2014-03-11 19:25:38 +00:00
Gert Driesen 34405caa24 BaseClient:
* Added bool argument to BaseClient ctor to indicate whether the specified ConnectionInfo
  instance is owned by the client.
* In Dispose, also dispose ConnectionInfo if ownsConnectionInfo is true.
* Modified Connect() to throw InvalidOperationException when the client is already connected.
* Postpone creation of keep-alive timer until client has actually connected, and stop timer
  when disconnecting the client.
* Document default value of KeepAliveInterval.
* Modified all public members to throw ObjectDisposedException when client is disposed.
* Modified Dispose to stop the keep-alive timer (and wait until all timer callbacks have
  been executed) before the session is disposed.

NetConfClient:
* Moved dispose of ConnectionInfo to BaseClient.
* Document default value of OperationTimeout and AutomaticMessageIdHandling.

ScpClient:
* Moved dispose of ConnectionInfo to BaseClient.
* Document default value of OperationTimeout and BufferSize.

SftpClient:
* Moved dispose of ConnectionInfo to BaseClient.
* Document default value of OperationTimeout and BufferSize.
* Modified all public members to throw ObjectDisposedException when client is disposed.
* Modified the WorkingDirectory and ProtocolVersion properties to throw
  SshConnectionException when the client is not connected.
* When disconnecting the client, also dispose the SftpSession to avoid leaks and set it
  to null as this is used to check whether the SftpClient is connected.

SshClient:
* Moved dispose of ConnectionInfo to BaseClient.

Session:

* include waithandle that signals when message listener has completed to avoid waiting for a response that can never be received
* throw SshConnectionException when message listener has completed (and no exception has been raised) if session is not disconnecting
* Modified IsConnected to also return false when:
  - disconnect message has been sent to server
  - the message listener completed waithandle is null or has been set (=listener thread has completed)
* Improved documentation of IsConnected property.
* Modified Disconnect() to also disconnect and dispose the underlying socket, and wait for the listener thread to complete.
  Only send disconnect message if session is still connected.
* Modified Connect() to to reset connection-specific information to ensure state of a
  previous connection does not affect new connections.
* Do not raise errors for SshConnectionException or socket timeout when session is disconnecting.
* Move any checks that are not socket related from IsSocketConnected to the IsConnected property.
* Modified IsSocketConnected on .NET to first check Connected property on underlying socket,
  and when true use Socket.Poll with SelectRead in combination with Socket.Available to detect
  if connection has been closed. Note that this does not detect loss of network connectivity.
2014-03-10 20:13:44 +00:00
Gert Driesen 07d575e78a Avoid race conditions when signaling events or setting waithandles. Remove empty lines.
Fixed event handler leak for Closed event on Channel.
2014-03-10 17:31:15 +00:00
Gert Driesen bbd5e2f6bb Document default values of ConnectionInfo class. 2014-03-10 17:25:18 +00:00
Gert Driesen 03b63e248c Fixed typo in comments, use var where possible.
Change visibility of _channelEof to private.
Remove empty lines.
2014-03-10 17:13:05 +00:00
Gert Driesen 98549ed087 Avoid NRE setting EventWaitHandle.
Remove emty lines.
2014-03-10 17:02:04 +00:00
Gert Driesen bbf44be46a Avoid race conditions when signaling events. 2014-03-10 16:10:59 +00:00
Gert Driesen 108b20965c Rename WaitHandle method to WaitOnHandle to avoid naming clash with WaitHandle class. 2014-03-10 15:14:49 +00:00
Gert Driesen 6a68a5f22b Remove extra ToArray call. 2014-03-10 14:41:21 +00:00
Gert Driesen 83e2067751 Issue #1918: Connection dropped by server due to invalid DSA signature
Pad each part of signature with zero's until its 20 bytes. Signature should be exactly 40 bytes.
2014-03-10 13:48:32 +00:00
Gert Driesen cd640aa1cd Fix compiler and (correct) resharper warnings across the solution. 2014-03-04 18:30:43 +00:00
Gert Driesen 7834d4ab59 Add build scripts and related artifacts to solution. 2014-03-02 09:46:49 +00:00
Gert Driesen 7946cddf69 Use the same assembly name across all supported target frameworks. 2014-03-02 09:44:19 +00:00
Gert Driesen 53de0a237e Added build script which by default:
* cleans the build output
* compiles the solution in Release configuration
* creates a NuGet package containing our assembly for all supported target frameworks

Added nuspec file, and updated it with information on
new features, breaking changes and fixes.

Removed generated NuGet package.
2014-03-02 09:43:51 +00:00
Gert Driesen 65c0412ad3 Sign the assemblies for .NET 3.5, .NET 4.0, Silverlight 4 and Silverlight 5. 2014-03-02 09:24:32 +00:00
Gert Driesen 8bea7cb388 Skip headers (and message body if Content-Length headers is set) returned by HTTP proxy. Fail fast when proxy does not return HTTP 200.
Added corresponding regression tests.
Fixes the following issues: 1601, 1890 and 1905.
2014-03-01 10:59:08 +00:00
Gert Driesen 1c35970820 Correct casing of Security/Cryptography/HMAC.cs.
Fixes issue #1505.
2014-02-23 19:18:01 +00:00
Gert Driesen 9f97b90c41 * Allow a private key to be read from a file which is already open, but which allows read access. This allows multiple connections to use the same private key file concurrently.
* Added tests for PrivateKeyFile, and fix all failing tests.
* Add private keys also as embedded resources to test project for .NET 3.5.
2014-02-15 19:19:49 +00:00
Gert Driesen a077321505 Remove Test project from solution as its a local project which is only used by Oleg. 2014-02-11 20:07:36 +00:00
Gert Driesen 2a4299eca5 Enable source control binding for all projects. 2014-02-11 20:06:23 +00:00
Gert Driesen c811a88c90 Modify Renci.SshNet.WindowsPhone project to target WP 7.1 again instead of 8.0. The upgrade of the solution and project files to VS 2013 caused this regression. 2014-02-11 19:57:51 +00:00
Gert Driesen 117e079011 Fix build when targeting .NET Framework 3.5 as Func only supports covariance on .NET Framework 4.0 and higher. 2014-02-11 19:52:38 +00:00
olegkap_cp af3fc6b404 Handle Event Handle leak per issue #1761 2013-11-01 15:52:13 +00:00
olegkap_cp f4141de4c9 Upgrade solution to VS.NET 2013
Apply patch 15311 - Fixes permission denied on their private key file.
Apply patch 15015 - Fixes the scp operations that are based upon streams.
Apply patch 15346 - Change socket to SocketOptionLevel.Tcp per microsoft documentation
2013-11-01 15:43:33 +00:00