Changeset 9783


Ignore:
Timestamp:
Dec 15, 2009, 9:33:24 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #2548 "T's request queue can send out too many duplicate requests" -- fix off-by-one when counting how many peers we'll send a given block request to during endgame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r9782 r9783  
    658658        }
    659659    }
     660    /*fprintf( stderr, "added request of block %lu from peer %p... "
     661                       "there are now %d block\n",
     662                       (unsigned long)block, peer, t->requestCount );*/
    660663}
    661664
     
    674677}
    675678
     679/* how many peers are we currently requesting this block from... */
    676680static int
    677681countBlockRequests( Torrent * t, tr_block_index_t block )
     
    712716                 t->requests + pos + 1,
    713717                 sizeof( struct block_request ) * ( --t->requestCount - pos ) );
     718        /*fprintf( stderr, "removing request of block %lu from peer %p... "
     719                           "there are now %d block requests left\n",
     720                           (unsigned long)block, peer, t->requestCount );*/
    714721    }
    715722}
     
    807814
    808815        t->isInEndgame = endgame;
     816        /*if( t->isInEndgame ) fprintf( stderr, "ENDGAME reached\n" );*/
    809817    }
    810818}
     
    986994
    987995                /* don't send the same request to any peer too many times */
    988                 if( countBlockRequests( t, b ) > maxDuplicatesPerBlock )
     996                if( countBlockRequests( t, b ) >= maxDuplicatesPerBlock )
    989997                    continue;
    990998
Note: See TracChangeset for help on using the changeset viewer.