Changeset 1234


Ignore:
Timestamp:
Dec 16, 2006, 1:58:07 AM (15 years ago)
Author:
livings124
Message:

libT can now better report if it can connect to a tracker, and as a result the mac's queue system will now start the next for any error (not just those sent by the tracker)

Location:
branches/multitracker
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/multitracker/libtransmission/tracker.c

    r1233 r1234  
    7171    int            complete;
    7272    int            randOffset;
     73   
     74    int            completelyUnconnectable;
    7375
    7476    uint64_t       dateTry;
     
    202204                                || tc->announceTierLast + 1 < inf->trackerList[tc->announceTier].count
    203205                                ? TC_CHANGE_NEXT : TC_CHANGE_NO;
     206   
     207    if( tc->shouldChangeAnnounce == TC_CHANGE_NO )
     208    {
     209        tc->completelyUnconnectable = 1;
     210    }
    204211}
    205212
     
    316323    if( ( NULL == tc->http ) && shouldConnect( tc ) )
    317324    {
     325        tc->completelyUnconnectable = 0;
    318326        tc->randOffset = tr_rand( 60000 );
    319327       
     
    10551063}
    10561064
     1065int tr_trackerCannotConnecting( tr_tracker_t * tc )
     1066{
     1067    if( !tc )
     1068    {
     1069        return 0;
     1070    }
     1071    return tc->completelyUnconnectable;
     1072}
     1073
    10571074/* Blocking version */
    10581075int tr_trackerScrape( tr_torrent_t * tor, int * s, int * l, int * d )
  • branches/multitracker/libtransmission/tracker.h

    r1192 r1234  
    6161const char * tr_trackerAnnounce( tr_tracker_t * tc );
    6262
     63int tr_trackerCannotConnecting( tr_tracker_t * tc );
     64
    6365/***********************************************************************
    6466 * tr_trackerScrape
  • branches/multitracker/libtransmission/transmission.c

    r1208 r1234  
    455455    tr_peer_t * peer;
    456456    tr_info_t * inf = &tor->info;
     457    tr_tracker_t * tc = tor->tracker;
    457458    int i;
    458459
     
    474475    memcpy( s->trackerError, tor->trackerError,
    475476            sizeof( s->trackerError ) );
     477    s->cannotConnect = tr_trackerCannotConnecting( tc );
    476478   
    477479    if( tor->tracker )
     
    532534    s->rateUpload = tr_rcRate( tor->upload );
    533535   
    534     s->seeders  = tr_trackerSeeders( tor->tracker );
    535     s->leechers = tr_trackerLeechers( tor->tracker );
     536    s->seeders  = tr_trackerSeeders( tc );
     537    s->leechers = tr_trackerLeechers( tc );
    536538    s->completedFromTracker = tr_trackerDownloaded( tor->tracker );
    537539
  • branches/multitracker/libtransmission/transmission.h

    r1223 r1234  
    364364    int                 error;
    365365    char                trackerError[128];
     366    int                 cannotConnect;
    366367   
    367368    const char        * trackerAddress;
  • branches/multitracker/macosx/Torrent.m

    r1223 r1234  
    351351        [fStatusString setString: [NSLocalizedString(@"Error: ", "Torrent -> status string") stringByAppendingString:
    352352                                    [self errorMessage]]];
    353         if (!fError && [self isActive])
     353    }
     354   
     355    BOOL wasError = fError;
     356    if ((fError = fStat->cannotConnect))
     357    {
     358        if (!wasError && [self isActive])
    354359        {
    355360            fError = YES;
     
    357362                [[NSNotificationCenter defaultCenter] postNotificationName: @"StoppedDownloading" object: self];
    358363        }
    359     }
    360     else
    361     {
    362         if (fError)
    363             fError = NO;
    364364    }
    365365
Note: See TracChangeset for help on using the changeset viewer.