Changeset 236 for trunk/libtransmission


Ignore:
Timestamp:
Apr 22, 2006, 5:12:59 PM (16 years ago)
Author:
titer
Message:

Code cleanup

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r218 r236  
    167167int tr_netResolve( char * address, struct in_addr * addr )
    168168{
    169     tr_resolve_t * r = tr_netResolveInit( address );
    170     int ret;
    171 
    172     for( ;; )
    173     {
    174         ret = tr_netResolvePulse( r, addr );
    175         if( ret != TR_RESOLVE_WAIT )
    176         {
    177             break;
    178         }
    179         tr_wait( 20 );
    180     }
    181 
    182     tr_netResolveClose( r );
    183     return ( ret != TR_RESOLVE_OK );
     169    addr->s_addr = inet_addr( address );
     170    return ( addr->s_addr == 0xFFFFFFFF );
    184171}
    185172
  • trunk/libtransmission/net.h

    r164 r236  
    2121 *****************************************************************************/
    2222
     23/***********************************************************************
     24 * DNS resolution
     25 **********************************************************************/
     26
     27/* Synchronous version: only works with character strings representing
     28   numbers expressed in the Internet standard `.' notation */
     29int tr_netResolve( char *, struct in_addr * );
     30
     31/* Asynchronous version */
    2332#define TR_RESOLVE_WAIT  0
    2433#define TR_RESOLVE_ERROR 1
     
    2938void           tr_netResolveClose( tr_resolve_t * );
    3039
    31 int  tr_netResolve ( char *, struct in_addr * );
     40
     41/***********************************************************************
     42 * TCP sockets
     43 **********************************************************************/
    3244int  tr_netOpen    ( struct in_addr addr, in_port_t port );
    3345int  tr_netBind    ( int );
     
    3951int  tr_netSend    ( int s, uint8_t * buf, int size );
    4052int  tr_netRecv    ( int s, uint8_t * buf, int size );
     53
Note: See TracChangeset for help on using the changeset viewer.