Ignore:
Timestamp:
Mar 1, 2009, 1:56:22 PM (13 years ago)
Author:
charles
Message:

(trunk libT) #1823: Ratio limit is only checked when peers are active

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r7948 r7977  
    997997
    998998static void
    999 fireRatioLimitHit( tr_torrent * tor )
    1000 {
    1001     assert( tr_isTorrent( tor ) );
    1002 
    1003     if( tor->ratio_limit_hit_func )
    1004         tor->ratio_limit_hit_func( tor, tor->ratio_limit_hit_func_user_data );
    1005 }
    1006 
    1007 static void
    1008999peerCallbackFunc( void * vpeer, void * vevent, void * vt )
    10091000{
     
    10361027            const time_t now = time( NULL );
    10371028            tr_torrent * tor = t->tor;
    1038             double seedRatio;
    10391029
    10401030            tor->activityDate = now;
     
    10541044            }
    10551045
    1056             /* if we're seeding and we've reached our seed ratio limit, stop the torrent */
    1057             if( tr_torrentIsSeed( tor ) && tr_torrentGetSeedRatio( tor, &seedRatio ) ) {
    1058                 const double up = tor->uploadedCur + tor->uploadedPrev;
    1059                 const double down = tor->downloadedCur + tor->downloadedPrev;
    1060                 const double ratio = tr_getRatio( up, down );
    1061                 if( ratio >= seedRatio ) {
    1062                     tr_torrentStop( tor );
    1063                    
    1064                     /* set to no ratio limit to allow easy restarting */
    1065                     tr_torrentSetRatioMode( tor, TR_RATIOLIMIT_UNLIMITED );
    1066                    
    1067                     fireRatioLimitHit( tor );
    1068                 }
    1069             }
     1046            tr_torrentCheckSeedRatio( tor );
    10701047
    10711048            break;
Note: See TracChangeset for help on using the changeset viewer.