Changeset 12041


Ignore:
Timestamp:
Feb 25, 2011, 1:48:46 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) peer-mgr.c peerCallbackFunc(): Replace some "should always be true" tests with assert()s. These tests used to be useful, but I don't think they are anymore. The assert()s have been put in their place to test that theory...

File:
1 edited

Legend:

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

    r12022 r12041  
    16081608    torrentLock( t );
    16091609
     1610    assert( peer != NULL );
     1611    assert( peer->atom != NULL );
     1612
    16101613    switch( e->eventType )
    16111614    {
     
    16281631
    16291632            /* update our atom */
    1630             if( peer && e->wasPieceData )
     1633            if( e->wasPieceData )
    16311634                peer->atom->piece_data_time = now;
    16321635
     
    16691672
    16701673        case TR_PEER_CLIENT_GOT_PORT:
    1671             if( peer )
    1672                 peer->atom->port = e->port;
     1674            peer->atom->port = e->port;
    16731675            break;
    16741676
    16751677        case TR_PEER_CLIENT_GOT_SUGGEST:
    1676             if( peer )
    1677                 peerSuggestedPiece( t, peer, e->pieceIndex, FALSE );
     1678            peerSuggestedPiece( t, peer, e->pieceIndex, FALSE );
    16781679            break;
    16791680
    16801681        case TR_PEER_CLIENT_GOT_ALLOWED_FAST:
    1681             if( peer )
    1682                 peerSuggestedPiece( t, peer, e->pieceIndex, TRUE );
     1682            peerSuggestedPiece( t, peer, e->pieceIndex, TRUE );
    16831683            break;
    16841684
     
    17001700
    17011701            /* update our atom */
    1702             if( peer && peer->atom && e->wasPieceData )
     1702            if( e->wasPieceData )
    17031703                peer->atom->piece_data_time = now;
    17041704
     
    17311731            tr_ptrArrayDestruct( &peerArr, FALSE );
    17321732
    1733             if( peer )
    1734                 tr_historyAdd( &peer->blocksSentToClient, tr_time( ), 1 );
     1733            tr_historyAdd( &peer->blocksSentToClient, tr_time( ), 1 );
    17351734
    17361735            if( tr_cpBlockIsComplete( &tor->completion, block ) )
Note: See TracChangeset for help on using the changeset viewer.