Changeset 6486


Ignore:
Timestamp:
Aug 11, 2008, 5:29:53 PM (13 years ago)
Author:
charles
Message:

(libT) #1179: when creating a torrent, don't add an announce-list if there's only one tracker

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/makemeta.c

    r6484 r6486  
    362362        int prevTier = -1;
    363363        tr_benc * tier = NULL;
    364         tr_benc * announceList;
    365 
    366         announceList = tr_bencDictAddList( &top, "announce-list", 0 );
    367         for( i=0; i<builder->trackerCount; ++i ) {
    368             if( prevTier != builder->trackers[i].tier ) {
    369                 prevTier = builder->trackers[i].tier;
    370                 tier = tr_bencListAddList( announceList, 0 );
     364
     365        if( builder->trackerCount > 1 )
     366        {
     367            tr_benc * annList = tr_bencDictAddList( &top, "announce-list", 0 );
     368            for( i=0; i<builder->trackerCount; ++i ) {
     369                if( prevTier != builder->trackers[i].tier ) {
     370                    prevTier = builder->trackers[i].tier;
     371                    tier = tr_bencListAddList( annList, 0 );
     372                }
     373                tr_bencListAddStr( tier, builder->trackers[i].announce );
    371374            }
    372             tr_bencListAddStr( tier, builder->trackers[i].announce );
    373375        }
    374376
    375377        tr_bencDictAddStr( &top, "announce", builder->trackers[0].announce );
    376378    }
    377    
     379
    378380    if( !builder->result && !builder->abortFlag )
    379381    {
Note: See TracChangeset for help on using the changeset viewer.