Ignore:
Timestamp:
Feb 1, 2010, 3:39:54 AM (12 years ago)
Author:
charles
Message:

(trunk libT) ignore the peer count from `stopped' responses when calculating lastAnnouncePeerCount

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/announcer.c

    r10062 r10063  
    10931093        const char * str;
    10941094        const uint8_t * raw;
     1095        tr_bool gotPeers = FALSE;
    10951096
    10961097        success = TRUE;
     
    11541155            /* "compact" extension */
    11551156            const int allAreSeeds = incomplete == 0;
    1156             peerCount = publishNewPeersCompact( tier, allAreSeeds, raw, rawlen );
     1157            peerCount += publishNewPeersCompact( tier, allAreSeeds, raw, rawlen );
     1158            gotPeers = TRUE;
    11571159        }
    11581160        else if( tr_bencDictFindList( &benc, "peers", &tmp ) )
     
    11621164            size_t byteCount = 0;
    11631165            uint8_t * array = parseOldPeers( tmp, &byteCount );
    1164             peerCount = publishNewPeers( tier, allAreSeeds, array, byteCount );
     1166            peerCount += publishNewPeers( tier, allAreSeeds, array, byteCount );
     1167            gotPeers = TRUE;
    11651168            tr_free( array );
    11661169        }
     
    11711174            const tr_bool allAreSeeds = incomplete == 0;
    11721175            peerCount += publishNewPeersCompact6( tier, allAreSeeds, raw, rawlen );
     1176            gotPeers = TRUE;
    11731177        }
    11741178
     
    11771181                        sizeof( tier->lastAnnounceStr ) );
    11781182
    1179         tier->lastAnnouncePeerCount = peerCount;
     1183        if( gotPeers )
     1184            tier->lastAnnouncePeerCount = peerCount;
    11801185    }
    11811186
Note: See TracChangeset for help on using the changeset viewer.