go-rsync-receiver

created pr with 45.1 on 2025-01-21T15:08:10Z · by c8ef7d19
cmds
checkout latest patchset:
ssh pr.pico.sh print 45 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 45.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 45

Patchset 45.1 on 2025-01-21T15:08:10Z · commit 146cd84

+1 -0 rsyncsender/sender.go #
......@@ -141,6 +141,7 @@ func (st *sendTransfer) sendFile(fileIndex int32, fl *utils.SenderFile) error {
141141 const chunkSize = 32 * 1024
142142
143143 fi, f, err := st.filesystem.Read(fl)
144+ defer f.Close()
144145 if err != nil {
145146 return err
146147 }
+6 -1 utils/fs.go #
......@@ -5,10 +5,15 @@ import (
55 "os"
66 )
77
8+type ReaderAtCloser interface {
9+ io.ReaderAt
10+ io.Closer
11+}
12+
813 // File System: need to handle all type of files: regular, folder, symlink, etc
914 type FS interface {
1015 Put(*ReceiverFile) (int64, error)
1116 Skip(*ReceiverFile) bool
1217 List(string) ([]os.FileInfo, error)
13- Read(*SenderFile) (os.FileInfo, io.ReaderAt, error)
18+ Read(*SenderFile) (os.FileInfo, ReaderAtCloser, error)
1419 }
Back to top