1723 Commits

Author SHA1 Message Date
drieseng 344e6e52c0 Use a very short timeout when clearing the read buffer. 2016-09-04 20:04:07 +02:00
drieseng 1e802c795e Update tests as we now load data from an offset as not to include the packet length and/or message type. 2016-09-03 00:02:29 +02:00
drieseng 5529efcab8 Do not send SSH_MSG_DISCONNECT when the server is closing the session by sending a SSH_MSG_DISCONNECT.
Reduces - but does not eliminate - likelyhood of race condition when remote server and client attempt to disconnect at the same time.

Currently this leads to a NRE or ObjectDisposedException in  Session.IsSocketConnected(ref bool isConnected) when one thread is attempting to check whether the socket is still connected, and the other thread is disposing the socket.

This commit just reduces the likelyhood as the message loop thread that handes the SSH_MSG_DISCONNECT sent by the server will no longer attempt to send a SSH_MSG_DISCONNECT to the server, and as such will not check whether the socket is still connected.
2016-09-03 00:01:21 +02:00
drieseng c141c7d4a7 Ignore data of SSH_MSG_IGNORE when its specified length is greater than the actual available bytes.
Fixes issue #41.
2016-09-02 23:50:57 +02:00
drieseng 76a92cfb0a SshData.cs:
- Remove ZeroReaderIndex from SshData; offset should instead be specified when instance is created/loaded.
- LoadBytes is now private, and is always invoked when a message is loaded.
- Eliminate ResetReader().
SshDataStream.cs:
- Added overload taking buffer, offset and count.
KeyExchange*Message.cs:
- Remove ResetReader() calls.
Message.cs:
- Remove ZeroReaderIndex override.
SftpMessage.cs:
- Pass offset and count to Load overload to allow skipping byte representing the message type.
- Remove ZeroReaderIndex override.
SftpSession.cs:
- Avoid buffering when packet contains full SFTP response message.
Session.cs:
- Pass offset and count to Load overload to allow skipping offset bytes.
General:
- Temporarily add (too) verbose tracing.
2016-09-01 21:54:57 +02:00
drieseng bd2fa5d16f Use the managed thread id as identifier in our trace messages. 2016-08-23 18:26:43 +02:00
drieseng 31b2019fe4 Temporarily introduce extra verbose tracing. 2016-08-23 18:25:52 +02:00
drieseng 5260f1b73d Number of bytes in read buffer can never be negative. 2016-08-21 18:46:31 +02:00
drieseng ad56cc9bdf Take into account the offset in SftpFileStream.Write(byte[] buffer, int offset, int count) when not writing to the buffer. Fixes issue #70. 2016-08-21 18:14:03 +02:00
drieseng fb9fe50bc0 Fixed some tests after recent GlobalRequestMessage changes. 2016-08-15 21:36:37 +02:00
drieseng 546caedc94 Include session id in (some) trace messages. 2016-08-15 21:36:13 +02:00
drieseng 4442b88419 Removed unused import. 2016-08-15 12:56:50 +02:00
drieseng 5deccd0c0e Use ASCIIEncoding GetString overload that is supported on all target frameworks. 2016-08-15 12:55:23 +02:00
drieseng 820ed146cf Added new classes to all projects used in VS 2015 solution. 2016-08-15 12:54:52 +02:00
drieseng 96160b3c74 Added extra debug/trace output. 2016-08-15 12:49:31 +02:00
drieseng 5916656d66 Introduce specialized GlobalRequestMessage classes for tcpip-forward and cancel-tcpip-forward. 2016-08-15 12:48:40 +02:00
drieseng 7fce6e0b03 When receiving SSH_MSG_GLOBAL_REQUEST, only read data that is not message specific. Fixes issue #58. 2016-08-15 12:47:22 +02:00
drieseng 8a97fecddd Improve exception message when attempting to read more bytes than available. 2016-08-15 12:41:04 +02:00
drieseng a3a8d42e7c Merge remote-tracking branch 'refs/remotes/origin/develop' 2016.0.0 2016-08-02 12:15:21 +02:00
Gert Driesen 7f8f3121f0 Added netstandard1.3 TFM. 2016-08-02 10:41:42 +02:00
drieseng 13cc56304a Prepare for stable release. 2016-08-01 21:05:02 +02:00
drieseng 342f3ef751 Merge remote-tracking branch 'refs/remotes/origin/develop' 2016-08-01 19:27:01 +02:00
drieseng f4f6708f46 Give in to Resharper's urge to save "migrated" settings. 2016-07-31 11:45:57 +02:00
drieseng c5d51b9d9d Harden against "leaking" message registration.
Fixes issue #55.
2016-07-31 11:45:31 +02:00
drieseng 7e2836a7a7 Modify TryAuthenticate to static. 2016-07-31 11:39:26 +02:00
drieseng 07c2a6001f Code formatting. 2016-07-31 11:38:58 +02:00
drieseng 68d9e4fc90 Moved into on conditional compilation symbols to wiki. 2016-07-27 14:16:26 +02:00
Gert Driesen 330e41b884 Merge remote-tracking branch 'refs/remotes/origin/develop' 2016.0.0-beta3 2016-07-27 14:15:07 +02:00
Gert Driesen 05cdb785ed Merge remote-tracking branch 'refs/remotes/origin/develop' 2016-07-27 14:10:37 +02:00
drieseng 75d982bb09 Remove references to EncoderFallbackException and DecoderFallbackException. 2016-07-27 14:03:22 +02:00
drieseng abeb2c8738 Use github release for the release notes. 2016-07-27 13:54:30 +02:00
drieseng f4a634f1d3 Minor (slash)doc improvements. 2016-07-27 13:52:31 +02:00
drieseng 76fdf58581 Improve slashdocs. 2016-07-27 12:52:50 +02:00
drieseng 563349d15a When the port is closing, first shutdown the send part of the socket.
Subsequently close/dispose the socket to ensure the blocking receive is interrupted.
2016-07-26 22:11:23 +02:00
drieseng 1e63a813cc Improved and corrected the slashdocs.
Fixed some typos.
2016-07-26 22:09:50 +02:00
drieseng bb4e719711 Added tests for SftpDownloadAsyncResult. 2016-07-26 19:53:00 +02:00
drieseng ae446661ef Use C# type. 2016-07-26 19:51:20 +02:00
drieseng 3598fcf3e4 Do not wrap exceptions in SshException. 2016-07-26 19:51:06 +02:00
drieseng db0300e00c Use C# types. 2016-07-26 19:25:47 +02:00
drieseng 1b28947a2d Attempt to harden test. 2016-07-26 14:44:10 +02:00
drieseng c0caf7dfa3 Harden tests. 2016-07-26 12:27:57 +02:00
drieseng 82c288b648 Harden test. 2016-07-24 22:53:21 +02:00
drieseng 590277f007 Harden test. 2016-07-24 22:33:44 +02:00
Gert Driesen 954db2fcc6 Merge pull request #50 from sshnet/master
Merge changes from master to develop branch.
2016-07-24 22:09:25 +02:00
Gert Driesen 177812fac9 Merge pull request #49 from sshnet/develop
Prepare for beta 3
2016-07-24 22:08:35 +02:00
drieseng d71baa1811 Use portable pdb.
Fixes issue #48
2016-07-24 22:03:38 +02:00
drieseng 75f6911f72 Implement tests for Length and MaxBufferLength. 2016-07-24 21:11:34 +02:00
drieseng 351e3c0afa Merge remote-tracking branch 'refs/remotes/origin/develop' 2016-07-24 10:22:00 +02:00
drieseng 81993af9d6 Disable null coalescing hint (as we need to support VS 2012 as well).
Code formatting updates.
2016-07-24 10:19:57 +02:00
drieseng 65bd07259a Stop listener before waiting for channels to close.
Remove extra exception handling.
2016-07-24 10:18:10 +02:00