Changeset 2989


Ignore:
Timestamp:
Sep 9, 2007, 12:29:59 AM (16 years ago)
Author:
charles
Message:

update the request block array after the recheck finishes, so that we don't re-ask for blocks we've got

Location:
branches/encryption/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/encryption/libtransmission/peer-mgr.c

    r2988 r2989  
    307307        if( t->blocks[i].have || t->blocks[i].dnd )
    308308            continue;
     309
    309310        if( !size ) { /* all peers full */
    310311            fprintf( stderr, "all peers full...\n" );
     
    626627
    627628void
     629tr_peerMgrUpdateCompletion( tr_peerMgr     * manager,
     630                            const uint8_t  * torrentHash )
     631{
     632    uint32_t i;
     633    Torrent * t = getExistingTorrent( manager, torrentHash );
     634
     635    for( i=0; i<t->blockCount; ++i ) {
     636        assert( t->blocks[i].block == i );
     637        t->blocks[i].have = tr_cpBlockIsComplete( t->tor->completion, i ) ? 1 : 0;
     638    }
     639}
     640
     641void
    628642tr_peerMgrAddTorrent( tr_peerMgr * manager,
    629643                      tr_torrent * tor )
  • branches/encryption/libtransmission/peer-mgr.h

    r2978 r2989  
    7373                           struct tr_torrent  * tor );
    7474
     75void tr_peerMgrUpdateCompletion( tr_peerMgr     * manager,
     76                                 const uint8_t  * torrentHash );
     77
     78
    7579void tr_peerMgrRemoveTorrent( tr_peerMgr     * manager,
    7680                               const uint8_t  * torrentHash );
  • branches/encryption/libtransmission/torrent.c

    r2988 r2989  
    268268{
    269269fprintf( stderr, "recheck done -- setting torrent %s to %d\n", tor->info.name, tor->runStatusAfterCheck );
     270    tr_peerMgrUpdateCompletion( tor->handle->peerMgr, tor->info.hash );
    270271    tor->runStatus = tor->runStatusAfterCheck;
    271272    fastResumeSave( tor );
Note: See TracChangeset for help on using the changeset viewer.