From: Charles Kerr Date: Thu, 7 Aug 2008 19:25:19 +0000 (+0000) Subject: #1155: when creating new torrents > 2 GiB, piece size should be 2 MiB X-Git-Tag: 1.32~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=efadcd8926166f37afc16e030c6b11525af646b4;p=transmission #1155: when creating new torrents > 2 GiB, piece size should be 2 MiB --- 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);