]> Cypherpunks.ru repositories - nncp.git/commitdiff
Fixed nncp-reass's badSize calculation
authorSergey Matveev <stargrave@stargrave.org>
Sat, 29 Apr 2023 09:49:53 +0000 (12:49 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 29 Apr 2023 11:00:09 +0000 (14:00 +0300)
doc/news.ru.texi
doc/news.texi
src/cmd/nncp-reass/main.go
src/nncp.go

index 49e7778ed9de4190719b9491ea57eb29b56b2c85..bc331a886664d09e8a176a237cbed16d313c1309 100644 (file)
@@ -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
index 50f675bc4973eca3e6b388124dcca94eca8e5869..fa973407bbac647a13281a5ece77fd9c6a9983aa 100644 (file)
@@ -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
index ac52eeb2e853f098ab75f811c0ebcc3cd5548467..e92a2e59307f1d5f2c5580d5d8992053106cb0a6 100644 (file)
@@ -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
                }
index b4ce4d8371d532de63010036c8008283cffa6b26..dde9bcb020cb3b509bf5c0e0d7cbf3f22361a388 100644 (file)
@@ -40,7 +40,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.`
 const Base32Encoded32Len = 52
 
 var (
-       Version string = "8.8.2"
+       Version string = "8.8.3"
 
        Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding)
 )