mirror of
https://github.com/transmission/transmission
synced 2025-02-03 04:53:27 +00:00
(trunk) make torrent creation's piece size more flexible. (ticket #293 reported by matt)
This commit is contained in:
parent
74f430990b
commit
9acf79d665
1 changed files with 6 additions and 7 deletions
|
@ -86,13 +86,12 @@ bestPieceSize( uint64_t totalSize )
|
|||
static const uint64_t MiB = 1048576;
|
||||
static const uint64_t KiB = 1024;
|
||||
|
||||
if( totalSize >= (8*GiB) )
|
||||
return MiB;
|
||||
|
||||
if( totalSize <= (8*MiB) )
|
||||
return 256 * KiB;
|
||||
|
||||
return 512 * KiB;
|
||||
if( totalSize >= (1*GiB) ) return MiB;
|
||||
if( totalSize >= (512*MiB) ) return (512*KiB);
|
||||
if( totalSize >= (350*MiB) ) return (256*KiB);
|
||||
if( totalSize >= (150*MiB) ) return (128*KiB);
|
||||
if( totalSize >= (50*MiB) ) return (64*KiB);
|
||||
return (32*KiB); /* less than 50 meg */
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in a new issue