diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 1dc31b980..ec8f0cf76 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -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 diff --git a/libtransmission/resume.c b/libtransmission/resume.c index 31334b8c0..cef4a3d38 100644 --- a/libtransmission/resume.c +++ b/libtransmission/resume.c @@ -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 ) ) { diff --git a/libtransmission/resume.h b/libtransmission/resume.h index 870bae6be..573e1c6b0 100644 --- a/libtransmission/resume.h +++ b/libtransmission/resume.h @@ -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 ) }; /** diff --git a/libtransmission/torrent.c b/libtransmission/torrent.c index 9311bbe77..cdf68a64d 100644 --- a/libtransmission/torrent.c +++ b/libtransmission/torrent.c @@ -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 ) diff --git a/libtransmission/torrent.h b/libtransmission/torrent.h index 6b1b4d41d..ae984c058 100644 --- a/libtransmission/torrent.h +++ b/libtransmission/torrent.h @@ -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; diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index 1f52856f6..686370e91 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -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 ****/