mirror of
https://github.com/transmission/transmission
synced 2025-02-20 13:16:53 +00:00
(trunk libT) #2632 "Add streaming capability to libtransmission (but not the Transmission GUI clients)" -- revert this feature due to pushback from devs and users and the 1.80 freeze
This commit is contained in:
parent
12ffdb7d87
commit
3e2269e5e3
6 changed files with 6 additions and 44 deletions
|
@ -859,7 +859,6 @@ pieceListRebuild( Torrent * t )
|
|||
tr_piece_index_t poolCount = 0;
|
||||
const tr_torrent * tor = t->tor;
|
||||
const tr_info * inf = tr_torrentInfo( tor );
|
||||
const tr_bool isStreaming = tr_torrentIsStreaming( tor );
|
||||
struct weighted_piece * pieces;
|
||||
int pieceCount;
|
||||
|
||||
|
@ -875,8 +874,7 @@ pieceListRebuild( Torrent * t )
|
|||
struct weighted_piece * piece = pieces + i;
|
||||
piece->index = pool[i];
|
||||
piece->requestCount = 0;
|
||||
piece->salt = isStreaming ? piece->index
|
||||
: (tr_piece_index_t)tr_cryptoWeakRandInt( 4096 );
|
||||
piece->salt = tr_cryptoWeakRandInt( 4096 );
|
||||
}
|
||||
|
||||
/* if we already had a list of pieces, merge it into
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#define KEY_SPEEDLIMIT_OLD "speed-limit"
|
||||
#define KEY_SPEEDLIMIT_UP "speed-limit-up"
|
||||
#define KEY_SPEEDLIMIT_DOWN "speed-limit-down"
|
||||
#define KEY_STREAMING "streaming"
|
||||
#define KEY_RATIOLIMIT "ratio-limit"
|
||||
#define KEY_UPLOADED "uploaded"
|
||||
|
||||
|
@ -504,7 +503,7 @@ tr_torrentSaveResume( const tr_torrent * tor )
|
|||
|
||||
tr_tordbg( tor, "Saving .resume file for \"%s\"", tr_torrentName( tor ) );
|
||||
|
||||
tr_bencInitDict( &top, 34 ); /* arbitrary "big enough" number */
|
||||
tr_bencInitDict( &top, 33 ); /* arbitrary "big enough" number */
|
||||
tr_bencDictAddInt( &top, KEY_ACTIVITY_DATE, tor->activityDate );
|
||||
tr_bencDictAddInt( &top, KEY_ADDED_DATE, tor->addedDate );
|
||||
tr_bencDictAddInt( &top, KEY_CORRUPT, tor->corruptPrev + tor->corruptCur );
|
||||
|
@ -517,7 +516,6 @@ tr_torrentSaveResume( const tr_torrent * tor )
|
|||
tr_bencDictAddInt( &top, KEY_MAX_PEERS, tor->maxConnectedPeers );
|
||||
tr_bencDictAddInt( &top, KEY_BANDWIDTH_PRIORITY, tr_torrentGetPriority( tor ) );
|
||||
tr_bencDictAddBool( &top, KEY_PAUSED, !tor->isRunning );
|
||||
tr_bencDictAddBool( &top, KEY_STREAMING, tr_torrentIsStreaming( tor ) );
|
||||
savePeers( &top, tor );
|
||||
saveFilePriorities( &top, tor );
|
||||
saveDND( &top, tor );
|
||||
|
@ -611,13 +609,6 @@ loadFromFile( tr_torrent * tor,
|
|||
fieldsLoaded |= TR_FR_RUN;
|
||||
}
|
||||
|
||||
if( ( fieldsToLoad & TR_FR_STREAMING )
|
||||
&& tr_bencDictFindBool( &top, KEY_STREAMING, &boolVal ) )
|
||||
{
|
||||
tor->isStreaming = boolVal;
|
||||
fieldsLoaded |= TR_FR_STREAMING;
|
||||
}
|
||||
|
||||
if( ( fieldsToLoad & TR_FR_ADDED_DATE )
|
||||
&& tr_bencDictFindInt( &top, KEY_ADDED_DATE, &i ) )
|
||||
{
|
||||
|
|
|
@ -35,8 +35,7 @@ enum
|
|||
TR_FR_ADDED_DATE = ( 1 << 13 ),
|
||||
TR_FR_DONE_DATE = ( 1 << 14 ),
|
||||
TR_FR_ACTIVITY_DATE = ( 1 << 15 ),
|
||||
TR_FR_RATIOLIMIT = ( 1 << 16 ),
|
||||
TR_FR_STREAMING = ( 1 << 17 )
|
||||
TR_FR_RATIOLIMIT = ( 1 << 16 )
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -1890,28 +1890,6 @@ tr_torrentSetPriority( tr_torrent * tor, tr_priority_t priority )
|
|||
****
|
||||
***/
|
||||
|
||||
tr_bool
|
||||
tr_torrentIsStreaming( const tr_torrent * tor )
|
||||
{
|
||||
assert( tr_isTorrent( tor ) );
|
||||
assert( tr_isBool( tor->isStreaming ) );
|
||||
|
||||
return tor->isStreaming;
|
||||
}
|
||||
|
||||
void
|
||||
tr_torrentSetStreaming( tr_torrent * tor, tr_bool isStreaming )
|
||||
{
|
||||
assert( tr_isTorrent( tor ) );
|
||||
assert( tr_isBool( isStreaming ) );
|
||||
|
||||
tor->isStreaming = isStreaming;
|
||||
}
|
||||
|
||||
/***
|
||||
****
|
||||
***/
|
||||
|
||||
void
|
||||
tr_torrentSetPeerLimit( tr_torrent * tor,
|
||||
uint16_t maxConnectedPeers )
|
||||
|
|
|
@ -226,7 +226,6 @@ struct tr_torrent
|
|||
tr_torrent_ratio_limit_hit_func * ratio_limit_hit_func;
|
||||
void * ratio_limit_hit_func_user_data;
|
||||
|
||||
tr_bool isStreaming;
|
||||
tr_bool isRunning;
|
||||
tr_bool isDeleting;
|
||||
tr_bool needsSeedRatioCheck;
|
||||
|
|
|
@ -707,6 +707,9 @@ uint16_t tr_sessionGetPeerLimit( const tr_session * );
|
|||
void tr_sessionSetPeerLimitPerTorrent( tr_session *, uint16_t maxGlobalPeers );
|
||||
uint16_t tr_sessionGetPeerLimitPerTorrent( const tr_session * );
|
||||
|
||||
tr_priority_t tr_torrentGetPriority( const tr_torrent * );
|
||||
void tr_torrentSetPriority( tr_torrent *, tr_priority_t );
|
||||
|
||||
|
||||
/**
|
||||
* Load all the torrents in tr_getTorrentDir().
|
||||
|
@ -1072,12 +1075,6 @@ void tr_torrentUseSessionLimits ( tr_torrent *, tr_bool );
|
|||
tr_bool tr_torrentUsesSessionLimits ( const tr_torrent * );
|
||||
|
||||
|
||||
tr_priority_t tr_torrentGetPriority( const tr_torrent * );
|
||||
void tr_torrentSetPriority( tr_torrent *, tr_priority_t );
|
||||
|
||||
tr_bool tr_torrentIsStreaming( const tr_torrent * );
|
||||
void tr_torrentSetStreaming( tr_torrent *, tr_bool );
|
||||
|
||||
/****
|
||||
***** Ratio Limits
|
||||
****/
|
||||
|
|
Loading…
Reference in a new issue