Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: libtransmission/torrent.c
- ===================================================================
- --- libtransmission/torrent.c (revision 13343)
- +++ libtransmission/torrent.c (working copy)
- @@ -621,6 +621,20 @@
- return priority;
- }
- +static tr_priority_t
- +calculateRightPiecePriority( tr_piece_index_t p, const tr_info *inf,
- + const tr_torrent * tor, int fileHint )
- +{
- + if(p>=(inf->pieceCount/3)*2){
- + return TR_PRI_LOW;
- + }else if(p>=inf->pieceCount/3&&p<=(inf->pieceCount/3)*2){
- + return TR_PRI_NORMAL;
- + }else if(p<=inf->pieceCount/3||p==inf->pieceCount){
- + return TR_PRI_HIGH;
- + }else
- + return calculatePiecePriority(tor, p, fileHint);
- +}
- +
- static void
- tr_torrentInitFilePieces( tr_torrent * tor )
- {
- @@ -661,7 +675,8 @@
- #endif
- for( p=0; p<inf->pieceCount; ++p )
- - inf->pieces[p].priority = calculatePiecePriority( tor, p, firstFiles[p] );
- + //inf->pieces[p].priority = calculatePiecePriority( tor, p, firstFiles[p] );
- + inf->pieces[p].priority = calculateRightPiecePriority(p, inf, tor, firstFiles[p]);
- tr_free( firstFiles );
- }
- @@ -2756,7 +2771,7 @@
- base = tr_strdup_printf( "%s__XXXXXX", tr_torrentName( tor ) );
- tmpdir = tr_buildPath( top, base, NULL );
- - tr_mkdtemp( tmpdir );
- + mkdtemp( tmpdir );
- tr_free( base );
- for( f=0; f<tor->info.fileCount; ++f )
Add Comment
Please, Sign In to add comment