X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcmd%2Fnncp-xfer%2Fmain.go;h=bb74f45cd4482b9f7bb97a0ec8e0cd29a1b79149;hb=4ba3188c55713c2b3a2326ab6b670606f27a13f5;hp=9c29b0284b1975b4da44fcd927a3cb5841901a32;hpb=ee648620885962bae731cd1e9a9eac0b6545c451;p=nncp.git diff --git a/src/cmd/nncp-xfer/main.go b/src/cmd/nncp-xfer/main.go index 9c29b02..bb74f45 100644 --- a/src/cmd/nncp-xfer/main.go +++ b/src/cmd/nncp-xfer/main.go @@ -1,6 +1,6 @@ /* NNCP -- Node to Node copy, utilities for store-and-forward data exchange -Copyright (C) 2016-2022 Sergey Matveev +Copyright (C) 2016-2023 Sergey Matveev 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 @@ -33,8 +33,8 @@ import ( ) func usage() { - fmt.Fprintf(os.Stderr, nncp.UsageHeader()) - fmt.Fprintf(os.Stderr, "nncp-xfer -- copy inbound and outbounds packets\n\n") + fmt.Fprint(os.Stderr, nncp.UsageHeader()) + fmt.Fprint(os.Stderr, "nncp-xfer -- copy inbound and outbounds packets\n\n") fmt.Fprintf(os.Stderr, "Usage: %s [options] DIR\nOptions:\n", os.Args[0]) flag.PrintDefaults() } @@ -293,7 +293,9 @@ func main() { } 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() } @@ -477,7 +479,7 @@ Tx: } 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, )