Changeset 5956


Ignore:
Timestamp:
May 28, 2008, 4:52:31 PM (14 years ago)
Author:
charles
Message:

(libT) remove dead code

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r5658 r5956  
    205205}
    206206
    207 int
    208 tr_netSend( int s, const void * buf, int size )
    209 {
    210     const int ret = send( s, buf, size, 0 );
    211     if( ret >= 0 )
    212         return ret;
    213 
    214     if( sockerrno == ENOTCONN || sockerrno == EAGAIN || sockerrno == EWOULDBLOCK )
    215         return TR_NET_BLOCK;
    216 
    217     return TR_NET_CLOSE;
    218 }
    219 
    220 int tr_netRecvFrom( int s, uint8_t * buf, int size, struct sockaddr_in * addr )
    221 {
    222     socklen_t len;
    223     int       ret;
    224 
    225     len = ( NULL == addr ? 0 : sizeof( *addr ) );
    226     ret = recvfrom( s, buf, size, 0, ( struct sockaddr * ) addr, &len );
    227     if( ret < 0 )
    228     {
    229         if( sockerrno == EAGAIN || sockerrno == EWOULDBLOCK )
    230         {
    231             ret = TR_NET_BLOCK;
    232         }
    233         else
    234         {
    235             ret = TR_NET_CLOSE;
    236         }
    237     }
    238     if( !ret )
    239     {
    240         ret = TR_NET_CLOSE;
    241     }
    242 
    243     return ret;
    244 }
    245 
    246207void
    247208tr_netClose( int s )
  • trunk/libtransmission/net.h

    r5588 r5956  
    7777void tr_netClose    ( int s );
    7878
    79 #define TR_NET_BLOCK 0x80000000
    80 #define TR_NET_CLOSE 0x40000000
    81 int  tr_netSend    ( int s, const void * buf, int size );
    82 #define tr_netRecv( s, buf, size ) tr_netRecvFrom( (s), (buf), (size), NULL )
    83 int  tr_netRecvFrom( int s, uint8_t * buf, int size, struct sockaddr_in * );
    84 
    8579void tr_netNtop( const struct in_addr * addr, char * buf, int len );
    8680
    8781void tr_netInit ( void );
    8882
    89 
    90 #define tr_addrcmp( aa, bb )    memcmp( ( void * )(aa), ( void * )(bb), 4)
    91 
    9283#endif /* _TR_NET_H_ */
Note: See TracChangeset for help on using the changeset viewer.