Changeset 9417


Ignore:
Timestamp:
Oct 27, 2009, 8:27:27 PM (12 years ago)
Author:
charles
Message:

(trunk libT) add a wrapper function, tr_netCloseSocket(), around EVUTIL_CLOSESOCKET() so that not all of our code has to #include evutil

Location:
trunk/libtransmission
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r9387 r9417  
    630630    if( ( s >= 0 ) && gFd->socketCount > gFd->socketLimit )
    631631    {
    632         EVUTIL_CLOSESOCKET( s );
     632        tr_netCloseSocket( s );
    633633        s = -1;
    634634    }
     
    676676    if( fd >= 0 )
    677677    {
    678         EVUTIL_CLOSESOCKET( fd );
     678        tr_netCloseSocket( fd );
    679679        --gFd->socketCount;
    680680    }
  • trunk/libtransmission/net.c

    r9387 r9417  
    369369    if( evutil_make_socket_nonblocking( fd ) < 0 ) {
    370370        *errOut = sockerrno;
    371         EVUTIL_CLOSESOCKET( fd );
     371        tr_netCloseSocket( fd );
    372372        return -1;
    373373    }
     
    392392            tr_err( _( "Couldn't bind port %d on %s: %s" ),
    393393                    port, tr_ntop_non_ts( addr ), tr_strerror( err ) );
    394         EVUTIL_CLOSESOCKET( fd );
     394        tr_netCloseSocket( fd );
    395395        *errOut = err;
    396396        return -1;
     
    402402    if( listen( fd, 128 ) == -1 ) {
    403403        *errOut = sockerrno;
    404         EVUTIL_CLOSESOCKET( fd );
     404        tr_netCloseSocket( fd );
    405405        return -1;
    406406    }
     
    429429            result = TRUE;
    430430        if( fd >= 0 )
    431             EVUTIL_CLOSESOCKET( fd );
     431            tr_netCloseSocket( fd );
    432432        alreadyDone = TRUE;
    433433    }
     
    453453
    454454void
     455tr_netCloseSocket( int fd )
     456{
     457    EVUTIL_CLOSESOCKET( fd );
     458}
     459
     460void
    455461tr_netClose( tr_session * session, int s )
    456462{
  • trunk/libtransmission/net.h

    r9387 r9417  
    117117void tr_netClose( tr_session * session, int s );
    118118
     119void tr_netCloseSocket( int fd );
     120
    119121void tr_netInit( void );
    120122
  • trunk/libtransmission/session.c

    r9389 r9417  
    148148    {
    149149        event_del( &b->ev );
    150         EVUTIL_CLOSESOCKET( b->socket );
     150        tr_netCloseSocket( b->socket );
    151151    }
    152152}
  • trunk/libtransmission/tr-dht.c

    r9383 r9417  
    256256
    257257    dht_uninit( dht_socket, 0 );
    258     EVUTIL_CLOSESOCKET( dht_socket );
     258    tr_netCloseSocket( dht_socket );
    259259
    260260    tr_ndbg("DHT", "Done uninitialising DHT");
  • trunk/libtransmission/trevent.c

    r8889 r9417  
    2020
    2121#include "transmission.h"
     22#include "net.h"
    2223#include "session.h"
    2324
     
    272273    session->events->die = TRUE;
    273274    tr_deepLog( __FILE__, __LINE__, NULL, "closing trevent pipe" );
    274     EVUTIL_CLOSESOCKET( session->events->fds[1] );
     275    tr_netCloseSocket( session->events->fds[1] );
    275276}
    276277
Note: See TracChangeset for help on using the changeset viewer.