Commit Graph

899 Commits

Author SHA1 Message Date
Cassondra Foesch 96bf4d30dc
Merge pull request #422 from greatroar/cleanup
Minor cleanup
2021-03-21 13:12:55 +00:00
greatroar 7a28771c60 Lowercase error messages 2021-03-20 20:35:04 +01:00
greatroar 32b9d99cf4 Fix typos in private identifiers 2021-03-20 20:35:04 +01:00
greatroar 95591b2015 Remove unnecessary TeeReader from readHash 2021-03-20 11:43:59 +01: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
Cassondra Foesch addaabd30b give the bytes.Buffer a preallocated slice to use for less variance 2021-03-17 20:18:50 +00:00
Cassondra Foesch 91163e4463 errors.Errorf over fmt.Errorf 2021-03-17 20:17:55 +00:00
Cassondra Foesch 32f98f3047 split benchmark and benchmark_w_memprofile, include memprofile files to gitignore 2021-03-17 20:17:15 +00:00
Cassondra Foesch c6518c34c4
Merge pull request #420 from greatroar/chmod-setfstat
Implement File.Chmod via setfstat
2021-03-17 17:56:06 +00:00
greatroar 846e27dc7f Implement File.Chmod via setfstat 2021-03-17 18:50:51 +01:00
Cassondra Foesch 325cdac782 Add convenient benchmark Makefile rule 2021-03-17 14:57:00 +00:00
Cassondra Foesch b22b9e472e remove writeToBuffer, the bytes.Buffer.Grow I saw in the memprofile was elsewhere 2021-03-17 13:18:17 +00:00
Cassondra Foesch 39e1161d12 address my own code review comments 2021-03-17 12:05:00 +00:00
Cassondra Foesch f1e28f8a88 Improve benchmarks and errors 2021-03-17 11:03:51 +00:00
Cassondra Foesch 460ad57385
Merge pull request #416 from greatroar/match-cleanup
Clean up matching/globbing code
2021-03-16 01:20:24 +00:00
greatroar d3695c2587 Fix Glob handling of backslashes
\m\a\t\c\h\.\g\o would be interpreted as a literal path, because the
backslash was missing in the check.
2021-03-15 18:11:02 +01:00
greatroar 413dd37571 Clean up matching/globbing code
getEsc, scanChunk and matchChunk were unused leftovers from the old
implementation, removed in 4f3e725e88.

isPathSeparator contained a useless cast to string.

The documentation (copied from path/filepath) referred to a Separator
constant, which is not present in the package.

Join, Split and Match are now explicitly marked as aliases for standard
library functions and refer to stdlib docs for details.
2021-03-15 18:10:43 +01: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
Cassondra Foesch 6c0c9a9e85
Merge pull request #417 from pkg/a-better-buffer-pool
A simpler bytes buffer pool
2021-03-15 09:51:10 +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
Nicola Murino df861a8348
Merge pull request #411 from drakkan/fuzz
client fix potential crash if we receive a short packet
2021-03-11 21:38:59 +01:00
Nicola Murino 25e9e632b3 client: add a test case for init packet too short 2021-03-11 19:56:45 +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
Nicola Murino 5b7da38a9c
Merge pull request #410 from pkg/export-realpath
Export RealPath for potential client use
2021-03-06 12:44:23 +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 f50ad19e9f
Merge pull request #408 from drakkan/345
add an option to disable concurrent reads
2021-03-05 22:37:51 +01: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
Nicola Murino a88961882e remove some redundant types 2021-02-22 22:29:35 +01:00
Nicola Murino 696db1cc39 CI: add Go 1.16 and remove 1.14 2021-02-22 16:33:20 +01:00
Nicola Murino b8102da57e
Merge pull request #397 from pkg/more-optimization
More optimization
2021-02-22 16:23:08 +01:00
Cassondra Foesch 861a8eaf5c pointer receivers and statusFromError(uint32, error) 2021-02-22 12:11:42 +00:00
Cassondra Foesch 1d73fd92d5 fix typo, error message is now two-way greppable 2021-02-22 12:04:43 +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 29c556e3a6 WriteTo benchmarks 2021-02-22 12:04:43 +00:00
Cassondra Foesch 5d0d479f46 The SSH_FX_CONNECTION_LOST exists precisely for this 2021-02-22 12:04:43 +00:00
Cassondra Foesch cdedb55a3b implement ReadFrom, normalize code patterns 2021-02-22 12:04:43 +00:00
Cassondra Foesch 79ae5c2d53 a new server disconnect error point rather than EOF 2021-02-22 12:04:43 +00:00
Cassondra Foesch 59de31242c more robust tests, fix typos 2021-02-22 12:04:43 +00:00
Cassondra Foesch 89afa8096c more concurrency, more overhead, but sometimes more throughput? 2021-02-22 12:04:43 +00:00
Cassondra Foesch ac6027de63 numerous subtle race conditions resolved in clientConn 2021-02-22 12:04:43 +00:00
Cassondra Foesch a66e205b29 chan is already available via closure 2021-02-22 12:04:43 +00:00