Changeset 3970


Ignore:
Timestamp:
Nov 26, 2007, 4:05:12 AM (15 years ago)
Author:
charles
Message:

disable SWIFT on private trackers, because they are typically ratio-based sites where you *want* to upload as much as possible to deadbeats

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/internal.h

    r3921 r3970  
    4444#endif
    4545
     46int tr_torrentIsPrivate( const tr_torrent * );
     47
    4648void tr_torrentRecheckCompleteness( tr_torrent * );
    4749
  • trunk/libtransmission/peer-msgs.c

    r3929 r3970  
    14431443**/
    14441444
     1445static int
     1446isSwiftEnabled( const tr_peermsgs * msgs )
     1447{
     1448    /* rationale: SWIFT is good for getting rid of deadbeats, but most
     1449     * private trackers have ratios where you _want_ to feed deadbeats
     1450     * as much as possible.  So we disable SWIFT on private torrents */
     1451    return SWIFT_ENABLED
     1452        && !tr_torrentIsSeed( msgs->torrent )
     1453        && !tr_torrentIsPrivate( msgs->torrent );
     1454}
     1455
    14451456static size_t
    14461457getUploadMax( const tr_peermsgs * msgs )
     
    14481459    static const size_t maxval = ~0;
    14491460    const tr_torrent * tor = msgs->torrent;
    1450     const int useSwift = SWIFT_ENABLED && !tr_torrentIsSeed( msgs->torrent );
     1461    const int useSwift = isSwiftEnabled( msgs );
    14511462    const size_t swiftLeft = msgs->info->credit;
    14521463    size_t speedLeft;
  • trunk/libtransmission/torrent.c

    r3932 r3970  
    643643
    644644int
     645tr_torrentIsPrivate( const tr_torrent * tor )
     646{
     647    return tor
     648        && tor->info.isPrivate;
     649}
     650
     651int
    645652tr_torrentIsPexEnabled( const tr_torrent * tor )
    646653{
    647     return !tor->info.isPrivate && !tor->pexDisabled;
     654    return tor
     655        && !tr_torrentIsPrivate( tor )
     656        && !tor->pexDisabled;
    648657}
    649658
Note: See TracChangeset for help on using the changeset viewer.