Ignore:
Timestamp:
May 5, 2007, 2:43:52 PM (15 years ago)
Author:
livings124
Message:

only allow one active transfer with the same name in the same location

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r1807 r1829  
    242242{
    243243    char name[32];
    244 
     244    tr_torrent_t * current, * next;
     245   
    245246    if( tor->status & ( TR_STATUS_STOPPING | TR_STATUS_STOPPED ) )
    246247    {
    247248        /* Join the thread first */
    248249        torrentReallyStop( tor );
     250    }
     251   
     252    /* Don't start if a torrent with the same name and destination is already active */
     253    for( current = tor->handle->torrentList; current; current = current->next )
     254    {
     255        if( current != tor && current->status != TR_STATUS_PAUSE
     256            && !strcmp( tor->destination, current->destination )
     257            && !strcmp( tor->info.name, current->info.name ) )
     258        {
     259            tor->error = TR_ERROR_IO_DUP_NAME;
     260            snprintf( tor->errorString, sizeof( tor->errorString ),
     261                          "%s", tr_errorString( TR_ERROR_IO_DUP_NAME ) );
     262            return;
     263        }
    249264    }
    250265
Note: See TracChangeset for help on using the changeset viewer.