Ignore:
Timestamp:
Mar 25, 2011, 5:34:26 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) API cleanup of the tr_address functions to make them more consistent.

This is loosely related to #2910, but only in the sense of laying the groundwork for #2910's fix...

File:
1 edited

Legend:

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

    r12228 r12229  
    148148        && ( atom->fromFirst < TR_PEER_FROM__MAX )
    149149        && ( atom->fromBest < TR_PEER_FROM__MAX )
    150         && ( tr_isAddress( &atom->addr ) );
     150        && ( tr_address_is_valid( &atom->addr ) );
    151151}
    152152#endif
     
    288288    const tr_handshake * a = va;
    289289
    290     return tr_compareAddresses( tr_handshakeGetAddr( a, NULL ), vb );
     290    return tr_address_compare( tr_handshakeGetAddr( a, NULL ), vb );
    291291}
    292292
     
    311311    const struct peer_atom * a = va;
    312312
    313     return tr_compareAddresses( &a->addr, vb );
     313    return tr_address_compare( &a->addr, vb );
    314314}
    315315
     
    346346peerCompare( const void * a, const void * b )
    347347{
    348     return tr_compareAddresses( tr_peerAddress( a ), tr_peerAddress( b ) );
     348    return tr_address_compare( tr_peerAddress( a ), tr_peerAddress( b ) );
    349349}
    350350
     
    18711871    struct peer_atom * a;
    18721872
    1873     assert( tr_isAddress( addr ) );
     1873    assert( tr_address_is_valid( addr ) );
    18741874    assert( from < TR_PEER_FROM__MAX );
    18751875
     
    20572057    if( tr_sessionIsAddressBlocked( session, addr ) )
    20582058    {
    2059         tr_dbg( "Banned IP address \"%s\" tried to connect to us", tr_ntop_non_ts( addr ) );
     2059        tr_dbg( "Banned IP address \"%s\" tried to connect to us", tr_address_to_string( addr ) );
    20602060        if(socket >= 0)
    20612061            tr_netClose( session, socket );
     
    21012101
    21022102        if( !tr_sessionIsAddressBlocked( t->manager->session, &pex->addr ) )
    2103             if( tr_isValidPeerAddress( &pex->addr, pex->port ) )
     2103            if( tr_address_is_valid_for_peers( &pex->addr, pex->port ) )
    21042104                ensureAtomExists( t, &pex->addr, pex->port, pex->flags, seedProbability, from );
    21052105
     
    22342234    assert( tr_isPex( b ) );
    22352235
    2236     if(( i = tr_compareAddresses( &a->addr, &b->addr )))
     2236    if(( i = tr_address_compare( &a->addr, &b->addr )))
    22372237        return i;
    22382238
     
    23342334        if( atom->addr.type == af )
    23352335        {
    2336             assert( tr_isAddress( &atom->addr ) );
     2336            assert( tr_address_is_valid( &atom->addr ) );
    23372337            walk->addr = atom->addr;
    23382338            walk->port = atom->port;
     
    26602660        tr_peer_stat *           stat = ret + i;
    26612661
    2662         tr_ntop( &atom->addr, stat->addr, sizeof( stat->addr ) );
     2662        tr_address_to_string_with_buf( &atom->addr, stat->addr, sizeof( stat->addr ) );
    26632663        tr_strlcpy( stat->client, ( peer->client ? peer->client : "" ),
    26642664                   sizeof( stat->client ) );
     
    35363536    assert( tr_isAtom( b ) );
    35373537
    3538     return tr_compareAddresses( &a->addr, &b->addr );
     3538    return tr_address_compare( &a->addr, &b->addr );
    35393539}
    35403540
Note: See TracChangeset for help on using the changeset viewer.