Patchset ps-86
fix(sftp): only call `writeHandler.Write` once during PUT
Eric Bower
fix(sftp): only call `writeHandler.Write` once during PUT
protocols/sftp/handler.go
link
+0
-8
+0
-8
1diff --git a/protocols/sftp/handler.go b/protocols/sftp/handler.go
2index 4ed2799..e1d7867 100644
3--- a/protocols/sftp/handler.go
4+++ b/protocols/sftp/handler.go
5@@ -1,7 +1,6 @@
6 package sftp
7
8 import (
9- "bytes"
10 "errors"
11 "io"
12 "io/fs"
13@@ -118,13 +117,6 @@ func toFileEntry(r *sftp.Request) *utils.FileEntry {
14
15 func (f *handler) Filewrite(r *sftp.Request) (io.WriterAt, error) {
16 entry := toFileEntry(r)
17- entry.Reader = bytes.NewReader([]byte{})
18-
19- _, err := f.writeHandler.Write(f.session, entry)
20- if err != nil {
21- return nil, err
22- }
23-
24 buf := &buffer{}
25 entry.Reader = buf
26