Changeset 3570


Ignore:
Timestamp:
Oct 26, 2007, 1:31:49 AM (14 years ago)
Author:
charles
Message:

Fix issue #413 "Starting a Torrent when one is checking make it queue after it" reported by tiennou

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/inout.c

    r3480 r3570  
    379379                 tr_recheck_done_cb    recheck_done_cb )
    380380{
    381     struct recheck_node * node;
    382     node = tr_new( struct recheck_node, 1 );
    383     node->torrent = tor;
    384     node->recheck_done_cb = recheck_done_cb;
    385 
    386     tr_lockLock( getRecheckLock( ) );
    387     tor->recheckState = recheckList ? TR_RECHECK_WAIT : TR_RECHECK_NOW;
    388     tr_list_append( &recheckList, node );
    389     if( recheckThread == NULL )
    390         recheckThread = tr_threadNew( recheckThreadFunc, NULL, "recheckThreadFunc" );
    391     tr_lockUnlock( getRecheckLock( ) );
     381    if( !tr_bitfieldCountTrueBits( tor->uncheckedPieces ) )
     382    {
     383        /* doesn't need to be checked... */
     384        recheck_done_cb( tor );
     385    }
     386    else
     387    {
     388        struct recheck_node * node;
     389
     390        node = tr_new( struct recheck_node, 1 );
     391        node->torrent = tor;
     392        node->recheck_done_cb = recheck_done_cb;
     393
     394        tr_lockLock( getRecheckLock( ) );
     395        tor->recheckState = recheckList ? TR_RECHECK_WAIT : TR_RECHECK_NOW;
     396        tr_list_append( &recheckList, node );
     397        if( recheckThread == NULL )
     398            recheckThread = tr_threadNew( recheckThreadFunc, NULL, "recheckThreadFunc" );
     399        tr_lockUnlock( getRecheckLock( ) );
     400    }
    392401}
    393402
Note: See TracChangeset for help on using the changeset viewer.