Commit Graph

455 Commits

Author SHA1 Message Date
Gert Driesen cc04517efd Use BE methods on Pack. 2017-07-29 11:04:37 +02:00
Gert Driesen 7c05bd19ba Increase max. SSH packet size back to 68536 (64 KB + 3000). 2017-07-23 21:54:58 +02:00
Gert Driesen ea47d9db98 Fix xml doc. 2017-07-23 20:45:23 +02:00
Gert Driesen e86fd18b21 Limit size of SSH packet to 35.000 bytes.
Improve documentation of LocalChannelDataPacketSize.
2017-07-23 20:43:11 +02:00
Gert Driesen fa640e12a5 Improve documentation of LocalPacketSize. 2017-07-23 20:41:54 +02:00
Gert Driesen 55e31b1e7b Sync project file 2017-07-16 22:03:06 +02:00
Gert Driesen 17a9c61464 Use langversion 5 for .NET Core project. 2017-07-16 20:06:53 +02:00
Gert Driesen b680765692 Add comment to clarify that StreamReader uses a buffer size of 1024 bytes. 2017-07-16 20:06:12 +02:00
Gert Driesen 5408aace90 Avoid reading from the server twice to determine EOF.
When a server returns less number of bytes than the read buffer size, this *may* indicate that EOF has been reached. A subsequent (SSH_FXP_READ) server request is necessary to make sure EOF has effectively been reached.
Breaking out of the read loop avoids reading from the server twice to determine EOF: once in the read loop,
and once upon the next Read or ReadByte invocation.
2017-07-16 20:04:58 +02:00
Gert Driesen 416f7be804 Ensure write buffer is initialized before attempting to use it. 2017-06-17 12:33:04 +02:00
Gert Driesen 5dda8f5247 Merge branch 'sftpfilestream' of https://github.com/sshnet/SSH.NET into sftpfilestream 2017-06-12 22:29:21 +02:00
Gert Driesen c83188a5a9 Harden test. 2017-06-12 22:29:16 +02:00
Gert Driesen 50ea405d5a Sync project file. 2017-06-12 21:35:13 +02:00
Gert Driesen 6fd1cc78c3 Update Read(byte[] buffer, int offset, int count) to not write bytes to read buffer when the read buffer is empty and count is greater than the number of bytes read from the server.
Lazily initialize read and write buffer.
2017-06-12 21:15:23 +02:00
Gert Driesen 40efaa6e5a Move back to writing all read bytes to read buffer, not only those that exceed the user supplied buffer. 2017-06-05 19:10:49 +02:00
Gert Driesen bcc8def223 No longer track write position separately.
Reading from the SftpFileStream will not also affect the position at which a subsequent write will be performed.
The position at which a write is performed in the server file is now always the current position minus the position in the buffer.
2017-03-19 20:37:14 +01:00
Gert Driesen 99fd7b460f Add tests for SftpFileStream.Seek(...). 2017-03-19 16:42:46 +01:00
Gert Driesen 30e8513800 Revert "Update SftFileStream to work correctly with mixed Read, Write and Seek operation, complete rewrite #194"
This reverts commit 0d88ddc79c.
2017-03-17 19:59:22 +01:00
olegkap 0d88ddc79c Update SftFileStream to work correctly with mixed Read, Write and Seek operation, complete rewrite #194 2017-03-10 22:05:15 -05:00
Gert Driesen d93f064c0f Attempt to harden test. 2017-03-08 20:13:11 +01:00
Gert Driesen 5f1494f09e Added test to verify that dispose has completed. 2017-03-08 20:00:13 +01:00
Gert Driesen ff68b38109 Merge branch 'develop' of https://github.com/sshnet/SSH.NET into develop 2017-03-08 19:44:50 +01:00
Gert Driesen f6daa4dfa6 Enable HandleShouldHaveBeenClosed test. 2017-03-08 19:44:44 +01:00
Gert Driesen b3e704b404 Sync .NET 3.5 test project file, and remove usage of string interpolation. 2017-03-05 21:56:38 +01:00
Gert Driesen 14b571fdd4 Update tests now that we reject invalid combination of FileMode and FileAccess.
Remove duplicate tests.
2017-03-05 21:42:37 +01:00
Gert Driesen ff78430ed4 Move null check into FEATURE_THREAD_THREADPOOL section. 2017-03-05 18:54:28 +01:00
Gert Driesen 04ca23176a Merge pull request #186 from agayardo/develop
Fix for recently introduced regression in SftpFileStream.Read(...).
2017-03-05 18:47:47 +01:00
Gert Driesen d3635d18fa Added test for recently introduced regression that is fixed by PR #186. 2017-03-05 18:47:01 +01:00
Gert Driesen 08b2d05ed8 Added tests for issue #191, and update tests for issue #154. 2017-03-05 16:01:34 +01:00
Gert Driesen 40e106828d Throw ArgumentException for invalid combinations of FileMode and FileAccess.
Fixes issue #191.
2017-03-05 16:00:48 +01:00
Gert Driesen 4b85e78e3c In the SftpFileStream ctor, only obtain file attributes when mode is Append and no longer keep the result as instance field.
Update Seek to only obtain file attributes when SeekOrigin is End.
Update SetLength to obtain server file attributes before updating sending an SSH_FXP_FSETSTAT with the new size/length.

