]> Cypherpunks.ru repositories - nncp.git/blobdiff - src/progress.go
Raise copyright years
[nncp.git] / src / progress.go
index 5ebc72bdb20b2e16df5ba53ed33bf0669f5a13b5..171f8e95878a4de603ae987784d52fa9e2fded25 100644 (file)
@@ -1,6 +1,6 @@
 /*
 NNCP -- Node to Node copy, utilities for store-and-forward data exchange
-Copyright (C) 2016-2021 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2016-2022 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
@@ -25,7 +25,7 @@ import (
        "time"
 
        "github.com/dustin/go-humanize"
-       "go.cypherpunks.ru/nncp/v7/uilive"
+       "go.cypherpunks.ru/nncp/v8/uilive"
 )
 
 func init() {
@@ -114,6 +114,18 @@ func CopyProgressed(
                        break
                }
        }
+       if showPrgrs {
+               for _, le := range les {
+                       if le.K == "FullSize" {
+                               if le.V.(int64) == 0 {
+                                       Progress(prgrsPrefix, append(
+                                               les, LE{"Size", written}, LE{"FullSize", written},
+                                       ))
+                               }
+                               break
+                       }
+               }
+       }
        return
 }
 
@@ -146,7 +158,7 @@ func Progress(prefix string, les LEs) {
        }
        what = prefix + " " + what
        pb.Render(what, size)
-       if size >= fullsize {
+       if fullsize != 0 && size >= fullsize {
                pb.Kill()
                progressBarsLock.Lock()
                delete(progressBars, pkt)