/*
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
fd.Close()
return w.CloseWithError(err)
}
- if _, err = io.Copy(tarWr, bufio.NewReader(fd)); err != nil {
+ if _, err = io.Copy(
+ tarWr, bufio.NewReaderSize(fd, MTHBlockSize),
+ ); err != nil {
fd.Close()
return w.CloseWithError(err)
}
_, finalSize, pktName, err := ctx.Tx(
node, pkt, nice,
srcSize, minSize, maxSize,
- bufio.NewReader(reader), dstPath, areaId,
+ bufio.NewReaderSize(reader, MTHBlockSize), dstPath, areaId,
)
les := LEs{
{"Type", "file"},
return err
}
- br := bufio.NewReader(reader)
+ br := bufio.NewReaderSize(reader, MTHBlockSize)
var sizeFull int64
var chunkNum int
checksums := [][MTHSize]byte{}