Fixes issue #154.
2017-03-05 15:58:44 +01:00
Artem Gayardo-Matrosov c2bd7b5171 Unit test fix. 2017-03-03 15:56:16 +01:00
Artem Gayardo-Matrosov 68dded5386 Fix for data corruption when reading to a buffer that is smaller than the
internal buffer.
2017-03-03 15:55:50 +01:00
Gert Driesen c8373c978f Eliminate intermediate copy to read buffer. 2017-02-26 17:48:55 +01:00
Gert Driesen 4e2bd63660 Only write to the read buffer if we actually received data. 2017-02-19 10:30:40 +01:00
Gert Driesen 391a41c35d Move on :p 2017-02-19 10:09:24 +01:00
Gert Driesen 98aba4920d Only copy the actual number of bytes received to the buffer.
Fixes issue #173.
2017-02-18 13:48:25 +01:00
Gert Driesen c3927660cf Added ExecuteThreadLongRunning. 2017-02-18 13:32:30 +01:00
Gert Driesen 178512c998 Use length of actual hash. 2017-02-18 13:32:16 +01:00
Gert Driesen 932f36fd86 Add Pack to project files. 2017-02-18 11:36:43 +01:00
Gert Driesen 847119fd87 Identify future optimization. 2017-02-18 11:21:40 +01:00
Gert Driesen 73437578c8 Use Monitor.PulseAll to ensure we signal all waiting threads. 2017-02-17 21:51:50 +01:00
Gert Driesen 58ab5b8c2a Fix warning. 2017-02-17 21:47:52 +01:00
Gert Driesen 1c288485ed Use packing methods from newly introduced Pack class. 2017-02-14 18:10:34 +01:00
Gert Driesen 9ca3880c29 Added tests for Reverse. 2017-02-14 18:05:38 +01:00
Gert Driesen b73d2e1ea8 Formatting. 2017-02-14 18:00:18 +01:00
Gert Driesen 9f6496da62 Added encrypt and decrypt test for CBC mode. 2017-02-14 18:00:09 +01:00
Gert Driesen 44211768ba Group all packing methods in Pack class, and add corresponding unit tests. 2017-02-12 22:07:06 +01:00
Gert Driesen ed9feebf71 Update summary for ProxyException.
Fixes issue #163.
2017-02-11 14:34:23 +01:00
Gert Driesen 8e9cf89511 Fix exception message for fallback SOCKS5 error.
Fixes issue #167.
2017-02-11 14:30:17 +01:00