Changeset 1342


Ignore:
Timestamp:
Jan 12, 2007, 5:16:20 PM (16 years ago)
Author:
livings124
Message:

a little less redundant checking of global bandwidth, and added myself as working on back-end

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/AUTHORS

    r1022 r1342  
    1414Mitchell Livingston <livings124@gmail.com>
    1515 + OS X interface
     16 + Back-end
    1617
    1718Bryan Varner <bryan@varnernet.com>
  • trunk/Transmission.xcodeproj/project.pbxproj

    r1341 r1342  
    285285                4DFBC2DE09C0970D00D5C571 /* Torrent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Torrent.m; path = macosx/Torrent.m; sourceTree = "<group>"; };
    286286                8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; name = Info.plist; path = macosx/Info.plist; sourceTree = "<group>"; };
    287                 8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; };
     287                8D1107320486CEB800E47090 /* Transmission.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Transmission.app; sourceTree = BUILT_PRODUCTS_DIR; };
    288288                A200B8390A2263BA007BBB1E /* InfoWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InfoWindowController.h; path = macosx/InfoWindowController.h; sourceTree = "<group>"; };
    289289                A200B83A0A2263BA007BBB1E /* InfoWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = InfoWindowController.m; path = macosx/InfoWindowController.m; sourceTree = "<group>"; };
  • trunk/libtransmission/ratecontrol.c

    r1320 r1342  
    103103    }
    104104   
    105     for( tor = h->torrentList; tor && rate < (float)limit; tor = tor->next )
    106     {
    107         if( !tor->customSpeedLimit )
     105    for( tor = h->torrentList; tor; tor = tor->next )
     106    {
     107        if( tor->customSpeedLimit )
    108108        {
    109             r = isUpload ? tor->upload : tor->download;
    110             tr_lockLock( &r->lock );
    111             rate += rateForInterval( r, 1000 );
    112             tr_lockUnlock( &r->lock );
     109            continue;
    113110        }
    114     }
    115    
    116     return rate < (float)limit;
     111       
     112        r = isUpload ? tor->upload : tor->download;
     113        tr_lockLock( &r->lock );
     114        rate += rateForInterval( r, 1000 );
     115        tr_lockUnlock( &r->lock );
     116       
     117        if( rate >= (float)limit )
     118        {
     119            return 0;
     120        }
     121    }
     122   
     123    return 1;
    117124}
    118125
Note: See TracChangeset for help on using the changeset viewer.