]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/tx.go
Raise copyright years
[nncp.git] / src / tx.go
index e38084e1a7a3c01390987af3da42c8667d2ee4ab..4edbea4e849eb183002f9f77e8d2f2c5ab626f98 100644 (file)
--- a/src/tx.go
+++ b/src/tx.go
@@ -1,6 +1,6 @@
 /*
 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
@@ -388,7 +388,9 @@ func prepareTxFile(srcPath string) (
                                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)
                        }
@@ -441,7 +443,7 @@ func (ctx *Ctx) TxFile(
                _, 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"},
@@ -469,7 +471,7 @@ func (ctx *Ctx) TxFile(
                return err
        }
 
-       br := bufio.NewReader(reader)
+       br := bufio.NewReaderSize(reader, MTHBlockSize)
        var sizeFull int64
        var chunkNum int
        checksums := [][MTHSize]byte{}