Commit Graph

206 Commits

Author SHA1 Message Date
tanishq.singhal 628da3e118 Adding Tests to test the func & resolving comment 2023-05-15 11:43:30 +05:30
tanishq.singhal 0ac5f90dbb Implemented Delete All Resources Function 2023-05-13 13:03:00 +05:30
Cassondra Foesch bd61319b07 refactor sshfx encoding, fix link rot, go fmt 2023-03-27 17:05:24 +00:00
Nick Craig-Wood 8add055936 Stop ReadFromWithConcurrency sending more data than it needs to
It was discovered that the ReadFrom method for uploading files in
pkg/sftp was sending more data than it needed to.

This was tracked down to the ReadFromWithConcurrency method forgetting
to truncate the packets it was sending to the size Read.

This was giving the remote server more work to do as it was writing
and re-writing parts of a file.

See: https://github.com/rclone/rclone/issues/6763
2023-02-13 14:18:36 +00:00
Cassondra Foesch aad3ee1c0e an even better error message 2022-07-11 11:34:22 +00:00
Cassondra Foesch cc19e20d72 more context for EOF during client setup 2022-06-29 12:13:03 +00:00
Nicola Murino c7fdf5e5c6 writeToSequential: improve tests for write errors 2022-03-03 12:30:24 +01:00
Hilari Moragrega 65f24bcee4 Improved test with CR feedback 2022-03-03 09:43:16 +01:00
Hilari Moragrega c2c0f6090e Return writer error if not nil in writeSequential 2022-03-03 09:43:11 +01:00
Gleb Teterin dad23755af Fix missing io.EOF when concurency is disabled #489 2022-01-20 07:55:17 +13:00
Cassondra Foesch 84714f9fee sequentially issue write requests, process results concurrently 2021-12-05 13:28:38 +00:00
Cassondra Foesch f525d180b6
Merge pull request #456 from pkg/refactor/regroup-and-lint
Regroup marshling/unmarshaling and lint
2021-08-20 22:59:08 +00:00
codesoap 997499abb6 Fix a few misspells 2021-08-20 21:00:33 +02:00
Cassondra Foesch 1b6d816185 remove min function 2021-08-11 13:29:16 +00:00
Cassondra Foesch ba854bee45 collect all marshal/unmarshal functions into packet.go 2021-08-11 11:12:34 +00:00
Nicola Murino eaa697cc21
Merge pull request #441 from CiscoM31/migrate_to_go_errors
Use go errors instead of github.com/pkg/errors
2021-07-05 21:28:12 +02:00
Cassondra Foesch ac2cd6e5ca
Merge pull request #447 from alanskind/master
fix typo
2021-06-30 17:07:29 +00:00
qianqian 0e4bd2a661 fix typo 2021-06-30 23:09:07 +08:00
Cassondra Foesch 6617a3a1aa [bugfix] short reads indicate EOF 2021-06-28 18:27:13 +00:00
Cassondra Foesch 120b9759fe concurrent reads: use sequential requests for ReadAt as well 2021-06-28 15:07:47 +00:00
Sebastien Rosset (serosset) 3b8042dfc0 Use go errors instead of github.com/pkg/errors 2021-06-04 14:18:41 -07:00
Nicola Murino 5b98d05076
Merge pull request #439 from pkg/feature/ReadFromWithConcurrency
Export a ReadFromWithConcurrency function that permits ensuring concurrency usage.
2021-05-22 19:07:36 +02:00
Cassondra Foesch 61f5f29b25 Export a ReadFromWithConcurrency function that permits ensuring concurrency usage 2021-05-22 15:42:42 +00:00
Cassondra Foesch d5fa851154 sequentially issue read requests, process results concurrently 2021-04-26 16:51:04 +00:00
Cassondra Foesch 6b08f4a44a document why the cast to int can no longer overflow an int 2021-04-23 08:55:35 +00:00
Cassondra Foesch b63107c68c better safer maths 2021-04-22 23:46:11 +00:00
Cassondra Foesch 9a42bd2223 bugfix: int64 math overflows possible on 32-bit architectures 2021-04-22 23:26:15 +00:00
Cassondra Foesch bc27e0c607
Merge pull request #425 from pkg/bug/write-to-unexpected-channel-closed
[Bugfix] WriteTo write work channel should never be closed…
2021-04-13 09:36:23 +00:00
Nicola Murino 6782c5448f ReadFrom: check also Size and Stat interfaces to calculate the size 2021-04-11 18:14:59 +02:00
Cassondra Foesch 2c3f761948 bugfix: these channels should never be closed 2021-03-29 22:47:07 +00:00
Cassondra Foesch d26c4bc2a7
Merge pull request #421 from pkg/benchmarks-and-errors
Improve benchmarks and errors
2021-03-20 03:11:49 +00:00
greatroar 846e27dc7f Implement File.Chmod via setfstat 2021-03-17 18:50:51 +01:00
Cassondra Foesch f1e28f8a88 Improve benchmarks and errors 2021-03-17 11:03:51 +00:00
Cassondra Foesch 6181f5c673
Merge pull request #414 from greatroar/chmod-bits
Support os.Mode{Setuid,Setgid,Sticky} in Chmod
2021-03-15 09:58:20 +00:00
greatroar 2573693ec5 Support os.Mode{Setuid,Setgid,Sticky} in Chmod
Previously, these bits were ignored by Chmod, which sent the numerical
value of the mode argument as-is to the server. As a result, callers had
to supply POSIX values for setuid, setgid and sticky to Chmod.

