Changeset 10288


Ignore:
Timestamp:
Feb 25, 2010, 11:06:05 PM (12 years ago)
Author:
livings124
Message:

for scrapes: add a new field to distinguish from error messages returned from the tracker, and scrape timeouts, so that they can be displayed differently

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/daemon/remote.c

    r10128 r10288  
    13581358                    int64_t lastScrapeStartTime;
    13591359                    int64_t lastScrapeTime;
     1360                    tr_bool lastScrapeTimedOut;
    13601361                    int64_t leecherCount;
    13611362                    int64_t nextAnnounceTime;
     
    13831384                        tr_bencDictFindBool( t, "lastScrapeSucceeded", &lastScrapeSucceeded ) &&
    13841385                        tr_bencDictFindInt ( t, "lastScrapeTime", &lastScrapeTime ) &&
     1386                        tr_bencDictFindBool( t, "lastScrapeTimedOut", &lastScrapeTimedOut ) &&
    13851387                        tr_bencDictFindInt ( t, "leecherCount", &leecherCount ) &&
    13861388                        tr_bencDictFindInt ( t, "nextAnnounceTime", &nextAnnounceTime ) &&
     
    14371439                                    printf( "  Tracker had %'d seeders and %'d leechers %s ago\n",
    14381440                                            (int)seederCount, (int)leecherCount, buf );
     1441                                else if( lastScrapeTimedOut )
     1442                                    printf( "  Tracker scrape timed out; will retry\n" );
    14391443                                else
    14401444                                    printf( "  Got a scrape error \"%s\" %s ago\n",
  • trunk/doc/rpc-spec.txt

    r10099 r10288  
    273273                      | lastScrapeSucceeded     | boolean    | tr_tracker_stat
    274274                      | lastScrapeTime          | number     | tr_tracker_stat
     275                      | lastScrapeTimedOut      | boolean    | tr_tracker_stat
    275276                      | leecherCount            | number     | tr_tracker_stat
    276277                      | nextAnnounceTime        | number     | tr_tracker_stat
     
    583584         |         | yes       | torrent-add    | new arg "bandwidthPriority"
    584585         |         | yes       | torrent-get    | new trackerStats arg "lastAnnounceTimedOut"
     586   ------+---------+-----------+----------------+-------------------------------
     587   8     | 1.92    | yes       | torrent-get    | new trackerStats arg "lastScrapeTimedOut"
  • trunk/libtransmission/announcer.c

    r10254 r10288  
    378378    time_t lastScrapeTime;
    379379    tr_bool lastScrapeSucceeded;
     380    tr_bool lastScrapeTimedOut;
    380381
    381382    time_t announceAt;
     
    17151716
    17161717        tier->lastScrapeSucceeded = success;
     1718        tier->lastScrapeTimedOut = responseCode == 0;
    17171719
    17181720        if( success && tier->currentTracker->host )
     
    19601962                    st->lastScrapeTime = tier->lastScrapeTime;
    19611963                    st->lastScrapeSucceeded = tier->lastScrapeSucceeded;
     1964                    st->lastScrapeTimedOut = tier->lastScrapeTimedOut;
    19621965                    tr_strlcpy( st->lastScrapeResult, tier->lastScrapeStr, sizeof( st->lastScrapeResult ) );
    19631966                }
  • trunk/libtransmission/rpcimpl.c

    r10252 r10288  
    382382    {
    383383        const tr_tracker_stat * s = &st[i];
    384         tr_benc * d = tr_bencListAddDict( list, 24 );
     384        tr_benc * d = tr_bencListAddDict( list, 25 );
    385385        tr_bencDictAddStr ( d, "announce", s->announce );
    386386        tr_bencDictAddInt ( d, "announceState", s->announceState );
     
    401401        tr_bencDictAddBool( d, "lastScrapeSucceeded", s->lastScrapeSucceeded );
    402402        tr_bencDictAddInt ( d, "lastScrapeTime", s->lastScrapeTime );
     403        tr_bencDictAddInt ( d, "lastScrapeTimedOut", s->lastScrapeTimedOut );
    403404        tr_bencDictAddInt ( d, "leecherCount", s->leecherCount );
    404405        tr_bencDictAddInt ( d, "nextAnnounceTime", s->nextAnnounceTime );
  • trunk/libtransmission/transmission.h

    r10260 r10288  
    14481448    tr_bool lastScrapeSucceeded;
    14491449
     1450    /* whether or not the last scrape timed out. */
     1451    tr_bool lastScrapeTimedOut;
     1452
    14501453    /* when the last scrape was completed.
    14511454       if "hasScraped" is false, this field is undefined */
  • trunk/macosx/TrackerNode.m

    r10190 r10288  
    183183   
    184184    NSString * baseString;
    185     if (fStat.hasScraped && !fStat.lastScrapeSucceeded)
     185    if (fStat.hasScraped && fStat.lastScrapeTimedOut)
     186        baseString = [NSLocalizedString(@"Scrape timed out", "Tracker last scrape") stringByAppendingFormat: @": %@", dateString];
     187    else if (fStat.hasScraped && !fStat.lastScrapeSucceeded)
    186188    {
    187189        baseString = NSLocalizedString(@"Scrape error", "Tracker last scrape");
Note: See TracChangeset for help on using the changeset viewer.