/*
NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2022 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2023 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
}
r, w := io.Pipe()
go func() {
- _, err := io.CopyN(w, bufio.NewReader(fd), fiInt.Size())
+ _, err := io.CopyN(
+ w, bufio.NewReaderSize(fd, nncp.MTHBlockSize), fiInt.Size(),
+ )
if err == nil {
err = w.Close()
}
}
bufW := bufio.NewWriter(tmp)
copied, err := nncp.CopyProgressed(
- bufW, bufio.NewReader(fd), "Tx",
+ bufW, bufio.NewReaderSize(fd, nncp.MTHBlockSize), "Tx",
append(les, nncp.LE{K: "FullSize", V: job.Size}),
ctx.ShowPrgrs,
)