From: Sergey Matveev Date: Sat, 29 Apr 2023 09:49:53 +0000 (+0300) Subject: Fixed nncp-reass's badSize calculation X-Git-Tag: v8.8.3^2 X-Git-Url: http://www.git.cypherpunks.ru/?p=nncp.git;a=commitdiff_plain;h=523ac7e7dd5a2f97711fa369f7a73e43ff7b49bc;hp=aaca09da4134a1ec348d96092794702bc4bf592c Fixed nncp-reass's badSize calculation --- diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 49e7778..bc331a8 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -1,6 +1,19 @@ @node Новости @section Новости +@node Релиз 8.8.3 +@subsection Релиз 8.8.3 +@itemize + +@item +Исправлена @command{nncp-reass} команда, которая некорректно сообщала о +плохом размере последнего куска файла если он был кратен размеру chunk-а. + +@item +Обновлены зависимости. Теперь требуется Go 1.20+. + +@end itemize + @node Релиз 8.8.2 @subsection Релиз 8.8.2 @itemize diff --git a/doc/news.texi b/doc/news.texi index 50f675b..fa97340 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -4,6 +4,19 @@ See also this page @ref{Новости, on russian}. +@node Release 8_8_3 +@section Release 8.8.3 +@itemize + +@item +Fixed @command{nncp-reass} command, that incorrectly reported about +wrong last chunk's size if it is multiple of the chunk-size. + +@item +Updated dependencies. Go 1.20+ is required now. + +@end itemize + @node Release 8_8_2 @section Release 8.8.2 @itemize diff --git a/src/cmd/nncp-reass/main.go b/src/cmd/nncp-reass/main.go index ac52eeb..e92a2e5 100644 --- a/src/cmd/nncp-reass/main.go +++ b/src/cmd/nncp-reass/main.go @@ -125,7 +125,8 @@ func process(ctx *nncp.Ctx, path string, keep, dryRun, stdout, dumpMeta bool) bo } var badSize bool if chunkNum+1 == len(chunksPaths) { - badSize = uint64(fi.Size()) != metaPkt.FileSize%metaPkt.ChunkSize + left := metaPkt.FileSize % metaPkt.ChunkSize + badSize = left != 0 && uint64(fi.Size()) != left } else { badSize = uint64(fi.Size()) != metaPkt.ChunkSize } diff --git a/src/nncp.go b/src/nncp.go index b4ce4d8..dde9bcb 100644 --- a/src/nncp.go +++ b/src/nncp.go @@ -40,7 +40,7 @@ along with this program. If not, see .` const Base32Encoded32Len = 52 var ( - Version string = "8.8.2" + Version string = "8.8.3" Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding) )