]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/cmd/nncp-bundle/main.go
Prefixed progress messages
[nncp.git] / src / cmd / nncp-bundle / main.go
index 0bca23f69c1ad5d502c05188ed416823b7079f91..f0fec55c61f357c554ff94a7bfcee9d02153f039 100644 (file)
@@ -153,7 +153,7 @@ func main() {
                                        log.Fatalln("Error writing tar header:", err)
                                }
                                if _, err = nncp.CopyProgressed(
-                                       tarWr, job.Fd,
+                                       tarWr, job.Fd, "Tx",
                                        nncp.SdsAdd(sds, nncp.SDS{
                                                "pkt":      nncp.ToBase32(job.HshValue[:]),
                                                "fullsize": job.Size,
@@ -293,7 +293,7 @@ func main() {
                                        log.Fatalln("Error during writing:", err)
                                }
                                if _, err = nncp.CopyProgressed(
-                                       hsh, tarR,
+                                       hsh, tarR, "Rx",
                                        nncp.SdsAdd(sds, nncp.SDS{"fullsize": entry.Size}),
                                        ctx.ShowPrgrs,
                                ); err != nil {
@@ -341,7 +341,7 @@ func main() {
                                        if _, err = hsh.Write(pktEncBuf); err != nil {
                                                log.Fatalln("Error during writing:", err)
                                        }
-                                       if _, err = nncp.CopyProgressed(hsh, tarR, sds, ctx.ShowPrgrs); err != nil {
+                                       if _, err = nncp.CopyProgressed(hsh, tarR, "check", sds, ctx.ShowPrgrs); err != nil {
                                                log.Fatalln("Error during copying:", err)
                                        }
                                        if nncp.ToBase32(hsh.Sum(nil)) != pktName {
@@ -356,7 +356,7 @@ func main() {
                                        if _, err = tmp.W.Write(pktEncBuf); err != nil {
                                                log.Fatalln("Error during writing:", err)
                                        }
-                                       if _, err = nncp.CopyProgressed(tmp.W, tarR, sds, ctx.ShowPrgrs); err != nil {
+                                       if _, err = nncp.CopyProgressed(tmp.W, tarR, "check", sds, ctx.ShowPrgrs); err != nil {
                                                log.Fatalln("Error during copying:", err)
                                        }
                                        if err = tmp.W.Flush(); err != nil {
@@ -374,7 +374,7 @@ func main() {
                                }
                        } else {
                                if *dryRun {
-                                       if _, err = nncp.CopyProgressed(ioutil.Discard, tarR, sds, ctx.ShowPrgrs); err != nil {
+                                       if _, err = nncp.CopyProgressed(ioutil.Discard, tarR, "Rx", sds, ctx.ShowPrgrs); err != nil {
                                                log.Fatalln("Error during copying:", err)
                                        }
                                } else {
@@ -386,7 +386,7 @@ func main() {
                                        if _, err = bufTmp.Write(pktEncBuf); err != nil {
                                                log.Fatalln("Error during writing:", err)
                                        }
-                                       if _, err = nncp.CopyProgressed(bufTmp, tarR, sds, ctx.ShowPrgrs); err != nil {
+                                       if _, err = nncp.CopyProgressed(bufTmp, tarR, "Rx", sds, ctx.ShowPrgrs); err != nil {
                                                log.Fatalln("Error during copying:", err)
                                        }
                                        if err = bufTmp.Flush(); err != nil {