From efadcd8926166f37afc16e030c6b11525af646b4 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 7 Aug 2008 19:25:19 +0000 Subject: [PATCH] #1155: when creating new torrents > 2 GiB, piece size should be 2 MiB --- libtransmission/makemeta.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libtransmission/makemeta.c b/libtransmission/makemeta.c index f224281cb..80aa5edfe 100644 --- a/libtransmission/makemeta.c +++ b/libtransmission/makemeta.c @@ -88,7 +88,8 @@ bestPieceSize( uint64_t totalSize ) static const uint64_t MiB = 1048576; static const uint64_t KiB = 1024; - if( totalSize >= (1*GiB) ) return MiB; + if( totalSize >= (2*GiB) ) return (2*MiB); + if( totalSize >= (1*GiB) ) return (1*MiB); if( totalSize >= (512*MiB) ) return (512*KiB); if( totalSize >= (350*MiB) ) return (256*KiB); if( totalSize >= (150*MiB) ) return (128*KiB); -- 2.40.0