Changeset 8411


Ignore:
Timestamp:
May 15, 2009, 3:42:13 PM (12 years ago)
Author:
charles
Message:

(trunk cli) #1805: creating multi-tracker torrents - CLI

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cli/cli.c

    r8233 r8411  
    4949static const char * torrentPath  = NULL;
    5050static const char * finishCall   = NULL;
    51 static const char * announce     = NULL;
    5251static const char * sourceFile   = NULL;
    5352static const char * comment      = NULL;
     53
     54#define MAX_ANNOUNCE 128
     55static tr_tracker_info announce[MAX_ANNOUNCE];
     56static int announceCount = 0;
    5457
    5558static const struct tr_option options[] =
     
    334337        int                   err;
    335338        tr_metainfo_builder * b = tr_metaInfoBuilderCreate( sourceFile );
    336         tr_tracker_info       ti;
    337         ti.tier = 0;
    338         ti.announce = (char*) announce;
    339         tr_makeMetaInfo( b, torrentPath, &ti, 1, comment, isPrivate );
     339        tr_makeMetaInfo( b, torrentPath, announce, announceCount, comment, isPrivate );
    340340        while( !b->isDone )
    341341        {
     
    490490        switch( c )
    491491        {
    492             case 'a':
    493                 announce = optarg; break;
    494 
     492            case 'a': if( announceCount + 1 < MAX_ANNOUNCE ) {
     493                          announce[announceCount].tier = announceCount;
     494                          announce[announceCount].announce = (char*) optarg;
     495                          ++announceCount;
     496                      }
     497                      break;
    495498            case 'b': tr_bencDictAddBool( d, TR_PREFS_KEY_BLOCKLIST_ENABLED, TRUE );
    496499                      break;
Note: See TracChangeset for help on using the changeset viewer.