Changeset 9817
- Timestamp:
- Dec 24, 2009, 6:01:48 PM (13 years ago)
- Location:
- trunk/libtransmission
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r9816 r9817 860 860 const tr_torrent * tor = t->tor; 861 861 const tr_info * inf = tr_torrentInfo( tor ); 862 const tr_bool isStreaming = tr_torrentIsStreaming( tor );863 862 struct weighted_piece * pieces; 864 863 int pieceCount; … … 876 875 piece->index = pool[i]; 877 876 piece->requestCount = 0; 878 piece->salt = isStreaming ? piece->index 879 : (tr_piece_index_t)tr_cryptoWeakRandInt( 4096 ); 877 piece->salt = tr_cryptoWeakRandInt( 4096 ); 880 878 } 881 879 -
trunk/libtransmission/resume.c
r9816 r9817 43 43 #define KEY_SPEEDLIMIT_UP "speed-limit-up" 44 44 #define KEY_SPEEDLIMIT_DOWN "speed-limit-down" 45 #define KEY_STREAMING "streaming"46 45 #define KEY_RATIOLIMIT "ratio-limit" 47 46 #define KEY_UPLOADED "uploaded" … … 505 504 tr_tordbg( tor, "Saving .resume file for \"%s\"", tr_torrentName( tor ) ); 506 505 507 tr_bencInitDict( &top, 3 4); /* arbitrary "big enough" number */506 tr_bencInitDict( &top, 33 ); /* arbitrary "big enough" number */ 508 507 tr_bencDictAddInt( &top, KEY_ACTIVITY_DATE, tor->activityDate ); 509 508 tr_bencDictAddInt( &top, KEY_ADDED_DATE, tor->addedDate ); … … 518 517 tr_bencDictAddInt( &top, KEY_BANDWIDTH_PRIORITY, tr_torrentGetPriority( tor ) ); 519 518 tr_bencDictAddBool( &top, KEY_PAUSED, !tor->isRunning ); 520 tr_bencDictAddBool( &top, KEY_STREAMING, tr_torrentIsStreaming( tor ) );521 519 savePeers( &top, tor ); 522 520 saveFilePriorities( &top, tor ); … … 612 610 } 613 611 614 if( ( fieldsToLoad & TR_FR_STREAMING )615 && tr_bencDictFindBool( &top, KEY_STREAMING, &boolVal ) )616 {617 tor->isStreaming = boolVal;618 fieldsLoaded |= TR_FR_STREAMING;619 }620 621 612 if( ( fieldsToLoad & TR_FR_ADDED_DATE ) 622 613 && tr_bencDictFindInt( &top, KEY_ADDED_DATE, &i ) ) -
trunk/libtransmission/resume.h
r9816 r9817 36 36 TR_FR_DONE_DATE = ( 1 << 14 ), 37 37 TR_FR_ACTIVITY_DATE = ( 1 << 15 ), 38 TR_FR_RATIOLIMIT = ( 1 << 16 ), 39 TR_FR_STREAMING = ( 1 << 17 ) 38 TR_FR_RATIOLIMIT = ( 1 << 16 ) 40 39 }; 41 40 -
trunk/libtransmission/torrent.c
r9816 r9817 1891 1891 ***/ 1892 1892 1893 tr_bool1894 tr_torrentIsStreaming( const tr_torrent * tor )1895 {1896 assert( tr_isTorrent( tor ) );1897 assert( tr_isBool( tor->isStreaming ) );1898 1899 return tor->isStreaming;1900 }1901 1902 void1903 tr_torrentSetStreaming( tr_torrent * tor, tr_bool isStreaming )1904 {1905 assert( tr_isTorrent( tor ) );1906 assert( tr_isBool( isStreaming ) );1907 1908 tor->isStreaming = isStreaming;1909 }1910 1911 /***1912 ****1913 ***/1914 1915 1893 void 1916 1894 tr_torrentSetPeerLimit( tr_torrent * tor, -
trunk/libtransmission/torrent.h
r9816 r9817 227 227 void * ratio_limit_hit_func_user_data; 228 228 229 tr_bool isStreaming;230 229 tr_bool isRunning; 231 230 tr_bool isDeleting; -
trunk/libtransmission/transmission.h
r9816 r9817 708 708 uint16_t tr_sessionGetPeerLimitPerTorrent( const tr_session * ); 709 709 710 tr_priority_t tr_torrentGetPriority( const tr_torrent * ); 711 void tr_torrentSetPriority( tr_torrent *, tr_priority_t ); 712 710 713 711 714 /** … … 1072 1075 tr_bool tr_torrentUsesSessionLimits ( const tr_torrent * ); 1073 1076 1074 1075 tr_priority_t tr_torrentGetPriority( const tr_torrent * );1076 void tr_torrentSetPriority( tr_torrent *, tr_priority_t );1077 1078 tr_bool tr_torrentIsStreaming( const tr_torrent * );1079 void tr_torrentSetStreaming( tr_torrent *, tr_bool );1080 1077 1081 1078 /****
Note: See TracChangeset
for help on using the changeset viewer.