From b7fa94c171d8ab43cf78d40acf2f2d468a465026 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 24 Apr 2023 21:26:14 -0700 Subject: [PATCH] transmission: Fix overflow in previous patch --- ...hoose-larger-pieces-for-larger-sizes.patch | 24 ++++++++++++------- pkg/transmission/ver | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/pkg/transmission/patch/0002-Choose-larger-pieces-for-larger-sizes.patch b/pkg/transmission/patch/0002-Choose-larger-pieces-for-larger-sizes.patch index 234a98c1..a984c29e 100644 --- a/pkg/transmission/patch/0002-Choose-larger-pieces-for-larger-sizes.patch +++ b/pkg/transmission/patch/0002-Choose-larger-pieces-for-larger-sizes.patch @@ -1,20 +1,27 @@ -From 4c111db979c3bec7496bdb856d3819591d5d85c6 Mon Sep 17 00:00:00 2001 +From ed525431bbe23d61c4c8dd4664c13bc19b4db889 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Mon, 24 Apr 2023 21:09:06 -0700 Subject: [PATCH] Choose larger pieces for larger sizes --- - libtransmission/makemeta.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) + libtransmission/makemeta.c | 21 ++++++++++++++++++--- + 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/libtransmission/makemeta.c b/libtransmission/makemeta.c -index 713f3e5cb..0ebb6d720 100644 +index 713f3e5cb..ae422395d 100644 --- a/libtransmission/makemeta.c +++ b/libtransmission/makemeta.c -@@ -92,6 +92,21 @@ static uint32_t bestPieceSize(uint64_t totalSize) - uint32_t const MiB = 1048576; - uint32_t const GiB = 1073741824; +@@ -88,9 +88,24 @@ static struct FileList* getFiles(char const* dir, char const* base, struct FileL + static uint32_t bestPieceSize(uint64_t totalSize) + { +- uint32_t const KiB = 1024; +- uint32_t const MiB = 1048576; +- uint32_t const GiB = 1073741824; ++ uint64_t const KiB = 1024; ++ uint64_t const MiB = 1048576; ++ uint64_t const GiB = 1073741824; ++ + if (totalSize >= 16 * GiB) + { + return 16 * MiB; @@ -29,10 +36,9 @@ index 713f3e5cb..0ebb6d720 100644 + { + return 4 * MiB; + } -+ + if (totalSize >= 2 * GiB) { - return 2 * MiB; -- 2.37.3 diff --git a/pkg/transmission/ver b/pkg/transmission/ver index 74490f88..a603702a 100644 --- a/pkg/transmission/ver +++ b/pkg/transmission/ver @@ -1 +1 @@ -3.00 r1 +3.00 r2 -- 2.45.2