]> Cypherpunks.ru repositories - nncp.git/commitdiff
Check enough space when running nncp-bundle -rx
authorSergey Matveev <stargrave@stargrave.org>
Sat, 14 Dec 2019 18:34:57 +0000 (21:34 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 14 Dec 2019 18:41:07 +0000 (21:41 +0300)
doc/news.ru.texi
doc/news.texi
src/cmd/nncp-bundle/main.go

index f7c4f13cd67494d60e7a364aabe51df0281f1d8c..fa95bf5c9eeaac3054d8d5ec2cb748b0aa4bef37 100644 (file)
 Исправлен некорректный код возврата @command{nncp-check} команды,
 который возвращал ошибку когда всё хорошо.
 
+@item
+Проверка свободного места для пакетов, во время выполнения
+@command{nncp-bundle -rx}.
+
 @end itemize
 
 @node Релиз 5.1.2
index 349880d95e2baaa2c0d686ff67b6af176d191a5d..461355755cd5b498f507e3768d5acc9a3ea83730 100644 (file)
@@ -16,6 +16,9 @@ Most commands by default show oneline operations progress.
 Fixed incorrect @command{nncp-check} command return code, that returned
 bad code when everything is good.
 
+@item
+Free disk space check during @command{nncp-bundle -rx} call.
+
 @end itemize
 
 @node Release 5.1.2
index 738012ae7336b0b91ab1d9127284ad931f377396..0bca23f69c1ad5d502c05188ed416823b7079f91 100644 (file)
@@ -239,6 +239,10 @@ func main() {
                                ctx.LogD("nncp-bundle", sds, "Too small packet")
                                continue
                        }
+                       if !ctx.IsEnoughSpace(entry.Size) {
+                               ctx.LogE("nncp-bundle", sds, errors.New("not enough spool space"), "")
+                               continue
+                       }
                        pktName = filepath.Base(entry.Name)
                        if _, err = nncp.FromBase32(pktName); err != nil {
                                ctx.LogD("nncp-bundle", nncp.SdsAdd(sds, nncp.SDS{"err": "bad packet name"}), "")