Changeset 5691


Ignore:
Timestamp:
Apr 25, 2008, 4:35:06 AM (14 years ago)
Author:
charles
Message:

Fix "Unknown Error (0)" messages for torrents that haven't been scraped yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/tracker.c

    r5690 r5691  
    860860    t->seederCount              = -1;
    861861    t->leecherCount             = -1;
     862    t->lastAnnounceResponse     = -1;
     863    t->lastScrapeResponse       = -1;
    862864    t->manualAnnounceAllowedAt  = ~(time_t)0;
    863865    t->name = tr_strdup( info->name );
     
    10011003    assert( setme );
    10021004
    1003     snprintf( setme->scrapeResponse,
    1004               sizeof( setme->scrapeResponse ),
    1005               "%s (%ld)", tr_webGetResponseStr( t->lastScrapeResponse ), t->lastScrapeResponse );
    1006 
    10071005    setme->lastScrapeTime = t->lastScrapeTime;
    10081006    setme->nextScrapeTime = t->scrapeAt;
    1009 
    1010     snprintf( setme->announceResponse,
    1011               sizeof( setme->announceResponse ),
    1012               "%s (%ld)", tr_webGetResponseStr( t->lastAnnounceResponse ), t->lastAnnounceResponse );
    1013 
    10141007    setme->lastAnnounceTime = t->lastAnnounceTime;
    10151008    setme->nextAnnounceTime = t->reannounceAt;
    10161009    setme->nextManualAnnounceTime = t->manualAnnounceAllowedAt;
    1017 }
     1010
     1011    if( t->lastScrapeResponse == -1 ) /* never been scraped */
     1012        *setme->scrapeResponse = '\0';
     1013    else
     1014        snprintf( setme->scrapeResponse,
     1015                  sizeof( setme->scrapeResponse ),
     1016                  "%s (%ld)",
     1017                  tr_webGetResponseStr( t->lastScrapeResponse ),
     1018                  t->lastScrapeResponse );
     1019
     1020    if( t->lastAnnounceResponse == -1 ) /* never been announced */
     1021        *setme->announceResponse = '\0';
     1022    else
     1023        snprintf( setme->announceResponse,
     1024                  sizeof( setme->announceResponse ),
     1025                  "%s (%ld)",
     1026                  tr_webGetResponseStr( t->lastAnnounceResponse ),
     1027                  t->lastAnnounceResponse );
     1028}
Note: See TracChangeset for help on using the changeset viewer.