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/session.c

    r12228 r12229  
    238238
    239239    if( is_default_value && bindinfo )
    240         *is_default_value = !tr_strcmp0( default_value, tr_ntop_non_ts( &bindinfo->addr ) );
     240        *is_default_value = !tr_strcmp0( default_value, tr_address_to_string( &bindinfo->addr ) );
    241241
    242242    return bindinfo ? &bindinfo->addr : NULL;
     
    422422    tr_bencDictAddInt ( d, TR_PREFS_KEY_UMASK,                    s->umask );
    423423    tr_bencDictAddInt ( d, TR_PREFS_KEY_UPLOAD_SLOTS_PER_TORRENT, s->uploadSlotsPerTorrent );
    424     tr_bencDictAddStr ( d, TR_PREFS_KEY_BIND_ADDRESS_IPV4,        tr_ntop_non_ts( &s->public_ipv4->addr ) );
    425     tr_bencDictAddStr ( d, TR_PREFS_KEY_BIND_ADDRESS_IPV6,        tr_ntop_non_ts( &s->public_ipv6->addr ) );
     424    tr_bencDictAddStr ( d, TR_PREFS_KEY_BIND_ADDRESS_IPV4,        tr_address_to_string( &s->public_ipv4->addr ) );
     425    tr_bencDictAddStr ( d, TR_PREFS_KEY_BIND_ADDRESS_IPV6,        tr_address_to_string( &s->public_ipv6->addr ) );
    426426    tr_bencDictAddBool( d, TR_PREFS_KEY_START,                    !tr_sessionGetPaused( s ) );
    427427    tr_bencDictAddBool( d, TR_PREFS_KEY_TRASH_ORIGINAL,           tr_sessionGetDeleteSource( s ) );
     
    806806    str = TR_PREFS_KEY_BIND_ADDRESS_IPV4;
    807807    tr_bencDictFindStr( settings, TR_PREFS_KEY_BIND_ADDRESS_IPV4, &str );
    808     if( !tr_pton( str, &b.addr ) || ( b.addr.type != TR_AF_INET ) )
     808    if( !tr_address_from_string( &b.addr, str ) || ( b.addr.type != TR_AF_INET ) )
    809809        b.addr = tr_inaddr_any;
    810810    b.socket = -1;
     
    813813    str = TR_PREFS_KEY_BIND_ADDRESS_IPV6;
    814814    tr_bencDictFindStr( settings, TR_PREFS_KEY_BIND_ADDRESS_IPV6, &str );
    815     if( !tr_pton( str, &b.addr ) || ( b.addr.type != TR_AF_INET6 ) )
     815    if( !tr_address_from_string( &b.addr, str ) || ( b.addr.type != TR_AF_INET6 ) )
    816816        b.addr = tr_in6addr_any;
    817817    b.socket = -1;
Note: See TracChangeset for help on using the changeset viewer.