Changeset 7421


Ignore:
Timestamp:
Dec 16, 2008, 10:28:19 PM (12 years ago)
Author:
charles
Message:

(trunk libT) fix jhujhiti's pex crash

File:
1 edited

Legend:

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

    r7414 r7421  
    15101510        tr_pex * walk = pex;
    15111511
    1512         for( i=0; i<peerCount; ++i, ++walk )
     1512        for( i=0; i<peerCount; ++i )
    15131513        {
    15141514            const tr_peer * peer = peers[i];
     
    15251525                    ( peer->progress >= 1.0 ) )
    15261526                    walk->flags |= ADDED_F_SEED_FLAG;
    1527                 peersReturning++;
     1527                ++peersReturning;
     1528                ++walk;
    15281529            }
    15291530        }
     1531
     1532#warning this for loop can be removed when we're sure the bug is fixed
     1533        for( i=0; i<peersReturning; ++i )
     1534            assert( tr_isAddress( &pex[i].addr ) );
    15301535
    15311536        assert( ( walk - pex ) == peerCount );
    15321537        qsort( pex, peersReturning, sizeof( tr_pex ), tr_pexCompare );
     1538
     1539#warning this for loop can be removed when we're sure the bug is fixed
     1540        for( i=0; i<peersReturning; ++i )
     1541            assert( tr_isAddress( &pex[i].addr ) );
     1542
    15331543        *setme_pex = pex;
    15341544    }
Note: See TracChangeset for help on using the changeset viewer.