Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Mar 18, 2024
1 parent 1abc4b8 commit bbabbbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metainfo/info.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package metainfo

import (
"bufio"
"errors"
"fmt"
"io"
Expand Down Expand Up @@ -98,7 +99,7 @@ func (info *Info) writeFiles(w io.Writer, open func(fi FileInfo) (io.ReadCloser,
if err != nil {
return fmt.Errorf("error opening %v: %s", fi, err)
}
wn, err := io.CopyN(w, r, fi.Length)
wn, err := io.CopyN(w, bufio.NewReaderSize(r, 4*1024*1024), fi.Length)
r.Close()
if wn != fi.Length {
return fmt.Errorf("error copying %v: %s", fi, err)
Expand Down

0 comments on commit bbabbbc

Please sign in to comment.