Changeset 2472


Ignore:
Timestamp:
Jul 24, 2007, 12:09:23 AM (15 years ago)
Author:
charles
Message:

get "recheck files" working properly again.

Location:
trunk/libtransmission
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fastresume.c

    r2462 r2472  
    357357                        FILE                * file )
    358358{
     359    int i;
    359360    const size_t len = FR_PROGRESS_LEN( tor );
    360361    uint8_t * buf = calloc( len, 1 );
     
    369370    /* compare file mtimes */
    370371    if (1) {
    371         int i, n;
     372        int n;
    372373        tr_time_t * curMTimes = getMTimes( tor, &n );
    373374        const tr_time_t * oldMTimes = (const tr_time_t *) walk;
     
    392393        bitfield.bits = walk;
    393394        tr_cpBlockBitfieldSet( tor->completion, &bitfield );
    394 /* FIXME: remove the "unchecked pieces" */
    395     }
     395    }
     396
     397    /* the files whose mtimes are wrong,
     398       remove from completion pending a recheck... */
     399    for( i=0; i<tor->info.pieceCount; ++i )
     400        if( tr_bitfieldHas( uncheckedPieces, i ) )
     401            tr_cpPieceRem( tor->completion, i );
     402
    396403
    397404    free( buf );
  • trunk/libtransmission/inout.c

    r2462 r2472  
    220220        tor->uncheckedPieces = NULL;
    221221
     222        /* remove the unchecked pieces from completion... */
     223        for( i=0; i<tor->info.pieceCount; ++i )
     224            if( tr_bitfieldHas( p, i ) )
     225                tr_cpPieceRem( tor->completion, i );
     226
    222227        tr_inf( "Verifying some pieces of \"%s\"", tor->info.name );
    223228
  • trunk/libtransmission/torrent.c

    r2462 r2472  
    239239    if( tr_bitfieldIsEmpty( uncheckedPieces ) )
    240240        tr_bitfieldFree( uncheckedPieces );
    241     else {
     241    else
    242242        tor->uncheckedPieces = uncheckedPieces;
    243         fprintf( stderr, "torrent %s has %d unchecked pieces\n", tor->info.name, (int)tr_bitfieldCountTrueBits(tor->uncheckedPieces) );
    244     }
    245243
    246244
Note: See TracChangeset for help on using the changeset viewer.