Changeset 7064 for trunk/libtransmission/torrent.c
- Timestamp:
- Nov 7, 2008, 4:10:27 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/torrent.c
r7056 r7064 147 147 { 148 148 tr_speedlimit * limit = direction == TR_UP ? &tor->uploadLimitMode 149 : &tor->downloadLimitMode;149 : &tor->downloadLimitMode; 150 150 151 151 *limit = mode; … … 157 157 { 158 158 return direction == TR_UP ? tor->uploadLimitMode 159 : tor->downloadLimitMode;159 : tor->downloadLimitMode; 160 160 } 161 161 … … 193 193 assert( 0 ); 194 194 } 195 } 196 197 int 198 tr_torrentPieceTransferIsAllowed( const tr_torrent * tor, 199 tr_direction direction ) 200 { 201 int isEnabled = FALSE; 202 203 switch( tr_torrentGetSpeedMode( tor, direction ) ) 204 { 205 case TR_SPEEDLIMIT_GLOBAL: 206 isEnabled = tr_sessionGetSpeedLimit( tor->session, direction ) > 0; 207 break; 208 209 case TR_SPEEDLIMIT_SINGLE: 210 isEnabled = tr_torrentGetSpeedLimit( tor, direction ) > 0; 211 break; 212 213 case TR_SPEEDLIMIT_UNLIMITED: 214 isEnabled = TRUE; 215 break; 216 217 default: 218 assert( 0 && "unhandled speed mode" ); 219 break; 220 } 221 222 return isEnabled; 195 223 } 196 224
Note: See TracChangeset
for help on using the changeset viewer.