Changeset 9445


Ignore:
Timestamp:
Oct 30, 2009, 4:24:58 PM (13 years ago)
Author:
charles
Message:

Adding term debug messages to help track down #2533 w/m1b

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r9443 r9445  
    10461046    uint64_t total = 0;
    10471047    const tr_file * f = &tor->info.files[index];
     1048fprintf( stderr, "in fileBytesCompleted for file #%d\n", (int)index );
    10481049
    10491050    if( f->length )
     
    10551056        if( firstBlock == lastBlock )
    10561057        {
     1058fprintf( stderr, "file fits in a single block\n" );
    10571059            if( tr_cpBlockIsCompleteFast( &tor->completion, firstBlock ) )
    10581060                total = f->length;
     
    10691071            if( f->firstPiece == f->lastPiece )
    10701072            {
     1073fprintf( stderr, "f->firstPiece == f->lastPiece\n" );
    10711074                for( i=firstBlock+1; i<lastBlock; ++i )
    10721075                    if( tr_cpBlockIsCompleteFast( &tor->completion, i ) )
     
    10831086
    10841087                /* the rest of the first piece */
     1088fprintf( stderr, "looping on the rest of the first piece\n" );
    10851089                for( i=firstBlock+1; i<lastBlock && i<=lastBlockOfFirstPiece; ++i )
    10861090                    if( tr_cpBlockIsCompleteFast( &tor->completion, i ) )
     
    10881092
    10891093                /* the middle pieces */
     1094fprintf( stderr, "looking at the middle pieces\n" );
    10901095                if( f->firstPiece + 1 < f->lastPiece )
    10911096                    for( i=f->firstPiece+1; i<f->lastPiece; ++i )
     
    10931098
    10941099                /* the rest of the last piece */
     1100fprintf( stderr, "looping on the rest of the last piece\n" );
    10951101                for( i=firstBlockOfLastPiece; i<lastBlock; ++i )
    10961102                    if( tr_cpBlockIsCompleteFast( &tor->completion, i ) )
     
    11061112        }
    11071113    }
     1114fprintf( stderr, "finished fileBytesCompleted for file #%d\n", (int)index );
    11081115
    11091116    return total;
     
    11191126    tr_file_stat *        walk = files;
    11201127    const tr_bool         isSeed = tor->completeness == TR_SEED;
    1121 
    1122     assert( tr_isTorrent( tor ) );
    1123 
    1124     for( i = 0; i < n; ++i, ++walk )
    1125     {
     1128static int numCalls = 0;
     1129
     1130fprintf( stderr, "entering tr_torrentFiles for the %d time\n", ++numCalls );
     1131
     1132    assert( tr_isTorrent( tor ) );
     1133
     1134    for( i=0; i<n; ++i, ++walk )
     1135    {
     1136fprintf( stderr, "looking at file #%d of %d\n", (int)i, (int)n );
    11261137        const uint64_t b = isSeed ? tor->info.files[i].length : fileBytesCompleted( tor, i );
     1138fprintf( stderr, "file has %"PRIu64" out of %"PRIu64" bytes\n", b, tor->info.files[i].length );
    11271139        walk->bytesCompleted = b;
    11281140        walk->progress = tr_getRatio( b, tor->info.files[i].length );
     1141fprintf( stderr, "walk->progress is %f\n", walk->progress );
    11291142    }
    11301143
    11311144    if( fileCount )
    11321145        *fileCount = n;
     1146
     1147fprintf( stderr, "tr_torrentFiles finished\n" );
    11331148
    11341149    return files;
Note: See TracChangeset for help on using the changeset viewer.