Changeset 6621


Ignore:
Timestamp:
Aug 22, 2008, 1:27:00 AM (13 years ago)
Author:
charles
Message:

undo part of r6616 to address the assertion failure reported by andersos and Waldorf

Location:
trunk/libtransmission
Files:
4 edited

Legend:

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

    r6618 r6621  
    185185compareAddresses( const struct in_addr * a, const struct in_addr * b )
    186186{
    187     return a->s_addr - b->s_addr;
     187    return tr_compareUint32( a->s_addr, b->s_addr );
    188188}
    189189
     
    17711771    const struct peer_atom * a = * (const struct peer_atom**) va;
    17721772    const struct peer_atom * b = * (const struct peer_atom**) vb;
    1773     int i;
    17741773
    17751774    if( a->piece_data_time > b->piece_data_time ) return -1;
    17761775    if( a->piece_data_time < b->piece_data_time ) return  1;
    17771776
    1778     if(( i = a->numFails - b->numFails ))
    1779         return i;
     1777    if( a->numFails != b->numFails )
     1778        return a->numFails < b->numFails ? -1 : 1;
    17801779
    17811780    if( a->time != b->time )
  • trunk/libtransmission/peer-msgs.c

    r6616 r6621  
    117117    time_t time_requested;
    118118};
    119 
    120 static int
    121 tr_compareUint32( uint32_t a, uint32_t b )
    122 {
    123     if( a < b ) return -1;
    124     if( a > b ) return 1;
    125     return 0;
    126 }
    127119
    128120static int
  • trunk/libtransmission/utils.c

    r6619 r6621  
    327327
    328328int
     329tr_compareUint32( uint32_t a, uint32_t b )
     330{
     331    if( a < b ) return -1;
     332    if( a > b ) return 1;
     333    return 0;
     334}
     335
     336int
    329337tr_compareUint64( uint64_t a, uint64_t b )
    330338{
  • trunk/libtransmission/utils.h

    r6619 r6621  
    219219                     tr_set_func in_both_cb,
    220220                     void * userData );
    221                    
     221
     222int tr_compareUint32( uint32_t a, uint32_t b );
    222223int tr_compareUint64( uint64_t a, uint64_t b );
    223224
Note: See TracChangeset for help on using the changeset viewer.