Changeset 7747


Ignore:
Timestamp:
Jan 19, 2009, 1:55:41 PM (12 years ago)
Author:
charles
Message:

(trunk libT) possible fix for the `few peers' errors reported on OS X. denis_, merlyn3d, give this a spin...

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-io.c

    r7730 r7747  
    191191    assert( tr_isPeerIo( io ) );
    192192
     193    io->hasFinishedConnecting = TRUE;
     194
    193195    curlen = EVBUFFER_LENGTH( io->inbuf );
    194196    howmuch = curlen >= max ? 0 : max - curlen;
     
    271273    assert( tr_isPeerIo( io ) );
    272274
     275    io->hasFinishedConnecting = TRUE;
     276
    273277    dbgmsg( io, "libevent says this peer is ready to write" );
    274278
     
    353357    io->socket = socket;
    354358    io->isIncoming = isIncoming != 0;
     359    io->hasFinishedConnecting = FALSE;
    355360    io->timeCreated = time( NULL );
    356361    io->inbuf = evbuffer_new( );
     
    822827    assert( tr_isDirection( dir ) );
    823828
    824     if( dir == TR_DOWN )
    825         bytesUsed = tr_peerIoTryRead( io, limit );
    826     else
    827         bytesUsed = tr_peerIoTryWrite( io, limit );
     829    if( io->hasFinishedConnecting )
     830    {
     831        if( dir == TR_DOWN )
     832            bytesUsed = tr_peerIoTryRead( io, limit );
     833        else
     834            bytesUsed = tr_peerIoTryWrite( io, limit );
     835    }
    828836
    829837    dbgmsg( io, "flushing peer-io, direction %d, limit %zu, bytesUsed %zd", (int)dir, limit, bytesUsed );
  • trunk/libtransmission/peer-io.h

    r7730 r7747  
    6565    tr_bool               fastExtensionSupported;
    6666
     67    /* we create the socket in a nonblocking way, so this flag is initially
     68     * false and then set to true when libevent says that the socket is ready
     69     * for reading or writing */
     70    tr_bool               hasFinishedConnecting;
     71
    6772    int                   magicNumber;
    6873
Note: See TracChangeset for help on using the changeset viewer.