Ignore:
Timestamp:
Jul 13, 2007, 1:34:14 AM (15 years ago)
Author:
charles
Message:

second draft of a fix for the tracker communication bug reported by TMT

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r2328 r2334  
    375375}
    376376
    377 int tr_netSend( int s, uint8_t * buf, int size )
    378 {
    379     int ret;
    380 
    381     ret = send( s, buf, size, 0 );
    382     if( ret < 0 )
    383     {
    384         if( errno == ENOTCONN || errno == EAGAIN || errno == EWOULDBLOCK )
    385         {
    386             ret = TR_NET_BLOCK;
    387         }
    388         else
    389         {
    390             ret = TR_NET_CLOSE;
    391         }
    392     }
    393 
    394     return ret;
     377int
     378tr_netSend( int s, const void * buf, int size )
     379{
     380    const int ret = send( s, buf, size, 0 );
     381    if( ret >= 0 )
     382        return ret;
     383
     384    if( errno == ENOTCONN || errno == EAGAIN || errno == EWOULDBLOCK )
     385        return TR_NET_BLOCK;
     386
     387    return TR_NET_CLOSE;
    395388}
    396389
Note: See TracChangeset for help on using the changeset viewer.