Changeset 6322


Ignore:
Timestamp:
Jul 11, 2008, 11:51:15 AM (15 years ago)
Author:
charles
Message:

#1042: "Announce allowed: Never"

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/details.c

    r6283 r6322  
    12391239
    12401240static void
    1241 refresh_countdown_lb( GtkWidget * l, time_t t,
     1241refresh_countdown_lb( GtkWidget * w, time_t t,
    12421242                      const char * countdown_done )
    12431243{
    12441244    const time_t now = time( NULL );
    1245 
    1246     if( !t || ( t < now ) )
    1247         gtk_label_set_text( GTK_LABEL( l ), countdown_done );
     1245    GtkLabel * l = GTK_LABEL( w );
     1246
     1247    if( t == 1 )
     1248        gtk_label_set_text( l, _( "In progress" ) );
     1249    else if( t < now )
     1250        gtk_label_set_text( l, countdown_done );
    12481251    else {
    12491252        char buf[1024];
    12501253        const int seconds = t - now;
    12511254        tr_strltime( buf, seconds, sizeof( buf ) );
    1252         gtk_label_set_text( GTK_LABEL( l ), buf );
     1255        gtk_label_set_text( l, buf );
    12531256    }
    12541257}
  • trunk/libtransmission/tracker.c

    r6282 r6322  
    724724        {
    725725            t->lastScrapeTime = now;
    726             t->scrapeAt = 0;
     726            t->scrapeAt = 1;
    727727        }
    728728        else
    729729        {
    730730            t->lastAnnounceTime = now;
    731             t->reannounceAt = 0;
     731            t->reannounceAt = 1;
     732            t->manualAnnounceAllowedAt = 1;
    732733            t->scrapeAt = req->reqtype == TR_REQ_STOPPED
    733734                        ? now + t->scrapeIntervalSec + t->randOffset
     
    783784        tr_tracker * t = tor->tracker;
    784785
    785         if( t->scrapeAt && trackerSupportsScrape( t, tor ) && ( now >= t->scrapeAt ) ) {
    786             t->scrapeAt = 0;
     786        if( ( t->scrapeAt > 1 ) &&
     787            ( t->scrapeAt <= now ) &&
     788            ( trackerSupportsScrape( t, tor ) ) )
     789        {
     790            t->scrapeAt = 1;
    787791            enqueueScrape( session, t );
    788792        }
    789793
    790         if( t->reannounceAt && t->isRunning && ( now >= t->reannounceAt ) ) {
    791             t->reannounceAt = 0;
     794        if( ( t->reannounceAt > 1 ) &&
     795            ( t->reannounceAt <= now ) &&
     796            ( t->isRunning ) )
     797        {
     798            t->reannounceAt = 1;
     799            t->manualAnnounceAllowedAt = 1;
    792800            enqueueRequest( session, t, TR_REQ_REANNOUNCE );
    793801        }
  • trunk/libtransmission/transmission.h

    r6299 r6322  
    13021302    time_t lastScrapeTime;
    13031303
    1304     /** Time when the next scrape request will be sent.
    1305         This value is always a valid time. */
     1304    /** Time when the next scrape request will be sent,
     1305        or 0 if an error has occured that stops scraping,
     1306        or 1 if a scrape is currently in progress s.t.
     1307        we haven't set a timer for the next one yet. */
    13061308    time_t nextScrapeTime;
    13071309
     
    13111313
    13121314    /** Time when the next reannounce request will be sent,
    1313         or zero if the torrent is stopped. */
     1315        or 0 if the torrent is stopped,
     1316        or 1 if an announce is currently in progress s.t.
     1317        we haven't set a timer for the next one yet */
    13141318    time_t nextAnnounceTime;
    13151319
    13161320    /** If the torrent is running, this is the time at which
    13171321        the client can manually ask the torrent's tracker
    1318         for more peers.  otherwise, the value is zero. */
     1322        for more peers,
     1323        or 0 if the torrent is stopped or doesn't allow manual,
     1324        or 1 if an announce is currently in progress s.t.
     1325        we haven't set a timer for the next one yet */
    13191326    time_t manualAnnounceTime;
    13201327
Note: See TracChangeset for help on using the changeset viewer.