The new version supports both the POSIX values and the Go values.

Also added a note to the docs to clarify that the umask is not
subtracted from the mode, and why that is. The only portable way to get
the umask is to set it, then reset it, but that's racy. On Linux, we
could parse /proc/self/status, but that doesn't work portably and will
fail where /proc is not available (some Docker containers, notably).
2021-03-12 16:17:56 +01:00
Cassondra Foesch c34ea374a2 A simpler bytes buffer pool 2021-03-12 15:14:27 +00:00
Nicola Murino e164c76a12
Merge pull request #413 from greatroar/mkdirall-slash
Check for '/', not os.IsPathSeparator, in MkdirAll
2021-03-11 21:39:17 +01:00
greatroar 9bd6912a11 Check for '/', not os.IsPathSeparator, in MkdirAll
The SFTP protocol uses '/' as the path separator, always.
2021-03-11 00:22:17 +01:00
Nicola Murino 23462f6cd7 client fix potential crash if we receive a short packet 2021-03-10 12:26:09 +01:00
Cassondra Foesch 714bd5db80 +godoc 2021-03-06 09:03:37 +00:00
Cassondra Foesch b83052b538 Export RealPath for potential client use 2021-03-06 08:48:23 +00:00
Nicola Murino c539fdb9b4 improve readAtSequential as for review 2021-03-05 17:10:39 +01:00
Nicola Murino e1e59da6e3 add readAtSequential: used if concurrent reads are disabled ...
... and the requested buffer is bigger than maxPacket
2021-03-05 15:04:17 +01:00
Nicola Murino 5f2c008b8e add an option to disable concurrent reads
Fixs #345
2021-02-23 19:13:26 +01:00
Cassondra Foesch 861a8eaf5c pointer receivers and statusFromError(uint32, error) 2021-02-22 12:11:42 +00:00
Cassondra Foesch c6f90f0596 polishing done? 2021-02-22 12:04:43 +00:00
Cassondra Foesch fc15699691 fixed concurrent writes, mid-polish 2021-02-22 12:04:43 +00:00
Cassondra Foesch 0be6950c0e fix comments and variable names to reflect Write instead of Read 2021-02-22 12:04:43 +00:00
Cassondra Foesch 64bc1f82e3 WriteTo better, but not best, version 2021-02-22 12:04:43 +00:00
Cassondra Foesch cdedb55a3b implement ReadFrom, normalize code patterns 2021-02-22 12:04:43 +00:00