Changeset 961


Ignore:
Timestamp:
Sep 29, 2006, 5:30:36 AM (15 years ago)
Author:
livings124
Message:

Torrents that have errors aren't counted in the queue, and when a torrent encounters an error the next torrent in the queue will start (even though that torrent might still be active).

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r928 r961  
    14211421        if ([torrent isActive])
    14221422        {
    1423             if (![torrent isSeeding])
     1423            if (![torrent isSeeding] && ![torrent isError])
    14241424            {
    14251425                desiredActive--;
     
    15081508    Torrent * torrent;
    15091509    while ((torrent = [enumerator nextObject]))
    1510         if ([torrent isActive] && ![torrent isSeeding])
     1510        if ([torrent isActive] && ![torrent isSeeding] && ![torrent isError])
    15111511        {
    15121512            desiredActive--;
  • trunk/macosx/Torrent.h

    r940 r961  
    5050    int     fStopRatioSetting;
    5151    float   fRatioLimit;
    52     BOOL    fFinishedSeeding, fWaitToStart;
     52    BOOL    fFinishedSeeding, fWaitToStart, fError;
    5353   
    5454    int fOrderValue;
  • trunk/macosx/Torrent.m

    r960 r961  
    262262    }
    263263   
    264     if( fStat->error & TR_ETRACKER )
    265         [fStatusString setString: [@"Error: " stringByAppendingString:
    266                         [NSString stringWithUTF8String: fStat->trackerError]]];
     264    if (fStat->error & TR_ETRACKER)
     265    {
     266        [fStatusString setString: [@"Error: " stringByAppendingString: [NSString stringWithUTF8String: fStat->trackerError]]];
     267        if (!fError && [self isActive])
     268        {
     269            fError = YES;
     270            if (![self isSeeding])
     271                [[NSNotificationCenter defaultCenter] postNotificationName: @"StoppedDownloading" object: self];
     272        }
     273    }
     274    else
     275    {
     276        if (fError)
     277            fError = NO;
     278    }
    267279
    268280    if ([self isActive])
     
    330342- (void) stopTransfer
    331343{
     344    fError = NO;
     345   
    332346    if ([self isActive])
    333347    {
     
    431445    NSLog(@"Volume: %@", volume);
    432446    NSLog(@"Remaining disk space: %qu (%@)", remainingSpace, [NSString stringForFileSize: remainingSpace]);
    433     NSLog(@"Progress: %f", [self progress]);
    434     NSLog(@"Torrent total size: %qu (%@)", [self size], [NSString stringForFileSize: [self size]]);
    435447    NSLog(@"Torrent remaining size: %qu (%@)", torrentRemaining, [NSString stringForFileSize: torrentRemaining]);
    436448   
     
    791803    fWaitToStart = waitToStart ? [waitToStart boolValue] : [fDefaults boolForKey: @"AutoStartDownload"];
    792804    fOrderValue = orderValue ? [orderValue intValue] : tr_torrentCount(fLib) - 1;
     805    fError = NO;
    793806   
    794807    NSString * fileType = fInfo->multifile ? NSFileTypeForHFSTypeCode('fldr') : [[self name] pathExtension];
Note: See TracChangeset for help on using the changeset viewer.