Changeset 10062


Ignore:
Timestamp:
Feb 1, 2010, 1:13:25 AM (12 years ago)
Author:
charles
Message:

(trunk libT) don't reset lastAnnouncePeerCount when stopping a torrent.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r10059 r10062  
    10861086    if( bencLoaded && tr_bencIsDict( &benc ) )
    10871087    {
     1088        int peerCount = 0;
    10881089        int incomplete = -1;
    10891090        size_t rawlen;
     
    11531154            /* "compact" extension */
    11541155            const int allAreSeeds = incomplete == 0;
    1155             tier->lastAnnouncePeerCount = publishNewPeersCompact( tier, allAreSeeds, raw, rawlen );
     1156            peerCount = publishNewPeersCompact( tier, allAreSeeds, raw, rawlen );
    11561157        }
    11571158        else if( tr_bencDictFindList( &benc, "peers", &tmp ) )
     
    11611162            size_t byteCount = 0;
    11621163            uint8_t * array = parseOldPeers( tmp, &byteCount );
    1163             tier->lastAnnouncePeerCount = publishNewPeers( tier, allAreSeeds, array, byteCount );
     1164            peerCount = publishNewPeers( tier, allAreSeeds, array, byteCount );
    11641165            tr_free( array );
    11651166        }
     
    11691170            /* "compact" extension */
    11701171            const tr_bool allAreSeeds = incomplete == 0;
    1171             tier->lastAnnouncePeerCount += publishNewPeersCompact6( tier, allAreSeeds, raw, rawlen );
     1172            peerCount += publishNewPeersCompact6( tier, allAreSeeds, raw, rawlen );
    11721173        }
    11731174
     
    11751176            tr_strlcpy( tier->lastAnnounceStr, _( "Success" ),
    11761177                        sizeof( tier->lastAnnounceStr ) );
     1178
     1179        tier->lastAnnouncePeerCount = peerCount;
    11771180    }
    11781181
     
    12111214    if( announcer && tier )
    12121215    {
    1213         tier->lastAnnouncePeerCount = 0;
    1214 
    12151216        if( tier->currentTracker->host )
    12161217        {
Note: See TracChangeset for help on using the changeset viewer.